[PATCH] Topology fix for "no cpus"

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

 



Here is a resubmission of this patch, corrected.


--
Elizabeth Kon (Beth)
IBM Linux Technology Center
Open Hypervisor Team
email: eak@xxxxxxxxxx

Index: src/xend_internal.c
===================================================================
RCS file: /data/cvs/libvirt/src/xend_internal.c,v
retrieving revision 1.146
diff -u -r1.146 xend_internal.c
--- src/xend_internal.c	5 Oct 2007 01:08:17 -0000	1.146
+++ src/xend_internal.c	8 Oct 2007 14:37:58 -0000
@@ -1988,9 +1988,15 @@
         offset++;
         /* get list of cpus associated w/ single cell */
         while (1) {
-            if ((len = getNumber(offset, &cpuNum)) < 0) {
-                virXendError(conn, VIR_ERR_XEN_CALL, " topology string syntax error");
-                goto error;
+            len = getNumber(offset, &cpuNum);
+            if (len < 0) {
+                if (!strncmp (offset, "no cpus", 7)){
+                    *(cpuIdsPtr++) = -1;
+                    break;
+                } else {
+                    virXendError(conn, VIR_ERR_XEN_CALL, "topology string syntax error");
+                    goto error;
+                }
             }
             offset += len;
             next = *(offset);
@@ -2058,6 +2064,8 @@
         if (r == -1) goto vir_buffer_failed;
 
         for (i = 0; i < cellCpuCount; i++) {
+            if (*(iCpuIdsPtr + i) == -1)
+                break;
             r = virBufferVSprintf (xml, "\
            <cpu id='%d'/>\n", *(iCpuIdsPtr + i));
         if (r == -1) goto vir_buffer_failed;
--
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]