Patchwork [2/6] net: net_check_clients() runs too early to see -device, fix

login
register
mail settings
Submitter Markus Armbruster
Date Feb. 11, 2010, 1:44 p.m.
Message ID <1265895902-15664-3-git-send-email-armbru@redhat.com>
Download mbox | patch
Permalink /patch/45130/
State New
Headers show

Comments

Markus Armbruster - Feb. 11, 2010, 1:44 p.m.
Call it right after -device devices get created.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 net.c |    4 +---
 net.h |    1 +
 vl.c  |    2 ++
 3 files changed, 4 insertions(+), 3 deletions(-)

Patch

diff --git a/net.c b/net.c
index f51d376..38b65f4 100644
--- a/net.c
+++ b/net.c
@@ -1275,7 +1275,7 @@  void net_cleanup(void)
     }
 }
 
-static void net_check_clients(void)
+void net_check_clients(void)
 {
     VLANState *vlan;
 
@@ -1323,8 +1323,6 @@  int net_init_clients(void)
         return -1;
     }
 
-    net_check_clients();
-
     return 0;
 }
 
diff --git a/net.h b/net.h
index ecbd812..3467c10 100644
--- a/net.h
+++ b/net.h
@@ -165,6 +165,7 @@  extern const char *legacy_bootp_filename;
 int net_client_init(Monitor *mon, QemuOpts *opts, int is_netdev);
 int net_client_parse(QemuOptsList *opts_list, const char *str);
 int net_init_clients(void);
+void net_check_clients(void);
 void net_cleanup(void);
 void net_set_boot_mask(int boot_mask);
 void net_host_device_add(Monitor *mon, const QDict *qdict);
diff --git a/vl.c b/vl.c
index 98918ac..084604f 100644
--- a/vl.c
+++ b/vl.c
@@ -5897,6 +5897,8 @@  int main(int argc, char **argv, char **envp)
     if (qemu_opts_foreach(&qemu_device_opts, device_init_func, NULL, 1) != 0)
         exit(1);
 
+    net_check_clients();
+
     if (!display_state)
         dumb_display_init();
     /* just use the first displaystate for the moment */