[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 6/7] xen-block: treat XenbusStateUnknown the same as XenbusStateCl
From: |
Anthony PERARD |
Subject: |
[PULL 6/7] xen-block: treat XenbusStateUnknown the same as XenbusStateClosed |
Date: |
Tue, 24 Sep 2019 12:30:25 +0100 |
From: Paul Durrant <address@hidden>
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 <address@hidden>
Signed-off-by: Paul Durrant <address@hidden>
Acked-by: Anthony PERARD <address@hidden>
Reviewed-by: John Snow <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Anthony PERARD <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);
--
Anthony PERARD
- [PULL 0/7] xen queue 2019-09-24, Anthony PERARD, 2019/09/24
- [PULL 6/7] xen-block: treat XenbusStateUnknown the same as XenbusStateClosed,
Anthony PERARD <=
- [PULL 1/7] xen-bus: check whether the frontend is active during device reset..., Anthony PERARD, 2019/09/24
- [PULL 5/7] MAINTAINERS: update my email address, Anthony PERARD, 2019/09/24
- [PULL 2/7] xen / notify: introduce a new XenWatchList abstraction, Anthony PERARD, 2019/09/24
- [PULL 7/7] xen-bus: only set the xen device frontend state if it is missing, Anthony PERARD, 2019/09/24
- [PULL 4/7] xen: perform XenDevice clean-up in XenBus watch handler, Anthony PERARD, 2019/09/24
- [PULL 3/7] xen: introduce separate XenWatchList for XenDevice objects, Anthony PERARD, 2019/09/24
- Re: [PULL 0/7] xen queue 2019-09-24, Peter Maydell, 2019/09/25