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

Re: [virt-tools-list] [virt-manager PATCH 5/5] Don't duplicate SCSI controller IDs and assign proper addresses



On 06/18/2013 10:12 AM, Martin Kletzander wrote:
> 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>
> ---
>  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 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
> 

ACK 3-5, though I'd like to see a test case for this. Please push.

- Cole


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