From: Michal Privoznik Date: Mon, 18 May 2020 13:11:49 +0000 (+0200) Subject: qemuProcessStop: Reattach NVMe disks a domain is mirroring into X-Git-Tag: v6.4.0-rc1~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8fd2749b2df99f3ac27215e9e4ab8be191c39460;p=thirdparty%2Flibvirt.git qemuProcessStop: Reattach NVMe disks a domain is mirroring into If the mirror destination is not a file but a NVMe disk, then call qemuHostdevReAttachOneNVMeDisk() to reattach the NVMe back to the host. This would be done by blockjob code when the job finishes, but in this case the job won't finish - QEMU is killed meanwhile. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1825785 Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 7e41695e03..7cdd19b393 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -7600,6 +7600,9 @@ void qemuProcessStop(virQEMUDriverPtr driver, if (disk->mirror) { if (qemuSecurityRestoreImageLabel(driver, vm, disk->mirror, false) < 0) VIR_WARN("Unable to restore security label on %s", disk->dst); + + if (virStorageSourceChainHasNVMe(disk->mirror)) + qemuHostdevReAttachOneNVMeDisk(driver, vm->def->name, disk->mirror); } qemuBlockRemoveImageMetadata(driver, vm, disk->dst, disk->src);