[Libvirt-cim] [PATCH] [TEST]Removing the set_bridge() function from the XenFVXML file

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Tue Apr 8 18:10:51 UTC 2008


Deepti B. Kalakeri wrote:
> # HG changeset patch
> # User Deepti B. Kalakeri <deeptik at linux.vnet.ibm.com>
> # Date 1207651811 -19800
> # Node ID 7b3c5acdddf0cb83c8135903b5148962a32cab81
> # Parent  851b6729397e782b7ac6fbadee849ee7da9b16d3
> [TEST]Removing the set_bridge() function from the XenFVXML file.
> 
> This is not required as set_vbridge() of XenFVXML can be used for the same.
> 
> Signed-off-by: Deepti B. Kalakeri <deeptik at linux.vnet.ibm.com>
> 
> diff -r 851b6729397e -r 7b3c5acdddf0 suites/libvirt-cim/lib/XenKvmLib/vxml.py
> --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py	Mon Apr 07 08:27:46 2008 -0700
> +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py	Tue Apr 08 16:20:11 2008 +0530
> @@ -544,7 +544,6 @@ class XenFVXML(VirtXML):
> 
>          interface = self.add_sub_node(devices, 'interface', type=net_type)
>          self.add_sub_node(interface, 'mac', address=net_mac)
> -        self.set_bridge(CIM_IP)
> 
>          disk = self.add_sub_node(devices, 'disk', type='file')
>          self.add_sub_node(disk, 'source', file=disk_img)
> 

I don't understand the need for this change.  _devices() gets called as 
part of the __init__ for the class.  It generates the source tag in for 
the guest's XML.  Removing this would mean the interface type is set to 
bridge, but then the bridge isn't set properly.

Here's the difference in XML generated:

With the patch:
<interface type="bridge">
  <mac address="00:16:3e:5d:c7:9e"/>
</interface>

Without the patch:
<interface type="bridge">
  <mac address="00:16:3e:5d:c7:9e"/>
  <source bridge="testbridge"/>
</interface>

I am able to define both XMLs just fine.  Here's the values returned 
from dumpxml:

With the patch:
     <interface type='ethernet'>
       <target dev='vif-1.0'/>
       <mac address='00:16:3e:5d:c7:9e'/>
     </interface>

Without the patch:
     <interface type='bridge'>
       <source bridge='testbridge'/>
       <target dev='vif-1.0'/>
       <mac address='00:16:3e:5d:c7:9e'/>
     </interface>

For the sake of consistency, since we define the interface type as 
bridge, I think we should set the bridge.  Otherwise, the interface is 
really just an ethernet type interface since we don't specify the bridge 
properly.

-- 
Kaitlin Rupert
IBM Linux Technology Center
kaitlin at linux.vnet.ibm.com




More information about the Libvirt-cim mailing list