diff options
Diffstat (limited to 'blockdev.c')
-rw-r--r-- | blockdev.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/blockdev.c b/blockdev.c index e48d33dd29..699f312c9b 100644 --- a/blockdev.c +++ b/blockdev.c @@ -93,6 +93,16 @@ int drive_get_max_bus(BlockInterfaceType type) return max_bus; } +/* Get a block device. This should only be used for single-drive devices + (e.g. SD/Floppy/MTD). Multi-disk devices (scsi/ide) should use the + appropriate bus. */ +DriveInfo *drive_get_next(BlockInterfaceType type) +{ + static int next_block_unit[IF_COUNT]; + + return drive_get(type, 0, next_block_unit[type]++); +} + DriveInfo *drive_get_by_blockdev(BlockDriverState *bs) { DriveInfo *dinfo; |