mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
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 <mike@very.puzzling.org>
This commit is contained in:
parent
89a5e25d05
commit
1ec03c8772
@ -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. */
|
||||
|
Loading…
Reference in New Issue
Block a user