[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 1/7] xen-bus: check whether the frontend is active during device r
From: |
Anthony PERARD |
Subject: |
[PULL 1/7] xen-bus: check whether the frontend is active during device reset... |
Date: |
Tue, 24 Sep 2019 12:30:20 +0100 |
From: Paul Durrant <address@hidden>
...not the backend
Commit cb323146 "xen-bus: Fix backend state transition on device reset"
contained a subtle mistake. The hunk
@@ -539,11 +556,11 @@ static void xen_device_backend_changed(void *opaque)
/*
* If the toolstack (or unplug request callback) has set the backend
- * state to Closing, but there is no active frontend (i.e. the
- * state is not Connected) then set the backend state to Closed.
+ * state to Closing, but there is no active frontend then set the
+ * backend state to Closed.
*/
if (xendev->backend_state == XenbusStateClosing &&
- xendev->frontend_state != XenbusStateConnected) {
+ !xen_device_state_is_active(state)) {
xen_device_backend_set_state(xendev, XenbusStateClosed);
}
mistakenly replaced the check of 'xendev->frontend_state' with a check
(now in a helper function) of 'state', which actually equates to
'xendev->backend_state'.
This patch fixes the mistake.
Fixes: cb3231460747552d70af9d546dc53d8195bcb796
Signed-off-by: Paul Durrant <address@hidden>
Reviewed-by: Anthony PERARD <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Anthony PERARD <address@hidden>
---
hw/xen/xen-bus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/xen/xen-bus.c b/hw/xen/xen-bus.c
index a04478ad4f..025df5e59f 100644
--- a/hw/xen/xen-bus.c
+++ b/hw/xen/xen-bus.c
@@ -560,7 +560,7 @@ static void xen_device_backend_changed(void *opaque)
* backend state to Closed.
*/
if (xendev->backend_state == XenbusStateClosing &&
- !xen_device_state_is_active(state)) {
+ !xen_device_state_is_active(xendev->frontend_state)) {
xen_device_backend_set_state(xendev, XenbusStateClosed);
}
--
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, 2019/09/24
- [PULL 1/7] xen-bus: check whether the frontend is active during device reset...,
Anthony PERARD <=
- [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