From bac3f6bcbd02af0faa795377539fd1a7708cb289 Mon Sep 17 00:00:00 2001 From: Charles Arnold Date: Tue, 12 Jan 2016 20:36:29 +0000 Subject: [PATCH] - bsc#960828 - Unable to create qcow2 volumes on remote KVM with virt-manager virtinst-vol-default-nocow.patch - bsc#960724 - virt-manager fails to create Virtual machines on a CentOS7 host virtinst-set-qemu-emulator.patch - Upstream bug fix 89c3638b-fix-detection-that-libvirtd-is-stopped.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=290 --- ...x-detection-that-libvirtd-is-stopped.patch | 32 +++++++++++++++ virt-manager.changes | 12 ++++++ virt-manager.spec | 5 ++- virtinst-set-qemu-emulator.patch | 39 ++++++------------- virtinst-vol-default-nocow.patch | 24 +++++++++--- virtman-add-connect-default.patch | 10 ++--- ...roy-from-shutdown-menu-of-crashed-vm.patch | 14 +++---- virtman-eepro100.patch | 8 ++-- virtman-libvirtd-not-running.patch | 8 ++-- virtman-load-stored-uris.patch | 9 +++-- virtman-packages.patch | 26 ++++++------- 11 files changed, 115 insertions(+), 72 deletions(-) create mode 100644 89c3638b-fix-detection-that-libvirtd-is-stopped.patch diff --git a/89c3638b-fix-detection-that-libvirtd-is-stopped.patch b/89c3638b-fix-detection-that-libvirtd-is-stopped.patch new file mode 100644 index 00000000..d39df074 --- /dev/null +++ b/89c3638b-fix-detection-that-libvirtd-is-stopped.patch @@ -0,0 +1,32 @@ +Subject: connection: fix detection that libvirtd is stopped +From: Pavel Hrdina phrdina@redhat.com Tue Jan 5 10:17:37 2016 +0100 +Date: Fri Jan 8 10:21:42 2016 +0100: +Git: 89c3638b63e5b251db92ef7066c1753bfa469d38 + +In case that libvirtd is stopped, we could receive another type of error +from libvirt "libvirtError: internal error: client socket is closed". +This one is usually reported from local connection. + +Signed-off-by: Pavel Hrdina + +Index: virt-manager-1.3.2/virtManager/connection.py +=================================================================== +--- virt-manager-1.3.2.orig/virtManager/connection.py ++++ virt-manager-1.3.2/virtManager/connection.py +@@ -1298,6 +1298,7 @@ class vmmConnection(vmmGObject): + from_remote = getattr(libvirt, "VIR_FROM_REMOTE", None) + from_rpc = getattr(libvirt, "VIR_FROM_RPC", None) + sys_error = getattr(libvirt, "VIR_ERR_SYSTEM_ERROR", None) ++ internal_error = getattr(libvirt, "VIR_ERR_INTERNAL_ERROR", None) + + dom = -1 + code = -1 +@@ -1309,7 +1310,7 @@ class vmmConnection(vmmGObject): + self.get_uri(), exc_info=True) + + if (dom in [from_remote, from_rpc] and +- code in [sys_error]): ++ code in [sys_error, internal_error]): + e = None + logging.debug("Not showing user error since libvirtd " + "appears to have stopped.") diff --git a/virt-manager.changes b/virt-manager.changes index 980bbcf2..c3dee931 100644 --- a/virt-manager.changes +++ b/virt-manager.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Fri Jan 8 11:50:46 MST 2016 - carnold@suse.com + +- bsc#960828 - Unable to create qcow2 volumes on remote KVM with + virt-manager + virtinst-vol-default-nocow.patch +- bsc#960724 - virt-manager fails to create Virtual machines on a + CentOS7 host + virtinst-set-qemu-emulator.patch +- Upstream bug fix + 89c3638b-fix-detection-that-libvirtd-is-stopped.patch + ------------------------------------------------------------------- Mon Jan 4 11:04:50 MST 2016 - carnold@suse.com diff --git a/virt-manager.spec b/virt-manager.spec index 05452a1d..f756f854 100644 --- a/virt-manager.spec +++ b/virt-manager.spec @@ -1,7 +1,7 @@ # # spec file for package virt-manager # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2016 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,7 +15,6 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # - %define with_guestfs 0 %define askpass_package "openssh-askpass" %define qemu_user "qemu" @@ -37,6 +36,7 @@ Source0: %{name}-%{version}.tar.bz2 Source1: virt-install.rb Source2: virt-install.desktop # Upstream Patches +Patch1: 89c3638b-fix-detection-that-libvirtd-is-stopped.patch # SUSE Only Patch70: virtman-desktop.patch Patch71: virtman-kvm.patch @@ -157,6 +157,7 @@ machine). %prep %setup -q # Upstream Patches +%patch1 -p1 # SUSE Only %patch70 -p1 %patch71 -p1 diff --git a/virtinst-set-qemu-emulator.patch b/virtinst-set-qemu-emulator.patch index 44951262..9a3e2a28 100644 --- a/virtinst-set-qemu-emulator.patch +++ b/virtinst-set-qemu-emulator.patch @@ -1,43 +1,26 @@ Use the correct qemu emulator based on the architecture. We want to get away from using the old qemu-dm emulator for Xen HVM guests so default to qemu-system-i386. -Index: virt-manager-1.3.0/virtinst/guest.py +Index: virt-manager-1.3.2/virtinst/guest.py =================================================================== ---- virt-manager-1.3.0.orig/virtinst/guest.py -+++ virt-manager-1.3.0/virtinst/guest.py -@@ -849,14 +849,29 @@ class Guest(XMLBuilder): +--- virt-manager-1.3.2.orig/virtinst/guest.py ++++ virt-manager-1.3.2/virtinst/guest.py +@@ -849,14 +849,11 @@ class Guest(XMLBuilder): self.emulator = None return - if self.emulator: -+ if self.conn.is_qemu(): -+ if self.os.arch == "s390x": -+ preferred_emulator = "/usr/bin/qemu-system-s390x" -+ elif self.os.arch == "ppc64" or self.os.arch == "ppc64le": -+ preferred_emulator = "/usr/bin/qemu-system-ppc64" -+ else: -+ preferred_emulator = "/usr/bin/qemu-system-x86_64" -+ elif self.conn.is_lxc(): -+ preferred_emulator = "/usr/lib/libvirt/libvirt_lxc" -+ if not os.path.exists(preferred_emulator): -+ preferred_emulator = "/usr/lib64/libvirt/libvirt_lxc" -+ else: -+ preferred_emulator = "/usr/lib/xen/bin/qemu-system-i386" -+ if self.emulator and self.emulator == preferred_emulator: - return - -- if self.os.is_hvm() and self.type == "xen": +- return +- + if self.os.is_hvm() and self.type == "xen": - if self.conn.caps.host.cpu.arch == "x86_64": - self.emulator = "/usr/lib64/xen/bin/qemu-dm" - else: - self.emulator = "/usr/lib/xen/bin/qemu-dm" -+ if os.path.exists(preferred_emulator): -+ self.emulator = preferred_emulator -+ elif self.os.is_hvm() and self.type == "xen": -+ # We don't want to use the old qemu-dm for xen -+ self.emulator = "/usr/lib/xen/bin/qemu-system-i386" -+ elif not self.emulator: -+ self.emulator = "/usr/bin/qemu-kvm" ++ # Force not using Xen's old qemu-dm except for remote ++ # connections where we don't know the Xen version ++ if not self.conn.is_remote() or not self.emulator: ++ self.emulator = "/usr/lib/xen/bin/qemu-system-i386" def _set_cpu_defaults(self): self.cpu.set_topology_defaults(self.vcpus) diff --git a/virtinst-vol-default-nocow.patch b/virtinst-vol-default-nocow.patch index 49386c54..395c361a 100644 --- a/virtinst-vol-default-nocow.patch +++ b/virtinst-vol-default-nocow.patch @@ -4,19 +4,33 @@ issue on btrfs. Signed-off-by: Chunyan Liu -Index: virt-manager-1.3.0/virtinst/storage.py +Index: virt-manager-1.3.2/virtinst/storage.py =================================================================== ---- virt-manager-1.3.0.orig/virtinst/storage.py -+++ virt-manager-1.3.0/virtinst/storage.py -@@ -716,6 +716,11 @@ class StorageVolume(_StorageObject): +--- virt-manager-1.3.2.orig/virtinst/storage.py ++++ virt-manager-1.3.2/virtinst/storage.py +@@ -716,6 +716,12 @@ class StorageVolume(_StorageObject): lazy_refcounts = XMLProperty("./target/features/lazy_refcounts", is_bool=True, default_cb=_lazy_refcounts_default_cb) + def _nocow_default_cb(self): -+ return True ++ return self.conn.check_support( ++ self.conn.SUPPORT_CONN_NOCOW) + nocow = XMLProperty("./target/nocow", + is_bool=True, default_cb=_nocow_default_cb) + ###################### # Public API helpers # +Index: virt-manager-1.3.2/virtinst/support.py +=================================================================== +--- virt-manager-1.3.2.orig/virtinst/support.py ++++ virt-manager-1.3.2/virtinst/support.py +@@ -314,6 +314,8 @@ SUPPORT_CONN_VCPU_PLACEMENT = _make( + SUPPORT_CONN_MEM_STATS_PERIOD = _make( + function="virDomain.setMemoryStatsPeriod", + version="1.1.1", hv_version={"qemu": 0}) ++SUPPORT_CONN_NOCOW = _make( ++ version="1.2.18", hv_version={"qemu": "2.2.0", "test": 0}) + + # This is for disk . xen supports this, but it's + # limited to arbitrary new enough xen, since I know libxl can handle it diff --git a/virtman-add-connect-default.patch b/virtman-add-connect-default.patch index 232e2d72..f2bab0af 100644 --- a/virtman-add-connect-default.patch +++ b/virtman-add-connect-default.patch @@ -1,10 +1,10 @@ Enhancement for when no hypervisor can be found locally it opens the new connection dialog. -Index: virt-manager-1.3.0/virtManager/engine.py +Index: virt-manager-1.3.2/virtManager/engine.py =================================================================== ---- virt-manager-1.3.0.orig/virtManager/engine.py -+++ virt-manager-1.3.0/virtManager/engine.py -@@ -207,9 +207,6 @@ class vmmEngine(vmmGObject): +--- virt-manager-1.3.2.orig/virtManager/engine.py ++++ virt-manager-1.3.2/virtManager/engine.py +@@ -236,9 +236,6 @@ class vmmEngine(vmmGObject): except: logging.exception("Error talking to PackageKit") @@ -14,7 +14,7 @@ Index: virt-manager-1.3.0/virtManager/engine.py warnmsg = _("The 'libvirtd' service will need to be started.\n\n" "After that, virt-manager will connect to libvirt on\n" "the next application start up.") -@@ -223,7 +220,11 @@ class vmmEngine(vmmGObject): +@@ -252,7 +249,11 @@ class vmmEngine(vmmGObject): if not connected and do_start: manager.err.ok(_("Libvirt service must be started"), warnmsg) diff --git a/virtman-allow-destroy-from-shutdown-menu-of-crashed-vm.patch b/virtman-allow-destroy-from-shutdown-menu-of-crashed-vm.patch index 54a42307..20f3a189 100644 --- a/virtman-allow-destroy-from-shutdown-menu-of-crashed-vm.patch +++ b/virtman-allow-destroy-from-shutdown-menu-of-crashed-vm.patch @@ -6,11 +6,11 @@ Steps to get a KVM VM in the crashed state: 4) Edit the VM's /etc/default/grub file and remove the crashkernel information and then run grub2-mkconfig /boot/grub2/grub.cfg. 5) Start the VM and within the VM's terminal type "echo 'c' > /proc/sysrq-trigger" -Index: virt-manager-1.3.0/virtManager/manager.py +Index: virt-manager-1.3.2/virtManager/manager.py =================================================================== ---- virt-manager-1.3.0.orig/virtManager/manager.py -+++ virt-manager-1.3.0/virtManager/manager.py -@@ -857,7 +857,7 @@ class vmmManager(vmmGObjectUI): +--- virt-manager-1.3.2.orig/virtManager/manager.py ++++ virt-manager-1.3.2/virtManager/manager.py +@@ -854,7 +854,7 @@ class vmmManager(vmmGObjectUI): show_pause = bool(vm and vm.is_unpauseable()) else: show_pause = bool(vm and vm.is_pauseable()) @@ -19,10 +19,10 @@ Index: virt-manager-1.3.0/virtManager/manager.py if vm and vm.managedsave_supported: self.change_run_text(vm.has_managed_save()) -Index: virt-manager-1.3.0/virtManager/vmmenu.py +Index: virt-manager-1.3.2/virtManager/vmmenu.py =================================================================== ---- virt-manager-1.3.0.orig/virtManager/vmmenu.py -+++ virt-manager-1.3.0/virtManager/vmmenu.py +--- virt-manager-1.3.2.orig/virtManager/vmmenu.py ++++ virt-manager-1.3.2/virtManager/vmmenu.py @@ -31,6 +31,7 @@ class _VMMenu(Gtk.Menu): self._parent = src self._current_vm_cb = current_vm_cb diff --git a/virtman-eepro100.patch b/virtman-eepro100.patch index 44694c58..2a9c0ab7 100644 --- a/virtman-eepro100.patch +++ b/virtman-eepro100.patch @@ -1,9 +1,9 @@ Enhancement to add the eepro100 NIC for KVM -Index: virt-manager-1.3.0/virtManager/addhardware.py +Index: virt-manager-1.3.2/virtManager/addhardware.py =================================================================== ---- virt-manager-1.3.0.orig/virtManager/addhardware.py -+++ virt-manager-1.3.0/virtManager/addhardware.py -@@ -565,6 +565,7 @@ class vmmAddHardware(vmmGObjectUI): +--- virt-manager-1.3.2.orig/virtManager/addhardware.py ++++ virt-manager-1.3.2/virtManager/addhardware.py +@@ -571,6 +571,7 @@ class vmmAddHardware(vmmGObjectUI): if vm.is_hvm(): mod_list = [] if vm.get_hv_type() in ["kvm", "qemu", "test"]: diff --git a/virtman-libvirtd-not-running.patch b/virtman-libvirtd-not-running.patch index 81766d4d..42996999 100644 --- a/virtman-libvirtd-not-running.patch +++ b/virtman-libvirtd-not-running.patch @@ -1,9 +1,9 @@ Use the correct systemd to start libvirt. -Index: virt-manager-1.3.0/virtManager/packageutils.py +Index: virt-manager-1.3.2/virtManager/packageutils.py =================================================================== ---- virt-manager-1.3.0.orig/virtManager/packageutils.py -+++ virt-manager-1.3.0/virtManager/packageutils.py -@@ -154,8 +154,8 @@ def start_libvirtd(): +--- virt-manager-1.3.2.orig/virtManager/packageutils.py ++++ virt-manager-1.3.2/virtManager/packageutils.py +@@ -143,8 +143,8 @@ def start_libvirtd(): logging.debug("libvirtd not running, asking system-config-services " "to start it") scs = Gio.DBusProxy.new_sync(bus, 0, None, diff --git a/virtman-load-stored-uris.patch b/virtman-load-stored-uris.patch index c295e9af..16508e81 100644 --- a/virtman-load-stored-uris.patch +++ b/virtman-load-stored-uris.patch @@ -1,7 +1,8 @@ -diff -rup a/virtManager/engine.py b/virtManager/engine.py ---- a/virtManager/engine.py 2015-12-07 01:23:13.000000000 +0100 -+++ b/virtManager/engine.py 2015-12-13 15:39:06.911652459 +0100 -@@ -260,9 +260,22 @@ class vmmEngine(vmmGObject): +Index: virt-manager-1.3.2/virtManager/engine.py +=================================================================== +--- virt-manager-1.3.2.orig/virtManager/engine.py ++++ virt-manager-1.3.2/virtManager/engine.py +@@ -257,9 +257,22 @@ class vmmEngine(vmmGObject): def load_stored_uris(self): uris = self.config.get_conn_uris() or [] diff --git a/virtman-packages.patch b/virtman-packages.patch index 29d08403..1ddb056b 100644 --- a/virtman-packages.patch +++ b/virtman-packages.patch @@ -4,10 +4,10 @@ This is not a normal situation on a suse distro. Split out required libvirt packages (kvm vs xen). Only install those libvirt packages for which the host is booted. This patch has a corresponding spec file change (%define libvirt_kvm_packages and %define libvirt_xen_packages). -Index: virt-manager-1.3.0/setup.py +Index: virt-manager-1.3.2/setup.py =================================================================== ---- virt-manager-1.3.0.orig/setup.py -+++ virt-manager-1.3.0/setup.py +--- virt-manager-1.3.2.orig/setup.py ++++ virt-manager-1.3.2/setup.py @@ -299,8 +299,11 @@ class configure(distutils.core.Command): ("prefix=", None, "installation prefix"), ("qemu-user=", None, @@ -45,10 +45,10 @@ Index: virt-manager-1.3.0/setup.py if self.kvm_package_names is not None: template += "hv_packages = %s\n" % self.kvm_package_names if self.askpass_package_names is not None: -Index: virt-manager-1.3.0/virtcli/cliconfig.py +Index: virt-manager-1.3.2/virtcli/cliconfig.py =================================================================== ---- virt-manager-1.3.0.orig/virtcli/cliconfig.py -+++ virt-manager-1.3.0/virtcli/cliconfig.py +--- virt-manager-1.3.2.orig/virtcli/cliconfig.py ++++ virt-manager-1.3.2/virtcli/cliconfig.py @@ -83,7 +83,8 @@ class _CLIConfig(object): _get_param("preferred_distros", "")) self.hv_packages = _split_list(_get_param("hv_packages", "")) @@ -59,10 +59,10 @@ Index: virt-manager-1.3.0/virtcli/cliconfig.py self.default_graphics = _get_param("default_graphics", "spice") self.default_hvs = _split_list(_get_param("default_hvs", "")) -Index: virt-manager-1.3.0/virtManager/config.py +Index: virt-manager-1.3.2/virtManager/config.py =================================================================== ---- virt-manager-1.3.0.orig/virtManager/config.py -+++ virt-manager-1.3.0/virtManager/config.py +--- virt-manager-1.3.2.orig/virtManager/config.py ++++ virt-manager-1.3.2/virtManager/config.py @@ -172,7 +172,8 @@ class vmmConfig(object): self.default_qemu_user = CLIConfig.default_qemu_user self.preferred_distros = CLIConfig.preferred_distros @@ -73,11 +73,11 @@ Index: virt-manager-1.3.0/virtManager/config.py self.askpass_package = CLIConfig.askpass_package self.default_graphics_from_config = CLIConfig.default_graphics self.default_hvs = CLIConfig.default_hvs -Index: virt-manager-1.3.0/virtManager/engine.py +Index: virt-manager-1.3.2/virtManager/engine.py =================================================================== ---- virt-manager-1.3.0.orig/virtManager/engine.py -+++ virt-manager-1.3.0/virtManager/engine.py -@@ -197,21 +197,18 @@ class vmmEngine(vmmGObject): +--- virt-manager-1.3.2.orig/virtManager/engine.py ++++ virt-manager-1.3.2/virtManager/engine.py +@@ -226,21 +226,18 @@ class vmmEngine(vmmGObject): ret = None try: