[libvirt] [PATCHv5 09/28] util: storage: Copy parent's disk metadata to backing chain elements

Peter Krempa pkrempa at redhat.com
Fri Jul 4 11:29:24 UTC 2014


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 | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index cdbe24b..591c2fa 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -2334,9 +2334,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;
 }


-- 
1.9.3




More information about the libvir-list mailing list