Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
SUSE:SLE-12-SP1:Update
virt-manager.12547
d5e50686-update-details-window-mapping-when-VM-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File d5e50686-update-details-window-mapping-when-VM-is-renamed.patch of Package virt-manager.12547
Subject: engine: Update details window mapping when VM is renamed From: Cole Robinson crobinso@redhat.com Tue Nov 3 15:56:39 2015 -0500 Date: Tue Nov 3 16:01:04 2015 -0500: Git: d5e506869966ffa39bb400313ce9d001208dda38 Fixes this issue: - Rename VM from 'foo' to 'foo1' - Create new VM named 'foo' - It raises 'foo1' window Index: virt-manager-1.2.1/virtManager/connection.py =================================================================== --- virt-manager-1.2.1.orig/virtManager/connection.py +++ virt-manager-1.2.1/virtManager/connection.py @@ -140,6 +140,7 @@ class vmmConnection(vmmGObject): __gsignals__ = { "vm-added": (GObject.SignalFlags.RUN_FIRST, None, [str]), "vm-removed": (GObject.SignalFlags.RUN_FIRST, None, [str]), + "vm-renamed": (GObject.SignalFlags.RUN_FIRST, None, [str, str]), "net-added": (GObject.SignalFlags.RUN_FIRST, None, [str]), "net-removed": (GObject.SignalFlags.RUN_FIRST, None, [str]), "pool-added": (GObject.SignalFlags.RUN_FIRST, None, [str]), @@ -650,10 +651,7 @@ class vmmConnection(vmmGObject): def define_interface(self, xml): return self._backend.interfaceDefineXML(xml, 0) - def rename_object(self, obj, origxml, newxml, oldname, newname): - ignore = oldname - ignore = newname - + def rename_object(self, obj, origxml, newxml, oldconnkey): if obj.class_name() == "domain": define_cb = self.define_domain elif obj.class_name() == "pool": @@ -691,6 +689,9 @@ class vmmConnection(vmmGObject): # Reinsert handle into new obj obj.change_name_backend(newobj) + if newobj and obj.class_name() == "domain": + self.emit("vm-renamed", oldconnkey, obj.get_connkey()) + ######################### # Domain event handling # Index: virt-manager-1.2.1/virtManager/engine.py =================================================================== --- virt-manager-1.2.1.orig/virtManager/engine.py +++ virt-manager-1.2.1/virtManager/engine.py @@ -277,6 +277,14 @@ class vmmEngine(vmmGObject): self.conns[hvuri]["windowDetails"][connkey].cleanup() del(self.conns[hvuri]["windowDetails"][connkey]) + def _do_vm_renamed(self, conn, oldconnkey, newconnkey): + hvuri = conn.get_uri() + if oldconnkey not in self.conns[hvuri]["windowDetails"]: + return + + self.conns[hvuri]["windowDetails"][newconnkey] = ( + self.conns[hvuri]["windowDetails"].pop(oldconnkey)) + def _do_conn_changed(self, conn): if conn.is_active() or conn.is_connecting(): return @@ -503,6 +511,7 @@ class vmmEngine(vmmGObject): } conn.connect("vm-removed", self._do_vm_removed) + conn.connect("vm-renamed", self._do_vm_renamed) conn.connect("state-changed", self._do_conn_changed) conn.connect("connect-error", self._connect_error) conn.connect("priority-tick", self._schedule_priority_tick) Index: virt-manager-1.2.1/virtManager/libvirtobject.py =================================================================== --- virt-manager-1.2.1.orig/virtManager/libvirtobject.py +++ virt-manager-1.2.1/virtManager/libvirtobject.py @@ -111,6 +111,7 @@ class vmmLibvirtObject(vmmGObject): self._backend = newbackend def define_name(self, newname): + oldconnkey = self.get_connkey() oldname = self.get_xmlobj().name self.ensure_latest_xml() @@ -126,7 +127,7 @@ class vmmLibvirtObject(vmmGObject): try: self._key = newname - self.conn.rename_object(self, origxml, newxml, oldname, newname) + self.conn.rename_object(self, origxml, newxml, oldconnkey) except: self._key = oldname raise
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor