diff options
author | Martin Kletzander <mkletzan@redhat.com> | 2013-06-18 16:12:39 +0200 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2013-06-19 18:18:33 -0400 |
commit | c457363f5a7402d77b43787bb0c84b68bd11cdda (patch) | |
tree | 9fb111b8e3715017fb801742acc7cc10fb8f45de | |
parent | af9762313e5701f05cbd140f956b0e683f644584 (diff) | |
download | virt-manager-c457363f5a7402d77b43787bb0c84b68bd11cdda.tar.gz |
Don't duplicate SCSI controller IDs and assign proper addresses
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@redhat.com>
-rw-r--r-- | virtManager/addhardware.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py index e8b48266..62d69e77 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@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 |