- Upstream bug fixes (bsc#1027942)
b9bc3b60-undefine-only-persistent-domain.patch 7fc7e94f-fix-virtio-scsi-controller-target-calculation.patch 2eb455c9-correctly-calculate-virtio-scsi-controller-index.patch - bsc#1067263 - virt-install: ERROR unicode argument expected, got 'str' f836e47b-virtinst-Fix-URLFetcher-for-reading-files.patch - Drop virtinst-fix-replace-StringIO-with-io.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=379
This commit is contained in:
parent
eb5d892eae
commit
47dab25b0a
@ -0,0 +1,43 @@
|
||||
Subject: addhardware: Correctly calculate virtio-scsi controller index
|
||||
From: Lin Ma lma@suse.com Mon Nov 6 20:52:07 2017 +0800
|
||||
Date: Wed Nov 22 16:50:33 2017 -0500:
|
||||
Git: 2eb455c97f1afda33a4b1c87adb2721fac9d9b5f
|
||||
|
||||
Because sata, usb and scsi use same device prefix: sd*, They will be
|
||||
included into occupied list while we add virtio-scsi disks, This is
|
||||
wrong and may cause adding additional virtio-scsi controller.
|
||||
|
||||
How to reproduce:
|
||||
1. fresh install a qemu guest.
|
||||
2. add 6 virtual USB disks.
|
||||
3. add disk A on scsi bus.
|
||||
(then a virtio-scsi controller 0 will be added automatically)
|
||||
4. add disk B on scsi bus.
|
||||
5. observe.
|
||||
|
||||
Expected:
|
||||
disk A and disk B should be connected to virtio-scsi controller 0 because
|
||||
controller 0 has enough available slots.
|
||||
|
||||
Actual:
|
||||
disk A was connected to virtio-scsi controller 0.
|
||||
An additional virtio-scsi controller 1 was added and disk B was connected
|
||||
to it because virt-manager thought the virtio-scsi controller 0 doesn't
|
||||
have available slot.
|
||||
|
||||
Signed-off-by: Lin Ma <lma@suse.com>
|
||||
|
||||
diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
|
||||
index 4a962e6..e563fe6 100644
|
||||
--- a/virtManager/addhardware.py
|
||||
+++ b/virtManager/addhardware.py
|
||||
@@ -1456,7 +1456,8 @@ class vmmAddHardware(vmmGObjectUI):
|
||||
# Save occupied places per controller
|
||||
occupied = {}
|
||||
for d in used_disks:
|
||||
- if d.get_target_prefix() == disk.get_target_prefix():
|
||||
+ if (d.get_target_prefix() == disk.get_target_prefix() and
|
||||
+ d.bus == "scsi"):
|
||||
num = virtinst.VirtualDisk.target_to_num(d.target)
|
||||
idx = num // 7
|
||||
if idx not in occupied:
|
43
7fc7e94f-fix-virtio-scsi-controller-target-calculation.patch
Normal file
43
7fc7e94f-fix-virtio-scsi-controller-target-calculation.patch
Normal file
@ -0,0 +1,43 @@
|
||||
Subject: addhardware: Fix virtio-scsi controller target calculation
|
||||
From: Cole Robinson crobinso@redhat.com Wed Nov 22 14:58:12 2017 -0500
|
||||
Date: Wed Nov 22 16:50:33 2017 -0500:
|
||||
Git: 7fc7e94f211676b9a958662cb93edf770f23273c
|
||||
|
||||
More details here: https://www.redhat.com/archives/virt-tools-list/2017-November/msg00014.html
|
||||
|
||||
Reported-by: Lin Ma <lma@suse.com>
|
||||
|
||||
diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
|
||||
index cd82cd3..4a962e6 100644
|
||||
--- a/virtManager/addhardware.py
|
||||
+++ b/virtManager/addhardware.py
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
import logging
|
||||
import traceback
|
||||
-import collections
|
||||
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Gdk
|
||||
@@ -1455,13 +1454,18 @@ class vmmAddHardware(vmmGObjectUI):
|
||||
if x.model == controller_model]
|
||||
|
||||
# Save occupied places per controller
|
||||
- occupied = collections.defaultdict(int)
|
||||
+ occupied = {}
|
||||
for d in used_disks:
|
||||
if d.get_target_prefix() == disk.get_target_prefix():
|
||||
num = virtinst.VirtualDisk.target_to_num(d.target)
|
||||
- occupied[num / 7] += 1
|
||||
+ idx = num // 7
|
||||
+ if idx not in occupied:
|
||||
+ occupied[idx] = []
|
||||
+ if d.target not in occupied[idx]:
|
||||
+ occupied[idx].append(d.target)
|
||||
+
|
||||
for c in ctrls_scsi:
|
||||
- if occupied[c.index] < 7:
|
||||
+ if c.index not in occupied or len(occupied[c.index]) < 7:
|
||||
controller = c
|
||||
break
|
||||
else:
|
47
b9bc3b60-undefine-only-persistent-domain.patch
Normal file
47
b9bc3b60-undefine-only-persistent-domain.patch
Normal file
@ -0,0 +1,47 @@
|
||||
Subject: delete: undefine only persistent domain
|
||||
From: Pavel Hrdina phrdina@redhat.com Fri Nov 24 17:26:59 2017 +0100
|
||||
Date: Fri Nov 24 17:39:58 2017 +0100:
|
||||
Git: b9bc3b605a96920d3e225d472d549864205e92ce
|
||||
|
||||
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1517119
|
||||
|
||||
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
|
||||
diff --git a/virtManager/delete.py b/virtManager/delete.py
|
||||
index 98df413..0ebfdeb 100644
|
||||
--- a/virtManager/delete.py
|
||||
+++ b/virtManager/delete.py
|
||||
@@ -162,6 +162,7 @@ class vmmDeleteDialog(vmmGObjectUI):
|
||||
def _async_delete(self, asyncjob, paths):
|
||||
storage_errors = []
|
||||
details = ""
|
||||
+ undefine = self.vm.is_persistent()
|
||||
|
||||
try:
|
||||
if self.vm.is_active():
|
||||
@@ -181,8 +182,9 @@ class vmmDeleteDialog(vmmGObjectUI):
|
||||
"".join(traceback.format_exc())))
|
||||
meter.end(0)
|
||||
|
||||
- logging.debug("Removing VM '%s'", self.vm.get_name())
|
||||
- self.vm.delete()
|
||||
+ if undefine:
|
||||
+ logging.debug("Removing VM '%s'", self.vm.get_name())
|
||||
+ self.vm.delete()
|
||||
|
||||
except Exception as e:
|
||||
error = (_("Error deleting virtual machine '%s': %s") %
|
||||
diff --git a/virtManager/domain.py b/virtManager/domain.py
|
||||
index a1f59e3..183a56c 100644
|
||||
--- a/virtManager/domain.py
|
||||
+++ b/virtManager/domain.py
|
||||
@@ -484,6 +484,9 @@ class vmmDomain(vmmLibvirtObject):
|
||||
return bool(self.get_xmlobj().os.loader_ro is True and
|
||||
self.get_xmlobj().os.loader_type == "pflash")
|
||||
|
||||
+ def is_persistent(self):
|
||||
+ return bool(self._backend.isPersistent())
|
||||
+
|
||||
##################
|
||||
# Support checks #
|
||||
##################
|
20
f836e47b-virtinst-Fix-URLFetcher-for-reading-files.patch
Normal file
20
f836e47b-virtinst-Fix-URLFetcher-for-reading-files.patch
Normal file
@ -0,0 +1,20 @@
|
||||
Subject: virtinst: Fix _URLFetcher for reading files
|
||||
From: Andrew Wong andrew.kw.w@gmail.com Wed Nov 8 01:23:28 2017 -0500
|
||||
Date: Wed Nov 22 17:26:31 2017 -0500:
|
||||
Git: f836e47b7053ce8cd83c66728acfb9b0f821bcac
|
||||
|
||||
_grabber() is used for both binary and text files.
|
||||
|
||||
diff --git a/virtinst/urlfetcher.py b/virtinst/urlfetcher.py
|
||||
index 5dae424c..1288668a 100644
|
||||
--- a/virtinst/urlfetcher.py
|
||||
+++ b/virtinst/urlfetcher.py
|
||||
@@ -169,7 +169,7 @@ class _URLFetcher(object):
|
||||
"""
|
||||
Grab the passed filename from self.location and return it as a string
|
||||
"""
|
||||
- fileobj = io.StringIO()
|
||||
+ fileobj = io.BytesIO()
|
||||
self._grabURL(filename, fileobj)
|
||||
return fileobj.getvalue()
|
||||
|
@ -1,3 +1,19 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Nov 28 08:24:39 MST 2017 - carnold@suse.com
|
||||
|
||||
- Upstream bug fixes (bsc#1027942)
|
||||
b9bc3b60-undefine-only-persistent-domain.patch
|
||||
7fc7e94f-fix-virtio-scsi-controller-target-calculation.patch
|
||||
2eb455c9-correctly-calculate-virtio-scsi-controller-index.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Nov 24 09:48:19 MST 2017 - carnold@suse.com
|
||||
|
||||
- bsc#1067263 - virt-install: ERROR unicode argument expected, got
|
||||
'str'
|
||||
f836e47b-virtinst-Fix-URLFetcher-for-reading-files.patch
|
||||
- Drop virtinst-fix-replace-StringIO-with-io.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Nov 8 13:59:11 MST 2017 - carnold@suse.com
|
||||
|
||||
|
@ -69,6 +69,10 @@ Patch28: 374a3779-urlfetcher-write-test-file-as-binary-content.patch
|
||||
Patch29: f7c8cf9f-devicepanic-dont-return-empty-model-list.patch
|
||||
Patch30: 3be78d1f-addhardware-dont-allow-panic-option-where-not-supported.patch
|
||||
Patch31: 73de8285-systray-remove-redundant-variable-assignment.patch
|
||||
Patch32: b9bc3b60-undefine-only-persistent-domain.patch
|
||||
Patch33: 7fc7e94f-fix-virtio-scsi-controller-target-calculation.patch
|
||||
Patch34: 2eb455c9-correctly-calculate-virtio-scsi-controller-index.patch
|
||||
Patch35: f836e47b-virtinst-Fix-URLFetcher-for-reading-files.patch
|
||||
# SUSE Only
|
||||
Patch70: virtman-desktop.patch
|
||||
Patch71: virtman-kvm.patch
|
||||
@ -111,7 +115,6 @@ Patch166: virtinst-check-date-format.patch
|
||||
Patch167: virtinst-no-usb-tablet-for-xenpv.patch
|
||||
Patch168: virtinst-add-sle15-detection-support.patch
|
||||
Patch169: virtinst-keep-install-iso-attached.patch
|
||||
Patch170: virtinst-fix-replace-StringIO-with-io.patch
|
||||
BuildArch: noarch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
@ -226,6 +229,10 @@ machine).
|
||||
%patch29 -p1
|
||||
%patch30 -p1
|
||||
%patch31 -p1
|
||||
%patch32 -p1
|
||||
%patch33 -p1
|
||||
%patch34 -p1
|
||||
%patch35 -p1
|
||||
# SUSE Only
|
||||
%patch70 -p1
|
||||
%patch71 -p1
|
||||
@ -268,7 +275,6 @@ machine).
|
||||
%patch167 -p1
|
||||
%patch168 -p1
|
||||
%patch169 -p1
|
||||
%patch170 -p1
|
||||
|
||||
%build
|
||||
%if %{qemu_user}
|
||||
|
@ -1,26 +0,0 @@
|
||||
Commit 75210ed37c0c5de569de73e04488808a2521a011 changed the file
|
||||
object type such that the write method requires a unicode value
|
||||
instead of a string. This is a follow-up patch to that commmit.
|
||||
|
||||
Index: virt-manager-1.4.3/virtinst/urlfetcher.py
|
||||
===================================================================
|
||||
--- virt-manager-1.4.3.orig/virtinst/urlfetcher.py
|
||||
+++ virt-manager-1.4.3/virtinst/urlfetcher.py
|
||||
@@ -105,6 +105,8 @@ class _URLFetcher(object):
|
||||
buff = urlobj.read(self._block_size)
|
||||
if not buff:
|
||||
break
|
||||
+ if isinstance(fileobj, io.StringIO) and type(buff) is str:
|
||||
+ buff = unicode(buff)
|
||||
fileobj.write(buff)
|
||||
total += len(buff)
|
||||
self.meter.update(total)
|
||||
@@ -207,6 +209,8 @@ class _HTTPURLFetcher(_URLFetcher):
|
||||
"""
|
||||
total = 0
|
||||
for data in urlobj.iter_content(chunk_size=self._block_size):
|
||||
+ if isinstance(fileobj, io.StringIO) and type(data) is str:
|
||||
+ data = unicode(data)
|
||||
fileobj.write(data)
|
||||
total += len(data)
|
||||
self.meter.update(total)
|
@ -1,11 +1,11 @@
|
||||
Reference: bnc#885094
|
||||
grub.xen is required to boot Xen PV VMs using BTRFS. It belongs to
|
||||
the grub2-x86_64-xen RPM and should never be deleted.
|
||||
Index: virt-manager-1.4.2/virtManager/delete.py
|
||||
Index: virt-manager-1.4.3/virtManager/delete.py
|
||||
===================================================================
|
||||
--- virt-manager-1.4.2.orig/virtManager/delete.py
|
||||
+++ virt-manager-1.4.2/virtManager/delete.py
|
||||
@@ -239,7 +239,7 @@ def populate_storage_list(storage_list,
|
||||
--- virt-manager-1.4.3.orig/virtManager/delete.py
|
||||
+++ virt-manager-1.4.3/virtManager/delete.py
|
||||
@@ -241,7 +241,7 @@ def populate_storage_list(storage_list,
|
||||
diskdata.append(("dtb", vm.get_xmlobj().os.dtb, True, False, True))
|
||||
|
||||
for target, path, ro, shared, is_media in diskdata:
|
||||
|
Loading…
Reference in New Issue
Block a user