diff mbox series

[12/29] vl: create "-net nic -net user" default earlier

Message ID 20201027182144.3315885-13-pbonzini@redhat.com
State Superseded
Headers show
Series cleanup qemu_init and make sense of command line processing | expand

Commit Message

Paolo Bonzini Oct. 27, 2020, 6:21 p.m. UTC
Create it together with other default backends, even though the processing is
done later.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 softmmu/vl.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Igor Mammedov Nov. 18, 2020, 2:43 p.m. UTC | #1
On Tue, 27 Oct 2020 14:21:27 -0400
Paolo Bonzini <pbonzini@redhat.com> wrote:

> Create it together with other default backends, even though the processing is

> done later.

> 

> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


Reviewed-by: Igor Mammedov <imammedo@redhat.com>


> ---

>  softmmu/vl.c | 16 ++++++++--------

>  1 file changed, 8 insertions(+), 8 deletions(-)

> 

> diff --git a/softmmu/vl.c b/softmmu/vl.c

> index 6749109b29..f643333f7e 100644

> --- a/softmmu/vl.c

> +++ b/softmmu/vl.c

> @@ -4254,6 +4254,14 @@ void qemu_init(int argc, char **argv, char **envp)

>              monitor_parse("vc:80Cx24C", "readline", false);

>      }

>  

> +    if (default_net) {

> +        QemuOptsList *net = qemu_find_opts("net");

> +        qemu_opts_set(net, NULL, "type", "nic", &error_abort);

> +#ifdef CONFIG_SLIRP

> +        qemu_opts_set(net, NULL, "type", "user", &error_abort);

> +#endif

> +    }

> +

>  #if defined(CONFIG_VNC)

>      if (!QTAILQ_EMPTY(&(qemu_find_opts("vnc")->head))) {

>          display_remote++;

> @@ -4389,14 +4397,6 @@ void qemu_init(int argc, char **argv, char **envp)

>          semihosting_arg_fallback(kernel_filename, kernel_cmdline);

>      }

>  

> -    if (default_net) {

> -        QemuOptsList *net = qemu_find_opts("net");

> -        qemu_opts_set(net, NULL, "type", "nic", &error_abort);

> -#ifdef CONFIG_SLIRP

> -        qemu_opts_set(net, NULL, "type", "user", &error_abort);

> -#endif

> -    }

> -

>      if (net_init_clients(&err) < 0) {

>          error_report_err(err);

>          exit(1);
diff mbox series

Patch

diff --git a/softmmu/vl.c b/softmmu/vl.c
index 6749109b29..f643333f7e 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -4254,6 +4254,14 @@  void qemu_init(int argc, char **argv, char **envp)
             monitor_parse("vc:80Cx24C", "readline", false);
     }
 
+    if (default_net) {
+        QemuOptsList *net = qemu_find_opts("net");
+        qemu_opts_set(net, NULL, "type", "nic", &error_abort);
+#ifdef CONFIG_SLIRP
+        qemu_opts_set(net, NULL, "type", "user", &error_abort);
+#endif
+    }
+
 #if defined(CONFIG_VNC)
     if (!QTAILQ_EMPTY(&(qemu_find_opts("vnc")->head))) {
         display_remote++;
@@ -4389,14 +4397,6 @@  void qemu_init(int argc, char **argv, char **envp)
         semihosting_arg_fallback(kernel_filename, kernel_cmdline);
     }
 
-    if (default_net) {
-        QemuOptsList *net = qemu_find_opts("net");
-        qemu_opts_set(net, NULL, "type", "nic", &error_abort);
-#ifdef CONFIG_SLIRP
-        qemu_opts_set(net, NULL, "type", "user", &error_abort);
-#endif
-    }
-
     if (net_init_clients(&err) < 0) {
         error_report_err(err);
         exit(1);