Do not try to use -net user as a default when slirp disabled (Jeremy Fitzhardinge)
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
Thu, 28 Aug 2008 20:05:14 +0000 (20:05 +0000)
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
Thu, 28 Aug 2008 20:05:14 +0000 (20:05 +0000)
When CONFIG_SLIRP is not defined, we should not try to use
-net user as a default.

Patch from Jeremy Fitzhardinge <jeremy@goop.org> (who is a Citrix
staff member).

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5092 c046a42c-6fe2-441c-8c8c-71466251a162

vl.c

diff --git a/vl.c b/vl.c
index 245177a52cf1413a65d70a2bb4deb095f8668917..8dc07082b50dc6c751195c733ffd7323b3798ddf 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -8978,9 +8978,10 @@ int main(int argc, char **argv)
     /* init network clients */
     if (nb_net_clients == 0) {
         /* if no clients, we use a default config */
-        net_clients[0] = "nic";
-        net_clients[1] = "user";
-        nb_net_clients = 2;
+        net_clients[nb_net_clients++] = "nic";
+#ifdef CONFIG_SLIRP
+        net_clients[nb_net_clients++] = "user";
+#endif
     }
 
     for(i = 0;i < nb_net_clients; i++) {