summaryrefslogtreecommitdiff
path: root/sysemu.h
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2009-07-22 16:42:58 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-07-27 14:08:23 -0500
commit1dae12e6d02f8714c04bc0681ef4527980b13a9a (patch)
tree23ffa374e7c2a043dc545a6e2813afbc0f42ae2c /sysemu.h
parent751c6a17042b5d011013d6963c0505d671cf708e (diff)
add support for drive ids.
-drive accepts the new id= now, allowing to explicitely name your drives. They will show up with that name in "info block" if specified, otherwise the existing namimg scheme is used to autogenerate one. There is also a new function to lookup drives by name. Not used yet. The plan is to link disk drivers and drives using the drive id instead of passing around pointers to BlockDriveState. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'sysemu.h')
-rw-r--r--sysemu.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sysemu.h b/sysemu.h
index e2a8cf5cc3..5bd4214601 100644
--- a/sysemu.h
+++ b/sysemu.h
@@ -161,6 +161,7 @@ typedef enum {
typedef struct DriveInfo {
BlockDriverState *bdrv;
+ char *id;
const char *devaddr;
BlockInterfaceType type;
int bus;
@@ -178,6 +179,7 @@ typedef struct DriveInfo {
extern TAILQ_HEAD(drivelist, DriveInfo) drives;
extern DriveInfo *drive_get(BlockInterfaceType type, int bus, int unit);
+extern DriveInfo *drive_get_by_id(char *id);
extern int drive_get_max_bus(BlockInterfaceType type);
extern void drive_uninit(BlockDriverState *bdrv);
extern void drive_remove(int index);