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
This commit is contained in:
Justin T. Gibbs 2012-02-17 22:33:46 +00:00
parent babc7c1258
commit 45cbfcdabc

View file

@ -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",