diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2010-08-20 13:52:00 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-08-22 17:11:06 -0500 |
commit | dfe795e71fcbf4f766353f2e76fe227b342fc605 (patch) | |
tree | 06ba414859b3f32551d7c8fd1aa066fdd12db56c /qemu-config.c | |
parent | 916452df46d7c1cec1357d3ec033f540db069156 (diff) |
QemuOpts: allow new option groups be registered at runtime.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'qemu-config.c')
-rw-r--r-- | qemu-config.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/qemu-config.c b/qemu-config.c index 730ffd9be3..e84e15e375 100644 --- a/qemu-config.c +++ b/qemu-config.c @@ -340,7 +340,7 @@ QemuOptsList qemu_cpudef_opts = { }, }; -static QemuOptsList *vm_config_groups[] = { +static QemuOptsList *vm_config_groups[32] = { &qemu_drive_opts, &qemu_chardev_opts, &qemu_device_opts, @@ -372,6 +372,22 @@ QemuOptsList *qemu_find_opts(const char *group) return find_list(vm_config_groups, group); } +void qemu_add_opts(QemuOptsList *list) +{ + int entries, i; + + entries = ARRAY_SIZE(vm_config_groups); + entries--; /* keep list NULL terminated */ + for (i = 0; i < entries; i++) { + if (vm_config_groups[i] == NULL) { + vm_config_groups[i] = list; + return; + } + } + fprintf(stderr, "ran out of space in vm_config_groups"); + abort(); +} + int qemu_set_option(const char *str) { char group[64], id[64], arg[64]; |