From: Markus Armbruster Date: Fri, 28 Jan 2011 10:21:44 +0000 (+0100) Subject: blockdev: New drive_get_by_index() X-Git-Tag: TizenStudio_2.0_p2.3~3484 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cb9ad44cff2dc365229e90a0aaa4cf0637c46a71;p=sdk%2Femulator%2Fqemu.git blockdev: New drive_get_by_index() Signed-off-by: Markus Armbruster Signed-off-by: Kevin Wolf --- diff --git a/blockdev.c b/blockdev.c index a42c5e4..01228f6 100644 --- a/blockdev.c +++ b/blockdev.c @@ -136,6 +136,13 @@ DriveInfo *drive_get(BlockInterfaceType type, int bus, int unit) return NULL; } +DriveInfo *drive_get_by_index(BlockInterfaceType type, int index) +{ + return drive_get(type, + drive_index_to_bus_id(type, index), + drive_index_to_unit_id(type, index)); +} + int drive_get_max_bus(BlockInterfaceType type) { int max_bus; diff --git a/blockdev.h b/blockdev.h index 0c01e08..18278cc 100644 --- a/blockdev.h +++ b/blockdev.h @@ -39,6 +39,7 @@ struct DriveInfo { }; DriveInfo *drive_get(BlockInterfaceType type, int bus, int unit); +DriveInfo *drive_get_by_index(BlockInterfaceType type, int index); int drive_get_max_bus(BlockInterfaceType type); DriveInfo *drive_get_next(BlockInterfaceType type); void drive_uninit(DriveInfo *dinfo);