libvirt/tests
Stefan Berger a8f75d2c7d vepa: parsing for 802.1Qb{g|h} XML
This patch parses the following two XML descriptions, one for
802.1Qbg and one for 802.1Qbh, and stores the data internally.
The actual triggering of the switch setup protocol has not been
implemented here but the relevant code to do that should go into
the functions associatePortProfileId() and disassociatePortProfileId().

   <interface type='direct'>
      <source dev='eth0.100' mode='vepa'/>
      <model type='virtio'/>
      <virtualport type='802.1Qbg'>
        <parameters managerid='12' typeid='0x123456' typeidversion='1'
         instanceid='fa9b7fff-b0a0-4893-8e0e-beef4ff18f8f'/>
      </virtualport>
      <filterref filter='clean-traffic'/>
    </interface>

    <interface type='direct'>
      <source dev='eth0.100' mode='vepa'/>
      <model type='virtio'/>
      <virtualport type='802.1Qbh'>
        <parameters profileid='my_profile'/>
      </virtualport>
    </interface>

I'd suggest to use this patch as a base for triggering the setup
protocol with the 802.1Qb{g|h} switch.

Several rounds of changes were made to this patch. The
following is a list of these changes.
- Renamed structure virVirtualPortProfileDef to virVirtualPortProfileParams
  as per Daniel Berrange's request
- Addressing Daniel Berrange's comments:
 - removing macvtap.h's dependency on domain_conf.h by
   moving the virVirtualPortProfileDef structure into macvtap.h
   and not passing virtDomainNetDefPtr to any functions in
   macvtap.c
- Addressed most of Chris Wright's comments:
  - indicating error in case virtualport XML node cannot be parsed
    properly
  - parsing hex and decimal numbers using virStrToLong_ui() with
    parameter '0' for base
  - tgifname (target interface name) variable wasn't necessary
    to pass to openMacvtapTap function anymore
- assigning the virtual port data structure to the virDomainNetDef
  only if it was previously parsed
- make sure that the error code returned by openMacvtapTap() is a negative n
  in case the associatePortProfileId() function failed.
- renaming vsi in the XML to virtualport
- replace all occurrences of vsi in the source as well
- removing mode and MAC address parameters from the functions that
  will communicate with the hareware diretctly or indirectly
- moving the associate and disassociate functions to the end of the
  file for subsequent patches to easier make them generally available
  for export
- passing the macvtap interface name rather than the link device since
  this otherwise gives funny side effects when using netlink messages
  where IFLA_IFNAME and IFLA_ADDRESS are specified and the link dev
  all of a sudden gets the MAC address of the macvtap interface.
- Removing rc = -1 error indications in the case of 802.1Qbg|h setup in case
  we wanted to use hook scripts for the setup and so the setup doesn't fail
  here.
- if instance ID UUID is not supplied it will automatically be generated
  - adapted schema to make instance ID UUID optional
  - added test case
- parser and XML generator have been separated into their own
  functions so they can be re-used elsewhere (passthrough case
  for example)
- Adapted XML parser and generator support the above shown type
  (802.1Qbg, 802.1Qbh).
- Adapted schema to above XML
- Adapted test XML to above XML
- Passing through the VM's UUID which seems to be necessary for
  802.1Qbh -- sorry no host UUID
- adding virtual function ID to association function, in case it's
  necessary to use (for SR-IOV)
