Re: [libvirt] [libvirt-test-api][PATCH 1/3] introduce 2 functions in utils
It's OK to me, please hongming help review it again. BR, Jianwei - Original Message - From: Luyao Huang lhu...@redhat.com To: libvir-list@redhat.com Cc: Luyao Huang lhu...@redhat.com Sent: Wednesday, April 22, 2015 9:00:55 PM Subject: [libvirt] [libvirt-test-api][PATCH 1/3] introduce 2 functions in utils get_standard_deviation() is to get Standard Deviation, and param_to_tuple_nolength() allow do not pass lengh when use param_to_tuple(). Signed-off-by: Luyao Huang lhu...@redhat.com --- utils/utils.py | 28 1 file changed, 28 insertions(+) diff --git a/utils/utils.py b/utils/utils.py index c3e46f6..954b2bf 100644 --- a/utils/utils.py +++ b/utils/utils.py @@ -31,6 +31,7 @@ import string import subprocess import hashlib import libvirt +import math from xml.dom import minidom from urlparse import urlparse @@ -896,3 +897,30 @@ def validate_remote_blk_type(hostname, username, password, else: logger.info(lspci and lsmod return nothing) return 1 + +def get_standard_deviation(cb1, cb2, opaque1, opaque2, number = 1000): + pass two callback functions and opaque return Standard Deviation, +this function will be useful when need equal some quick change +value (like memory, cputime), default loop times are 1000, +and notice callback functions cb1 and cb2 should allways success + +D = 0 +for i in range(number): +a = cb1(opaque1) +b = cb2(opaque2) +D += (int(a) - int(b))**2 +return math.sqrt(D/number) + +def param_to_tuple_nolength(paramlist): +paramlist contains numbers which can be divided by '-', '^' and + ',', return tuple only have True or False value + +d = [] +a = paramlist.split(',') +for i in range(len(a)): +if a[i].find('^') = 0: +continue +d += a[i].split('-') +lengh = max(d) + +return param_to_tuple(paramlist, int(lengh) + 1) -- 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [libvirt-test-api][PATCH 3/3] fix the logic in getDomainCapabilities
ACKed, thanks. - Original Message - From: Luyao Huang lhu...@redhat.com To: libvir-list@redhat.com Cc: Luyao Huang lhu...@redhat.com Sent: Wednesday, April 22, 2015 9:00:57 PM Subject: [libvirt] [libvirt-test-api][PATCH 3/3] fix the logic in getDomainCapabilities Signed-off-by: Luyao Huang lhu...@redhat.com --- repos/virconn/connection_getDomainCapabilities.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/repos/virconn/connection_getDomainCapabilities.py b/repos/virconn/connection_getDomainCapabilities.py index f0cfa1f..566d3ed 100644 --- a/repos/virconn/connection_getDomainCapabilities.py +++ b/repos/virconn/connection_getDomainCapabilities.py @@ -228,9 +228,7 @@ def check_os(arch, logger): ovmf1 = os.getElementsByTagName('value')[0] ovmf1 = ovmf1.childNodes[0].data logger.debug(Got OVMF path is %s % ovmf1) -if ovmf_f and ovmf1 == OVMF: -pass -else: +if ovmf_f and ovmf1 != OVMF: return False enum = loader.getElementsByTagName('enum') for item in enum: -- 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [libvirt-test-API][PATCH V2 04/11] Add IPv6 section into related network case
Thanks for your correction. - Original Message - From: hongming honzh...@redhat.com To: jiahu ji...@redhat.com, libvir-list@redhat.com Sent: Friday, January 30, 2015 1:17:12 PM Subject: Re: [libvirt] [libvirt-test-API][PATCH V2 04/11] Add IPv6 section into related network case On 01/28/2015 03:14 PM, jiahu wrote: Added 4 IPv6 required parameters to case. --- repos/network/define.py | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/repos/network/define.py b/repos/network/define.py index dd054f7..6e50eb7 100644 --- a/repos/network/define.py +++ b/repos/network/define.py @@ -17,7 +17,12 @@ required_params = ('networkname', 'bridgenetmask', 'netstart', 'netend', - 'netmode',) + 'netmode', + 'netip6addr', + 'netip6prefix', + 'netip6start', + 'netip6end', + ) These ipv6 params should be optional . ACK and Pushed after modifying the patch as follows and getting the correct testing result --- repos/network/create.py | 4 1 file changed, 4 insertions(+) diff --git a/repos/network/create.py b/repos/network/create.py index 399328c..b1b3245 100644 --- a/repos/network/create.py +++ b/repos/network/create.py @@ -19,6 +19,10 @@ required_params = ('networkname', 'netend', 'netmode',) optional_params = {'xml' : 'xmls/network.xml', + 'netip6addr' : '2001 b8:ca2:98::1', + 'netip6prefix' : '64', + 'netip6start' : '2001 b8:ca2:98::11', + 'netip6end' : '2001 b8:ca2:98::ff', } def check_network_status(*args): -- 1.8.3.1 optional_params = {'xml' : 'xmls/network.xml', } -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] docs: vhost-net should instead of net-vhost
It's a minor typo issue, /dev/vhost-net is a default device. # ll /dev/vhost-net crw---. 1 root root 10, 238 Sep 22 20:30 /dev/vhost-net --- docs/formatdomain.html.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 5e2b65a..eefdd5e 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -3989,7 +3989,7 @@ qemu-kvm -net nic,model=? /dev/null lt;source network='default'/gt; lt;target dev='vnet1'/gt; lt;model type='virtio'/gt; - blt;backend tap='/dev/net/tun' vhost='/dev/net-vhost'/gt;/b + blt;backend tap='/dev/net/tun' vhost='/dev/vhost-net'/gt;/b lt;driver name='vhost' txmode='iothread' ioeventfd='on' event_idx='off' queues='5'/gt; lt;/interfacegt; lt;/devicesgt; -- 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] rng: validating tap and vhost attributes separately
When using virt-xml-validate to check tap and vhost attributes in interface of domain xml, should validate them separately, don't combine to check them, we can ignore/specify any of them. --- docs/schemas/domaincommon.rng | 4 1 file changed, 4 insertions(+) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 36bc184..b6b309d 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2313,12 +2313,16 @@ /optional optional element name=backend + optional attribute name='tap' ref name='absFilePath'/ /attribute + /optional + optional attribute name='vhost' ref name='absFilePath'/ /attribute + /optional /element /optional optional -- 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] docs: fix missing forward slash
Should like below: interface type='server' mac address='52:54:00:22:c9:42'/ source address='192.168.0.1' port='5558'/ /interface ... interface type='client' mac address='52:54:00:8b:c9:51'/ source address='192.168.0.1' port='5558'/ /interface --- docs/formatdomain.html.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index bd99ae0..ed17389 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -3701,12 +3701,12 @@ ... lt;devicesgt; lt;interface type='server'gt; - lt;mac address='52:54:00:22:c9:42'gt; + lt;mac address='52:54:00:22:c9:42'/gt; lt;source address='192.168.0.1' port='5558'/gt; lt;/interfacegt; ... lt;interface type='client'gt; - lt;mac address='52:54:00:8b:c9:51'gt; + lt;mac address='52:54:00:8b:c9:51'/gt; lt;source address='192.168.0.1' port='5558'/gt; lt;/interfacegt; lt;/devicesgt; -- 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] Maximum vlanid should be 4095 in interface.rng
The correct vlanid range is 0~4095. After merging this patch, we can not validate a interface xml with vlanid = 4096. [root@localhost ~]# cat vlan.xml interface type='vlan' name='eno1.4096' start mode='onboot'/ protocol family='ipv4' dhcp/ /protocol vlan tag='4096' interface name='eno1'/ /vlan /interface [root@localhost ~]# virt-xml-validate vlan.xml vlan.xml:1: element interface: Relax-NG validity error : Invalid sequence in interleave vlan.xml:6: element vlan: Relax-NG validity error : Element interface failed to validate content vlan.xml:6: element vlan: Relax-NG validity error : Element vlan failed to validate attributes vlan.xml fails to validate [root@localhost ~]# Here is a ip command help on this. [root@localhost /]# ip link add link eno1 name eno1.90 type vlan help Usage: ... vlan [ protocol VLANPROTO ] id VLANID[ FLAG-LIST ] [ ingress-qos-map QOS-MAP ] [ egress-qos-map QOS-MAP ] VLANPROTO: [ 802.1Q / 802.1ad ] VLANID := 0-4095 FLAG-LIST := [ FLAG-LIST ] FLAG FLAG := [ reorder_hdr { on | off } ] [ gvrp { on | off } ] [ mvrp { on | off } ] [ loose_binding { on | off } ] QOS-MAP := [ QOS-MAP ] QOS-MAPPING QOS-MAPPING := FROM:TO --- docs/schemas/interface.rng | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/schemas/interface.rng b/docs/schemas/interface.rng index 80962d4..0f577d6 100644 --- a/docs/schemas/interface.rng +++ b/docs/schemas/interface.rng @@ -440,7 +440,7 @@ define name='vlan-id' data type=unsignedInt - param name=maxInclusive4096/param + param name=maxInclusive4095/param /data /define /grammar -- 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] Clear bandwidth settings for a shutoff domain using domiftune
qemu: To clear bandwidth settings for a shutoff domain by using domiftune. After applying this patch, we can use virsh domiftune command to clear inbound or/and outbound setting for a shutoff domain. for example: virsh domiftune $domain $interface 0 0 Please refer to below virsh help message: man virsh: To clear inbound or outbound settings, use --inbound or --outbound respectfully with average value of zero. --- src/qemu/qemu_driver.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 82a82aa..7db2e9c 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -9983,11 +9983,17 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom, VIR_FREE(persistentNet-bandwidth-in); persistentNet-bandwidth-in = bandwidth-in; bandwidth-in = NULL; +} else { +VIR_FREE(persistentNet-bandwidth-in); +persistentNet-bandwidth-in = 0; } if (bandwidth-out) { VIR_FREE(persistentNet-bandwidth-out); persistentNet-bandwidth-out = bandwidth-out; bandwidth-out = NULL; +} else { +VIR_FREE(persistentNet-bandwidth-out); +persistentNet-bandwidth-out = 0; } } -- 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] Fix missing attribute dscp in supported protocols in nwfilter docs
Added attribute dscp to below supported protocols table in nwfilter docs. IPV4 (ip) TCP/UDP/SCTP (tcp/udp/sctp) ICMP (icmp) IGMP,ESP,AH,UDPLITE,'ALL' (igmp,esp,ah,udplite,all) TCP/UDP/SCTP over IPV6 (tcp-ipv6,udp-ipv6,sctp-ipv6) ICMPV6 (icmpv6) IGMP,ESP,AH,UDPLITE,'ALL' over IPv6 (igmp-ipv6,esp-ipv6,ah-ipv6,udplite-ipv6,all-ipv6) Here is a simple example: [root@localhost ~]# virsh nwfilter-dumpxml myself filter name='myself' chain='root' uuid7192ef51-cd50-4f14-ad7b-fa5c69ea19e3/uuid rule action='accept' direction='in' priority='500' ip dscp='1'/ /rule rule action='accept' direction='in' priority='500' tcp dscp='1'/ /rule rule action='accept' direction='in' priority='500' tcp-ipv6 dscp='2'/ /rule rule action='accept' direction='in' priority='500' icmp dscp='55'/ /rule rule action='accept' direction='in' priority='500' icmpv6 dscp='55'/ /rule rule action='accept' direction='in' priority='500' udp dscp='3'/ /rule rule action='accept' direction='in' priority='500' udp-ipv6 dscp='4'/ /rule rule action='accept' direction='in' priority='500' udplite dscp='5'/ /rule rule action='accept' direction='in' priority='500' udplite-ipv6 dscp='6'/ /rule rule action='accept' direction='in' priority='500' esp dscp='7'/ /rule rule action='accept' direction='in' priority='500' esp-ipv6 dscp='8'/ /rule rule action='accept' direction='in' priority='500' ah dscp='9'/ /rule rule action='accept' direction='in' priority='500' ah-ipv6 dscp='10'/ /rule rule action='accept' direction='in' priority='500' sctp dscp='11'/ /rule rule action='accept' direction='in' priority='500' sctp-ipv6 dscp='55'/ /rule rule action='accept' direction='in' priority='500' igmp dscp='55'/ /rule rule action='accept' direction='in' priority='500' all-ipv6 dscp='55'/ /rule rule action='accept' direction='in' priority='500' all dscp='55'/ /rule /filter --- docs/formatnwfilter.html.in | 35 +++ 1 file changed, 35 insertions(+) diff --git a/docs/formatnwfilter.html.in b/docs/formatnwfilter.html.in index 7169fa9..46b0bfa 100644 --- a/docs/formatnwfilter.html.in +++ b/docs/formatnwfilter.html.in @@ -1101,6 +1101,11 @@ tdEnd of range of valid destination ports; requires codeprotocol/code/td /tr tr + tddscp/td + tdUINT8 (0x0-0x3f, 0 - 63)/td + tdcodepoint within the DS field in the IP header/td + /tr + tr tdcomment span class=since(Since 0.8.5)/span/td tdSTRING/td tdtext with max. 256 characters/td @@ -1284,6 +1289,11 @@ tdEnd of range of valid destination ports/td /tr tr + tddscp/td + tdUINT8 (0x0-0x3f, 0 - 63)/td + tdcodepoint within the DS field in the IP header/td + /tr + tr tdcomment span class=since(Since 0.8.5)/span/td tdSTRING/td tdtext with max. 256 characters/td @@ -1399,6 +1409,11 @@ tdICMP code/td /tr tr + tddscp/td + tdUINT8 (0x0-0x3f, 0 - 63)/td + tdcodepoint within the DS field in the IP header/td + /tr + tr tdcomment span class=since(Since 0.8.5)/span/td tdSTRING/td tdtext with max. 256 characters/td @@ -1498,6 +1513,11 @@ tdEnd of range of destination IP address/td /tr tr + tddscp/td + tdUINT8 (0x0-0x3f, 0 - 63)/td + tdcodepoint within the DS field in the IP header/td + /tr + tr tdcomment span class=since(Since 0.8.5)/span/td tdSTRING/td tdtext with max. 256 characters/td @@ -1604,6 +1624,11 @@ tdEnd of range of valid destination ports/td /tr tr + tddscp/td + tdUINT8 (0x0-0x3f, 0 - 63)/td + tdcodepoint within the DS field in the IP header/td + /tr + tr tdcomment span class=since(Since 0.8.5)/span/td tdSTRING/td tdtext with max. 256 characters/td @@ -1705,6 +1730,11 @@ tdICMPv6 code/td /tr tr + tddscp/td + tdUINT8 (0x0-0x3f, 0 - 63)/td + tdcodepoint within the DS field in the IP header/td + /tr + tr tdcomment span class=since(Since 0.8.5)/span/td tdSTRING/td tdtext with max. 256 characters/td @@ -1789,6 +1819,11 @@ tdEnd of range of destination IP address/td /tr tr + tddscp/td + tdUINT8 (0x0-0x3f, 0 - 63)/td + tdcodepoint within the DS field in the IP header/td + /tr + tr tdcomment span class=since(Since 0.8.5)/span/td tdSTRING/td tdtext with max. 256 characters/td -- 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] Fix typo error attribute name vlan-id should be vlanid in docs
[root@localhost ~]# virsh nwfilter-dumpxml myself filter name='myself' chain='root' uuid7192ef51-cd50-4f14-ad7b-fa5c69ea19e3/uuid rule action='accept' direction='in' priority='500' vlan dstmacaddr='00:11:22:33:44:55' vlanid='44'/ /rule /filter [root@localhost ~]# ebtables -t nat -L Bridge table: nat ... -p 802_1Q -d 0:11:22:33:44:55 --vlan-id 44 -j ACCEPT --- docs/formatnwfilter.html.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/formatnwfilter.html.in b/docs/formatnwfilter.html.in index 45b97f7..7169fa9 100644 --- a/docs/formatnwfilter.html.in +++ b/docs/formatnwfilter.html.in @@ -765,7 +765,7 @@ tdMask applied to MAC address of destination/td /tr tr - tdvlan-id/td + tdvlanid/td tdUINT16 (0x0-0xfff, 0 - 4095)/td tdVLAN ID/td /tr -- 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] To provide more accurate help messages of iface/net/pool-define in virsh help and man virsh
--- tools/virsh-interface.c | 4 ++-- tools/virsh-network.c | 4 ++-- tools/virsh-pool.c | 4 ++-- tools/virsh.pod | 8 +--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/tools/virsh-interface.c b/tools/virsh-interface.c index d4ec854..6b4fd5f 100644 --- a/tools/virsh-interface.c +++ b/tools/virsh-interface.c @@ -507,10 +507,10 @@ cmdInterfaceDumpXML(vshControl *ctl, const vshCmd *cmd) */ static const vshCmdInfo info_interface_define[] = { {.name = help, - .data = N_(define (but don't start) a physical host interface from an XML file) + .data = N_(define (but don't start) or update a physical host interface from an XML file) }, {.name = desc, - .data = N_(Define a physical host interface.) + .data = N_(Define a physical host interface or update an existing one.) }, {.name = NULL} }; diff --git a/tools/virsh-network.c b/tools/virsh-network.c index fc08b09..0db333c 100644 --- a/tools/virsh-network.c +++ b/tools/virsh-network.c @@ -189,10 +189,10 @@ cmdNetworkCreate(vshControl *ctl, const vshCmd *cmd) */ static const vshCmdInfo info_network_define[] = { {.name = help, - .data = N_(define (but don't start) a network from an XML file) + .data = N_(define (but don't start) or update a network from an XML file) }, {.name = desc, - .data = N_(Define a network.) + .data = N_(Define a network or update an existing one.) }, {.name = NULL} }; diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c index 7c40b5b..b0acd89 100644 --- a/tools/virsh-pool.c +++ b/tools/virsh-pool.c @@ -342,10 +342,10 @@ cmdPoolCreateAs(vshControl *ctl, const vshCmd *cmd) */ static const vshCmdInfo info_pool_define[] = { {.name = help, - .data = N_(define (but don't start) a pool from an XML file) + .data = N_(define (but don't start) or update a pool from an XML file) }, {.name = desc, - .data = N_(Define a pool.) + .data = N_(Define a pool or update an existing one.) }, {.name = NULL} }; diff --git a/tools/virsh.pod b/tools/virsh.pod index 849ae31..8086885 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -2472,7 +2472,8 @@ to get a description of the XML network format used by libvirt. =item Bnet-define Ifile Define a persistent virtual network from an XML Ifile, the network is just -defined but not instantiated (started). +defined but not instantiated (started). If a persistent virtual network with +the same name and UUID already exists, it will be replaced with the new XML. =item Bnet-destroy Inetwork @@ -2631,7 +2632,7 @@ See also Biface-unbridge for undoing this operation. =item Biface-define Ifile Define a host interface from an XML Ifile, the interface is just defined but -not started. +not started. If a host interface with the same name already exists, it will be replaced with the new XML. =item Biface-destroy Iinterface @@ -2778,7 +2779,8 @@ Itype. =item Bpool-define Ifile -Create, but do not start, a pool object from the XML Ifile. +Create, but do not start, a pool object from the XML Ifile. If a pool object +with the same name and UUID already exists, it will be replaced with the new XML. =item Bpool-define-as Iname I--print-xml Itype [Isource-host] [Isource-path] [Isource-dev] [Isource-name] [target] -- 1.8.1.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list