xen: handle backend deletion from xenstore

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
This commit is contained in:
Stefano Stabellini 2012-03-30 14:33:03 +00:00
parent 9468e9c41a
commit 77ba8fef89
2 changed files with 13 additions and 8 deletions

View file

@ -745,6 +745,10 @@ static int blk_free(struct XenDevice *xendev)
struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev);
struct ioreq *ioreq;
if (blkdev->bs || blkdev->sring) {
blk_disconnect(xendev);
}
while (!QLIST_EMPTY(&blkdev->freelist)) {
ioreq = QLIST_FIRST(&blkdev->freelist);
QLIST_REMOVE(ioreq, list);