]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuMigrationDstPrepareStorage: Reject migration into 'dir' and 'vhost-user' types
authorPeter Krempa <pkrempa@redhat.com>
Mon, 19 Feb 2024 12:53:26 +0000 (13:53 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 21 Feb 2024 13:15:49 +0000 (14:15 +0100)
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>
src/qemu/qemu_migration.c

index d248f87c2dcbabce8195f20b15111367a223be22..4c524fafe4c65012e52f24c20304660697114228 100644 (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;