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

Re: [Xen-devel] [PATCH net v3 1/1] xen-netback: Handle backend state transitions in a more robust way



> -----Original Message-----
> From: Wei Liu [mailto:wei.liu2@xxxxxxxxxx]
> Sent: 24 September 2013 16:26
> To: Paul Durrant
> Cc: xen-devel@xxxxxxxxxxxxx; netdev@xxxxxxxxxxxxxxx; Ian Campbell; Wei Liu;
> David Vrabel
> Subject: Re: [PATCH net v3 1/1] xen-netback: Handle backend state
> transitions in a more robust way
> 
> On Tue, Sep 24, 2013 at 03:51:22PM +0100, Paul Durrant wrote:
> > When the frontend state changes metback now specifies its desired state
> to
>                                   netback
> > a new function, set_backend_state(), which transitions through any
> [...]
> > +/* Handle backend state transitions:
> > + *
> > + * The backend state starts in InitWait and the following transtions are
>                                                              transitions
> > + * allowed.
> >
> [...]
> > @@ -363,7 +448,9 @@ static void hotplug_status_changed(struct
> xenbus_watch *watch,
> >     if (IS_ERR(str))
> >             return;
> >     if (len == sizeof("connected")-1 && !memcmp(str, "connected", len))
> {
> > -           xenbus_switch_state(be->dev, XenbusStateConnected);
> > +           /* Complete any pending state change */
> > +           xenbus_switch_state(be->dev, be->state);
> > +
> 
> The state transition takes place iff hotplug status is "connected", is
> this desirable? What if hotplug fails?
> 

The xenbus state will remain in InitWait but the backend state will be 
Connected.

> If it cycles through connect again it looks like it will trigger that
> BUG_ON in connect()?
> 

No, I don't think so because be->state is not the same as dev->state. The 
frontend can go to Closing/Closed (which will take dev->state to 
Closing/Closed) and this should be fine.

  Paul

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.