Skip to contentSkip to conversation

xen: cpupool support - support in libxc

PATCH In review Juergen Gross 1 participant 1 message Apr 17, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 2/6 xen: cpupool support - support in libxc

Signed-off-by [email protected]
Signature · 5 lines
Juergen Gross                 Principal Developer Operating Systems
TSP ES&S SWE OS6                       Telephone: +49 (0) 89 636 47950
Fujitsu Technolgy Solutions               e-mail: [email protected]
Otto-Hahn-Ring 6                        Internet: ts.fujitsu.com
D-81739 Muenchen                 Company details: ts.fujitsu.com/imprint.html
tools/libxc/Makefile +1 -0
diff -r 655dc3bc1d8e tools/libxc/Makefile
@@ -8,6 +8,7 @@ CTRL_SRCS-y       += xc_core.c
 CTRL_SRCS-y       += xc_core.c
 CTRL_SRCS-$(CONFIG_X86) += xc_core_x86.c
 CTRL_SRCS-$(CONFIG_IA64) += xc_core_ia64.c
+CTRL_SRCS-y       += xc_cpupool.c
 CTRL_SRCS-y       += xc_domain.c
 CTRL_SRCS-y       += xc_evtchn.c
 CTRL_SRCS-y       += xc_misc.c
tools/libxc/xc_domain.c +9 -1
diff -r 655dc3bc1d8e tools/libxc/xc_domain.c
@@ -6,6 +6,7 @@
  * Copyright (c) 2003, K A Fraser.
  */
 
+#include <stdarg.h>
 #include "xc_private.h"
 #include "xg_save_restore.h"
 #include <xen/memory.h>
@@ -15,15 +16,21 @@ int xc_domain_create(int xc_handle,
                      uint32_t ssidref,
                      xen_domain_handle_t handle,
                      uint32_t flags,
-                     uint32_t *pdomid)
+                     uint32_t *pdomid, ...)
 {
     int err;
+    va_list ap;
     DECLARE_DOMCTL;
 
     domctl.cmd = XEN_DOMCTL_createdomain;
     domctl.domain = (domid_t)*pdomid;
     domctl.u.createdomain.ssidref = ssidref;
     domctl.u.createdomain.flags   = flags;
+    if ( flags & XEN_DOMCTL_CDF_pool ) {
+        va_start(ap, pdomid);
+        domctl.u.createdomain.cpupool = va_arg(ap, uint32_t);
+        va_end(ap);
+    }
     memcpy(domctl.u.createdomain.handle, handle, sizeof(xen_domain_handle_t));
     if ( (err = do_domctl(xc_handle, &domctl)) != 0 )
         return err;
@@ -205,6 +212,7 @@ int xc_domain_getinfo(int xc_handle,
         info->cpu_time = domctl.u.getdomaininfo.cpu_time;
         info->nr_online_vcpus = domctl.u.getdomaininfo.nr_online_vcpus;
         info->max_vcpu_id = domctl.u.getdomaininfo.max_vcpu_id;
+        info->cpupool = domctl.u.getdomaininfo.cpupool;
 
         memcpy(info->handle, domctl.u.getdomaininfo.handle,
                sizeof(xen_domain_handle_t));
tools/libxc/xc_private.h +13 -0
diff -r 655dc3bc1d8e tools/libxc/xc_private.h
@@ -155,6 +155,19 @@ static inline int do_domctl(int xc_handl
     unlock_pages(domctl, sizeof(*domctl));
 
  out1:
+    return ret;
+}
+
+static inline int do_domctl_save(int xc_handle, struct xen_domctl *domctl)
+{
+    int ret;
+
+    do
+    {
+        ret = do_domctl(xc_handle, domctl);
+    }
+    while ( (ret < 0 ) && (errno == EAGAIN) );
+
     return ret;
 }
 
tools/libxc/xenctrl.h +95 -1

114 lines not on this page · raw message

tools/libxc/xc_cpupool.c new file +154 -0

154 lines not on this page · raw message

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel