qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 12/19] dev-serial: convert init to realize


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v2 12/19] dev-serial: convert init to realize
Date: Thu, 18 Sep 2014 14:58:32 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0

Il 18/09/2014 14:47, address@hidden ha scritto:
>      if (s->cs->be_open && !dev->attached) {
> -        usb_device_attach(dev, &local_err);
> -        if (local_err) {
> -            qerror_report_err(local_err);
> -            error_free(local_err);
> -        }
> +        usb_device_attach(dev, errp);
>      }
> -    return 0;

Subtle change: realize now fails if the attach fails, i.e. if the speed
is mismatched.  This is a bugfix, but it doesn't happen if the backend
is closed (e.g. for server socket chardevs).

For a follow-up, the speed check could be extracted to a separate
function usb_check_attach, that is called just once at realize time,
even if !s->cs->be_open.  Then, I think, all calls to usb_device_attach
in dev-serial can pass &error_abort.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]