[virt-tools-list] [virt-manager PATCH 5/5] Don't duplicate SCSI controller IDs and assign proper addresses
Martin Kletzander
mkletzan at redhat.com
Tue Jun 18 14:12:39 UTC 2013
When Virtio SCSI disk was added to machine with default-model SCSI
controller, the new Virtio SCSI controller had the same index as the
default one (so the domain wouldn't start or with newer libvirt even
define).
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=950330
Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
---
virtManager/addhardware.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
index e8b4826..62d69e7 100644
--- a/virtManager/addhardware.py
+++ b/virtManager/addhardware.py
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2006-2007 Red Hat, Inc.
+# Copyright (C) 2006-2007, 2013 Red Hat, Inc.
# Copyright (C) 2006 Hugh O. Brock <hbrock at redhat.com>
#
# This program is free software; you can redistribute it and/or modify
@@ -1340,8 +1340,15 @@ class vmmAddHardware(vmmGObjectUI):
controller.set_model(controller_model)
disk.vmm_controller = controller
for d in controllers:
+ if controller.type == d.type:
+ controller.index += 1
if controller_model == d.model:
disk.vmm_controller = None
+ controller = d
+ break
+
+ disk.address.type = disk.address.ADDRESS_TYPE_DRIVE
+ disk.address.controller = controller.index
self._dev = disk
return True
--
1.8.2.1
More information about the virt-tools-list
mailing list