libvirt/docs/schemas
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
..
.gitignore update .gitignore and .hgignore files 2009-03-03 11:25:00 +00:00
capability.rng Add arm arch to capabilities schema 2009-09-10 12:25:42 +01:00
domain.rng Add support for setting disk drive serial numbers 2009-09-03 13:53:34 +01:00
interface.rng Add netcf XML schemas and test data 2009-07-15 20:16:36 +02:00
Makefile.am Add volume encryption information handling. 2009-09-01 18:27:28 +01:00
network.rng network: add 'bootp' and 'tftp' config 2009-09-23 09:47:10 +02:00
nodedev.rng Typo and comment fixes 2009-08-05 11:56:56 +02:00
secret.rng Make secrets RNG more strict 2009-09-14 17:49:37 +01:00
storageencryption.rng Remove accidentally added UUID re-definition in storage schema 2009-09-14 19:11:13 +01:00
storagepool.rng Typo and comment fixes 2009-08-05 11:56:56 +02:00
storagevol.rng Add UUID definition required by storage encryption import 2009-09-14 21:09:49 +01:00