summaryrefslogtreecommitdiffstats
path: root/sys/dev/xen/blkback
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>2012-02-17 22:33:46 +0000
committergibbs <gibbs@FreeBSD.org>2012-02-17 22:33:46 +0000
commitb7cff9346353517bc204fe45512c010fcab10186 (patch)
treefbb385cf4bc9bfc5c8a9712803b42d3d28a6f74f /sys/dev/xen/blkback
parent76a02d0f90718d7b7529bec05bc6140d2cb9ad44 (diff)
downloadFreeBSD-src-b7cff9346353517bc204fe45512c010fcab10186.zip
FreeBSD-src-b7cff9346353517bc204fe45512c010fcab10186.tar.gz
Fix regression in the handling of blkback close events for
devices that are unplugged via QEMU. sys/dev/xen/blkback/blkback.c: Toolstack initiated closures change the frontend's state to Closing. The backend must change to Closing as well, even if we can't actually close yet, in order for the frontend to notice and start the closing process. MFC after: 3 days
Diffstat (limited to 'sys/dev/xen/blkback')
-rw-r--r--sys/dev/xen/blkback/blkback.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/dev/xen/blkback/blkback.c b/sys/dev/xen/blkback/blkback.c
index 15e5a29..c2e5b30 100644
--- a/sys/dev/xen/blkback/blkback.c
+++ b/sys/dev/xen/blkback/blkback.c
@@ -3955,16 +3955,12 @@ xbb_frontend_changed(device_t dev, XenbusState frontend_state)
xbb_connect(xbb);
break;
case XenbusStateClosing:
- /*
- * Frontend has acknowledged Closing request.
- * Wait for Closed state.
- */
- break;
case XenbusStateClosed:
mtx_lock(&xbb->lock);
xbb_shutdown(xbb);
mtx_unlock(&xbb->lock);
- xenbus_set_state(xbb->dev, XenbusStateClosed);
+ if (frontend_state == XenbusStateClosed)
+ xenbus_set_state(xbb->dev, XenbusStateClosed);
break;
default:
xenbus_dev_fatal(xbb->dev, EINVAL, "saw state %d at frontend",
OpenPOWER on IntegriCloud