mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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 <mprivozn@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user