WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] libxl: Specify no nics to qemu when no emulated nics

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] libxl: Specify no nics to qemu when no emulated nics
From: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
Date: Mon, 28 Jun 2010 16:17:56 +0100
Cc: george.dunlap@xxxxxxxxxxxxx
Delivery-date: Mon, 28 Jun 2010 08:19:29 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.4.3
qemu will default to one emulated NIC if no network configuration is
specified on the command-line.  If there are no emualted NICs (i.e.,
no NICs or all NICs are PV), specify no nics to avoid getting an
emulated NIC by default.

Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>

diff -r bf64e1081333 -r 67e4cfb20569 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Fri Jun 25 16:05:20 2010 +0100
+++ b/tools/libxl/libxl.c       Mon Jun 28 16:17:32 2010 +0100
@@ -858,6 +858,8 @@
         flexarray_set(dm_args, num++, info->serial);
     }
     if (info->type == XENFV) {
+        int ioemu_vifs = 0;
+
         if (info->videoram) {
             flexarray_set(dm_args, num++, "-videoram");
             flexarray_set(dm_args, num++, libxl_sprintf(ctx, "%d", 
info->videoram));
@@ -901,8 +903,14 @@
                 flexarray_set(dm_args, num++, "-net");
                 flexarray_set(dm_args, num++, libxl_sprintf(ctx, 
"tap,vlan=%d,ifname=%s,bridge=%s",
                             vifs[i].devid, vifs[i].ifname, vifs[i].bridge));
+                ioemu_vifs++;
             }
         }
+        /* If we have no emulated nics, tell qemu not to create any */
+        if ( ioemu_vifs == 0 ) {
+            flexarray_set(dm_args, num++, "-net");
+            flexarray_set(dm_args, num++, "none");
+        }
     }
     if (info->saved_state) {
         flexarray_set(dm_args, num++, "-loadvm");

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] libxl: Specify no nics to qemu when no emulated nics, George Dunlap <=