summaryrefslogtreecommitdiffstats
path: root/hw/block/xen-block.c
diff options
context:
space:
mode:
authorPaul Durrant2019-09-18 13:57:02 +0200
committerAnthony PERARD2019-09-24 13:21:11 +0200
commitef916ab3ec570eac799be540e499d0123fe61899 (patch)
treeb7f82c1e1e48b57afcc2ceaf7b7e68d7e2598732 /hw/block/xen-block.c
parentMAINTAINERS: update my email address (diff)
downloadqemu-ef916ab3ec570eac799be540e499d0123fe61899.tar.gz
qemu-ef916ab3ec570eac799be540e499d0123fe61899.tar.xz
qemu-ef916ab3ec570eac799be540e499d0123fe61899.zip
xen-block: treat XenbusStateUnknown the same as XenbusStateClosed
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. 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> Acked-by: Anthony PERARD <anthony.perard@citrix.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-Id: <20190918115702.38959-1-paul.durrant@citrix.com> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Diffstat (limited to 'hw/block/xen-block.c')
-rw-r--r--hw/block/xen-block.c1
1 files changed, 1 insertions, 0 deletions
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);