Yeah, I found this issue has been solved by the early patch from John after git pull. Sorry working on other things so long that I am out of date :-) Please drop this patch and I think my works on libvirt-cim could work well based on upstream of
cimtest.

Thanks,
Xu Wang
于 2013/10/2 0:34, Viktor Mihajlovski 写道:
On 09/26/2013 09:28 AM, Xu Wang wrote:
The name of interface should be read based on the type of it. There
are two basic types for interface device (bridge and network). The
name should be fetched in different way. I don't clear if Xen could
support network type so I didn't make any change for it and just
enhanced the logic in "virt == 'KVM'". I'll submit a set of patches
and they solved XFAIL of VirtualSystemManagementService/
22_addmulti_brg_interface.py. So it's necessary to fix it.

Signed-off-by: Xu Wang <[email protected]>
---
suites/libvirt-cim/lib/XenKvmLib/vsms_util.py | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/suites/libvirt-cim/lib/XenKvmLib/vsms_util.py b/suites/libvirt-cim/lib/XenKvmLib/vsms_util.py
index 075c09f..7839a38 100644
--- a/suites/libvirt-cim/lib/XenKvmLib/vsms_util.py
+++ b/suites/libvirt-cim/lib/XenKvmLib/vsms_util.py
@@ -189,10 +189,19 @@ def add_net_res(server, service, virt, cxml, vssd_ref, nasd, attr):
% attr['nmac'])

if virt == "KVM":
- name = cxml.get_value_xpath(
+ if attr['ntype'] == "network":
+ name = cxml.get_value_xpath(
'/domain/devices/interface/source/@network[. = "%s"]'
% attr['net_name'])
-
+ elif attr['ntype'] == "bridge":
+ br = get_bridge_from_network_xml(attr['net_name'], server, virt)
+ name = cxml.get_value_xpath(
+ '/domain/devices/interface/source/@bridge[. = "%s"]'
+ % br)
+ if name != None:
+ name = attr['net_name']
+ else:
+ logger.error("Unrecognized interface type: %s" % type)
else:
# For Xen, network interfaces are converted to bridge interfaces.
br = get_bridge_from_network_xml(attr['net_name'], server, virt)

Hi Xu Wang,

I was trying to apply the patch on master but failed doing so. Maybe you
will need to rebase it onto current upstream? I have seen that John
Ferlan has committed something in May which looks similar to your
changes, naturally leading to a conflict.


_______________________________________________
Libvirt-cim mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libvirt-cim

Reply via email to