From 6f87fb9b6f51c2e2b1ac254648e9d0836be68868 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 27 Jun 2014 14:33:01 +0200 Subject: [PATCH] util: storage: Copy parent's disk metadata to backing chain elements 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 b97fd56bc3..505b652169 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -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; } -- GitLab