qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paul Durrant <Paul.Durrant@citrix.com>
To: 'John Snow' <jsnow@redhat.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"qemu-block@nongnu.org" <qemu-block@nongnu.org>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Anthony Perard <anthony.perard@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Mark Syms <Mark.Syms@citrix.com>, Max Reitz <mreitz@redhat.com>
Subject: RE: [Qemu-block] [PATCH] xen-block: treat XenbusStateUnknown the same as XenbusStateClosed
Date: Mon, 23 Sep 2019 09:38:20 +0000	[thread overview]
Message-ID: <46f838982f7d448b86391bc48e9d8179@AMSPEX02CL03.citrite.net> (raw)
In-Reply-To: <d02b4f9a-4277-6aaf-324d-2c7958878690@redhat.com>

> -----Original Message-----
> From: John Snow <jsnow@redhat.com>
> Sent: 20 September 2019 22:11
> To: Paul Durrant <Paul.Durrant@citrix.com>; xen-devel@lists.xenproject.org; qemu-devel@nongnu.org;
> qemu-block@nongnu.org
> Cc: Kevin Wolf <kwolf@redhat.com>; Stefano Stabellini <sstabellini@kernel.org>; Max Reitz
> <mreitz@redhat.com>; Anthony Perard <anthony.perard@citrix.com>; Mark Syms <Mark.Syms@citrix.com>
> 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 <mark.syms@citrix.com>
> > Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
> > ---
> > Cc: Stefano Stabellini <sstabellini@kernel.org>
> > Cc: Anthony Perard <anthony.perard@citrix.com>
> > Cc: Kevin Wolf <kwolf@redhat.com>
> > Cc: Max Reitz <mreitz@redhat.com>
> > ---
> >  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	other threads:[~2019-09-23 13:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-18 11:57 [Qemu-devel] [PATCH] xen-block: treat XenbusStateUnknown the same as XenbusStateClosed Paul Durrant
2019-09-20 21:10 ` [Qemu-block] " John Snow
2019-09-23  9:38   ` Paul Durrant [this message]
2019-09-23 17:08     ` John Snow
2019-09-23 11:34 ` Anthony PERARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46f838982f7d448b86391bc48e9d8179@AMSPEX02CL03.citrite.net \
    --to=paul.durrant@citrix.com \
    --cc=Mark.Syms@citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).