qemu-block
[Top][All Lists]
Advanced

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

RE: [Qemu-block] [PATCH] xen-block: treat XenbusStateUnknown the same as


From: Paul Durrant
Subject: RE: [Qemu-block] [PATCH] xen-block: treat XenbusStateUnknown the same as XenbusStateClosed
Date: Mon, 23 Sep 2019 09:38:20 +0000

> -----Original Message-----
> From: John Snow <address@hidden>
> Sent: 20 September 2019 22:11
> To: Paul Durrant <address@hidden>; address@hidden; address@hidden;
> address@hidden
> Cc: Kevin Wolf <address@hidden>; Stefano Stabellini <address@hidden>; Max 
> Reitz
> <address@hidden>; Anthony Perard <address@hidden>; Mark Syms <address@hidden>
> Subject: Re: [Qemu-block] [PATCH] xen-block: treat XenbusStateUnknown the 
> same as XenbusStateClosed
> 
> 
> 
> On 9/18/19 7:57 AM, Paul Durrant wrote:
> > When a frontend gracefully disconnects from an offline backend, it will
> > set its own state to XenbusStateClosed. The code in xen-block.c correctly
> > deals with this and sets the backend into XenbusStateClosed. Unfortunately
> > it is possible for toolstack to actually delete the frontend area
> > before the state key has been read, leading to an apparent frontend state
> > of XenbusStateUnknown. This prevents the backend state from transitioning
> > to XenbusStateClosed and hence leaves it limbo.
> >
> 
> Does the 0 come from a read into de-allocated memory?

No, it comes from the fact that the xenstore state key is not present. 
Conventionally a missing state key means the state is reported as 
XenbusStateUnknown.

  Paul

> 
> --js
> 
> > This patch simply treats a frontend state of XenbusStateUnknown the same
> > as XenbusStateClosed, which will unblock the backend in these circumstances.
> >
> > Reported-by: Mark Syms <address@hidden>
> > Signed-off-by: Paul Durrant <address@hidden>
> > ---
> > Cc: Stefano Stabellini <address@hidden>
> > Cc: Anthony Perard <address@hidden>
> > Cc: Kevin Wolf <address@hidden>
> > Cc: Max Reitz <address@hidden>
> > ---
> >  hw/block/xen-block.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c
> > index f77343db60..879fc310a4 100644
> > --- a/hw/block/xen-block.c
> > +++ b/hw/block/xen-block.c
> > @@ -313,6 +313,7 @@ static void xen_block_frontend_changed(XenDevice 
> > *xendev,
> >          break;
> >
> >      case XenbusStateClosed:
> > +    case XenbusStateUnknown:
> >          xen_block_disconnect(xendev, &local_err);
> >          if (local_err) {
> >              error_propagate(errp, local_err);
> >

reply via email to

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