virt-manager/57db4185-virt-clone-fix-force-copy-of-empty-cdrom-or-floppy-disk.patch
Charles Arnold 2d558399a0 - Upstream bug fixes (bsc#1027942)
57db4185-virt-clone-fix-force-copy-of-empty-cdrom-or-floppy-disk.patch
  26a433fc-virtManager-clone-check-which-storage-pools-supports-volume-cloning.patch
  4f66c423-cloner-Handle-nonsparse-for-qcow2-images.patch
  a02fc0d0-virtManager-clone-build-default-clone-path-if-we-know-how.patch
  1856c1fa-support-Fix-minimum-version-check.patch
  74bbc3db-urldetect-Check-also-for-treeinfo.patch
  708af01c-osdict-Add-supports_virtioinput.patch
  f23b01be-guest-Add-VirtIO-input-devices-to-s390x-guests-with-graphics.patch
  7afbb90b-virt-xml-Handle-VM-names-that-look-like-id-uuid.patch
  a0ca387a-cli-Fix-pool-default-when-path-belongs-to-another-pool.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=465
2019-04-03 17:16:11 +00:00

42 lines
1.8 KiB
Diff

Subject: virt-clone: fix force-copy of empty cdrom or floppy disk
From: Pavel Hrdina phrdina@redhat.com Thu Feb 28 17:53:58 2019 +0100
Date: Thu Feb 28 18:05:31 2019 +0100:
Git: 57db41854c86704af331d283810db0d86786825a
There is nothing to copy so don't try to generate new path.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1564863
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Index: virt-manager-2.1.0/tests/clitest.py
===================================================================
--- virt-manager-2.1.0.orig/tests/clitest.py
+++ virt-manager-2.1.0/tests/clitest.py
@@ -1047,6 +1047,7 @@ c.add_invalid("--original-xml " + _CLONE
c.add_invalid("--original-xml " + _CLONE_UNMANAGED + " --file %(NEWCLONEIMG1)s --file %(NEWCLONEIMG2)s --force-copy=hdc") # XML w/ disks, force copy but not enough disks passed
c.add_invalid("--original-xml " + _CLONE_MANAGED + " --file /tmp/clonevol") # XML w/ managed storage, specify unmanaged path (should fail)
c.add_invalid("--original-xml " + _CLONE_NOEXIST + " --file %(EXISTIMG1)s") # XML w/ non-existent storage, WITHOUT --preserve
+c.add_valid("--original-xml " + _CLONE_MANAGED + " --auto-clone --force-copy fda") # force copy empty floppy drive
Index: virt-manager-2.1.0/virt-clone
===================================================================
--- virt-manager-2.1.0.orig/virt-clone
+++ virt-manager-2.1.0/virt-clone
@@ -67,11 +67,10 @@ def get_clone_diskfile(new_diskfiles, de
new_diskfiles.append(None)
newpath = new_diskfiles[newidx]
- if newpath is None and auto_clone:
- newpath = design.generate_clone_disk_path(origpath)
-
if origpath is None:
newpath = None
+ elif newpath is None and auto_clone:
+ newpath = design.generate_clone_disk_path(origpath)
clonepaths.append(newpath)
newidx += 1