mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
qdev: Fix exit code for -device ?
Help was shoehorned into device creation, qdev_device_add(). Since help doesn't create a device, it returns NULL, which looks to callers just like failed device creation. Monitor handler do_device_add() doesn't care, but main() exits unsuccessfully. Move help out of device creation, into new qdev_device_help(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
4a2594ddd3
commit
ff952ba25d
3 changed files with 28 additions and 9 deletions
8
vl.c
8
vl.c
|
@ -4459,6 +4459,11 @@ char *qemu_find_file(int type, const char *name)
|
|||
return buf;
|
||||
}
|
||||
|
||||
static int device_help_func(QemuOpts *opts, void *opaque)
|
||||
{
|
||||
return qdev_device_help(opts);
|
||||
}
|
||||
|
||||
static int device_init_func(QemuOpts *opts, void *opaque)
|
||||
{
|
||||
DeviceState *dev;
|
||||
|
@ -5828,6 +5833,9 @@ int main(int argc, char **argv, char **envp)
|
|||
|
||||
module_call_init(MODULE_INIT_DEVICE);
|
||||
|
||||
if (qemu_opts_foreach(&qemu_device_opts, device_help_func, NULL, 0) != 0)
|
||||
exit(0);
|
||||
|
||||
if (watchdog) {
|
||||
i = select_watchdog(watchdog);
|
||||
if (i > 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue