Skip to contentSkip to conversation

remove default NIC in qemu when no vif configured

PATCH In review Zhai, Edwin 2 participants 2 messages Aug 5, 2008 – Aug 11, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

This simple patch can fix it.

tools/python/xen/xend/image.py +4 -0
diff -r 37ebd7eae0be 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):
Signature · 2 lines
best rgds,
edwin
tools/python/xen/xend/image.py +4 -0
diff -r 37ebd7eae0be 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):

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

Zhai, Edwin writes ("[PATCH][IOEMU] remove default NIC in qemu when no vif configured"):

Quoted 3 lines

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.

Thanks. (I see Keir has applied this.)

Ian.