mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
blockdev: Eliminate drive_del()
drive_del() has become a trivial wrapper around blk_unref(). Get rid of it. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
9ba10c95a4
commit
b9fe8a7a12
4 changed files with 7 additions and 10 deletions
|
@ -27,6 +27,7 @@
|
|||
#include <hw/i386/pc.h>
|
||||
#include <hw/pci/pci.h>
|
||||
#include <hw/isa/isa.h>
|
||||
#include "sysemu/block-backend.h"
|
||||
#include "sysemu/blockdev.h"
|
||||
#include "sysemu/sysemu.h"
|
||||
#include "sysemu/dma.h"
|
||||
|
@ -178,12 +179,13 @@ int pci_piix3_xen_ide_unplug(DeviceState *dev)
|
|||
for (; i < 3; i++) {
|
||||
di = drive_get_by_index(IF_IDE, i);
|
||||
if (di != NULL && !di->media_cd) {
|
||||
BlockBackend *blk = blk_by_legacy_dinfo(di);
|
||||
DeviceState *ds = bdrv_get_attached_dev(di->bdrv);
|
||||
if (ds) {
|
||||
bdrv_detach_dev(di->bdrv, ds);
|
||||
}
|
||||
pci_ide->bus[di->bus].ifs[di->unit].bs = NULL;
|
||||
drive_del(di);
|
||||
blk_unref(blk);
|
||||
}
|
||||
}
|
||||
qdev_reset_all(DEVICE(dev));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue