[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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



On 01/31/2012 10:58 AM, Guannan Ren wrote:
---
  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)

   Sorry, the problem have been solved in upstream, please skip the patch.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]