1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-04-01 20:05:19 +00:00

qemuMigrationDstPrepareStorage: Move assumption that 'network' disks always exist

Move the assumption from the code pre-creating the storage to
qemuMigrationDstPrepareStorage where it's checked for other cases.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2024-02-19 14:16:19 +01:00
parent 360fd479ae
commit eeb1cecf1e

@ -338,10 +338,6 @@ qemuMigrationDstPrecreateDisk(virConnectPtr *conn,
break;
case VIR_STORAGE_TYPE_NETWORK:
VIR_DEBUG("Skipping creation of network disk '%s'",
disk->dst);
return 0;
case VIR_STORAGE_TYPE_BLOCK:
case VIR_STORAGE_TYPE_DIR:
case VIR_STORAGE_TYPE_NVME:
@ -492,6 +488,12 @@ qemuMigrationDstPrepareStorage(virDomainObj *vm,
exists = virFileExists(disk->src->vdpadev);
break;
case VIR_STORAGE_TYPE_NETWORK:
/* For network disks we always assume they exist as the storage drivec
* can't create them */
exists = true;
break;
case VIR_STORAGE_TYPE_VHOST_USER:
case VIR_STORAGE_TYPE_DIR:
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
@ -499,7 +501,6 @@ qemuMigrationDstPrepareStorage(virDomainObj *vm,
virStorageTypeToString(virStorageSourceGetActualType(disk->src)));
return -1;
case VIR_STORAGE_TYPE_NETWORK:
case VIR_STORAGE_TYPE_VOLUME:
case VIR_STORAGE_TYPE_LAST:
case VIR_STORAGE_TYPE_NONE: