1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-12 13:17:58 +03:00
Libvirt native C API and daemons
Go to file
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
.gnulib@28db629d4f build: update gnulib submodule to latest 2009-09-09 12:11:29 +02:00
build-aux generate ChangeLog from git logs into distribution tarball 2009-07-08 16:17:51 +02:00
daemon Introduce virStrncpy. 2009-09-22 20:10:00 +02:00
docs network: add 'bootp' and 'tftp' config 2009-09-23 09:47:10 +02:00
examples Move example XML files into examples/xml 2009-09-21 14:41:48 +01:00
include Ignore auto-generated header file 2009-09-22 16:12:51 +01:00
m4 remove all .cvsignore files 2009-07-08 16:17:51 +02:00
po Misc syntax-check fixes 2009-09-21 14:41:47 +01:00
proxy Introduce virStrncpy. 2009-09-22 20:10:00 +02:00
python Misc syntax-check fixes 2009-09-21 14:41:47 +01:00
src network: add 'bootp' and 'tftp' config 2009-09-23 09:47:10 +02:00
tests network: add 'bootp' and 'tftp' config 2009-09-23 09:47:10 +02:00
tools Move all shared utility files to src/util/ 2009-09-21 14:41:47 +01:00
.gitignore build: automatically rerun ./bootstrap when needed 2009-07-10 13:39:28 +02:00
.gitmodules make .gnulib a submodule 2009-07-08 16:17:51 +02:00
.hgignore Add qemuhelptest to .*ignore files 2009-06-16 14:06:48 +00:00
.x-sc_avoid_ctype_macros exempt gnulib from ctype-macros prohibition 2008-10-28 17:36:31 +00:00
.x-sc_avoid_if_before_free avoid a "make syntax-check" failure 2009-07-09 20:00:37 +02:00
.x-sc_avoid_write Misc syntax-check fixes 2009-09-21 14:41:47 +01:00
.x-sc_m4_quote_check syntax-check: enable more checks 2009-02-03 13:08:36 +00:00
.x-sc_prohibit_asprintf add .x-sc_prohibit_asprintf 2008-12-23 13:40:42 +00:00
.x-sc_prohibit_gethostby add more files pulled in via yesterday's gnulib upgrade 2009-01-07 17:11:02 +00:00
.x-sc_prohibit_have_config_h maint: sync from coreutils 2009-01-29 18:06:19 +00:00
.x-sc_prohibit_HAVE_MBRTOWC maint: sync from coreutils 2009-01-29 18:06:19 +00:00
.x-sc_prohibit_nonreentrant Misc syntax-check fixes 2009-09-21 14:41:47 +01:00
.x-sc_prohibit_strcmp exempt gnulib/ from "make syntax-check" strcmp prohibition 2008-05-14 21:18:27 +00:00
.x-sc_prohibit_strcmp_and_strncmp Prepare to use maint.mk from gnulib 2009-07-08 16:17:51 +02:00
.x-sc_prohibit_VIR_ERR_NO_MEMORY Misc syntax-check fixes 2009-09-21 14:41:47 +01:00
.x-sc_require_config_h Misc syntax-check fixes 2009-09-21 14:41:47 +01:00
.x-sc_require_config_h_first Misc syntax-check fixes 2009-09-21 14:41:47 +01:00
.x-sc_trailing_blank build: exempt *.ico files from the trailing blank check 2008-10-16 13:28:07 +00:00
acinclude.m4 remove all trailing blank lines 2009-07-16 15:06:42 +02:00
AUTHORS Add Miloslav Trmač to AUTHORS file 2009-09-01 18:37:38 +01:00
autobuild.sh Enable ESX driver build on Mingw32 2009-07-31 16:15:51 +01:00
autogen.sh build: automatically rerun ./bootstrap when needed 2009-07-10 13:39:28 +02:00
bootstrap Local file implementation of secret driver API 2009-09-11 14:54:46 +01:00
cfg.mk Introduce virStrncpy. 2009-09-22 20:10:00 +02:00
ChangeLog-old generate ChangeLog from git logs into distribution tarball 2009-07-08 16:17:51 +02:00
configure.in Move docs/examples into examples/ 2009-09-21 14:41:46 +01:00
COPYING.LIB remove all trailing blank lines 2009-07-16 15:06:42 +02:00
HACKING Introduce virStrncpy. 2009-09-22 20:10:00 +02:00
libvirt.pc.in * libvirt.pc.in: applied patch from Daniel Berrange to fix --cflags 2006-03-24 13:18:12 +00:00
libvirt.spec.in Tweak specfile to fix RHEL6 rules & ESX/PHYP enablement 2009-09-21 15:24:08 +01:00
Makefile.am Move example XML files into examples/xml 2009-09-21 14:41:48 +01:00
Makefile.nonreentrant syntax-check: enable prohibit_nonreentrant 2009-02-05 16:28:41 +00:00
mingw32-libvirt.spec.in Make pki_check.sh into an installed & supported tool 2009-09-21 14:41:46 +01:00
NEWS More whitespace problems 2009-09-15 14:31:59 +02:00
README Correct typos in the documentation (Atsushi SAKAI) 2008-01-24 10:15:13 +00:00
README-hacking build: automatically rerun ./bootstrap when needed 2009-07-10 13:39:28 +02:00
TODO Remove all trailing blanks; turn on the rule to detect them. 2008-02-05 19:27:37 +00:00

         LibVirt : simple API for virtualization

  Libvirt is a C toolkit to interact with the virtualization capabilities
of recent versions of Linux (and other OSes). It is free software
available under the GNU Lesser General Public License. Virtualization of
the Linux Operating System means the ability to run multiple instances of
Operating Systems concurrently on a single hardware system where the basic
resources are driven by a Linux instance. The library aim at providing
long term stable C API initially for the Xen paravirtualization but
should be able to integrate other virtualization mechanisms if needed.

Daniel Veillard <veillard@redhat.com>