From 4f22f7f4d57bb31d91ff04d2a9e61fe8858db32e Mon Sep 17 00:00:00 2001 From: Charles Arnold Date: Thu, 27 Mar 2014 22:27:37 +0000 Subject: [PATCH] - Upstream bug fixes 5332ee4d-enable-media-detection-for-ISO-images.patch 53341e7e-hide-hardware-removal-for-non-devices.patch 53342f31-set-right-ip-address-for-ipv6.patch - bnc#870098 - virt-manager+x show wrong number of assigned cpu's virtman-init-vm-processor-topology.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=157 --- ...nable-media-detection-for-ISO-images.patch | 88 +++++++++++++++++++ ...ide-hardware-removal-for-non-devices.patch | 61 +++++++++++++ 53342f31-set-right-ip-address-for-ipv6.patch | 28 ++++++ virt-manager.changes | 14 +++ virt-manager.spec | 8 ++ virtinst-detect-suse-distros.patch | 12 +-- virtinst-pvgrub2-bootloader.patch | 19 ++-- virtman-autorestart.patch | 12 +-- virtman-autoyast-support.patch | 6 +- virtman-default-guest-from-host-os.patch | 4 +- virtman-default-to-xen-pv.patch | 2 +- virtman-device-flags.patch | 2 +- virtman-init-vm-processor-topology.patch | 33 +++++++ 13 files changed, 262 insertions(+), 27 deletions(-) create mode 100644 5332ee4d-enable-media-detection-for-ISO-images.patch create mode 100644 53341e7e-hide-hardware-removal-for-non-devices.patch create mode 100644 53342f31-set-right-ip-address-for-ipv6.patch create mode 100644 virtman-init-vm-processor-topology.patch diff --git a/5332ee4d-enable-media-detection-for-ISO-images.patch b/5332ee4d-enable-media-detection-for-ISO-images.patch new file mode 100644 index 00000000..5d4cc923 --- /dev/null +++ b/5332ee4d-enable-media-detection-for-ISO-images.patch @@ -0,0 +1,88 @@ +Subject: virt-manager: enable media detection for CD/ISO images +From: Giuseppe Scrivano gscrivan@redhat.com Tue Mar 25 14:31:08 2014 +0100 +Date: Wed Mar 26 16:12:13 2014 +0100: +Git: 6b5171031e7e688fd9c1c44aeec599dcb1a9e6cd + +Signed-off-by: Giuseppe Scrivano + +Index: virt-manager-1.0.1/virtManager/create.py +=================================================================== +--- virt-manager-1.0.1.orig/virtManager/create.py ++++ virt-manager-1.0.1/virtManager/create.py +@@ -132,7 +132,7 @@ class vmmCreate(vmmGObjectUI): + "on_install_url_box_changed": self.url_box_changed, + "on_install_local_cdrom_toggled": self.toggle_local_cdrom, + "on_install_local_cdrom_combo_changed": self.detect_media_os, +- "on_install_local_box_changed": self.detect_media_os, ++ "on_install_local_box_changed": self.local_box_changed, + "on_install_local_browse_clicked": self.browse_iso, + "on_install_import_browse_clicked": self.browse_import, + "on_install_app_browse_clicked": self.browse_app, +@@ -543,6 +543,11 @@ class vmmCreate(vmmGObjectUI): + + self.mediacombo = vmmMediaCombo(self.conn, self.builder, self.topwin, + MEDIA_CDROM) ++ def mediacombo_changed(src): ++ ignore = src ++ self.mediaDetected = False ++ self.detect_media_os() ++ self.mediacombo.combo.connect("changed", mediacombo_changed) + self.mediacombo.reset_state() + self.widget("install-local-cdrom-align").add( + self.mediacombo.top_box) +@@ -1109,16 +1114,22 @@ class vmmCreate(vmmGObjectUI): + + self.change_caps(self.capsguest.os_type, arch) + +- def url_box_changed(self, ignore): ++ def media_box_changed(self, widget): + self.mediaDetected = False + +- # If the url_entry has focus, don't fire detect_media_os, it means ++ # If the widget has focus, don't fire detect_media_os, it means + # the user is probably typing +- if self.widget("install-url-box").get_child().has_focus(): ++ if self.widget(widget).get_child().has_focus(): + return + + self.detect_media_os() + ++ def url_box_changed(self, ignore): ++ self.media_box_changed("install-url-box") ++ ++ def local_box_changed(self, ignore): ++ self.media_box_changed("install-local-box") ++ + def should_detect_media(self): + return (self.is_detect_active() and not self.mediaDetected) + +@@ -1182,6 +1193,7 @@ class vmmCreate(vmmGObjectUI): + is_active = src.get_active() + if is_active and self.mediacombo.get_path(): + # Local CDROM was selected with media preset, detect distro ++ self.mediaDetected = False + self.detect_media_os() + + self.widget("install-local-cdrom-align").set_sensitive(is_active) +@@ -1190,6 +1202,8 @@ class vmmCreate(vmmGObjectUI): + uselocal = src.get_active() + self.widget("install-local-box").set_sensitive(uselocal) + self.widget("install-local-browse").set_sensitive(uselocal) ++ self.mediaDetected = False ++ self.detect_media_os() + + def detect_visibility_changed(self, src, ignore=None): + is_visible = src.get_visible() +@@ -1241,11 +1255,7 @@ class vmmCreate(vmmGObjectUI): + INSTALL_PAGE_CONTAINER_OS] + osbox.set_visible(iscontainer) + +- # Detection only works/ is valid for URL, +- # FIXME: Also works for CDROM if running as root (since we need to +- # mount the iso/cdrom), but we should probably make this work for +- # more distros (like windows) before we enable it +- if (instpage == INSTALL_PAGE_URL): ++ if instpage in (INSTALL_PAGE_ISO, INSTALL_PAGE_URL): + detectbox.show() + else: + detectbox.hide() diff --git a/53341e7e-hide-hardware-removal-for-non-devices.patch b/53341e7e-hide-hardware-removal-for-non-devices.patch new file mode 100644 index 00000000..9a3c8e8a --- /dev/null +++ b/53341e7e-hide-hardware-removal-for-non-devices.patch @@ -0,0 +1,61 @@ +Subject: virtManager: hide "Remove Hardware" for non-devices +From: Giuseppe Scrivano gscrivan@redhat.com Thu Mar 27 12:40:42 2014 +0100 +Date: Thu Mar 27 13:50:06 2014 +0100: +Git: 37eecb215d137ffb6e98f36adfa37f96220d7287 + +The menu item "Remove Hardware" in the Overview window is valid only +when a hardware device is selected, hide it in any other case. + +Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1081373 + +Signed-off-by: Giuseppe Scrivano + +diff --git a/virtManager/details.py b/virtManager/details.py +index c1833ae..8c72efa 100644 +--- a/virtManager/details.py ++++ b/virtManager/details.py +@@ -530,6 +530,7 @@ class vmmDetails(vmmGObjectUI): + + self.oldhwkey = None + self.addhwmenu = None ++ self._addhwmenuitems = None + self.keycombo_menu = None + self.init_menus() + self.init_details() +@@ -706,6 +707,7 @@ class vmmDetails(vmmGObjectUI): + self.vm = None + self.conn = None + self.addhwmenu = None ++ self._addhwmenuitems = None + + self.gfxdetails.cleanup() + self.gfxdetails = None +@@ -801,8 +803,9 @@ class vmmDetails(vmmGObjectUI): + rmHW.show() + rmHW.connect("activate", self.remove_xml_dev) + +- self.addhwmenu.add(addHW) +- self.addhwmenu.add(rmHW) ++ self._addhwmenuitems = {"add" : addHW, "remove" : rmHW} ++ for i in self._addhwmenuitems.values(): ++ self.addhwmenu.add(i) + + # Don't allowing changing network/disks for Dom0 + dom0 = self.vm.is_management_domain() +@@ -1075,6 +1078,16 @@ class vmmDetails(vmmGObjectUI): + if event.button != 3: + return + ++ devobj = self.get_hw_selection(HW_LIST_COL_DEVICE) ++ if not devobj: ++ return ++ ++ rmdev = self._addhwmenuitems["remove"] ++ if hasattr(devobj, "virtual_device_type"): ++ rmdev.show() ++ else: ++ rmdev.hide() ++ + self.addhwmenu.popup(None, None, None, None, 0, event.time) + + def control_fullscreen(self, src): diff --git a/53342f31-set-right-ip-address-for-ipv6.patch b/53342f31-set-right-ip-address-for-ipv6.patch new file mode 100644 index 00000000..eab38d94 --- /dev/null +++ b/53342f31-set-right-ip-address-for-ipv6.patch @@ -0,0 +1,28 @@ +Subject: createinterface: set right ip address for ipv6 +From: Chen Hanxiao chenhanxiao@cn.fujitsu.com Thu Mar 27 22:01:21 2014 +0800 +Date: Thu Mar 27 22:01:21 2014 +0800: +Git: 58d8795b27b792bbbc89b93ac9333253df205943 + +We use v4_addr for building ipv6 addr. +This patch will use right ip address for ipv6. + +Signed-off-by: Chen Hanxiao + +diff --git a/virtManager/createinterface.py b/virtManager/createinterface.py +index 77fb6e1..11fc9b2 100644 +--- a/virtManager/createinterface.py ++++ b/virtManager/createinterface.py +@@ -818,9 +818,10 @@ class vmmCreateInterface(vmmGObjectUI): + if not ipv6.dhcp: + if v6_gate: + ipv6.gateway = v6_gate +- addr, prefix = build_ip(v4_addr) +- if addr: +- ipv6.add_ip(addr, prefix) ++ for v6_addr in v6_addrlist: ++ addr, prefix = build_ip(v6_addr) ++ if addr: ++ ipv6.add_ip(addr, prefix) + + return [is_manual, copy_name, ipv4, ipv6, proto_xml] + diff --git a/virt-manager.changes b/virt-manager.changes index d3c9e9fb..cf4538de 100644 --- a/virt-manager.changes +++ b/virt-manager.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Wed Mar 27 08:28:21 MDT 2014 - carnold@suse.com + +- Upstream bug fixes + 5332ee4d-enable-media-detection-for-ISO-images.patch + 53341e7e-hide-hardware-removal-for-non-devices.patch + 53342f31-set-right-ip-address-for-ipv6.patch + +------------------------------------------------------------------- +Wed Mar 26 16:36:28 MDT 2014 - carnold@suse.com + +- bnc#870098 - virt-manager+x show wrong number of assigned cpu's + virtman-init-vm-processor-topology.patch + ------------------------------------------------------------------- Wed Mar 24 13:58:36 MDT 2014 - carnold@suse.com diff --git a/virt-manager.spec b/virt-manager.spec index 070a4782..15b529d0 100644 --- a/virt-manager.spec +++ b/virt-manager.spec @@ -36,6 +36,9 @@ Url: http://virt-manager.org/ Source0: %{name}-%{version}.tar.bz2 Source1: virt-install.rb Source2: virt-install.desktop +Patch1: 5332ee4d-enable-media-detection-for-ISO-images.patch +Patch2: 53341e7e-hide-hardware-removal-for-non-devices.patch +Patch3: 53342f31-set-right-ip-address-for-ipv6.patch Patch50: virtman-desktop.patch Patch51: virtman-cdrom.patch Patch52: virtman-kvm.patch @@ -56,6 +59,7 @@ Patch72: virtman-packages.patch Patch73: virtman-load-stored-uris.patch Patch74: virtman-libvirtd-not-running.patch Patch75: virtman-stable-os-support.patch +Patch76: virtman-init-vm-processor-topology.patch Patch150: virtinst-cdrom.patch Patch151: virtinst-storage-ocfs2.patch Patch152: virtinst-qed.patch @@ -155,6 +159,9 @@ machine). %prep %setup -q +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 %patch50 -p1 %patch51 -p1 %patch52 -p1 @@ -175,6 +182,7 @@ machine). %patch73 -p1 %patch74 -p1 %patch75 -p1 +%patch76 -p1 #%patch150 -p1 use 'c' for cdrom %patch151 -p1 %patch152 -p1 diff --git a/virtinst-detect-suse-distros.patch b/virtinst-detect-suse-distros.patch index b26bd84c..af4e9053 100644 --- a/virtinst-detect-suse-distros.patch +++ b/virtinst-detect-suse-distros.patch @@ -1,7 +1,7 @@ -Index: virt-manager-1.0.0/virtinst/urlfetcher.py +Index: virt-manager-1.0.1/virtinst/urlfetcher.py =================================================================== ---- virt-manager-1.0.0.orig/virtinst/urlfetcher.py -+++ virt-manager-1.0.0/virtinst/urlfetcher.py +--- virt-manager-1.0.1.orig/virtinst/urlfetcher.py ++++ virt-manager-1.0.1/virtinst/urlfetcher.py @@ -296,6 +296,68 @@ def _distroFromTreeinfo(fetcher, arch, v return ob @@ -96,7 +96,7 @@ Index: virt-manager-1.0.0/virtinst/urlfetcher.py Distro.__init__(self, *args, **kwargs) if re.match(r'i[4-9]86', self.arch): self.arch = 'i386' -@@ -824,18 +889,32 @@ class SuseDistro(Distro): +@@ -824,18 +889,34 @@ class SuseDistro(Distro): oldkern += "64" oldinit += "64" @@ -129,6 +129,8 @@ Index: virt-manager-1.0.0/virtinst/urlfetcher.py def isValidStore(self): + # self.content is the VERSION line from the contents file ++ if self.content is None or self.content[1] is None: ++ return False + distro_version = self.content[1] + version = distro_version.split('.', 1)[0].strip() + if int(version) >= 10: @@ -139,7 +141,7 @@ Index: virt-manager-1.0.0/virtinst/urlfetcher.py if not self.fetcher.hasFile("directory.yast"): return False -@@ -860,6 +939,27 @@ class SuseDistro(Distro): +@@ -860,6 +941,27 @@ class SuseDistro(Distro): return name return self.os_variant diff --git a/virtinst-pvgrub2-bootloader.patch b/virtinst-pvgrub2-bootloader.patch index 9ea10a89..aaa5428a 100644 --- a/virtinst-pvgrub2-bootloader.patch +++ b/virtinst-pvgrub2-bootloader.patch @@ -2,24 +2,25 @@ Index: virt-manager-1.0.1/virtinst/guest.py =================================================================== --- virt-manager-1.0.1.orig/virtinst/guest.py +++ virt-manager-1.0.1/virtinst/guest.py -@@ -331,7 +331,15 @@ class Guest(XMLBuilder): +@@ -331,7 +331,16 @@ class Guest(XMLBuilder): this.) @type disk_boot: C{bool} """ - osblob_install = install and not disk_boot + boot_pvgrub2 = False -+ os_ver = self._get_os_variant() -+ if install == False and (os_ver == "sles12" or os_ver == "sled12"): -+ boot_pvgrub2 = True -+ self.installer._install_kernel = "/usr/lib/grub2/x86_64-xen/grub.xen" -+ self.installer._install_initrd = None -+ self.installer.extraargs = None -+ logging.info("Using grub.xen to boot guest") ++ if install == False and self.os.is_xenpv(): ++ os_ver = self._get_os_variant() ++ if os_ver == "sles12" or os_ver == "sled12": ++ boot_pvgrub2 = True ++ self.installer._install_kernel = "/usr/lib/grub2/x86_64-xen/grub.xen" ++ self.installer._install_initrd = None ++ self.installer.extraargs = None ++ logging.info("Using grub.xen to boot guest") + osblob_install = (install or boot_pvgrub2) and not disk_boot if osblob_install and not self.installer.has_install_phase(): return None -@@ -348,7 +356,8 @@ class Guest(XMLBuilder): +@@ -348,7 +357,8 @@ class Guest(XMLBuilder): if (not install and self.os.is_xenpv() and not self.os.kernel): diff --git a/virtman-autorestart.patch b/virtman-autorestart.patch index f7c303eb..76259b0b 100644 --- a/virtman-autorestart.patch +++ b/virtman-autorestart.patch @@ -1,8 +1,8 @@ -Index: virt-manager-1.0.0/virtManager/details.py +Index: virt-manager-1.0.1/virtManager/details.py =================================================================== ---- virt-manager-1.0.1/virtManager/details.py.orig 2014-03-22 16:46:50.641411724 -0600 -+++ virt-manager-1.0.1/virtManager/details.py 2014-03-22 16:55:45.703098510 -0600 -@@ -2034,10 +2034,10 @@ class vmmDetails(vmmGObjectUI): +--- virt-manager-1.0.1.orig/virtManager/details.py ++++ virt-manager-1.0.1/virtManager/details.py +@@ -2047,10 +2047,10 @@ class vmmDetails(vmmGObjectUI): return self._change_config_helper(self.vm.define_memory, kwargs, hotplug_args=hotplug_args) @@ -17,7 +17,7 @@ Index: virt-manager-1.0.0/virtManager/details.py auto = self.widget("config-autostart") try: self.vm.set_autostart(auto.get_active()) -@@ -2046,6 +2046,9 @@ class vmmDetails(vmmGObjectUI): +@@ -2059,6 +2059,9 @@ class vmmDetails(vmmGObjectUI): (_("Error changing autostart value: %s") % str(e))) return False @@ -27,7 +27,7 @@ Index: virt-manager-1.0.0/virtManager/details.py if self.edited(EDIT_BOOTORDER): kwargs["boot_order"] = self.get_config_boot_order() -@@ -2359,6 +2362,8 @@ class vmmDetails(vmmGObjectUI): +@@ -2372,6 +2375,8 @@ class vmmDetails(vmmGObjectUI): buttons=Gtk.ButtonsType.OK, dialog_type=dtype) diff --git a/virtman-autoyast-support.patch b/virtman-autoyast-support.patch index f35cf18b..ec945b63 100644 --- a/virtman-autoyast-support.patch +++ b/virtman-autoyast-support.patch @@ -2,7 +2,7 @@ Index: virt-manager-1.0.1/virtManager/create.py =================================================================== --- virt-manager-1.0.1.orig/virtManager/create.py +++ virt-manager-1.0.1/virtManager/create.py -@@ -1216,11 +1216,34 @@ class vmmCreate(vmmGObjectUI): +@@ -1227,11 +1227,34 @@ class vmmCreate(vmmGObjectUI): variant = self.widget("install-os-version") variant.set_active(0) @@ -37,7 +37,7 @@ Index: virt-manager-1.0.1/virtManager/create.py # Get previous type_row = self._selected_os_row() if not type_row: -@@ -1575,7 +1598,10 @@ class vmmCreate(vmmGObjectUI): +@@ -1585,7 +1608,10 @@ class vmmCreate(vmmGObjectUI): if extra: extraargs += extra if ks: @@ -49,7 +49,7 @@ Index: virt-manager-1.0.1/virtManager/create.py if extraargs: self.guest.installer.extraargs = extraargs -@@ -1971,6 +1997,7 @@ class vmmCreate(vmmGObjectUI): +@@ -1981,6 +2007,7 @@ class vmmCreate(vmmGObjectUI): dl = self.set_os_val(self.widget("install-os-type"), distro_type) vl = self.set_os_val(self.widget("install-os-version"), distro_var) self.set_distro_labels(dl, vl) diff --git a/virtman-default-guest-from-host-os.patch b/virtman-default-guest-from-host-os.patch index d857f218..ec3feca5 100644 --- a/virtman-default-guest-from-host-os.patch +++ b/virtman-default-guest-from-host-os.patch @@ -11,7 +11,7 @@ Index: virt-manager-1.0.1/virtManager/create.py # pylint: disable=E0611 from gi.repository import GObject -@@ -1129,6 +1131,55 @@ class vmmCreate(vmmGObjectUI): +@@ -1140,6 +1142,55 @@ class vmmCreate(vmmGObjectUI): return self.start_detection(forward=forward) @@ -67,7 +67,7 @@ Index: virt-manager-1.0.1/virtManager/create.py def toggle_detect_os(self, src): dodetect = src.get_active() -@@ -1140,6 +1191,8 @@ class vmmCreate(vmmGObjectUI): +@@ -1151,6 +1202,8 @@ class vmmCreate(vmmGObjectUI): if dodetect: self.mediaDetected = False self.detect_media_os() diff --git a/virtman-default-to-xen-pv.patch b/virtman-default-to-xen-pv.patch index 5ecbe229..a2f6a6dd 100644 --- a/virtman-default-to-xen-pv.patch +++ b/virtman-default-to-xen-pv.patch @@ -2,7 +2,7 @@ Index: virt-manager-1.0.1/virtManager/create.py =================================================================== --- virt-manager-1.0.1.orig/virtManager/create.py +++ virt-manager-1.0.1/virtManager/create.py -@@ -857,7 +857,12 @@ class vmmCreate(vmmGObjectUI): +@@ -862,7 +862,12 @@ class vmmCreate(vmmGObjectUI): if gtype is None: # If none specified, prefer HVM so install options aren't limited # with a default PV choice. diff --git a/virtman-device-flags.patch b/virtman-device-flags.patch index f13c9454..cb851c07 100644 --- a/virtman-device-flags.patch +++ b/virtman-device-flags.patch @@ -25,7 +25,7 @@ Index: virt-manager-1.0.1/virtManager/details.py =================================================================== --- virt-manager-1.0.1.orig/virtManager/details.py +++ virt-manager-1.0.1/virtManager/details.py -@@ -2268,6 +2268,17 @@ class vmmDetails(vmmGObjectUI): +@@ -2281,6 +2281,17 @@ class vmmDetails(vmmGObjectUI): text1=(_("Are you sure you want to remove this device?"))): return diff --git a/virtman-init-vm-processor-topology.patch b/virtman-init-vm-processor-topology.patch new file mode 100644 index 00000000..ca8158ff --- /dev/null +++ b/virtman-init-vm-processor-topology.patch @@ -0,0 +1,33 @@ +Index: virt-manager-1.0.1/virtManager/details.py +=================================================================== +--- virt-manager-1.0.1.orig/virtManager/details.py ++++ virt-manager-1.0.1/virtManager/details.py +@@ -2564,13 +2564,6 @@ class vmmDetails(vmmGObjectUI): + def refresh_config_cpu(self): + conn = self.vm.conn + host_active_count = conn.host_active_processor_count() +- maxvcpus = self.vm.vcpu_max_count() +- curvcpus = self.vm.vcpu_count() +- +- curadj = self.widget("config-vcpus") +- maxadj = self.widget("config-maxvcpus") +- curadj.set_value(int(curvcpus)) +- maxadj.set_value(int(maxvcpus)) + + self.widget("state-host-cpus").set_text(str(host_active_count)) + +@@ -2592,6 +2585,14 @@ class vmmDetails(vmmGObjectUI): + if show_top: + self.widget("cpu-topology-expander").set_expanded(True) + ++ maxvcpus = self.vm.vcpu_max_count() ++ curvcpus = self.vm.vcpu_count() ++ ++ curadj = self.widget("config-vcpus") ++ maxadj = self.widget("config-maxvcpus") ++ curadj.set_value(int(curvcpus)) ++ maxadj.set_value(int(maxvcpus)) ++ + model = cpu.model or None + if not model: + if cpu.mode == "host-model" or cpu.mode == "host-passthrough":