diff --git a/1240-cdrom-driver-name.patch b/1240-cdrom-driver-name.patch new file mode 100644 index 00000000..1c042d40 --- /dev/null +++ b/1240-cdrom-driver-name.patch @@ -0,0 +1,71 @@ +# HG changeset patch +# User Cole Robinson +# Date 1251727555 14400 +# Node ID c0de24094ca26b8da900d29746adba056f4114f7 +# Parent 37a986ce54ceac389573d763c78f633a10ec1ab7 +Don't mangle QEMU driver name on cdrom connect (bz 516116) + +Index: virt-manager-0.8.0/src/virtManager/domain.py +=================================================================== +--- virt-manager-0.8.0.orig/src/virtManager/domain.py ++++ virt-manager-0.8.0/src/virtManager/domain.py +@@ -1291,19 +1291,28 @@ class vmmDomain(gobject.GObject): + xml = self.get_device_xml("disk", dev_id_info) + + def cdrom_xml_connect(doc, ctx): +- disk_fragment = ctx.xpathEval("/disk") ++ disk_fragment = ctx.xpathEval("/disk")[0] + driver_fragment = ctx.xpathEval("/disk/driver") +- disk_fragment[0].setProp("type", _type) +- elem = disk_fragment[0].newChild(None, "source", None) ++ disk_fragment.setProp("type", _type) ++ elem = disk_fragment.newChild(None, "source", None) ++ + if _type == "file": + elem.setProp("file", source) +- if driver_fragment: +- driver_fragment[0].setProp("name", _type) ++ driver_name = _type + else: + elem.setProp("dev", source) +- if driver_fragment: +- driver_fragment[0].setProp("name", "phy") +- return disk_fragment[0].serialize() ++ driver_name = "phy" ++ ++ if driver_fragment: ++ driver_fragment = driver_fragment[0] ++ orig_name = driver_fragment.prop("name") ++ ++ # For Xen, the driver name is dependent on the storage type ++ # (file or phys). ++ if orig_name and orig_name in [ "file", "phy" ]: ++ driver_fragment.setProp("name", driver_name) ++ ++ return disk_fragment.serialize() + + result = util.xml_parse_wrapper(xml, cdrom_xml_connect) + logging.debug("connect_cdrom produced: %s" % result) +@@ -1313,17 +1322,19 @@ class vmmDomain(gobject.GObject): + xml = self.get_device_xml("disk", dev_id_info) + + def cdrom_xml_disconnect(doc, ctx): +- disk_fragment = ctx.xpathEval("/disk") ++ disk_fragment = ctx.xpathEval("/disk")[0] + sourcenode = None +- for child in disk_fragment[0].children: ++ ++ for child in disk_fragment.children: + if child.name == "source": + sourcenode = child + break + else: + continue ++ + sourcenode.unlinkNode() + sourcenode.freeNode() +- return disk_fragment[0].serialize() ++ return disk_fragment.serialize() + + result = util.xml_parse_wrapper(xml, cdrom_xml_disconnect) + logging.debug("eject_cdrom produced: %s" % result) diff --git a/1242-delete-active-vm.patch b/1242-delete-active-vm.patch new file mode 100644 index 00000000..8ed1ebf1 --- /dev/null +++ b/1242-delete-active-vm.patch @@ -0,0 +1,21 @@ +# HG changeset patch +# User Cole Robinson +# Date 1251728389 14400 +# Node ID b70858b9f8c6f9fea21f6e66a10e7b9498f11e5e +# Parent 0bdea2b6c30e3b9ac7ca7b35f957598e66fd8c36 +Don't allow deleting an active VM (bz 518536) + +Index: virt-manager-0.8.0/src/virtManager/manager.py +=================================================================== +--- virt-manager-0.8.0.orig/src/virtManager/manager.py ++++ virt-manager-0.8.0/src/virtManager/manager.py +@@ -684,7 +684,8 @@ class vmmManager(gobject.GObject): + show_open = bool(vm) + show_details = bool(vm) + host_details = bool(vm or conn) +- delete = bool((vm and vm.is_runable()) or conn) ++ delete = bool((vm and vm.is_runable()) or ++ (not vm and conn)) + show_run = bool(vm and vm.is_runable()) + is_paused = bool(vm and vm.is_paused()) + if is_paused: diff --git a/1243-syntax-typo.patch b/1243-syntax-typo.patch new file mode 100644 index 00000000..fd8f1cee --- /dev/null +++ b/1243-syntax-typo.patch @@ -0,0 +1,47 @@ +# HG changeset patch +# User Paul W. Frields +# Date 1251729959 14400 +# Node ID d34def55dbd78e2ad5f099d6a38c1f358c798555 +# Parent b70858b9f8c6f9fea21f6e66a10e7b9498f11e5e +addhardware: Fix error message syntax typo + +Index: virt-manager-0.8.0/AUTHORS +=================================================================== +--- virt-manager-0.8.0.orig/AUTHORS ++++ virt-manager-0.8.0/AUTHORS +@@ -59,6 +59,7 @@ Further patches have been submitted by: + Emmanuel Lacour + Laurent LĂ©onard + Michal Novotny ++ Paul W. Frields + + <...send a patch & get your name here...> + +Index: virt-manager-0.8.0/src/virtManager/addhardware.py +=================================================================== +--- virt-manager-0.8.0.orig/src/virtManager/addhardware.py ++++ virt-manager-0.8.0/src/virtManager/addhardware.py +@@ -1186,8 +1186,8 @@ class vmmAddHardware(gobject.GObject): + conn = self.vm.get_connection().vmm, + name = nodedev_name) + except Exception, e: +- return self.err.val_err(_("Host device parameter error", +- str(e))) ++ return self.err.val_err(_("Host device parameter error"), ++ str(e)) + + elif page_num == PAGE_CHAR: + chartype = self.get_char_type() +Index: virt-manager-0.8.0/src/vmm-manager.glade +=================================================================== +--- virt-manager-0.8.0.orig/src/vmm-manager.glade ++++ virt-manager-0.8.0/src/vmm-manager.glade +@@ -118,7 +118,7 @@ + + + True +- Delete Virtual Machine ++ Delete + True + + diff --git a/1245-storage-browser-selection.patch b/1245-storage-browser-selection.patch new file mode 100644 index 00000000..72306c62 --- /dev/null +++ b/1245-storage-browser-selection.patch @@ -0,0 +1,75 @@ +# HG changeset patch +# User Cole Robinson +# Date 1252939197 14400 +# Node ID 486cd6791c3926420786d30401a690884acdf653 +# Parent 043ca66e19aabcdb89b8bbe76ef5ded8b0c0fc54 +Fix populating text box with storage browser selection in 'New VM' (bz 517263) + +We were only properly setting the 'finish' callback for the first time the +storage browser was launched. All subsequent runs would not enter anything +in the associated text box. + +Index: virt-manager-0.8.0/src/virtManager/addhardware.py +=================================================================== +--- virt-manager-0.8.0.orig/src/virtManager/addhardware.py ++++ virt-manager-0.8.0/src/virtManager/addhardware.py +@@ -80,7 +80,6 @@ class vmmAddHardware(gobject.GObject): + _("An unexpected error occurred")) + + self.storage_browser = None +- self._browse_cb_id = None + + self._dev = None + +@@ -911,10 +910,8 @@ class vmmAddHardware(gobject.GObject): + conn = self.vm.get_connection() + if self.storage_browser == None: + self.storage_browser = vmmStorageBrowser(self.config, conn, False) +- if self._browse_cb_id: +- self.storage_browser.disconnect(self._browse_cb_id) + +- self._browse_cb_id = self.storage_browser.connect("storage-browse-finish", set_storage_cb) ++ self.storage_browser.set_finish_cb(set_storage_cb) + self.storage_browser.local_args = { "dialog_name": dialog_name, + "confirm_func": confirm_func, + "browse_reason": +Index: virt-manager-0.8.0/src/virtManager/create.py +=================================================================== +--- virt-manager-0.8.0.orig/src/virtManager/create.py ++++ virt-manager-0.8.0/src/virtManager/create.py +@@ -1644,8 +1644,9 @@ class vmmCreate(gobject.GObject): + if self.storage_browser == None: + self.storage_browser = vmmStorageBrowser(self.config, self.conn, + is_media) +- self.storage_browser.connect("storage-browse-finish", +- callback) ++ ++ self.storage_browser.set_finish_cb(callback) ++ + if is_media: + reason = self.config.CONFIG_DIR_MEDIA + else: +Index: virt-manager-0.8.0/src/virtManager/storagebrowse.py +=================================================================== +--- virt-manager-0.8.0.orig/src/virtManager/storagebrowse.py ++++ virt-manager-0.8.0/src/virtManager/storagebrowse.py +@@ -47,6 +47,7 @@ class vmmStorageBrowser(gobject.GObject) + self.config = config + self.conn = conn + self.conn_signal_ids = [] ++ self.finish_cb_id = None + + self.topwin = self.window.get_widget("vmm-storage-browse") + self.err = vmmErrorDialog(self.topwin, +@@ -89,6 +90,11 @@ class vmmStorageBrowser(gobject.GObject) + self.addvol.close() + return 1 + ++ def set_finish_cb(self, callback): ++ if self.finish_cb_id: ++ self.disconnect(self.finish_cb_id) ++ self.finish_cb_id = self.connect("storage-browse-finish", callback) ++ + def set_initial_state(self): + pool_list = self.window.get_widget("pool-list") + virtManager.host.init_pool_list(pool_list, self.pool_selected) diff --git a/1248-libvirt-connection.patch b/1248-libvirt-connection.patch new file mode 100644 index 00000000..ffccf77d --- /dev/null +++ b/1248-libvirt-connection.patch @@ -0,0 +1,51 @@ +# HG changeset patch +# User Cole Robinson +# Date 1253131339 14400 +# Node ID 1c886d1863f72e7ddd5fb99050362296be6a9deb +# Parent 9242a7fe76b16c6505bdd3d3d328ae8f0c56da10 +Don't close connection on all libvirt errors: only if libvirtd goes away. + +Index: virt-manager-0.8.0/src/virtManager/connection.py +=================================================================== +--- virt-manager-0.8.0.orig/src/virtManager/connection.py ++++ virt-manager-0.8.0/src/virtManager/connection.py +@@ -941,7 +941,15 @@ class vmmConnection(gobject.GObject): + updateVMs = newVMs + + for uuid in updateVMs: +- self.vms[uuid].tick(now) ++ vm = self.vms[uuid] ++ try: ++ vm.tick(now) ++ except libvirt.libvirtError, e: ++ if e.get_error_code() == libvirt.VIR_ERR_SYSTEM_ERROR: ++ raise ++ logging.exception("Tick for VM '%s' failed" % vm.get_name()) ++ except Exception, e: ++ logging.exception("Tick for VM '%s' failed" % vm.get_name()) + + if not noStatsUpdate: + self._recalculate_stats(now) +Index: virt-manager-0.8.0/src/virtManager/engine.py +=================================================================== +--- virt-manager-0.8.0.orig/src/virtManager/engine.py ++++ virt-manager-0.8.0/src/virtManager/engine.py +@@ -199,10 +199,14 @@ class vmmEngine(gobject.GObject): + self.connections[uri]["connection"].tick() + except KeyboardInterrupt: + raise +- except: +- logging.exception("Could not refresh connection %s." % uri) +- logging.debug("Closing connection since refresh failed.") +- self.connections[uri]["connection"].close() ++ except libvirt.libvirtError, e: ++ if e.get_error_code() == libvirt.VIR_ERR_SYSTEM_ERROR: ++ logging.exception("Could not refresh connection %s." % uri) ++ logging.debug("Closing connection since libvirtd " ++ "appears to have stopped.") ++ self.connections[uri]["connection"].close() ++ else: ++ raise + return 1 + + def change_timer_interval(self,ignore1,ignore2,ignore3,ignore4): diff --git a/virt-manager.changes b/virt-manager.changes index 8e91d783..cdeb0b9f 100644 --- a/virt-manager.changes +++ b/virt-manager.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Mon Sep 21 16:00:56 MDT 2009 - carnold@novell.com + +- Added upstream bug fixes. + 1240-cdrom-driver-name.patch + 1242-delete-active-vm.patch + 1243-syntax-typo.patch + 1245-storage-browser-selection.patch + 1248-libvirt-connection.patch + ------------------------------------------------------------------- Fri Aug 28 16:44:17 MDT 2009 - carnold@novell.com diff --git a/virt-manager.spec b/virt-manager.spec index 62cbb9fc..b26184f3 100644 --- a/virt-manager.spec +++ b/virt-manager.spec @@ -26,7 +26,7 @@ Name: virt-manager %define virtinst_rel 0 %define virtinst_name virtinst-%{virtinst_maj}.%{virtinst_min}.%{virtinst_rel} Version: 0.8.0 -Release: 2 +Release: 3 Summary: Virtual Machine Manager Group: System/Monitoring License: LGPL v2.1 or later @@ -35,16 +35,21 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build ExclusiveArch: %{ix86} x86_64 Source0: virt-manager-%{version}.tar.bz2 Source1: %{virtinst_name}.tar.bz2 -Patch0: virtman-desktop.diff -Patch1: virtman-vminstall.diff -Patch2: virtman-netcat.diff -Patch3: virtman-pointer.diff -Patch4: virtman-cdrom.diff -Patch5: virtman-kvm.diff -Patch6: virtman-bridge.diff -Patch7: virtman-manager.diff -Patch8: virtman-help.diff -Patch51: virtinst-cdrom.diff +Patch0: 1240-cdrom-driver-name.patch +Patch1: 1242-delete-active-vm.patch +Patch2: 1243-syntax-typo.patch +Patch3: 1245-storage-browser-selection.patch +Patch4: 1248-libvirt-connection.patch +Patch51: virtman-desktop.diff +Patch52: virtman-vminstall.diff +Patch53: virtman-netcat.diff +Patch54: virtman-pointer.diff +Patch55: virtman-cdrom.diff +Patch56: virtman-kvm.diff +Patch57: virtman-bridge.diff +Patch58: virtman-manager.diff +Patch59: virtman-help.diff +Patch81: virtinst-cdrom.diff # Requires: pygtk2 >= 1.99.12-6 Requires: python-gtk # Requires: gnome-python2-gconf >= 1.99.11-7 @@ -122,12 +127,17 @@ Authors: %patch2 -p1 %patch3 -p1 %patch4 -p1 -%patch5 -p1 -#%patch6 -p1 -%patch7 -p1 -%patch8 -p1 -pushd $RPM_BUILD_DIR/%{virtinst_name} %patch51 -p1 +%patch52 -p1 +%patch53 -p1 +%patch54 -p1 +%patch55 -p1 +%patch56 -p1 +#%patch57 -p1 +%patch58 -p1 +%patch59 -p1 +pushd $RPM_BUILD_DIR/%{virtinst_name} +%patch81 -p1 popd # sed -i -e "s@sr\@Latn@sr\@latin@" configure # mv po/sr@Latn.po po/sr@latin.po @@ -180,7 +190,7 @@ sed -i -e 's/Categories=.*/Categories=Qt;X-SuSE-YaST;X-SuSE-YaST-Virtualization; # sed -i '\^/usr/share/gnome/help/^d' %{name}.lang %clean -rm -rf $RPM_BUILD_ROOT +# rm -rf $RPM_BUILD_ROOT %pre -f %{name}.schemas_pre diff --git a/virtinst-cdrom.diff b/virtinst-cdrom.diff index 2e30123a..3c4ce71b 100644 --- a/virtinst-cdrom.diff +++ b/virtinst-cdrom.diff @@ -1,7 +1,8 @@ -diff -Nuar virtinst-0.400.3.orig//virtinst/VirtualDisk.py virtinst-0.400.3//virtinst/VirtualDisk.py ---- virtinst-0.400.3.orig//virtinst/VirtualDisk.py 2009-03-09 21:32:15.000000000 -0600 -+++ virtinst-0.400.3//virtinst/VirtualDisk.py 2009-04-21 10:58:25.000000000 -0600 -@@ -846,14 +846,18 @@ +Index: virtinst-0.500.0/virtinst/VirtualDisk.py +=================================================================== +--- virtinst-0.500.0.orig/virtinst/VirtualDisk.py ++++ virtinst-0.500.0/virtinst/VirtualDisk.py +@@ -1181,14 +1181,18 @@ class VirtualDisk(VirtualDevice): return self.target raise ValueError(_("IDE CDROM must use 'hdc', but target in use.")) diff --git a/virtman-cdrom.diff b/virtman-cdrom.diff index a0612bdf..cf2e3558 100644 --- a/virtman-cdrom.diff +++ b/virtman-cdrom.diff @@ -2,7 +2,7 @@ Index: virt-manager-0.8.0/src/virtManager/addhardware.py =================================================================== --- virt-manager-0.8.0.orig/src/virtManager/addhardware.py +++ virt-manager-0.8.0/src/virtManager/addhardware.py -@@ -1301,6 +1301,7 @@ class vmmAddHardware(gobject.GObject): +@@ -1298,6 +1298,7 @@ class vmmAddHardware(gobject.GObject): if self.vm.get_hv_type().lower() == "kvm": add_dev("virtio", virtinst.VirtualDisk.DEVICE_DISK, "Virtio Disk") if self.vm.get_connection().get_type().lower() == "xen": diff --git a/virtman-manager.diff b/virtman-manager.diff index 22095561..b3271434 100644 --- a/virtman-manager.diff +++ b/virtman-manager.diff @@ -18,7 +18,7 @@ Index: virt-manager-0.8.0/src/virtManager/manager.py if active[1] != None: parent = active[0].iter_parent(active[1]) # return the connection of the currently selected vm, or the -@@ -768,7 +777,14 @@ class vmmManager(gobject.GObject): +@@ -769,7 +778,14 @@ class vmmManager(gobject.GObject): return False def new_vm(self, ignore=None): diff --git a/virtman-vminstall.diff b/virtman-vminstall.diff index faaf9aba..76c283c5 100644 --- a/virtman-vminstall.diff +++ b/virtman-vminstall.diff @@ -12,7 +12,7 @@ Index: virt-manager-0.8.0/src/virtManager/engine.py from virtManager.host import vmmHost from virtManager.error import vmmErrorDialog from virtManager.systray import vmmSystray -@@ -390,13 +391,24 @@ class vmmEngine(gobject.GObject): +@@ -394,13 +395,24 @@ class vmmEngine(gobject.GObject): return False return True