Daniel P. Berrange wrote:
On Fri, Jun 08, 2007 at 04:57:37PM +0900, Masayuki Sunou wrote:
Hi
When the disk is added to active VM by virt-manager, VM cannot be
restarted after VM is stopped.
--> Bugzilla Bug 239763
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=239763
This patch fixes it.
When the device is attached to active VM, virt-manager adds the device
twice in add_device() of "domain.py".
1. Call attachDevice()
2. Call define_domain() after the XML is updated
Therefore, the same device is doubly attached.
(So, when the device is disk, VM cannot be started)
This patch fixes "domain.py" as follows so that the same device is not
doubly attached.
VM is active : Call attachDevice() only
It is implementation defined whether attachDevice() persists te changes
it makes. In Xen 3.1.0 it happens to persist them, but in earlier Xen
it does not. So we still need to use define_domain as well.
VM is inactive : Call define_domain() after the XML is updated
Signed-off-by: Masayuki Sunou <fj1826dm@xxxxxxxxxxxxxxxxx>
Thanks,
Masayuki Sunou.
----------------------------------------------------------------------
diff -r 27ad8c7fbc3e src/virtManager/domain.py
--- a/src/virtManager/domain.py Thu May 24 16:49:13 2007 -0400
+++ b/src/virtManager/domain.py Sat Jun 09 14:45:20 2007 +0900
@@ -540,15 +540,15 @@ class vmmDomain(gobject.GObject):
if self.is_active():
self.vm.attachDevice(xml)
-
- vmxml = self.vm.XMLDesc(0)
The key is that we should be calling vm.XMLDesc(0) before the call
to attachDevice() so we get the original XML prior to any device
addition. I'll add such a fix.
I have made this change, see
http://hg.et.redhat.com/virt/applications/virt-manager--devel?cs=643e8d92e3cf
--Hugh
--
Red Hat Virtualization Group http://redhat.com/virtualization
Hugh Brock | virt-manager http://virt-manager.org
hbrock@xxxxxxxxxx | virtualization library http://libvirt.org