mirror of https://github.com/xqemu/xqemu.git
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>
This commit is contained in:
parent
916452df46
commit
dfe795e71f
|
@ -340,7 +340,7 @@ QemuOptsList qemu_cpudef_opts = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static QemuOptsList *vm_config_groups[] = {
|
static QemuOptsList *vm_config_groups[32] = {
|
||||||
&qemu_drive_opts,
|
&qemu_drive_opts,
|
||||||
&qemu_chardev_opts,
|
&qemu_chardev_opts,
|
||||||
&qemu_device_opts,
|
&qemu_device_opts,
|
||||||
|
@ -372,6 +372,22 @@ QemuOptsList *qemu_find_opts(const char *group)
|
||||||
return find_list(vm_config_groups, 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)
|
int qemu_set_option(const char *str)
|
||||||
{
|
{
|
||||||
char group[64], id[64], arg[64];
|
char group[64], id[64], arg[64];
|
||||||
|
|
|
@ -16,6 +16,7 @@ extern QemuOptsList qemu_mon_opts;
|
||||||
extern QemuOptsList qemu_cpudef_opts;
|
extern QemuOptsList qemu_cpudef_opts;
|
||||||
|
|
||||||
QemuOptsList *qemu_find_opts(const char *group);
|
QemuOptsList *qemu_find_opts(const char *group);
|
||||||
|
void qemu_add_opts(QemuOptsList *list);
|
||||||
int qemu_set_option(const char *str);
|
int qemu_set_option(const char *str);
|
||||||
int qemu_global_option(const char *str);
|
int qemu_global_option(const char *str);
|
||||||
void qemu_add_globals(void);
|
void qemu_add_globals(void);
|
||||||
|
|
Loading…
Reference in New Issue