[PATCH 2/3] qemu: Error out if the bitmap for pinning is all clear

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

 



For both "live" and "config" changes of vcpupin and emulatorpin, an
all clear bitmap doesn't make sense, and it can just cause corruptions.
E.g (similar for emulatorpin).

% virsh vcpupin hame 0 8,^8 --config

% virsh vcpupin hame
VCPU: CPU Affinity
----------------------------------
   0:
   1: 0-63
   2: 0-63
   3: 0-63

% virsh dumpxml hame |grep cpuset
    <vcpupin vcpu='0' cpuset=''/>

% virsh start ham
error: Failed to start domain hame
error: An error occurred, but the cause is unknown
---
 src/qemu/qemu_driver.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 96bf235..c6dc882 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3892,6 +3892,12 @@ qemuDomainPinVcpuFlags(virDomainPtr dom,
     if (!pcpumap)
         goto cleanup;
 
+    if (virBitmapIsAllClear(pcpumap)) {
+        virReportError(VIR_ERR_INVALID_ARG, "%s",
+                       _("Empty cpu list for pinning"));
+        goto cleanup;
+    }
+
     /* pinning to all physical cpus means resetting,
      * so check if we can reset setting.
      */
@@ -4161,6 +4167,12 @@ qemuDomainPinEmulator(virDomainPtr dom,
     if (!pcpumap)
         goto cleanup;
 
+    if (virBitmapIsAllClear(pcpumap)) {
+        virReportError(VIR_ERR_INVALID_ARG, "%s",
+                       _("Empty cpu list for pinning"));
+        goto cleanup;
+    }
+
     /* pinning to all physical cpus means resetting,
      * so check if we can reset setting.
      */
-- 
1.8.1.4

--
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]