qemu-option: Move the implied first name into QemuOptsList

We sometimes permit omitting the first option name, for example
-device foo is short for -device driver=foo.  The name to use
("driver" in the example) is passed as argument to qemu_opts_parse().
For each QemuOptsList, we use at most one such name.

Move the name into QemuOptsList, and pass whether to permit the
abbreviation.  This ensures continued consistency, and simplifies the
commit after next in this series.
This commit is contained in:
Markus Armbruster
2010-02-10 19:52:18 +01:00
parent 01e7f18869
commit 8212c64f0e
8 changed files with 24 additions and 13 deletions

View File

@@ -97,6 +97,7 @@ typedef struct QemuOptDesc {
struct QemuOptsList {
const char *name;
const char *implied_opt_name;
QTAILQ_HEAD(, QemuOpts) head;
QemuOptDesc desc[];
};
@@ -118,7 +119,7 @@ const char *qemu_opts_id(QemuOpts *opts);
void qemu_opts_del(QemuOpts *opts);
int qemu_opts_validate(QemuOpts *opts, const QemuOptDesc *desc);
int qemu_opts_do_parse(QemuOpts *opts, const char *params, const char *firstname);
QemuOpts *qemu_opts_parse(QemuOptsList *list, const char *params, const char *firstname);
QemuOpts *qemu_opts_parse(QemuOptsList *list, const char *params, int permit_abbrev);
QemuOpts *qemu_opts_from_qdict(QemuOptsList *list, const QDict *qdict);
QDict *qemu_opts_to_qdict(QemuOpts *opts, QDict *qdict);