From: Michael Chapman Date: Thu, 16 Apr 2015 09:24:21 +0000 (+1000) Subject: qemuProcessStop: wake up pending sync block jobs X-Git-Tag: v1.2.15-rc2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ec03c87725b08a4612435969d7bfcb7b7472861;p=thirdparty%2Flibvirt.git qemuProcessStop: wake up pending sync block jobs Other threads may be blocked in qemuBlockJobSyncWait. Ensure that they're woken up when the domain is stopped. Signed-off-by: Michael Chapman --- diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 605b3c62d0..56719ebe95 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5061,6 +5061,13 @@ void qemuProcessStop(virQEMUDriverPtr driver, if (virAtomicIntDecAndTest(&driver->nactive) && driver->inhibitCallback) driver->inhibitCallback(false, driver->inhibitOpaque); + /* Wake up anything waiting on synchronous block jobs */ + for (i = 0; i < vm->def->ndisks; i++) { + virDomainDiskDefPtr disk = vm->def->disks[i]; + if (disk->blockJobSync && disk->blockJobStatus == -1) + virCondSignal(&disk->blockJobSyncCond); + } + if ((logfile = qemuDomainCreateLog(driver, vm, true)) < 0) { /* To not break the normal domain shutdown process, skip the * timestamp log writing if failed on opening log file. */