libvirt/tests
Paolo Bonzini 738ee810b4 network: add 'bootp' and 'tftp' config
Currently, libvirtd will start a dnsmasq process for the virtual
network, but (aside from killing the dnsmasq process and replacing it),
there's no way to define tftp boot options.

This change introduces the appropriate tags to the dhcp configuration:

 <network>
   <name>default</name>
   <bridge name="virbr%d" />
   <forward/>
   <ip address="192.168.122.1" netmask="255.255.255.0">
     <tftp root="/var/lib/tftproot" />
     <dhcp>
       <range start="192.168.122.2" end="192.168.122.254" />
       <bootp file="pxeboot.img"/>
     </dhcp>
   </ip>
 </network>

When the attributes are present, these are passed to the
arguments to dnsmasq:

 dnsmasq [...] --enable-tftp --tftp-root /srv/tftp --dhcp-boot pxeboot.img
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
                      from <tftp />                     from <bootp />

At present, only local tftp servers are supported (ie, dnsmasq runs as
the tftp server), but we could improve this in future by adding a
server= attribute.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

2009-09-21  Paolo Bonzini  <pbonzini@redhat.com>
            Jeremy Kerr  <jk@ozlabs.org>

	* docs/formatnetwork.html.in: Document new tags.
	* docs/formatnetwork.html: Regenerate.
	* docs/schemas/network.rng: Update.
	* src/network_conf.c (virNetworkDefFree): Free new fields.
	(virNetworkDHCPRangeDefParseXML): Parse <bootp>.
	(virNetworkIPParseXML): New, parsing <dhcp> and <tftp>.
	(virNetworkDefParseXML): Use virNetworkIPParseXML instead of
	virNetworkDHCPRangeDefParseXML.
	(virNetworkDefFormat): Pretty print new fields.
	* src/network_conf.h (struct _virNetworkDef): Add netboot fields.
	* src/network_driver.c (networkBuildDnsmasqArgv): Add
	TFTP and BOOTP arguments.

	* tests/Makefile.am (EXTRA_DIST): Add networkschemadata.
	* tests/networkschematest: Look in networkschemadata.
	* tests/networkschemadata/netboot-network.xml: New.
