]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix xend XML generation when CPU pinning is used
authorJohn Levon <john.levon@sun.com>
Thu, 29 Jan 2009 18:40:32 +0000 (18:40 +0000)
committerJohn Levon <john.levon@sun.com>
Thu, 29 Jan 2009 18:40:32 +0000 (18:40 +0000)
ChangeLog
src/xend_internal.c

index b85d35a854b7aaf32f2b3bad2e00467906bfce5e..c6b7696f21a4a6ab6942f7b7f5eebee83696c40d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Jan 29 17:22:53 GMT 2009 John Levon <john.levon@sun.com>
+
+       * src/xend_internal.c: Fix xend XML generation when CPU pinning
+       is used
+
 Thu Jan 29 19:05:00 +0100 2009 Jim Meyering <meyering@redhat.com>
 
        maint: sync from coreutils
index 46b4382beac232bef5516c7e0c0d53547371180f..a47214663a521498aa3a0d2979d33d437742e778 100644 (file)
@@ -2226,11 +2226,21 @@ xenDaemonParseSxpr(virConnectPtr conn,
         def->maxmem = def->memory;
 
     if (cpus != NULL) {
+        def->cpumasklen = VIR_DOMAIN_CPUMASK_LEN;
+        if (VIR_ALLOC_N(def->cpumask, def->cpumasklen) < 0) {
+            virReportOOMError(conn);
+            goto error;
+        }
+
         if (virDomainCpuSetParse(conn, &cpus,
                                  0, def->cpumask,
-                                 def->cpumasklen) < 0)
+                                 def->cpumasklen) < 0) {
+            virXendError(conn, VIR_ERR_INTERNAL_ERROR,
+                         _("invalid CPU mask %s"), cpus);
             goto error;
+        }
     }
+
     def->vcpus = sexpr_int(root, "domain/vcpus");
 
     tmp = sexpr_node(root, "domain/on_poweroff");