[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH v2 1/7] qemuSnapshotDiskPrepareOne: Get available even if snapdisk is NULL



From: Masayoshi Mizuma <m mizuma jp fujitsu com>

Get available even if snapdisk argument is NULL at qemuSnapshotDiskPrepareOne()
so that the caller can setup dd->src.

Signed-off-by: Masayoshi Mizuma <m mizuma jp fujitsu com>
---
 src/qemu/qemu_snapshot.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index 1e8ea80b22..d310e6ff02 100644
--- a/src/qemu/qemu_snapshot.c
+++ b/src/qemu/qemu_snapshot.c
@@ -953,8 +953,9 @@ qemuSnapshotDiskPrepareOne(virQEMUDriverPtr driver,
     if (qemuDomainStorageSourceValidateDepth(disk->src, 1, disk->dst) < 0)
         return -1;
 
-    if (!(dd->src = virStorageSourceCopy(snapdisk->src, false)))
-        return -1;
+    if (snapdisk)
+        if (!(dd->src = virStorageSourceCopy(snapdisk->src, false)))
+            return -1;
 
     if (virStorageSourceInitChainElement(dd->src, dd->disk->src, false) < 0)
         return -1;
-- 
2.27.0


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]