WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [RFC][PATCH 03/13] Kemari: change parameter type of xc_{set,

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [RFC][PATCH 03/13] Kemari: change parameter type of xc_{set, get}_hvm_param
From: Yoshiaki Tamura <tamura.yoshiaki@xxxxxxxxxxxxx>
Date: Fri, 06 Mar 2009 14:54:56 +0900
Cc: ospk-vm@xxxxxxxxxxxxx, Ian Pratt <ian.pratt@xxxxxxxxxx>, ian.jackson@xxxxxxxxxxxxx, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Delivery-date: Thu, 05 Mar 2009 22:54:04 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <49B0B8DC.5000606@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <49B0B8DC.5000606@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.19 (Windows/20081209)
This patch changes arguments "value" of xc_set_hvm_param and xc_get_hvm_param
from 32bit to 64bit.  This is because Xen sets and gets a 64bit variable for
those "value"s in xc_set_hvm_param and xc_get_hvm_param, respectively.  We need
this change because callback irqs got from xc_get_hvm_param and set by
xc_set_hvm_param are 64bit.

Signed-off-by: Yoshisato Yanagisawa <yanagisawa.yoshisato@xxxxxxxxxxxxx>
Signed-off-by: Yoshi Tamura <tamura.yoshiaki@xxxxxxxxxxxxx>
---
 tools/libxc/xc_cpuid_x86.c        |    2 +-
 tools/libxc/xc_domain.c           |    4 ++--
 tools/libxc/xc_domain_save.c      |    8 ++++----
 tools/libxc/xc_resume.c           |    2 +-
 tools/python/xen/lowlevel/xc/xc.c |    4 ++--
 5 files changed, 10 insertions(+), 10 deletions(-)

diff -r 19201eebab16 tools/libxc/xc_cpuid_x86.c
--- a/tools/libxc/xc_cpuid_x86.c        Thu Sep 25 13:33:50 2008 +0100
+++ b/tools/libxc/xc_cpuid_x86.c        Wed Mar 04 17:04:19 2009 +0900
@@ -148,7 +148,7 @@
     int xc, domid_t domid, const unsigned int *input, unsigned int *regs)
 {
     char brand[13];
-    unsigned long pae;
+    unsigned long long pae;
     int is_pae;

     xc_get_hvm_param(xc, domid, HVM_PARAM_PAE_ENABLED, &pae);
diff -r 19201eebab16 tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c   Thu Sep 25 13:33:50 2008 +0100
+++ b/tools/libxc/xc_domain.c   Wed Mar 04 17:04:20 2009 +0900
@@ -690,7 +690,7 @@
     return do_domctl(xc_handle, &domctl);
 }

-int xc_set_hvm_param(int handle, domid_t dom, int param, unsigned long value)
+int xc_set_hvm_param(int handle, domid_t dom, int param, unsigned long long 
value)
 {
     DECLARE_HYPERCALL;
     xen_hvm_param_t arg;
@@ -709,7 +709,7 @@
     return rc;
 }

-int xc_get_hvm_param(int handle, domid_t dom, int param, unsigned long *value)
+int xc_get_hvm_param(int handle, domid_t dom, int param, unsigned long long 
*value)
 {
     DECLARE_HYPERCALL;
     xen_hvm_param_t arg;
diff -r 19201eebab16 tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c      Thu Sep 25 13:33:50 2008 +0100
+++ b/tools/libxc/xc_domain_save.c      Wed Mar 04 17:04:20 2009 +0900
@@ -1400,7 +1400,7 @@
         } chunk = { -3, 0 };

         xc_get_hvm_param(xc_handle, dom, HVM_PARAM_IDENT_PT,
-                         (unsigned long *)&chunk.ident_pt);
+                         &chunk.ident_pt);

         if ( (chunk.ident_pt != 0) &&
              write_exact(io_fd, &chunk, sizeof(chunk)) )
@@ -1425,11 +1425,11 @@
         /* Save magic-page locations. */
         memset(magic_pfns, 0, sizeof(magic_pfns));
         xc_get_hvm_param(xc_handle, dom, HVM_PARAM_IOREQ_PFN,
-                         (unsigned long *)&magic_pfns[0]);
+                         &magic_pfns[0]);
         xc_get_hvm_param(xc_handle, dom, HVM_PARAM_BUFIOREQ_PFN,
-                         (unsigned long *)&magic_pfns[1]);
+                         &magic_pfns[1]);
         xc_get_hvm_param(xc_handle, dom, HVM_PARAM_STORE_PFN,
-                         (unsigned long *)&magic_pfns[2]);
+                         &magic_pfns[2]);
         if ( write_exact(io_fd, magic_pfns, sizeof(magic_pfns)) )
         {
             PERROR("Error when writing to state file (7)");
diff -r 19201eebab16 tools/libxc/xc_resume.c
--- a/tools/libxc/xc_resume.c   Thu Sep 25 13:33:50 2008 +0100
+++ b/tools/libxc/xc_resume.c   Wed Mar 04 17:04:21 2009 +0900
@@ -27,7 +27,7 @@
     /* HVM guests without PV drivers do not have a return code to modify. */
     if ( info.hvm )
     {
-        unsigned long irq = 0;
+        unsigned long long irq = 0;
         xc_get_hvm_param(xc_handle, domid, HVM_PARAM_CALLBACK_IRQ, &irq);
         if ( !irq )
             return 0;
diff -r 19201eebab16 tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c Thu Sep 25 13:33:50 2008 +0100
+++ b/tools/python/xen/lowlevel/xc/xc.c Wed Mar 04 17:04:22 2009 +0900
@@ -490,7 +490,7 @@
 {
     uint32_t dom;
     int param;
-    unsigned long value;
+    unsigned long long value;

     static char *kwd_list[] = { "domid", "param", NULL };
     if ( !PyArg_ParseTupleAndKeywords(args, kwds, "ii", kwd_list,
@@ -500,7 +500,7 @@
     if ( xc_get_hvm_param(self->xc_handle, dom, param, &value) != 0 )
         return pyxc_error_to_exception();

-    return PyLong_FromUnsignedLong(value);
+    return PyLong_FromUnsignedLongLong(value);

 }



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel