From 45f66e11cc2fd740762e43a5b41318ebc316b471 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Tue, 5 Aug 2008 09:29:42 +0100 Subject: [PATCH] xend: remove default NIC in qemu when no vif configured 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. Signed-off-by: Zhai Edwin --- tools/python/xen/xend/image.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/python/xen/xend/image.py b/tools/python/xen/xend/image.py index 3b1fc4225c..49cce20225 100644 --- a/tools/python/xen/xend/image.py +++ b/tools/python/xen/xend/image.py @@ -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): -- 2.30.2