]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
util: storage: Copy parent's disk metadata to backing chain elements
authorPeter Krempa <pkrempa@redhat.com>
Fri, 27 Jun 2014 12:33:01 +0000 (14:33 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 8 Jul 2014 12:34:05 +0000 (14:34 +0200)
When discovering a disk backing chain the parent disk's metadata need to
be populated into the guest images so that each piece of the backing
chain contains a copy of those. This will allow us to refactor the
security driver so that it will not need to carry around the original
disk definition.

src/util/virstoragefile.c

index b97fd56bc3d6e8e840a6d097fae4aafbda89368e..505b652169ae70d7d6d0f058846cb2483f322e8a 100644 (file)
@@ -2315,9 +2315,17 @@ virStorageSourceNewFromBacking(virStorageSourcePtr parent)
                 }
             }
         }
+
+        /* copy parent's labelling and other top level stuff */
+        if (virStorageSourceInitChainElement(ret, parent, false) < 0)
+            goto error;
     }
 
     return ret;
+
+ error:
+    virStorageSourceFree(ret);
+    return NULL;
 }