Il 18/09/2014 14:47, arei.gong...@huawei.com 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