From cd1953b37e073f181d7fb3c360f64086a5c3c866 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 26 Jul 2011 21:24:26 -0400 Subject: [PATCH] =?UTF-8?q?Rebased=20to=20version=200.9.0=20Use=20a=20hidi?= =?UTF-8?q?ng=20toolbar=20for=20fullscreen=20mode=20Use=20libguestfs=20to?= =?UTF-8?q?=20show=20guest=20packagelist=20and=20more=20(Richard=20W.M.=20?= =?UTF-8?q?Jones)=20Basic=20'New=20VM'=20wizard=20support=20for=20LXC=20gu?= =?UTF-8?q?ests=20Remote=20serial=20console=20access=20(with=20latest=20li?= =?UTF-8?q?bvirt)=20Remote=20URL=20guest=20installs=20(with=20latest=20lib?= =?UTF-8?q?virt)=20Add=20Hardware:=20Support=20=20devices=20Ad?= =?UTF-8?q?d=20Hardware:=20Support=20=20devices=20(Marc-Andr?= =?UTF-8?q?=C3=A9=20Lureau)=20Enable=20direct=20interface=20selection=20fo?= =?UTF-8?q?r=20qemu/kvm=20(Gerhard=20Stenzel)=20Allow=20viewing=20and=20ch?= =?UTF-8?q?anging=20disk=20serial=20number?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + sources | 2 +- virt-manager-bump-default-mem.patch | 32 -- virt-manager-fix-broken-cspo.patch | 18 - virt-manager-fix-config-options.patch | 35 -- virt-manager-fix-hotplug-fallback.patch | 20 -- virt-manager-gconf-after-fork.patch | 38 --- virt-manager-spicevmc.patch | 436 ------------------------ virt-manager-stop-netcf-flood.patch | 23 -- virt-manager.spec | 165 +++++---- 10 files changed, 102 insertions(+), 668 deletions(-) delete mode 100644 virt-manager-bump-default-mem.patch delete mode 100644 virt-manager-fix-broken-cspo.patch delete mode 100644 virt-manager-fix-config-options.patch delete mode 100644 virt-manager-fix-hotplug-fallback.patch delete mode 100644 virt-manager-gconf-after-fork.patch delete mode 100644 virt-manager-spicevmc.patch delete mode 100644 virt-manager-stop-netcf-flood.patch diff --git a/.gitignore b/.gitignore index a153826..fc7425e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ virt-manager-0.8.4.tar.gz /virt-manager-0.8.5.tar.gz /virt-manager-0.8.6.tar.gz /virt-manager-0.8.7.tar.gz +/virt-manager-0.9.0.tar.gz diff --git a/sources b/sources index 62235c7..8f92cb4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -9b1f3ead125d53bf506216c4bc7c4a84 virt-manager-0.8.7.tar.gz +a10331b467f92f4134a39bf636e04adc virt-manager-0.9.0.tar.gz diff --git a/virt-manager-bump-default-mem.patch b/virt-manager-bump-default-mem.patch deleted file mode 100644 index df83cf4..0000000 --- a/virt-manager-bump-default-mem.patch +++ /dev/null @@ -1,32 +0,0 @@ -commit 6a14834c7d3a3fd622bb51f9ade18750267e95d3 -Author: Cole Robinson -Date: Thu Apr 28 10:39:12 2011 -0400 - - create: Bump default memory from 512 to 1024MB - - F15 needs more than 512 or the installer crashes, pretty sure recent windows - require at least a GB as well. Long term plan is to track a default mem value - per OS being installed. - -diff --git a/src/virtManager/create.py b/src/virtManager/create.py -index 6bbe23d..f8da9f2 100644 ---- a/src/virtManager/create.py -+++ b/src/virtManager/create.py -@@ -42,6 +42,8 @@ OS_GENERIC = "generic" - # Number of seconds to wait for media detection - DETECT_TIMEOUT = 20 - -+DEFAULT_MEM = 1024 -+ - PAGE_NAME = 0 - PAGE_INSTALL = 1 - PAGE_MEM = 2 -@@ -377,7 +379,7 @@ class vmmCreate(vmmGObjectUI): - self.window.get_widget("install-import-entry").set_text("") - - # Mem / CPUs -- self.window.get_widget("config-mem").set_value(512) -+ self.window.get_widget("config-mem").set_value(DEFAULT_MEM) - self.window.get_widget("config-cpus").set_value(1) - - # Storage diff --git a/virt-manager-fix-broken-cspo.patch b/virt-manager-fix-broken-cspo.patch deleted file mode 100644 index b28ad0b..0000000 --- a/virt-manager-fix-broken-cspo.patch +++ /dev/null @@ -1,18 +0,0 @@ -commit cb56316cf3702f03b05e30f406ff3028e45f7bfb -Author: Cole Robinson -Date: Tue Apr 5 16:21:42 2011 -0400 - - cs.po: Busted Plural-forms crashes python gettext - -diff --git a/po/cs.po b/po/cs.po -index d1808a7..cc13a1b 100644 ---- a/po/cs.po -+++ b/po/cs.po -@@ -16,7 +16,6 @@ msgstr "" - "MIME-Version: 1.0\n" - "Content-Type: text/plain; charset=UTF-8\n" - "Content-Transfer-Encoding: 8bit\n" --"Plural-Forms: \n" - - #: ../src/virt-manager.desktop.in.in.h:1 - msgid "Manage virtual machines" diff --git a/virt-manager-fix-config-options.patch b/virt-manager-fix-config-options.patch deleted file mode 100644 index b045ab7..0000000 --- a/virt-manager-fix-config-options.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- virt-manager-0.8.7/configure 2011-03-24 16:41:26.000000000 -0400 -+++ /home/crobinso/sandbox/upstream/virt-manager/virt-manager.git/configure 2011-03-29 09:27:40.115612001 -0400 -@@ -718,7 +718,7 @@ with_libvirt_package_names - with_kvm_packages - enable_unsupported_rhel_options - with_preferred_distros --with___with_default_graphics -+with_default_graphics - ' - ac_precious_vars='build_alias - host_alias -@@ -6521,7 +6521,9 @@ fi - - # Check whether --enable-unsupported-rhel-options was given. - if test "${enable_unsupported_rhel_options+set}" = set; then : -- enableval=$enable_unsupported_rhel_options; test "x$enableval" == "xno" && ENABLE_UNSUPPORTED_RHEL_OPTS=0 -+ enableval=$enable_unsupported_rhel_options; test "x$enableval" == "xno" && \ -+ ENABLE_UNSUPPORTED_RHEL_OPTS=0 || -+ ENABLE_UNSUPPORTED_RHEL_OPTS=1 - else - ENABLE_UNSUPPORTED_RHEL_OPTS=1 - fi -@@ -6537,9 +6539,9 @@ fi - - - --# Check whether --with---with-default-graphics was given. --if test "${with___with_default_graphics+set}" = set; then : -- withval=$with___with_default_graphics; DEFAULT_GRAPHICS=$withval -+# Check whether --with-default-graphics was given. -+if test "${with_default_graphics+set}" = set; then : -+ withval=$with_default_graphics; DEFAULT_GRAPHICS=$withval - else - DEFAULT_GRAPHICS="vnc" - fi diff --git a/virt-manager-fix-hotplug-fallback.patch b/virt-manager-fix-hotplug-fallback.patch deleted file mode 100644 index 8ae3f57..0000000 --- a/virt-manager-fix-hotplug-fallback.patch +++ /dev/null @@ -1,20 +0,0 @@ -commit 4922222c2c7b13704b6f461aedbee9ec06c01b5b -Author: Cole Robinson -Date: Tue Apr 5 16:15:05 2011 -0400 - - addhw: Fix nonhotplug to running guest - -diff --git a/src/virtManager/addhardware.py b/src/virtManager/addhardware.py -index 885c8b9..7fa5b6e 100644 ---- a/src/virtManager/addhardware.py -+++ b/src/virtManager/addhardware.py -@@ -938,7 +938,8 @@ class vmmAddHardware(vmmGObjectUI): - "Would you like to make the device available after the " - "next VM shutdown?")), - dialog_type=gtk.MESSAGE_WARNING, -- buttons=gtk.BUTTONS_YES_NO) -+ buttons=gtk.BUTTONS_YES_NO, -+ async=False) - - if not res: - return (False, None) diff --git a/virt-manager-gconf-after-fork.patch b/virt-manager-gconf-after-fork.patch deleted file mode 100644 index 984875e..0000000 --- a/virt-manager-gconf-after-fork.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff -rup virt-manager-0.8.7/src/virt-manager.py.in foobar/src/virt-manager.py.in ---- virt-manager-0.8.7/src/virt-manager.py.in 2011-03-24 16:39:28.000000000 -0400 -+++ foobar/src/virt-manager.py.in 2011-03-31 11:34:02.389991998 -0400 -@@ -393,9 +393,16 @@ def main(): - dbus.glib.threads_init() - import dbus.service - -- # Specifically init config/gconf before the fork, so that pam -- # doesn't think we closed the app, therefor robbing us of -- # display access -+ # Now we've got basic environment up & running we can fork -+ if not options.nofork and not options.debug: -+ drop_tty() -+ drop_stdio() -+ -+ # Ignore SIGHUP, otherwise a serial console closing drops the whole app -+ signal.signal(signal.SIGHUP, signal.SIG_IGN) -+ -+ # Initing gconf before forking makes the app lockup on f15/rawhide... -+ # https://bugzilla.redhat.com/show_bug.cgi?id=692570 - import virtManager.config - config = virtManager.config.vmmConfig(appname, appversion, - gconf_dir, glade_dir, -@@ -408,14 +415,6 @@ def main(): - config.hv_packages = hv_packages - config.libvirt_packages = libvirt_packages - -- # Now we've got basic environment up & running we can fork -- if not options.nofork and not options.debug: -- drop_tty() -- drop_stdio() -- -- # Ignore SIGHUP, otherwise a serial console closing drops the whole app -- signal.signal(signal.SIGHUP, signal.SIG_IGN) -- - from virtManager.engine import vmmEngine - - gtk.window_set_default_icon_from_file(icon_dir + "/" + diff --git a/virt-manager-spicevmc.patch b/virt-manager-spicevmc.patch deleted file mode 100644 index eefaebf..0000000 --- a/virt-manager-spicevmc.patch +++ /dev/null @@ -1,436 +0,0 @@ -commit 6fa885e5831e637976487e39c877ab3a80325ee8 -Author: Marc-André Lureau -Date: Tue Apr 5 01:35:31 2011 +0200 - - addhardware: allow setting the char device target name - -diff --git a/src/virtManager/addhardware.py b/src/virtManager/addhardware.py -index a8ceb78..91ece33 100644 ---- a/src/virtManager/addhardware.py -+++ b/src/virtManager/addhardware.py -@@ -54,6 +54,7 @@ char_widget_mappings = { - "bind_port" : "char-bind-port", - "bind_host" : "char-bind-host", - "protocol" : "char-use-telnet", -+ "target_name" : "char-target-name", - } - - def get_list_selection(widget): -@@ -117,6 +118,7 @@ class vmmAddHardware(vmmGObjectUI): - "char_host_focus_in": (self.update_doc, "source_host"), - "char_bind_host_focus_in": (self.update_doc, "bind_host"), - "char_telnet_focus_in": (self.update_doc, "protocol"), -+ "char_name_focus_in": (self.update_doc, "target_name"), - }) - util.bind_escape_key_close(self) - -@@ -443,6 +445,7 @@ class vmmAddHardware(vmmGObjectUI): - self.window.get_widget("char-bind-host").set_text("127.0.0.1") - self.window.get_widget("char-bind-port").get_adjustment().value = 4556 - self.window.get_widget("char-use-telnet").set_active(False) -+ self.window.get_widget("char-target-name").set_text("com.redhat.spice.0") - - # Hide all notebook pages, so the wizard isn't as big as the largest - # page -@@ -1143,6 +1146,7 @@ class vmmAddHardware(vmmGObjectUI): - bind_host = self.window.get_widget("char-bind-host").get_text() - source_port = self.window.get_widget("char-port").get_adjustment().value - bind_port = self.window.get_widget("char-bind-port").get_adjustment().value -+ target_name = self.window.get_widget("char-target-name").get_text() - - if self.window.get_widget("char-use-telnet").get_active(): - protocol = VirtualCharDevice.CHAR_PROTOCOL_TELNET -@@ -1156,6 +1160,7 @@ class vmmAddHardware(vmmGObjectUI): - "bind_port": bind_port, - "bind_host": bind_host, - "protocol": protocol, -+ "target_name": target_name, - } - - try: -diff --git a/src/vmm-add-hardware.glade b/src/vmm-add-hardware.glade -index bbd3a42..c5087a1 100644 ---- a/src/vmm-add-hardware.glade -+++ b/src/vmm-add-hardware.glade -@@ -1504,7 +1504,7 @@ to connect to the virtual machine. - - - True -- 5 -+ 6 - 2 - 8 - 8 -@@ -1520,6 +1520,34 @@ to connect to the virtual machine. - - - -+ -+ True -+ True -+ -+ -+ -+ 1 -+ 2 -+ 5 -+ 6 -+ -+ -+ -+ -+ True -+ 0 -+ Name: -+ True -+ char-use-telnet -+ -+ -+ 5 -+ 6 -+ GTK_FILL -+ -+ -+ -+ - - True - True -commit ce9a125728b6622008849dd9c35309e36104913e -Author: Marc-André Lureau -Date: Tue Apr 5 01:35:32 2011 +0200 - - addhardware: fix adding and removing a channel device - -diff --git a/src/virtManager/addhardware.py b/src/virtManager/addhardware.py -index 91ece33..885c8b9 100644 ---- a/src/virtManager/addhardware.py -+++ b/src/virtManager/addhardware.py -@@ -286,19 +286,6 @@ class vmmAddHardware(vmmGObjectUI): - video_dev = self.window.get_widget("video-model") - uihelpers.build_video_combo(self.vm, video_dev) - -- # Char device type -- char_devtype = self.window.get_widget("char-device-type") -- # Type name, desc -- char_devtype_model = gtk.ListStore(str, str) -- char_devtype.set_model(char_devtype_model) -- text = gtk.CellRendererText() -- char_devtype.pack_start(text, True) -- char_devtype.add_attribute(text, 'text', 1) -- for t in VirtualCharDevice.char_types: -- desc = VirtualCharDevice.get_char_type_desc(t) -- row = [t, desc + " (%s)" % t] -- char_devtype_model.append(row) -- - # Character dev mode - char_mode = self.window.get_widget("char-mode") - # Mode name, desc -@@ -358,6 +345,10 @@ class vmmAddHardware(vmmGObjectUI): - self.vm.is_hvm(), - _("Not supported for this guest type."), - "parallel") -+ add_hw_option("Channel", gtk.STOCK_CONNECT, PAGE_CHAR, -+ self.vm.is_hvm(), -+ _("Not supported for this guest type."), -+ "channel") - add_hw_option("USB Host Device", "system-run", PAGE_HOSTDEV, - self.vm.get_connection().is_nodedev_capable(), - _("Connection does not support host device enumeration"), -@@ -688,6 +679,23 @@ class vmmAddHardware(vmmGObjectUI): - def get_hw_selection(self): - return get_list_selection(self.window.get_widget("hardware-list")) - -+ def update_char_device_type_model(self): -+ # Char device type -+ char_devtype = self.window.get_widget("char-device-type") -+ dev_type = self.get_char_type() -+ # Type name, desc -+ char_devtype_model = gtk.ListStore(str, str) -+ char_devtype.clear() -+ char_devtype.set_model(char_devtype_model) -+ text = gtk.CellRendererText() -+ char_devtype.pack_start(text, True) -+ char_devtype.add_attribute(text, 'text', 1) -+ for t in VirtualCharDevice.char_types_for_dev_type[dev_type]: -+ desc = VirtualCharDevice.get_char_type_desc(t) -+ row = [t, desc + " (%s)" % t] -+ char_devtype_model.append(row) -+ char_devtype.set_active(0) -+ - def hw_selected(self, src=None): - ignore = src - self._dev = None -@@ -707,6 +715,7 @@ class vmmAddHardware(vmmGObjectUI): - self.window.get_widget("hardware-info").set_text(msg) - - if page == PAGE_CHAR: -+ self.update_char_device_type_model() - devtype = self.window.get_widget("char-device-type") - self.change_char_device_type(devtype) - -@@ -814,6 +823,8 @@ class vmmAddHardware(vmmGObjectUI): - - if label == "parallel": - return VirtualDevice.VIRTUAL_DEV_PARALLEL -+ elif label == "channel": -+ return VirtualDevice.VIRTUAL_DEV_CHANNEL - return VirtualDevice.VIRTUAL_DEV_SERIAL - - def dev_to_title(self, page): -@@ -849,6 +860,9 @@ class vmmAddHardware(vmmGObjectUI): - - def change_char_device_type(self, src): - self.update_doc(None, None, "char_type") -+ idx = src.get_active() -+ if idx < 0: -+ return - - chartype = self.get_char_type() - devtype = src.get_model()[src.get_active()][0] -@@ -863,7 +877,6 @@ class vmmAddHardware(vmmGObjectUI): - self.window.get_widget(widget_name).set_sensitive(make_visible) - - has_mode = self._dev.supports_property("source_mode") -- - if has_mode and self.window.get_widget("char-mode").get_active() == -1: - self.window.get_widget("char-mode").set_active(0) - -diff --git a/src/virtManager/details.py b/src/virtManager/details.py -index 69e2b1a..ca21c2d 100644 ---- a/src/virtManager/details.py -+++ b/src/virtManager/details.py -@@ -2752,7 +2752,7 @@ class vmmDetails(vmmGObjectUI): - port = chardev.target_port - - label = devtype.capitalize() -- if devtype != "console": -+ if devtype not in ["console", "channel"]: - # Don't show port for console - label += " %s" % (int(port) + 1) - -diff --git a/src/virtManager/domain.py b/src/virtManager/domain.py -index 9730233..7fc66ed 100644 ---- a/src/virtManager/domain.py -+++ b/src/virtManager/domain.py -@@ -46,6 +46,7 @@ def compare_device(origdev, newdev, idx): - "console" : ["char_type", "target_type", "target_port"], - "graphics" : ["type", "vmmindex"], - "controller" : ["type", "index"], -+ "channel" : ["char_type", "target_name"], - } - - if id(origdev) == id(newdev): -@@ -713,8 +714,9 @@ class vmmDomainBase(vmmLibvirtObject): - serials = self._build_device_list("serial") - parallels = self._build_device_list("parallel") - consoles = self._build_device_list("console") -+ channels = self._build_device_list("channel") - -- for devicelist in [serials, parallels, consoles]: -+ for devicelist in [serials, parallels, consoles, channels]: - devs.extend(devicelist) - - # Don't display if it's just a duplicate of -commit 127e065d9ee7c5bee0f221352e51fb51ccff1626 -Author: Marc-André Lureau -Date: Tue Apr 5 01:35:33 2011 +0200 - - details: show char device target name - -diff --git a/src/virtManager/details.py b/src/virtManager/details.py -index ca21c2d..8e6e50e 100644 ---- a/src/virtManager/details.py -+++ b/src/virtManager/details.py -@@ -2495,6 +2495,7 @@ class vmmDetails(vmmGObjectUI): - target_port = chardev.target_port - dev_type = chardev.char_type or "pty" - src_path = chardev.source_path -+ target_name = chardev.target_name - primary = hasattr(chardev, "virtmanager_console_dup") - - typelabel = "" -@@ -2518,6 +2519,7 @@ class vmmDetails(vmmGObjectUI): - self.window.get_widget("char-type").set_markup(typelabel) - self.window.get_widget("char-dev-type").set_text(dev_type) - self.window.get_widget("char-source-path").set_text(src_path or "-") -+ self.window.get_widget("char-target-name").set_text(target_name or "-") - - def refresh_hostdev_page(self): - hostdev = self.get_hw_selection(HW_LIST_COL_DEVICE) -diff --git a/src/vmm-details.glade b/src/vmm-details.glade -index d0d3837..d23c3da 100644 ---- a/src/vmm-details.glade -+++ b/src/vmm-details.glade -@@ -4681,7 +4681,7 @@ I/O: - - True - 3 -- 2 -+ 3 - 2 - 8 - 4 -@@ -4689,7 +4689,7 @@ I/O: - - True - 1 -- Device Type: -+ Device type: - - - GTK_FILL -@@ -4700,7 +4700,7 @@ I/O: - - True - 1 -- Source Path: -+ Source path: - - - 1 -@@ -4710,6 +4710,19 @@ I/O: - - - -+ -+ True -+ 1 -+ Target name: -+ -+ -+ 2 -+ 3 -+ GTK_FILL -+ -+ -+ -+ - - True - 0 -@@ -4739,6 +4752,22 @@ I/O: - - - -+ -+ -+ True -+ 0 -+ label508 -+ True -+ -+ -+ 1 -+ 2 -+ 2 -+ 3 -+ GTK_FILL -+ -+ -+ - - - -commit 69ba897ac35731bf6cfca00a3e8ac30485a9855d -Author: Marc-André Lureau -Date: Tue Apr 5 01:35:34 2011 +0200 - - details: propose to add or remove Spice agent when switching - - crobinso: Improve metric for deciding to ask about add/remove agent - -diff --git a/src/virtManager/details.py b/src/virtManager/details.py -index 8e6e50e..eb5a9e5 100644 ---- a/src/virtManager/details.py -+++ b/src/virtManager/details.py -@@ -1850,17 +1850,54 @@ class vmmDetails(vmmGObjectUI): - (dev_id_info, nettype, source)]) - - # Graphics options -+ def _do_change_spicevmc(self, gdev, newgtype): -+ has_multi_spice = (len(filter( -+ lambda dev: dev.type == dev.TYPE_SPICE, -+ self.vm.get_graphics_devices())) > 1) -+ has_spicevmc = bool(filter( -+ (lambda dev: -+ (dev.dev_type == dev.DEV_CHANNEL and -+ dev.char_type == dev.CHAR_SPICEVMC)), -+ self.vm.get_char_devices())) -+ fromspice = (gdev.type == "spice") -+ tospice = (newgtype == "spice") -+ -+ if fromspice and tospice: -+ return False -+ if not fromspice and not tospice: -+ return False -+ -+ print tospice, fromspice, has_spicevmc, has_multi_spice -+ -+ if tospice and has_spicevmc: -+ return False -+ if fromspice and not has_spicevmc: -+ return False -+ -+ if fromspice and has_multi_spice: -+ # Don't offer to remove if there are other spice displays -+ return False -+ -+ msg = (_("You are switching graphics type to %(gtype)s, " -+ "would you like to %(action)s Spice agent channels?") % -+ {"gtype": newgtype, -+ "action": fromspice and "remove" or "add"}) -+ return self.err.yes_no(msg) -+ - def config_graphics_apply(self, dev_id_info): - gtype = self.get_combo_label_value("gfx-type") - passwd = self.window.get_widget("gfx-password").get_text() or None - keymap = self.get_combo_label_value("gfx-keymap") - -+ change_spicevmc = self._do_change_spicevmc(dev_id_info, gtype) -+ - return self._change_config_helper([self.vm.define_graphics_password, - self.vm.define_graphics_keymap, - self.vm.define_graphics_type], - [(dev_id_info, passwd), - (dev_id_info, keymap), -- (dev_id_info, gtype)], -+ (dev_id_info, gtype, -+ change_spicevmc)], - [self.vm.hotplug_graphics_password], - [(dev_id_info, passwd)]) - -diff --git a/src/virtManager/domain.py b/src/virtManager/domain.py -index 7fc66ed..a4d2f5c 100644 ---- a/src/virtManager/domain.py -+++ b/src/virtManager/domain.py -@@ -26,6 +26,7 @@ import threading - import gobject - - import virtinst -+from virtinst.VirtualCharDevice import VirtualCharSpicevmcDevice - from virtManager import util - import virtinst.support as support - -@@ -450,9 +451,20 @@ class vmmDomainBase(vmmLibvirtObject): - def change(editdev): - editdev.keymap = newval - return self._redefine_device(change, devobj) -- def define_graphics_type(self, devobj, newval): -+ def define_graphics_type(self, devobj, newval, spicevmc): - def change(editdev): - editdev.type = newval -+ if spicevmc: -+ guest = self._get_guest_to_define() -+ if newval == "spice": -+ guest.add_device(VirtualCharSpicevmcDevice(guest.conn)) -+ else: -+ channels = guest.get_devices("channel") -+ channels = filter(lambda x: x.char_type == -+ virtinst.VirtualCharDevice.CHAR_SPICEVMC, channels) -+ for dev in channels: -+ guest.remove_device(dev) -+ - return self._redefine_device(change, devobj) - - def define_sound_model(self, devobj, newmodel): diff --git a/virt-manager-stop-netcf-flood.patch b/virt-manager-stop-netcf-flood.patch deleted file mode 100644 index a0b8beb..0000000 --- a/virt-manager-stop-netcf-flood.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -rup virt-manager-0.8.7/src/virtManager/connection.py tmp/src/virtManager/connection.py ---- virt-manager-0.8.7/src/virtManager/connection.py 2011-03-24 16:39:28.000000000 -0400 -+++ tmp/src/virtManager/connection.py 2011-04-28 10:45:19.836484967 -0400 -@@ -1319,15 +1319,15 @@ class vmmConnection(vmmGObject): - try: - check_obj(name, True) - except: -- logging.exception("Couldn't fetch active " -- "interface '%s'" % name) -+ #logging.debug("Couldn't fetch active interface '%s'" % name) -+ pass - - for name in newInactiveNames: - try: - check_obj(name, False) - except: -- logging.exception("Couldn't fetch inactive " -- "interface '%s'" % name) -+ #logging.debug("Couldn't fetch inactive interface '%s'" % name) -+ pass - - return (stop, start, orig, new, current) - diff --git a/virt-manager.spec b/virt-manager.spec index e195bba..1b7f672 100644 --- a/virt-manager.spec +++ b/virt-manager.spec @@ -1,9 +1,9 @@ # -*- rpm-spec -*- %define _package virt-manager -%define _version 0.8.7 -%define _release 5 -%define virtinst_version 0.500.6-2 +%define _version 0.9.0 +%define _release 1 +%define virtinst_version 0.600.6 %define qemu_user "qemu" %define preferred_distros "fedora,rhel" @@ -12,7 +12,9 @@ %define disable_unsupported_rhel 0 %define default_graphics "spice" +%define with_guestfs 1 %define with_spice 1 +%define with_tui 1 # End local config @@ -25,26 +27,13 @@ Name: %{_package} Version: %{_version} Release: %{_release}%{_extra_release} -Summary: Virtual Machine Manager +%define verrel %{version}-%{release} +Summary: Virtual Machine Manager Group: Applications/Emulators License: GPLv2+ URL: http://virt-manager.org/ Source0: http://virt-manager.org/download/sources/%{name}/%{name}-%{version}.tar.gz -# Fix using spice as default graphics type -Patch1: %{name}-fix-config-options.patch -# Fix lockup as non-root (bz 692570) -Patch2: %{name}-gconf-after-fork.patch -# Fix broken cs.po which crashed gettext -Patch3: %{name}-fix-broken-cspo.patch -# Fix offline attach fallback if hotplug fails -Patch4: %{name}-fix-hotplug-fallback.patch -# Offer to attach spicevmc if switching to spice -Patch5: %{name}-spicevmc.patch -# Stop netcf errors from flooding logs (bz 676920) -Patch6: %{name}-stop-netcf-flood.patch -# Bump default mem for new guests to 1GB so F15 installs work (bz 700480) -Patch7: %{name}-bump-default-mem.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -70,8 +59,6 @@ Requires: libxml2-python >= 2.6.23 Requires: python-virtinst >= %{virtinst_version} # Required for loading the glade UI Requires: pygtk2-libglade -# Required for our graphics which are currently SVG format -Requires: librsvg2 # Earlier vte had broken python binding module Requires: vte >= 0.12.2 # For online help @@ -89,6 +76,16 @@ Requires: PolicyKit-gnome %if %{with_spice} Requires: spice-gtk-python %endif +%if %{with_guestfs} +Requires: python-libguestfs +%endif + +%if %{with_tui} == 0 +Obsoletes: virt-manager-common <= %{verrel} +Conflicts: virt-manager-common > %{verrel} +%else +Requires: virt-manager-common = %{verrel} +%endif BuildRequires: gettext BuildRequires: scrollkeeper @@ -107,15 +104,39 @@ connect to a graphical or serial console, and see resource usage statistics for existing VMs on local or remote machines. Uses libvirt as the backend management API. +# TUI package setup +%if %{with_tui} +%package tui +Summary: Virtual Machine Manager text user interface +Group: Applications/Emulators + +Requires: virt-manager-common = %{verrel} +Requires: python-newt_syrup +Requires: libuser-python +Requires: python-IPy + +%description tui +An interactive text user interface for Virtual Machine Manager. + +%package common +Summary: Common files used by the different Virtual Machine Manager interfaces +Group: Applications/Emulators + +# This version not strictly required: virt-manager should work with older, +# however varying amounts of functionality will not be enabled. +Requires: libvirt-python >= 0.7.0 +Requires: dbus-python +# Minimum we've tested with +Requires: libxml2-python >= 2.6.23 +# Absolutely require this version or later +Requires: python-virtinst >= %{virtinst_version} + +%description common +Common files used by the different Virtual Machine Manager interfaces. +%endif + %prep %setup -q -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 %build %if %{qemu_user} @@ -142,8 +163,13 @@ management API. %define _default_graphics --with-default-graphics=%{default_graphics} %endif +%if %{with_tui} +%define _tui_opt --with-tui +%else +%define _tui_opt --without-tui +%endif -%configure --without-tui \ +%configure %{?_tui_opt} \ %{?_qemu_user} \ %{?_kvm_packages} \ %{?_libvirt_packages} \ @@ -162,36 +188,24 @@ make install DESTDIR=$RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT %pre -if [ "$1" -gt 1 ]; then - export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` - gconftool-2 --makefile-uninstall-rule \ - %{_sysconfdir}/gconf/schemas/%{name}.schemas > /dev/null || : -fi +%gconf_schema_prepare %{name} %post -export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` -gconftool-2 --makefile-install-rule \ - %{_sysconfdir}/gconf/schemas/%{name}.schemas > /dev/null || : - -update-desktop-database %{_datadir}/applications - -# Revive when we update help docs -#if which scrollkeeper-update>/dev/null 2>&1; then scrollkeeper-update -q -o %{_datadir}/omf/%{name}; fi +update-desktop-database -q %{_datadir}/applications +%gconf_schema_upgrade virt-manager %postun -update-desktop-database %{_datadir}/applications - -# Revive when we update help docs -#if which scrollkeeper-update>/dev/null 2>&1; then scrollkeeper-update -q; fi +update-desktop-database -q %{_datadir}/applications %preun -if [ "$1" -eq 0 ]; then - export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` - gconftool-2 --makefile-uninstall-rule \ - %{_sysconfdir}/gconf/schemas/%{name}.schemas > /dev/null || : -fi +%gconf_schema_remove %{name} + +%if %{with_tui} +%files +%else %files -f %{name}.lang +%endif %defattr(-,root,root,-) %doc README COPYING COPYING-DOCS AUTHORS ChangeLog NEWS %{_sysconfdir}/gconf/schemas/%{name}.schemas @@ -200,30 +214,51 @@ fi %{_mandir}/man1/%{name}.1* +%if %{with_tui} == 0 %dir %{_datadir}/%{name} -%{_datadir}/%{name}/*.glade -%{_datadir}/%{name}/*.py* - -%dir %{_datadir}/%{name}/pixmaps/ -%{_datadir}/%{name}/pixmaps/*.png -%{_datadir}/%{name}/pixmaps/*.svg - -%dir %{_datadir}/%{name}/pixmaps/hicolor/ -%dir %{_datadir}/%{name}/pixmaps/hicolor/*/ -%dir %{_datadir}/%{name}/pixmaps/hicolor/*/*/ -%{_datadir}/%{name}/pixmaps/hicolor/*/*/*.png - %dir %{_datadir}/%{name}/virtManager/ %{_datadir}/%{name}/virtManager/*.py* +%endif -# Revive when we update help docs -#%{_datadir}/omf/%{name}/ -#%{_datadir}/gnome/help/%{name} +%{_datadir}/%{name}/*.glade +%{_datadir}/%{name}/%{name}.py* + +%{_datadir}/%{name}/icons +%{_datadir}/icons/hicolor/*/apps/* %{_datadir}/applications/%{name}.desktop %{_datadir}/dbus-1/services/%{name}.service +%if %{with_tui} +%files common -f %{name}.lang +%defattr(-,root,root,-) +%dir %{_datadir}/%{name} +%dir %{_datadir}/%{name}/virtManager/ + +%{_datadir}/%{name}/virtManager/*.py* + +%files tui +%defattr(-,root,root,-) + +%{_bindir}/%{name}-tui +%{_datadir}/%{name}/%{name}-tui.py* + +%{_datadir}/%{name}/virtManagerTui +%endif + %changelog +* Tue Jul 26 2011 Cole Robinson - 0.9.0-1.fc17 +- Rebased to version 0.9.0 +- Use a hiding toolbar for fullscreen mode +- Use libguestfs to show guest packagelist and more (Richard W.M. Jones) +- Basic 'New VM' wizard support for LXC guests +- Remote serial console access (with latest libvirt) +- Remote URL guest installs (with latest libvirt) +- Add Hardware: Support devices +- Add Hardware: Support devices (Marc-André Lureau) +- Enable direct interface selection for qemu/kvm (Gerhard Stenzel) +- Allow viewing and changing disk serial number + * Thu Apr 28 2011 Cole Robinson - 0.8.7-5.fc16 - Stop netcf errors from flooding logs (bz 676920) - Bump default mem for new guests to 1GB so F15 installs work (bz