mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-05 04:25:19 +00:00
qemu: roll back if not all nbdkit backends are successful
When starting nbdkit processes for the backing store of a disk, we were returning an error if any backing store failed, but we were not cleaning up processes that succeeded higher in the chain. Make sure that if we return a failure status from qemuNbdkitStartStorageSource() that we roll back any processes that had been started. Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
7a03785d88
commit
4495ec7d9b
@ -914,8 +914,11 @@ qemuNbdkitStartStorageSource(virQEMUDriver *driver,
|
|||||||
virStorageSource *backing;
|
virStorageSource *backing;
|
||||||
|
|
||||||
for (backing = src; backing != NULL; backing = backing->backingStore) {
|
for (backing = src; backing != NULL; backing = backing->backingStore) {
|
||||||
if (qemuNbdkitStartStorageSourceOne(driver, vm, backing) < 0)
|
if (qemuNbdkitStartStorageSourceOne(driver, vm, backing) < 0) {
|
||||||
|
/* roll back any previously-started sources */
|
||||||
|
qemuNbdkitStopStorageSource(src, vm, chain);
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
if (!chain)
|
if (!chain)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user