2010-05-25 17:37:00 -04:00
..
capabilityschemadata Add a more featureful qemu capabilities test data 2009-09-10 12:25:42 +01:00
confdata Expose a host UUID in the capabilities XML 2010-05-25 17:09:18 +01:00
domainschemadata vepa: parsing for 802.1Qb{g|h} XML 2010-05-25 17:37:00 -04:00
domainsnapshotxml2xmlin Domain snapshot RNG and tests. 2010-05-20 13:50:03 -04:00
domainsnapshotxml2xmlout Domain snapshot RNG and tests. 2010-05-20 13:50:03 -04:00
interfaceschemadata Update interface.rng and xml test files to match netcf 0.1.5 2010-01-19 21:13:03 +01:00
networkxml2xmlin Add support for an external TFTP boot server 2009-10-28 15:57:49 +01:00
networkxml2xmlout Add support for an external TFTP boot server 2009-10-28 15:57:49 +01:00
nodedevschemadata nodedev: Add removable storage 'media_label' prop 2009-12-14 14:58:23 +01:00
nodeinfodata Get thread and socket information in virsh nodeinfo. 2010-03-08 09:26:04 -05:00
nwfilterxml2xmlin nwfilter: add support for RAPR protocol 2010-04-27 07:26:12 -04:00
nwfilterxml2xmlout nwfilter: add support for RAPR protocol 2010-04-27 07:26:12 -04:00
qemuhelpdata qemu_conf: fix flag value 2010-05-17 16:28:02 -06:00
qemuxml2argvdata Fix indentation for storage conf XML 2010-04-27 12:01:32 +02:00
sexpr2xmldata build: avoid non-srcdir "make distcheck" failures (srcdir vs wildcard) 2010-02-25 10:50:18 +01:00
storagepoolxml2xmlin storage: Sanitize pool target paths 2010-05-25 12:30:44 -04:00
storagepoolxml2xmlout tests: Add XML 2 XML tests for storage pools. 2009-10-16 10:21:47 -04:00
storagevolxml2xmlin tests: Add storage volume XML 2 XML tests. 2009-10-16 10:52:27 -04:00
storagevolxml2xmlout tests: Add storage volume XML 2 XML tests. 2009-10-16 10:52:27 -04:00
vmx2xmldata esx: Add support for the VMXNET 2 (Enhanced) NIC model 2010-04-20 20:58:24 +02:00
xencapsdata build: avoid non-srcdir "make distcheck" failures (srcdir vs wildcard) 2010-02-25 10:50:18 +01:00
xmconfigdata build: avoid non-srcdir "make distcheck" failures (srcdir vs wildcard) 2010-02-25 10:50:18 +01:00
xml2sexprdata tests: do not use the ":disk" suffix in sample xml input 2010-03-23 11:22:26 +01:00
xml2vmxdata esx: Add support for the VMXNET 2 (Enhanced) NIC model 2010-04-20 20:58:24 +02:00
.gitignore Add virt-aa-helper and secaatest to .gitignore 2010-03-31 13:36:54 +02:00
.valgrind.supp Supress annoying libcap-ng errors from valgrind 2009-11-26 12:07:17 +00:00
capabilityschematest Make test suite output less verbose 2010-01-15 16:28:05 +00:00
conftest.c avoid calling exit with a constant; use EXIT_* instead 2009-12-15 17:46:04 +01:00
cpuset tests: use GPLv2+, not GPLv3 2010-05-12 08:41:10 +02:00
daemon-conf tests: Skip daemon-conf test if dir exceeds UNIX_PATH_MAX 2010-05-17 15:01:59 -04:00
define-dev-segfault Fix up "make check" 2009-10-07 12:18:13 +02:00
domainschematest Make test suite output less verbose 2010-01-15 16:28:05 +00:00
domainsnapshotschematest Domain snapshot RNG and tests. 2010-05-20 13:50:03 -04:00
esxutilstest.c esx: Add domain snapshot support 2010-04-08 21:54:43 +02:00
eventtest.c Make test suite output less verbose 2010-01-15 16:28:05 +00:00
int-overflow Fix up "make check" 2009-10-07 12:18:13 +02:00
interfaceschematest Make test suite output less verbose 2010-01-15 16:28:05 +00:00
interfacexml2xmltest.c Remove virConnectPtr from interface XML APIs 2010-02-10 13:32:48 +00:00
libvirtd-fail Fix up "make check" 2009-10-07 12:18:13 +02:00
libvirtd-pool Fix up "make check" 2009-10-07 12:18:13 +02:00
Makefile.am build: Distribute the whole tests/qemuhelpdata directory 2010-05-21 20:08:57 +02:00
networkschematest Make test suite output less verbose 2010-01-15 16:28:05 +00:00
networkxml2xmltest.c Remove virConnectPtr from network XML APis 2010-02-10 13:31:28 +00:00
nodedevschematest Make test suite output less verbose 2010-01-15 16:28:05 +00:00
nodedevxml2xmltest.c Remove virConnectPtr from all node device XML APIs 2010-02-10 13:32:01 +00:00
nodeinfotest.c tests: do not ignore virInitialize failure 2010-05-18 19:23:32 +02:00
nwfilterschematest nwfilter: Add filter schema for nwfilter XML, extend domain XML schema 2010-04-06 11:09:46 -04:00
nwfilterxml2xmltest.c nwfilter: add support for RAPR protocol 2010-04-27 07:26:12 -04:00
object-locking.ml build: import latest gnulib 2010-04-02 10:18:55 -06:00
oomtrace.pl Generic test suite helpers for OOM testing 2008-05-29 15:21:45 +00:00
qemuargv2xmltest.c Add enospace option to qemu disk error policy 2010-04-09 03:35:47 -04:00
qemuhelptest.c qemu_conf: fix flag value 2010-05-17 16:28:02 -06:00
qemuxml2argvtest.c Snapshot QEMU driver. 2010-04-05 10:24:51 -04:00
qemuxml2xmltest.c Fix indentation for storage conf XML 2010-04-27 12:01:32 +02:00
qparamtest.c build: enable redundant-const check 2009-02-03 13:08:59 +00:00
read-bufsiz tests: use GPLv2+, not GPLv3 2010-05-12 08:41:10 +02:00
read-non-seekable tests: use GPLv2+, not GPLv3 2010-05-12 08:41:10 +02:00
reconnect.c avoid calling exit with a constant; use EXIT_* instead 2009-12-15 17:46:04 +01:00
schematestutils.sh schematestutils.sh: improve shell portability: avoid "echo -e" 2010-04-14 17:34:12 +02:00
secaatest.c sVirt AppArmor security driver 2009-10-08 16:34:22 +02:00
seclabeltest.c Move security drivers to src/security/ 2009-09-21 14:41:44 +01:00
sexpr2xmltest.c Remove virConnectPtr from all domain XML parsing/formatting APIs 2010-02-10 11:49:23 +00:00
start tests: use GPLv2+, not GPLv3 2010-05-12 08:41:10 +02:00
statstest.c build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00
storagepoolschematest Make test suite output less verbose 2010-01-15 16:28:05 +00:00
storagepoolxml2xmltest.c Remove virConnectPtr from storage APIs & driver 2010-02-10 13:32:11 +00:00
storagevolschematest Make test suite output less verbose 2010-01-15 16:28:05 +00:00
storagevolxml2xmltest.c Remove virConnectPtr from storage APIs & driver 2010-02-10 13:32:11 +00:00
test_conf.sh Make test suite output less verbose 2010-01-15 16:28:05 +00:00
test-lib.sh build: don't use "test cond1 -o cond2": it's not portable 2010-03-25 09:28:24 +01:00
testutils.c tests: Don't add extra padding if counter mod 40 is 0 2010-03-24 01:07:57 +01:00
testutils.h build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00
testutilsqemu.c testutilsqemu: avoid uninitialized variable 2010-04-22 09:00:30 -06:00
testutilsqemu.h remove all trailing blank lines 2009-07-16 15:06:42 +02:00
testutilsxen.c Fix crashes in Xen capabilities code 2009-07-27 16:45:01 +01:00
testutilsxen.h remove all trailing blank lines 2009-07-16 15:06:42 +02:00
undefine tests: use GPLv2+, not GPLv3 2010-05-12 08:41:10 +02:00
vcpupin tests: use GPLv2+, not GPLv3 2010-05-12 08:41:10 +02:00
virsh-all tests: use GPLv2+, not GPLv3 2010-05-12 08:41:10 +02:00
virsh-schedinfo tests: use GPLv2+, not GPLv3 2010-05-12 08:41:10 +02:00
virsh-synopsis tests: use GPLv2+, not GPLv3 2010-05-12 08:41:10 +02:00
virshtest.c avoid calling exit with a constant; use EXIT_* instead 2009-12-15 17:46:04 +01:00
virt-aa-helper-test virt-aa-helper-test: avoid non-portable echo -n 2010-04-14 11:17:18 -06:00
vmx2xmltest.c esx: Fix virtualHW.version generation 2010-04-21 00:37:46 +02:00
xencapstest.c Move xen driver code into src/xen/ directory 2009-09-21 14:41:42 +01:00
xmconfigtest.c maint: make Red Hat copyright notices consistent 2010-03-18 16:48:05 +01:00
xml2sexprtest.c Remove virConnectPtr from all domain XML parsing/formatting APIs 2010-02-10 11:49:23 +00:00
xml2vmxtest.c esx: Fix virtualHW.version generation 2010-04-21 00:37:46 +02:00