Blame SOURCES/virt-manager-clone-Fix-inverted-nonsparse-check.patch

e4cbec
From a271e4c0e4415a179c26aa62ef8492fd6a2424f5 Mon Sep 17 00:00:00 2001
e4cbec
Message-Id: <a271e4c0e4415a179c26aa62ef8492fd6a2424f5@dist-git>
e4cbec
From: Pavel Hrdina <phrdina@redhat.com>
e4cbec
Date: Mon, 13 May 2019 10:29:23 -0400
e4cbec
Subject: [PATCH] clone: Fix inverted --nonsparse check
e4cbec
e4cbec
From: Cole Robinson <crobinso@redhat.com>
e4cbec
e4cbec
I botched 4f66c423f7 and inverted the sparse check, meaning --nonsparse
e4cbec
on the command line would actually request a sparse image. Fix it
e4cbec
e4cbec
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1675743
e4cbec
(cherry picked from commit 622a363e5bd19491bbf84ec35c6bfdaf8b54ae9a)
e4cbec
Signed-off-by: Cole Robinson <crobinso@redhat.com>
e4cbec
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
e4cbec
---
e4cbec
 tests/clone-xml/cross-pool-disks-out.xml | 4 ++--
e4cbec
 virtinst/cloner.py                       | 2 +-
e4cbec
 2 files changed, 3 insertions(+), 3 deletions(-)
e4cbec
e4cbec
diff --git a/tests/clone-xml/cross-pool-disks-out.xml b/tests/clone-xml/cross-pool-disks-out.xml
e4cbec
index 6093e240..260f321c 100644
e4cbec
--- a/tests/clone-xml/cross-pool-disks-out.xml
e4cbec
+++ b/tests/clone-xml/cross-pool-disks-out.xml
e4cbec
@@ -1,7 +1,7 @@
e4cbec
 <volume>
e4cbec
   <name>new1.img</name>
e4cbec
   <capacity>1000000</capacity>
e4cbec
-  <allocation>1000000</allocation>
e4cbec
+  <allocation>50000</allocation>
e4cbec
   <target>
e4cbec
     <format type="qcow2"/>
e4cbec
     <features>
e4cbec
@@ -12,7 +12,7 @@
e4cbec
 <volume>
e4cbec
   <name>new2.img</name>
e4cbec
   <capacity>1000000</capacity>
e4cbec
-  <allocation>1000000</allocation>
e4cbec
+  <allocation>50000</allocation>
e4cbec
   <target>
e4cbec
     <format type="qcow2"/>
e4cbec
     <features>
e4cbec
diff --git a/virtinst/cloner.py b/virtinst/cloner.py
e4cbec
index 3ce44b15..6d1196d9 100644
e4cbec
--- a/virtinst/cloner.py
e4cbec
+++ b/virtinst/cloner.py
e4cbec
@@ -348,7 +348,7 @@ class Cloner(object):
e4cbec
                 vol_install.input_vol = orig_disk.get_vol_object()
e4cbec
                 vol_install.sync_input_vol(only_format=True)
e4cbec
 
e4cbec
-            if self.clone_sparse:
e4cbec
+            if not self.clone_sparse:
e4cbec
                 vol_install.allocation = vol_install.capacity
e4cbec
             vol_install.reflink = self.reflink
e4cbec
             clone_disk.set_vol_install(vol_install)
e4cbec
-- 
e4cbec
2.21.0
e4cbec