mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-02 04:15:46 +00:00
qemuDomainAttachDeviceDiskLiveInternal: Fix jumps on error
When I've originally refactored the function in commit0d981bcefc
the logic was still correct, but then later in commit52f8655439
I've moved most of the image setup logic into the function neglecting to add the 'goto cleanup;' needed to skip over the setup of the disk images. Fixes:52f8655439
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
a1f7faa402
commit
16f8daf2df
@ -931,7 +931,7 @@ qemuDomainAttachDeviceDiskLiveInternal(virQEMUDriver *driver,
|
||||
if (disk->device == VIR_DOMAIN_DISK_DEVICE_LUN) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("disk device='lun' is not supported for usb bus"));
|
||||
break;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (virDomainUSBAddressEnsure(priv->usbaddrs, &disk->info) < 0)
|
||||
@ -991,6 +991,7 @@ qemuDomainAttachDeviceDiskLiveInternal(virQEMUDriver *driver,
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
|
||||
_("disk bus '%1$s' cannot be hotplugged."),
|
||||
virDomainDiskBusTypeToString(disk->bus));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (qemuDomainStorageSourceChainAccessAllow(driver, vm, disk->src) < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user