mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-28 17:47:20 +03:00
Fix BZ 239763 -- we shouldn't add a disk twice when we add it to a live domain on Xen 3.1.
This commit is contained in:
parent
8ff8679b10
commit
04501bbe77
@ -538,10 +538,13 @@ class vmmDomain(gobject.GObject):
|
||||
def add_device(self, xml):
|
||||
logging.debug("Adding device " + xml)
|
||||
|
||||
# get the XML for the live domain before we attach the device
|
||||
# otherwise the device gets added to the XML twice.
|
||||
vmxml = self.vm.XMLDesc(0)
|
||||
|
||||
if self.is_active():
|
||||
self.vm.attachDevice(xml)
|
||||
|
||||
vmxml = self.vm.XMLDesc(0)
|
||||
|
||||
index = vmxml.find("</devices>")
|
||||
newxml = vmxml[0:index] + xml + vmxml[index:]
|
||||
|
Loading…
x
Reference in New Issue
Block a user