From: "Zhai, Edwin" Subject: [PATCH][IOEMU] remove default NIC in qemu when no vif configured Date: Tue, 5 Aug 2008 16:26:25 +0800 Message-ID: <20080805082625.GG22375@edwin-srv.sh.intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0eh6TmSyL6TZE2Uz" Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Jackson Cc: xen-devel@lists.xensource.com, "Zhai, Edwin" List-Id: xen-devel@lists.xenproject.org --0eh6TmSyL6TZE2Uz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Latest QEMU would add a NIC device by default, unless specify the "-nic none". So end user still get a unusable NIC even no vif in the config file. This simple patch can fix it. Signed-off-by: Zhai Edwin diff -r 37ebd7eae0be tools/python/xen/xend/image.py --- a/tools/python/xen/xend/image.py Tue Apr 15 17:23:39 2008 +0800 +++ b/tools/python/xen/xend/image.py Tue Aug 05 16:04:08 2008 +0800 @@ -777,6 +777,10 @@ class HVMImageHandler(ImageHandler): ret.append("tap,vlan=%d,ifname=tap%d.%d,bridge=%s" % (nics, self.vm.getDomid(), nics-1, bridge)) + if nics == 0: + ret.append("-net") + ret.append("none") + return ret def getDeviceModelArgs(self, restore = False): -- best rgds, edwin --0eh6TmSyL6TZE2Uz Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="qemu_no_nic_fix.patch" diff -r 37ebd7eae0be tools/python/xen/xend/image.py --- a/tools/python/xen/xend/image.py Tue Apr 15 17:23:39 2008 +0800 +++ b/tools/python/xen/xend/image.py Tue Aug 05 16:04:08 2008 +0800 @@ -777,6 +777,10 @@ class HVMImageHandler(ImageHandler): ret.append("tap,vlan=%d,ifname=tap%d.%d,bridge=%s" % (nics, self.vm.getDomid(), nics-1, bridge)) + if nics == 0: + ret.append("-net") + ret.append("none") + return ret def getDeviceModelArgs(self, restore = False): --0eh6TmSyL6TZE2Uz Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --0eh6TmSyL6TZE2Uz--