Skip to contentSkip to conversation

Cpupools: libxc part

PATCH In review Juergen Gross 1 participant 1 message Apr 20, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 2/6 Cpupools: libxc part

Signature · 6 lines
-- 
Juergen Gross                 Principal Developer Operating Systems
TSP ES&S SWE OS6                       Telephone: +49 (0) 89 3222 2967
Fujitsu Technology Solutions              e-mail: [email protected]
Domagkstr. 28                           Internet: ts.fujitsu.com
D-80807 Muenchen                 Company details: ts.fujitsu.com/imprint.html
Signed-off-by [email protected]
tools/libxc/Makefile +1 -0
diff -r fadf63ab49e7 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_cpupool.c new file +154 -0

154 lines not on this page · raw message

tools/libxc/xc_domain.c +9 -1
diff -r fadf63ab49e7 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;
@@ -220,6 +227,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 fadf63ab49e7 tools/libxc/xc_private.h
@@ -164,6 +164,19 @@ static inline int do_domctl(int xc_handl
     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;
+}
+
 static inline int do_sysctl(int xc_handle, struct xen_sysctl *sysctl)
 {
     int ret = -1;
tools/libxc/xenctrl.h +104 -1

129 lines not on this page · raw message

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