[libvirt] [PATCH] Fix xend XML generation when CPU pinning is used

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

 



# HG changeset patch
# User john.levon@xxxxxxx
# Date 1233203295 28800
# Node ID 9aac8028d5f266023c85338afe71ecabe26079f7
# Parent  add5d46423d8cc24ac922373ba5cd1b3ea2e6f9f
Fix xend XML generation when CPU pinning is used

Signed-off-by: John Levon <john.levon@xxxxxxx>

diff --git a/src/xend_internal.c b/src/xend_internal.c
--- a/src/xend_internal.c
+++ b/src/xend_internal.c
@@ -2227,11 +2227,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) {
+            virXendError(conn, VIR_ERR_NO_MEMORY, NULL);
+            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");

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]