details: If changing disk bus, remove <address>

Need to let libvirt regenerate so things don't get funny
This commit is contained in:
Cole Robinson 2011-07-11 17:01:37 -04:00
parent 19d7df4e47
commit 305808187d

View File

@ -539,6 +539,11 @@ class vmmDomain(vmmLibvirtObject):
return self._redefine_device(change, devobj)
def define_disk_bus(self, devobj, newval):
def change(editdev):
if editdev.bus != newval:
# Old <address> probably isn't applicable for new bus value
editdev.address.clear()
# XXX: Need to change target value as well?
editdev.bus = newval
return self._redefine_device(change, devobj)