Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
---
src/qemu/qemu_driver.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 8ea34e868c..4e0804d505 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -15356,16 +15356,16 @@ qemuDomainSnapshotDiskPrepareOne(virQEMUDriverPtr driver,
else
VIR_FREE(backingStoreStr);
}
- }
-
- /* pre-create the image file so that we can label it before handing it to qemu */
- if (!reuse && dd->src->type != VIR_STORAGE_TYPE_BLOCK) {
- if (virStorageFileCreate(dd->src) < 0) {
- virReportSystemError(errno, _("failed to create image file
'%s'"),
- NULLSTR(dd->src->path));
- return -1;
+ } else {
+ /* pre-create the image file so that we can label it before handing it to qemu
*/
+ if (dd->src->type != VIR_STORAGE_TYPE_BLOCK) {
+ if (virStorageFileCreate(dd->src) < 0) {
+ virReportSystemError(errno, _("failed to create image file
'%s'"),
+ NULLSTR(dd->src->path));
+ return -1;
+ }
+ dd->created = true;
}
- dd->created = true;
}
/* set correct security, cgroup and locking options on the new image */
--
2.21.0