mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
net: do not exit on "netdev_add help" monitor command
"netdev_add help" is causing QEMU to exit because the code that invokes show_netdevs is shared between CLI and HMP processing. Move the check to the callers so that exit(0) remains only in the CLI flow. "netdev_add help" is not fixed by this patch; that is left for later work. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
parent
c2cb511634
commit
ad6f932fe8
3 changed files with 43 additions and 36 deletions
|
@ -24,6 +24,7 @@
|
|||
#include "qemu/option.h"
|
||||
#include "qemu/timer.h"
|
||||
#include "qemu/sockets.h"
|
||||
#include "qemu/help_option.h"
|
||||
#include "monitor/monitor-internal.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/clone-visitor.h"
|
||||
|
@ -1631,7 +1632,12 @@ void hmp_netdev_add(Monitor *mon, const QDict *qdict)
|
|||
{
|
||||
Error *err = NULL;
|
||||
QemuOpts *opts;
|
||||
const char *type = qdict_get_try_str(qdict, "type");
|
||||
|
||||
if (type && is_help_option(type)) {
|
||||
show_netdevs();
|
||||
return;
|
||||
}
|
||||
opts = qemu_opts_from_qdict(qemu_find_opts("netdev"), qdict, &err);
|
||||
if (err) {
|
||||
goto out;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue