]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage: Traverse backing chains of network disks
authorPeter Krempa <pkrempa@redhat.com>
Mon, 28 Apr 2014 13:09:32 +0000 (15:09 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 3 Jun 2014 07:27:24 +0000 (09:27 +0200)
Now we don't need to skip backing chain detection for remote disks.

src/qemu/qemu_domain.c
src/storage/storage_driver.c

index be056909a5e6916789a9e19116e5e583aec86ccf..bbe32a0be905327ec0652f03ce5cd843e8dc7d5a 100644 (file)
@@ -2428,12 +2428,10 @@ qemuDomainDetermineDiskChain(virQEMUDriverPtr driver,
     int ret = 0;
     uid_t uid;
     gid_t gid;
-    const char *src = virDomainDiskGetSource(disk);
-    int type = virDomainDiskGetType(disk);
+    int type = virStorageSourceGetActualType(&disk->src);
 
-    if (!src ||
-        type == VIR_STORAGE_TYPE_NETWORK ||
-        type == VIR_STORAGE_TYPE_VOLUME)
+    if (type != VIR_STORAGE_TYPE_NETWORK &&
+        !disk->src.path)
         goto cleanup;
 
     if (disk->src.backingStore) {
index 4d960705fecdca76693232e860a2e59dacce3b14..4f51517bf467dc694f503d668e847a18fdc0f0b4 100644 (file)
@@ -3189,19 +3189,13 @@ virStorageFileGetMetadata(virStorageSourcePtr src,
     if (!(cycle = virHashCreate(5, NULL)))
         return -1;
 
-    if (virStorageSourceGetActualType(src) != VIR_STORAGE_TYPE_NETWORK) {
-        if (!src->relPath &&
-            VIR_STRDUP(src->relPath, src->path) < 0)
-            goto cleanup;
+    if (!src->relPath &&
+        VIR_STRDUP(src->relPath, src->path) < 0)
+        goto cleanup;
 
-        if (!src->relDir &&
-            !(src->relDir = mdir_name(src->path))) {
-            virReportOOMError();
-            goto cleanup;
-        }
-    } else {
-        /* TODO: currently unimplemented for non-local storage */
-        ret = 0;
+    if (!src->relDir &&
+        !(src->relDir = mdir_name(src->path))) {
+        virReportOOMError();
         goto cleanup;
     }