diff options
author | Markus Armbruster <armbru@redhat.com> | 2011-01-28 11:21:41 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2011-01-31 10:59:09 +0100 |
commit | 2292ddaeab3467c68efd9e07e17ca0c9fc510fdc (patch) | |
tree | 7977bb2762dc972c8bbf4e2f20d0c034a6772839 /blockdev.h | |
parent | 27d6bf40edc346a61ade6d4c5d4f27f6b40acc81 (diff) |
blockdev: Make drive_add() take explicit type, index parameters
Before, type & index were hidden in printf-like fmt, ... parameters,
which get expanded into an option string. Rather inconvenient for
uses later in this series.
New IF_DEFAULT to ask for the machine's default interface. Before,
that was done by having no option "if" in the option string.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'blockdev.h')
-rw-r--r-- | blockdev.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/blockdev.h b/blockdev.h index cf8fc0112d..0c01e0801e 100644 --- a/blockdev.h +++ b/blockdev.h @@ -19,6 +19,7 @@ void blockdev_auto_del(BlockDriverState *bs); #define BLOCK_SERIAL_STRLEN 20 typedef enum { + IF_DEFAULT = -1, /* for use with drive_add() only */ IF_NONE, IF_IDE, IF_SCSI, IF_FLOPPY, IF_PFLASH, IF_MTD, IF_SD, IF_VIRTIO, IF_XEN, IF_COUNT @@ -43,7 +44,12 @@ DriveInfo *drive_get_next(BlockInterfaceType type); void drive_uninit(DriveInfo *dinfo); DriveInfo *drive_get_by_blockdev(BlockDriverState *bs); -QemuOpts *drive_add(const char *file, const char *fmt, ...) GCC_FMT_ATTR(2, 3); +QemuOpts *drive_def(const char *optstr); +QemuOpts *drive_add(BlockInterfaceType type, int index, const char *file, + const char *fmt, ...) /*GCC_FMT_ATTR(4, 5)*/; + /* GCC_FMT_ATTR() commented out to avoid the (pretty useless) + * "zero-length gnu_printf format string" warning we insist to + * enable */ DriveInfo *drive_init(QemuOpts *arg, int default_to_scsi, int *fatal_error); /* device-hotplug */ |