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

[Xen-devel] [PATCH 01/13] xen: Fix XEN_SYSCTL_getdomaininfolist for version 0xa



Also add a default case so future bumps of the sysctl interface version dont
result in spurious passes of the IOCTL handler.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 coregrind/m_syswrap/syswrap-xen.c |   17 +++++++++++++++++
 include/vki/vki-xen-sysctl.h      |   10 ++++++++++
 2 files changed, 27 insertions(+)

diff --git a/coregrind/m_syswrap/syswrap-xen.c 
b/coregrind/m_syswrap/syswrap-xen.c
index ce300e8..0314451 100644
--- a/coregrind/m_syswrap/syswrap-xen.c
+++ b/coregrind/m_syswrap/syswrap-xen.c
@@ -401,6 +401,17 @@ PRE(sysctl) {
         PRE_XEN_SYSCTL_READ(getdomaininfolist_00000009, max_domains);
         PRE_XEN_SYSCTL_READ(getdomaininfolist_00000009, buffer);
         break;
+      case 0x0000000a:
+        PRE_XEN_SYSCTL_READ(getdomaininfolist_0000000a, first_domain);
+        PRE_XEN_SYSCTL_READ(getdomaininfolist_0000000a, max_domains);
+        PRE_XEN_SYSCTL_READ(getdomaininfolist_0000000a, buffer);
+        break;
+      default:
+          VG_(dmsg)("WARNING: XEN_SYSCTL_getdomaininfolist for sysctl version "
+                    "%"PRIx32" not implemented yet\n",
+                    sysctl->interface_version);
+          SET_STATUS_Failure(VKI_EINVAL);
+          return;
       }
       break;
 
@@ -801,6 +812,12 @@ POST(sysctl)
                        sizeof(*sysctl->u.getdomaininfolist_00000009.buffer.p)
                        * sysctl->u.getdomaininfolist_00000009.num_domains);
         break;
+      case 0x0000000a:
+        POST_XEN_SYSCTL_WRITE(getdomaininfolist_0000000a, num_domains);
+        POST_MEM_WRITE((Addr)sysctl->u.getdomaininfolist_0000000a.buffer.p,
+                       sizeof(*sysctl->u.getdomaininfolist_0000000a.buffer.p)
+                       * sysctl->u.getdomaininfolist_0000000a.num_domains);
+        break;
       }
       break;
 
diff --git a/include/vki/vki-xen-sysctl.h b/include/vki/vki-xen-sysctl.h
index 453752c..06cbaf6 100644
--- a/include/vki/vki-xen-sysctl.h
+++ b/include/vki/vki-xen-sysctl.h
@@ -56,6 +56,15 @@ struct vki_xen_sysctl_getdomaininfolist_00000009 {
     vki_uint32_t              num_domains;
 };
 
+struct vki_xen_sysctl_getdomaininfolist_0000000a {
+    /* IN variables. */
+    vki_xen_domid_t           first_domain;
+    vki_uint32_t              max_domains;
+    VKI_XEN_GUEST_HANDLE_64(vki_xen_domctl_getdomaininfo_00000009_t) buffer;
+    /* OUT variables. */
+    vki_uint32_t              num_domains;
+};
+
 #define VKI_XEN_SYSCTL_CPUPOOL_OP_CREATE                1  /* C */
 #define VKI_XEN_SYSCTL_CPUPOOL_OP_DESTROY               2  /* D */
 #define VKI_XEN_SYSCTL_CPUPOOL_OP_INFO                  3  /* I */
@@ -139,6 +148,7 @@ struct vki_xen_sysctl {
         //struct vki_xen_sysctl_perfc_op          perfc_op;
         struct vki_xen_sysctl_getdomaininfolist_00000008 
getdomaininfolist_00000008;
         struct vki_xen_sysctl_getdomaininfolist_00000009 
getdomaininfolist_00000009;
+        struct vki_xen_sysctl_getdomaininfolist_0000000a 
getdomaininfolist_0000000a;
         //struct vki_xen_sysctl_debug_keys        debug_keys;
         //struct vki_xen_sysctl_getcpuinfo        getcpuinfo;
         //struct vki_xen_sysctl_availheap         availheap;
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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