[virt-tools-list] [PATCH] Change target value of disk when defining it

Guannan Ren gren at redhat.com
Tue Jan 31 02:58:01 UTC 2012


---
 src/virtManager/domain.py |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/virtManager/domain.py b/src/virtManager/domain.py
index c27e0b5..f16036e 100644
--- a/src/virtManager/domain.py
+++ b/src/virtManager/domain.py
@@ -584,7 +584,13 @@ class vmmDomain(vmmLibvirtObject):
             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?
+                used = []
+                disks = (self.get_disk_devices() +
+                         self.get_disk_devices(inactive=True))
+                for d in disks:
+                    used.append(d.target)
+
+                editdev.generate_target(used)
 
             editdev.bus = newval
         return self._redefine_device(change, devobj)
-- 
1.7.7.5




More information about the virt-tools-list mailing list