2009-09-23 09:47:10 +02:00
..
capabilityschemadata Add a more featureful qemu capabilities test data 2009-09-10 12:25:42 +01:00
confdata remove all trailing blank lines 2009-07-16 15:06:42 +02:00
domainschemadata Support for container related domain XML extensions 2008-08-01 13:31:37 +00:00
interfaceschemadata Add netcf XML schemas and test data 2009-07-15 20:16:36 +02:00
networkschemadata network: add 'bootp' and 'tftp' config 2009-09-23 09:47:10 +02:00
nodedevschemadata remove all trailing blank lines 2009-07-16 15:06:42 +02:00
nodeinfodata remove all trailing blank lines 2009-07-16 15:06:42 +02:00
qemuhelpdata Add qemu -help test data for qemu-kvm-0.11.0-rc2 2009-09-10 12:37:35 +01:00
qemuxml2argvdata Fix handling of Xen(ner) detection 2009-09-22 16:13:33 +01:00
sexpr2xmldata Don't blindly reorder disk drives 2009-09-02 15:19:34 +01:00
storagepoolschemadata remove all trailing blank lines 2009-07-16 15:06:42 +02:00
storagevolschemadata Attach encryption information to virStorageVolDef. 2009-09-01 18:27:38 +01:00
xencapsdata remove all trailing blank lines 2009-07-16 15:06:42 +02:00
xmconfigdata remove all .cvsignore files 2009-07-08 16:17:51 +02:00
xml2sexprdata Don't blindly reorder disk drives 2009-09-02 15:19:34 +01:00
.gitignore netcf XML validation and input and output tests 2009-07-15 20:16:36 +02:00
.valgrind.supp Fix bogus valgrind memory leak warnings in test suite 2009-01-28 21:53:48 +00:00
capabilityschematest Added complete set of RNG schemas for all XML formats 2009-01-27 15:29:53 +00:00
conftest.c extend the configuration parser for VMX syntax 2009-06-19 12:34:30 +00:00
cpuset avoid two test failures induced by today's error-reporting changes 2009-02-09 15:31:34 +00:00
daemon-conf Rename qemud/ directory to daemon/ 2009-09-21 14:41:42 +01:00
define-dev-segfault tests: exercise a bug that could make virsh and libvirtd segfault 2009-01-16 18:06:33 +00:00
domainschematest Added complete set of RNG schemas for all XML formats 2009-01-27 15:29:53 +00:00
eventtest.c Rename qemud/ directory to daemon/ 2009-09-21 14:41:42 +01:00
int-overflow Move example XML files into examples/xml 2009-09-21 14:41:48 +01:00
interfaceschematest netcf XML validation and input and output tests 2009-07-15 20:16:36 +02:00
interfacexml2xmltest.c netcf XML validation and input and output tests 2009-07-15 20:16:36 +02:00
libvirtd-fail Fix misc failures in test suite & make test cases more robust to future changes 2009-03-04 13:04:06 +00:00
libvirtd-pool Fix misc failures in test suite & make test cases more robust to future changes 2009-03-04 13:04:06 +00:00
Makefile.am network: add 'bootp' and 'tftp' config 2009-09-23 09:47:10 +02:00
networkschematest network: add 'bootp' and 'tftp' config 2009-09-23 09:47:10 +02:00
nodedevschematest Added complete set of RNG schemas for all XML formats 2009-01-27 15:29:53 +00:00
nodedevxml2xmltest.c NPIV implementation for node device create and destroy 2009-06-02 15:12:53 +00:00
nodeinfotest.c remove all trailing blank lines 2009-07-16 15:06:42 +02:00
object-locking.ml Fix misc thread locking bugs / bogus warnings 2009-09-10 14:26:56 +01:00
oomtrace.pl Generic test suite helpers for OOM testing 2008-05-29 15:21:45 +00:00
qemuargv2xmltest.c Move QEMU driver to src/qemu/ 2009-09-21 14:41:43 +01:00
qemuhelptest.c Move QEMU driver to src/qemu/ 2009-09-21 14:41:43 +01:00
qemuxml2argvtest.c Fix handling of Xen(ner) detection 2009-09-22 16:13:33 +01:00
qemuxml2xmltest.c Move QEMU driver to src/qemu/ 2009-09-21 14:41:43 +01:00
qparamtest.c build: enable redundant-const check 2009-02-03 13:08:59 +00:00
read-bufsiz Support domain events in test driver 2009-01-20 20:23:53 +00:00
read-non-seekable Convert test driver to new domain XML apis 2008-07-11 16:41:27 +00:00
reconnect.c remove all trailing blank lines 2009-07-16 15:06:42 +02:00
seclabeltest.c Move security drivers to src/security/ 2009-09-21 14:41:44 +01:00
sexpr2xmltest.c Move xen driver code into src/xen/ directory 2009-09-21 14:41:42 +01:00
start Fix actual vs expected data comparison order to get correct diff +++/--- output 2009-01-20 12:03:40 +00:00
statstest.c Move xen driver code into src/xen/ directory 2009-09-21 14:41:42 +01:00
storagepoolschematest Added complete set of RNG schemas for all XML formats 2009-01-27 15:29:53 +00:00
storagevolschematest Added complete set of RNG schemas for all XML formats 2009-01-27 15:29:53 +00:00
test_conf.sh Re-factor and pretty print differences 2008-04-18 15:28:33 +00:00
test-lib.sh Don't fail to read a file because it's non-seekable (e.g., a pipe). 2008-04-08 15:33:16 +00:00
testutils.c Dump qemu driver capabilities if test debugging enabled 2009-09-10 12:37:42 +01:00
testutils.h Dump qemu driver capabilities if test debugging enabled 2009-09-10 12:37:42 +01:00
testutilsqemu.c Test that domain-specific qemu machine types are used correctly 2009-09-10 12:37:43 +01: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 avoid two test failures induced by today's error-reporting changes 2009-02-09 15:31:34 +00:00
vcpupin Fix actual vs expected data comparison order to get correct diff +++/--- output 2009-01-20 12:03:40 +00:00
virsh-all tests: quiet virsh-all 2009-01-12 18:23:10 +00:00
virsh-synopsis tests: new test: virsh-synopsis 2008-11-24 07:13:29 +00:00
virshtest.c Move example XML files into examples/xml 2009-09-21 14:41:48 +01:00
xencapstest.c Move xen driver code into src/xen/ directory 2009-09-21 14:41:42 +01:00
xmconfigtest.c Move xen driver code into src/xen/ directory 2009-09-21 14:41:42 +01:00
xml2sexprtest.c Move xen driver code into src/xen/ directory 2009-09-21 14:41:42 +01:00