From 56a14938809331372b6cdb2afcb14d9818de4cbf Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 25 Sep 2009 21:42:46 +0200 Subject: drive cleanup fixes. Changes: * drive_uninit() wants a DriveInfo now. * drive_uninit() also calls bdrv_delete(), so callers don't need to do that. * drive_uninit() calls are moved over to the ->exit() callbacks, destroy_bdrvs() is zapped. * setting bdrv->private is not needed any more as the only user (destroy_bdrvs) is gone. * usb-storage needs no drive_uninit, scsi-disk will handle that. Signed-off-by: Gerd Hoffmann Signed-off-by: Anthony Liguori --- hw/device-hotplug.c | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'hw/device-hotplug.c') diff --git a/hw/device-hotplug.c b/hw/device-hotplug.c index 69779caef5..c0cfd31d4d 100644 --- a/hw/device-hotplug.c +++ b/hw/device-hotplug.c @@ -62,21 +62,3 @@ void destroy_nic(dev_match_fn *match_fn, void *arg) } } } - -void destroy_bdrvs(dev_match_fn *match_fn, void *arg) -{ - DriveInfo *dinfo; - struct BlockDriverState *bs; - - QTAILQ_FOREACH(dinfo, &drives, next) { - bs = dinfo->bdrv; - if (bs) { - if (bs->private && match_fn(bs->private, arg)) { - drive_uninit(bs); - bdrv_delete(bs); - } - } - } -} - - -- cgit v1.2.3