Blame SOURCES/libvirt-util-storage-Copy-driver-type-when-initializing-chain-element.patch

9119d9
From 403c8a3286a5f2a6b86f1b76737eb76bc8a01cb6 Mon Sep 17 00:00:00 2001
9119d9
Message-Id: <403c8a3286a5f2a6b86f1b76737eb76bc8a01cb6@dist-git>
9119d9
From: Peter Krempa <pkrempa@redhat.com>
9119d9
Date: Tue, 16 Sep 2014 18:11:04 +0200
9119d9
Subject: [PATCH] util: storage: Copy driver type when initializing chain
9119d9
 element
9119d9
9119d9
virStorageSourceInitChainElement initializes a new storage chain element
9119d9
for use as a new disk source. If the new element doesn't contain the
9119d9
driver name, copy it from the old source.
9119d9
9119d9
This fixes issue where a disk would forget the driver after a snapshot.
9119d9
9119d9
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1140984
9119d9
(cherry picked from commit 865421c94a63f43c0164d598a73226d0e4231c93)
9119d9
9119d9
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9119d9
---
9119d9
 src/util/virstoragefile.c | 4 ++++
9119d9
 1 file changed, 4 insertions(+)
9119d9
9119d9
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
9119d9
index 5b6b2f5..79f4adb 100644
9119d9
--- a/src/util/virstoragefile.c
9119d9
+++ b/src/util/virstoragefile.c
9119d9
@@ -1920,6 +1920,10 @@ virStorageSourceInitChainElement(virStorageSourcePtr newelem,
9119d9
         virStorageSourceSeclabelsCopy(newelem, old) < 0)
9119d9
         goto cleanup;
9119d9
 
9119d9
+    if (!newelem->driverName &&
9119d9
+        VIR_STRDUP(newelem->driverName, old->driverName) < 0)
9119d9
+        goto cleanup;
9119d9
+
9119d9
     newelem->shared = old->shared;
9119d9
     newelem->readonly = old->readonly;
9119d9
 
9119d9
-- 
9119d9
2.1.0
9119d9