qemuMigrationDstPrepareStorage: Reject migration into 'dir' and 'vhost-user' types

Migrating into a 'directory' won't ever work as we ask qemu to emulate a
fat filesystem, so restoring of the files won't be possible. Same for
'vhost-user' disks which don't support blockjobs as there's no block
backend used in qemu.

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 13:53:26 +01:00
parent d6ba6cbaa4
commit 360fd479ae

View File

@ -475,7 +475,6 @@ qemuMigrationDstPrepareStorage(virDomainObj *vm,
break;
case VIR_STORAGE_TYPE_FILE:
case VIR_STORAGE_TYPE_DIR:
exists = virFileExists(disk->src->path);
break;
@ -493,9 +492,15 @@ qemuMigrationDstPrepareStorage(virDomainObj *vm,
exists = virFileExists(disk->src->vdpadev);
break;
case VIR_STORAGE_TYPE_VHOST_USER:
case VIR_STORAGE_TYPE_DIR:
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("non-shared storage migration into '%1$s' target is not supported"),
virStorageTypeToString(virStorageSourceGetActualType(disk->src)));
return -1;
case VIR_STORAGE_TYPE_NETWORK:
case VIR_STORAGE_TYPE_VOLUME:
case VIR_STORAGE_TYPE_VHOST_USER:
case VIR_STORAGE_TYPE_LAST:
case VIR_STORAGE_TYPE_NONE:
break;