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 <phrdina@redhat.com>
This commit is contained in:
Pavel Hrdina 2017-02-12 17:58:05 +01:00
parent c6d2fba69c
commit 99f00fb8bc

View 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;
}