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: Gonglei (Arei)
Subject: Re: [Qemu-devel] [PATCH v2 12/19] dev-serial: convert init to realize
Date: Thu, 18 Sep 2014 13:26:45 +0000

> From: Paolo Bonzini [mailto:address@hidden
> Sent: Thursday, September 18, 2014 8:59 PM
> Subject: Re: [PATCH v2 12/19] dev-serial: convert init to realize
> 
> 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).
> 
Yes. Good catch. :)

> 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.
> 
Yes, we can. 

Can we use qerror_report_err still in realize function?
Just report this error but not propagate to the caller. Thanks!

Best regards,
-Gonglei



reply via email to

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