From 360fd479ae725677e9744aaa05101606463d0f56 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 19 Feb 2024 13:53:26 +0100 Subject: [PATCH] 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 Reviewed-by: Michal Privoznik --- src/qemu/qemu_migration.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index d248f87c2d..4c524fafe4 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -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;