]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
xen-block: treat XenbusStateUnknown the same as XenbusStateClosed
authorPaul Durrant <paul.durrant@citrix.com>
Wed, 18 Sep 2019 11:57:02 +0000 (12:57 +0100)
committerAnthony PERARD <anthony.perard@citrix.com>
Fri, 27 Sep 2019 10:21:35 +0000 (11:21 +0100)
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>
(cherry picked from commit ef916ab3ec570eac799be540e499d0123fe61899)

hw/block/xen-block.c

index 69d73196e2a074e771f5fb771649e667b0396f43..ed54db74ad76c31c59cd0fe3e8a4bfc856fbbe46 100644 (file)
@@ -312,6 +312,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);