[libvirt] [PATCH ] (type ioem) adding mode type = "pvxen" configuration option in to libvirt (XEN)

Gihan Munasinghe GMunasinghe at Xcalibre.co.uk
Tue Feb 3 13:56:31 UTC 2009


Daniel P. Berrange wrote:
> On Thu, Dec 04, 2008 at 10:33:28PM +0000, Gihan Munasinghe wrote:
>   
>> Daniel P. Berrange wrote:
>>     
>>>>     <mac address='00:16:3e:00:a5:01'/>
>>>>     <source bridge='eth0'/>
>>>>     <target dev='vif1.0'/>
>>>> </interface>
>>>>    
>>>>         
>>> As I mentioned before this should be handled with the existing
>>> XML <model> element.
>>>
>>>
>>>  ...no model element...  -> Default QEMU nic + Paravirt Driver backend
>>>  <model type='e1000'/>  -> Only QEMU's e1000 nic
>>>  <model type='rtl8139'/>  -> Only QEMU's rtl8139 nic
>>>  <model type='ne2k_pci'/>  -> Only QEMU's ne2k nic
>>>  <model type='xen'/>       -> Only Paravirt driver backend
>>>
>>>  
>>>       
>>
Supporting pv net drives in XEN patch.
If you define the interface model type as pvxen (<model type ="pvxen">). 
XEN will not load emulated network card
Let me know what you think of the patch

--- xend_internal.c.back        2009-02-02 10:53:31.000000000 +0000
+++ xend_internal.c     2009-02-03 10:02:54.000000000 +0000
@@ -75,6 +75,8 @@
 #define XEND_CONFIG_MIN_VERS_PVFB_NEWCONF 3
 #endif

+#define XEN_PV_NETWORK "pvxen"
+

 #ifndef PROXY
 static int
@@ -5198,12 +5200,25 @@
     if (def->model != NULL)
         virBufferVSprintf(buf, "(model '%s')", def->model);

+   /*Fixing up the model to support XEN pv drivers
+   , if the user XML is defined as <model type="pvxen" > this means that
+    there is a PV driver for network is alredy installed. So xen should 
not
+    emulate the network card */
+
+    if(hvm && (def->model!=NULL) && 
(strcmp(def->model,XEN_PV_NETWORK)==0) ){
+                virBufferAddLit(buf, "(type none)");
+    }else if(hvm){// For any other hvm guest ask XEN to emulate the card
+       virBufferAddLit(buf, "(type ioemu)");
+        if (def->model != NULL)
+        virBufferVSprintf(buf, "(model '%s')", def->model);
+    }
+   
     /*
      * apparently (type ioemu) breaks paravirt drivers on HVM so skip this
      * from Xen 3.1.0
-     */
+    
     if (hvm && xendConfigVersion <= XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU)
-        virBufferAddLit(buf, "(type ioemu)");
+        virBufferAddLit(buf, "(type ioemu)");*/

     if (!isAttach)
         virBufferAddLit(buf, ")");
@@ -5566,3 +5581,4 @@
 }

 #endif /* ! PROXY */
+



Thanks

-- 
Gihan Munasinghe
R&D Team Leader
XCalibre Communications Ltd.
www.flexiscale.com




More information about the libvir-list mailing list