Commit ef916ab3 authored by Paul Durrant's avatar Paul Durrant Committed by Anthony PERARD
Browse files

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: default avatarMark Syms <mark.syms@citrix.com>
Signed-off-by: default avatarPaul Durrant <paul.durrant@citrix.com>
Acked-by: default avatarAnthony PERARD <anthony.perard@citrix.com>
Reviewed-by: default avatarJohn Snow <jsnow@redhat.com>
Message-Id: <20190918115702.38959-1-paul.durrant@citrix.com>
Signed-off-by: default avatarAnthony PERARD <anthony.perard@citrix.com>
parent 784e9727
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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);