]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu_driver: check whether iothread is used by controller
authorPavel Hrdina <phrdina@redhat.com>
Sun, 12 Feb 2017 16:58:05 +0000 (17:58 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 20 Feb 2017 17:44:24 +0000 (18:44 +0100)
This follows the same check for disk, because we cannot remove iothread
if it's used by disk or by controller.  It could lead to crashing QEMU.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
src/qemu/qemu_driver.c

index 98cf06bd681f9d8c002c54f9e8b4e718f56a0b6e..013add5e9be84d024346510c9afd9fce7c83ef89 100644 (file)
@@ -5749,6 +5749,16 @@ qemuDomainDelIOThreadCheck(virDomainDefPtr def,
         }
     }
 
+    for (i = 0; i < def->ncontrollers; i++) {
+        if (def->controllers[i]->iothread == iothread_id) {
+            virReportError(VIR_ERR_INVALID_ARG,
+                           _("cannot remove IOThread '%u' since it "
+                             "is being used by controller"),
+                           iothread_id);
+            return -1;
+        }
+    }
+
     return 0;
 }