On Wed, Jul 18, 2012 at 12:12 PM, Gerd Hoffmann <kra...@redhat.com> wrote:
> Use the controller_type passed in when looking for a free usb port, so
> get_free_usb_port(something, "ehci") actually gets you a ehci port even
> in case there is a uhci controller present.

I've reviewed your 9-patch series and it all looks good, all applied to next.

Thanks Gerd,

Lucas

> Signed-off-by: Gerd Hoffmann <kra...@redhat.com>
> ---
>  client/virt/kvm_vm.py |   19 ++++++++++---------
>  1 files changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/client/virt/kvm_vm.py b/client/virt/kvm_vm.py
> index 4d4c2ae..82218f4 100644
> --- a/client/virt/kvm_vm.py
> +++ b/client/virt/kvm_vm.py
> @@ -267,17 +267,18 @@ class VM(virt_vm.BaseVM):
>
>              for usb in params.objects("usbs"):
>                  usb_params = params.object_params(usb)
> -
> +                usb_type = usb_params.get("usb_type")
>                  usb_dev = self.usb_dev_dict.get(usb)
>
> -                controller = usb
> -                max_port = int(usb_params.get("usb_max_port", 6))
> -                if len(usb_dev) < max_port:
> -                    bus = "%s.0" % usb
> -                    self.usb_dev_dict[usb].append(dev)
> -                    # Usb port starts from 1, so add 1 directly here.
> -                    port = self.usb_dev_dict[usb].index(dev) + 1
> -                    break
> +                if usb_type.find(controller_type) != -1:
> +                    controller = usb
> +                    max_port = int(usb_params.get("usb_max_port", 6))
> +                    if len(usb_dev) < max_port:
> +                        bus = "%s.0" % usb
> +                        self.usb_dev_dict[usb].append(dev)
> +                        # Usb port starts from 1, so add 1 directly here.
> +                        port = self.usb_dev_dict[usb].index(dev) + 1
> +                        break
>
>              if controller is None:
>                  raise virt_vm.VMUSBControllerMissingError(self.name,
> --
> 1.7.1
>
> _______________________________________________
> Autotest mailing list
> Autotest@test.kernel.org
> http://test.kernel.org/cgi-bin/mailman/listinfo/autotest



-- 
Lucas
_______________________________________________
Autotest mailing list
Autotest@test.kernel.org
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to