]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: don't call virFileExists() for network type disks
authorMartin Kletzander <mkletzan@redhat.com>
Tue, 29 Apr 2014 07:20:26 +0000 (09:20 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Tue, 29 Apr 2014 08:32:27 +0000 (10:32 +0200)
Based on suggestion from Eric [1], because it might not get cleaned up
before the release, so to avoid potential errors.

[1] https://www.redhat.com/archives/libvir-list/2014-April/msg00929.html

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/qemu/qemu_domain.c
src/qemu/qemu_process.c

index ab197381096947b9157af3d40fd6df0bbf9614d8..8fa58f33ddd4212e6a3f1d8c16995d327629e967 100644 (file)
@@ -2270,6 +2270,7 @@ qemuDomainCheckDiskPresence(virQEMUDriverPtr driver,
         disk = vm->def->disks[i - 1];
         const char *path = virDomainDiskGetSource(disk);
         enum virStorageFileFormat format = virDomainDiskGetFormat(disk);
+        enum virStorageType type = virStorageSourceGetActualType(&disk->src);
 
         if (!path)
             continue;
@@ -2277,7 +2278,8 @@ qemuDomainCheckDiskPresence(virQEMUDriverPtr driver,
         /* There is no need to check the backing chain for disks
          * without backing support, the fact that the file exists is
          * more than enough */
-        if (format >= VIR_STORAGE_FILE_NONE &&
+        if (type != VIR_STORAGE_TYPE_NETWORK &&
+            format >= VIR_STORAGE_FILE_NONE &&
             format < VIR_STORAGE_FILE_BACKING &&
             virFileExists(path))
             continue;
index 0afad9d0785ed7d707ef3554cb7556867647bca7..f53a9e169a21f99dadbfa6c454fff4475875b0e1 100644 (file)
@@ -3807,11 +3807,6 @@ int qemuProcessStart(virConnectPtr conn,
     if (qemuAssignDeviceAliases(vm->def, priv->qemuCaps) < 0)
         goto cleanup;
 
-    if (qemuDomainCheckDiskPresence(driver, vm,
-                                    flags & VIR_QEMU_PROCESS_START_COLD) < 0)
-        goto cleanup;
-
-
     /* Get the advisory nodeset from numad if 'placement' of
      * either <vcpu> or <numatune> is 'auto'.
      */
@@ -3840,6 +3835,10 @@ int qemuProcessStart(virConnectPtr conn,
             goto cleanup;
     }
 
+    if (qemuDomainCheckDiskPresence(driver, vm,
+                                    flags & VIR_QEMU_PROCESS_START_COLD) < 0)
+        goto cleanup;
+
     if (VIR_ALLOC(priv->monConfig) < 0)
         goto cleanup;