]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuMigrationDstPrepareStorage: Move assumption that 'network' disks always exist
authorPeter Krempa <pkrempa@redhat.com>
Mon, 19 Feb 2024 13:16:19 +0000 (14:16 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 21 Feb 2024 13:15:49 +0000 (14:15 +0100)
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>
src/qemu/qemu_migration.c

index 4c524fafe4c65012e52f24c20304660697114228..438aa4503ea64648b4ce7dba5f483eefaab2f8a5 100644 (file)
@@ -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: