From: Pavel Hrdina Date: Sun, 12 Feb 2017 16:58:05 +0000 (+0100) Subject: qemu_driver: check whether iothread is used by controller X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=99f00fb8bc19f7fa17fb55d7f7ac60c32f29ef9d;p=libvirt.git qemu_driver: check whether iothread is used by controller 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 --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 98cf06bd68..013add5e9b 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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; }