[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Fix types used in xc_memshr_* functions



# HG changeset patch
# User Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>
# Date 1326209888 0
# Node ID cfbab2c7c3cc864fcc8a3f78d9745b54fe0d624a
# Parent  fc78d16447b49491c560c99491a9ce47cad5765f
Fix types used in xc_memshr_* functions

Currently the memshr functions use uint32_t for the domid.  This actually leads
to a funny domid_t -> uint32_t -> domid_t sequence of casts.  This patch
updates the API functions to be domid_t in the first place.

No tools need to be modified with this patch, the casts were implicit.

Signed-off-by: Adin Scannell <adin@xxxxxxxxxxx>
Signed-off-by: Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r fc78d16447b4 -r cfbab2c7c3cc tools/libxc/xc_memshr.c
--- a/tools/libxc/xc_memshr.c   Tue Jan 10 15:35:01 2012 +0000
+++ b/tools/libxc/xc_memshr.c   Tue Jan 10 15:38:08 2012 +0000
@@ -26,7 +26,7 @@
 #include <xen/grant_table.h>
 
 int xc_memshr_control(xc_interface *xch,
-                      uint32_t domid,
+                      domid_t domid,
                       int enable)
 {
     DECLARE_DOMCTL;
@@ -34,7 +34,7 @@
 
     domctl.cmd = XEN_DOMCTL_mem_sharing_op;
     domctl.interface_version = XEN_DOMCTL_INTERFACE_VERSION;
-    domctl.domain = (domid_t)domid;
+    domctl.domain = domid;
     op = &(domctl.u.mem_sharing_op);
     op->op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_CONTROL;
     op->u.enable = enable;
@@ -43,7 +43,7 @@
 }
 
 int xc_memshr_nominate_gfn(xc_interface *xch,
-                           uint32_t domid,
+                           domid_t domid,
                            unsigned long gfn,
                            uint64_t *handle)
 {
@@ -53,7 +53,7 @@
 
     domctl.cmd = XEN_DOMCTL_mem_sharing_op;
     domctl.interface_version = XEN_DOMCTL_INTERFACE_VERSION;
-    domctl.domain = (domid_t)domid;
+    domctl.domain = domid;
     op = &(domctl.u.mem_sharing_op);
     op->op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_NOMINATE_GFN;
     op->u.nominate.u.gfn = gfn;
@@ -65,7 +65,7 @@
 }
 
 int xc_memshr_nominate_gref(xc_interface *xch,
-                            uint32_t domid,
+                            domid_t domid,
                             grant_ref_t gref,
                             uint64_t *handle)
 {
@@ -75,7 +75,7 @@
 
     domctl.cmd = XEN_DOMCTL_mem_sharing_op;
     domctl.interface_version = XEN_DOMCTL_INTERFACE_VERSION;
-    domctl.domain = (domid_t)domid;
+    domctl.domain = domid;
     op = &(domctl.u.mem_sharing_op);
     op->op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_NOMINATE_GREF;
     op->u.nominate.u.grant_ref = gref;
@@ -105,14 +105,14 @@
 }
 
 int xc_memshr_domain_resume(xc_interface *xch,
-                            uint32_t domid)
+                            domid_t domid)
 {
     DECLARE_DOMCTL;
     struct xen_domctl_mem_sharing_op *op;
 
     domctl.cmd = XEN_DOMCTL_mem_sharing_op;
     domctl.interface_version = XEN_DOMCTL_INTERFACE_VERSION;
-    domctl.domain = (domid_t)domid;
+    domctl.domain = domid;
     op = &(domctl.u.mem_sharing_op);
     op->op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_RESUME;
 
@@ -120,7 +120,7 @@
 }
 
 int xc_memshr_debug_gfn(xc_interface *xch,
-                        uint32_t domid,
+                        domid_t domid,
                         unsigned long gfn)
 {
     DECLARE_DOMCTL;
@@ -128,7 +128,7 @@
 
     domctl.cmd = XEN_DOMCTL_mem_sharing_op;
     domctl.interface_version = XEN_DOMCTL_INTERFACE_VERSION;
-    domctl.domain = (domid_t)domid;
+    domctl.domain = domid;
     op = &(domctl.u.mem_sharing_op);
     op->op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_DEBUG_GFN;
     op->u.debug.u.gfn = gfn;
@@ -137,7 +137,7 @@
 }
 
 int xc_memshr_debug_mfn(xc_interface *xch,
-                        uint32_t domid,
+                        domid_t domid,
                         unsigned long mfn)
 {
     DECLARE_DOMCTL;
@@ -145,7 +145,7 @@
 
     domctl.cmd = XEN_DOMCTL_mem_sharing_op;
     domctl.interface_version = XEN_DOMCTL_INTERFACE_VERSION;
-    domctl.domain = (domid_t)domid;
+    domctl.domain = domid;
     op = &(domctl.u.mem_sharing_op);
     op->op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_DEBUG_MFN;
     op->u.debug.u.mfn = mfn;
@@ -154,7 +154,7 @@
 }
 
 int xc_memshr_debug_gref(xc_interface *xch,
-                         uint32_t domid,
+                         domid_t domid,
                          grant_ref_t gref)
 {
     DECLARE_DOMCTL;
@@ -162,7 +162,7 @@
 
     domctl.cmd = XEN_DOMCTL_mem_sharing_op;
     domctl.interface_version = XEN_DOMCTL_INTERFACE_VERSION;
-    domctl.domain = (domid_t)domid;
+    domctl.domain = domid;
     op = &(domctl.u.mem_sharing_op);
     op->op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_DEBUG_GREF;
     op->u.debug.u.gref = gref;
diff -r fc78d16447b4 -r cfbab2c7c3cc tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h     Tue Jan 10 15:35:01 2012 +0000
+++ b/tools/libxc/xenctrl.h     Tue Jan 10 15:38:08 2012 +0000
@@ -1880,29 +1880,29 @@
  * memshr operations
  */
 int xc_memshr_control(xc_interface *xch,
-                      uint32_t domid,
+                      domid_t domid,
                       int enable);
 int xc_memshr_nominate_gfn(xc_interface *xch,
-                           uint32_t domid,
+                           domid_t domid,
                            unsigned long gfn,
                            uint64_t *handle);
 int xc_memshr_nominate_gref(xc_interface *xch,
-                            uint32_t domid,
+                            domid_t domid,
                             grant_ref_t gref,
                             uint64_t *handle);
 int xc_memshr_share(xc_interface *xch,
                     uint64_t source_handle,
                     uint64_t client_handle);
 int xc_memshr_domain_resume(xc_interface *xch,
-                            uint32_t domid);
+                            domid_t domid);
 int xc_memshr_debug_gfn(xc_interface *xch,
-                        uint32_t domid,
+                        domid_t domid,
                         unsigned long gfn);
 int xc_memshr_debug_mfn(xc_interface *xch,
-                        uint32_t domid,
+                        domid_t domid,
                         unsigned long mfn);
 int xc_memshr_debug_gref(xc_interface *xch,
-                         uint32_t domid,
+                         domid_t domid,
                          grant_ref_t gref);
 
 int xc_flask_load(xc_interface *xc_handle, char *buf, uint32_t size);

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.