libvirt/src/conf
Laine Stump 1734cdb995 config: report error when script given for inappropriate interface type
This fixes https://bugzilla.redhat.com/show_bug.cgi?id=638633

Although scripts are not used by interfaces of type other than
"ethernet" in qemu, due to the fact that the parser stores the script
name in a union that is only valid when type is ethernet or bridge,
there is no way for anyone except the parser itself to catch the
problem of specifying an interface script for an inappropriate
interface type (by the time the parsed data gets back to the code that
called the parser, all evidence that a script was specified is
forgotten).

Since the parser itself should be agnostic to which type of interface
allows scripts (an example of why: a script specified for an interface
of type bridge is valid for xen domains, but not for qemu domains),
the solution here is to move the script out of the union(s) in the
DomainNetDef, always populate it when specified (regardless of
interface type), and let the driver decide whether or not it is
appropriate.

Currently the qemu, xen, libxml, and uml drivers recognize the script
parameter and do something with it (the uml driver only to report that
it isn't supported). Those drivers have been updated to log a
CONFIG_UNSUPPORTED error when a script is specified for an interface
type that's inappropriate for that particular hypervisor.

(NB: There was earlier discussion of solving this problem by adding a
VALIDATE flag to all libvirt APIs that accept XML, which would cause
the XML to be validated against the RNG files. One statement during
that discussion was that the RNG shouldn't contain hypervisor-specific
things, though, and a proper solution to this problem would require
that (again, because a script for an interface of type "bridge" is
accepted by xen, but not by qemu).
2012-01-08 10:52:24 -05:00
..
capabilities.c Remove powerMgmt_valid field from capabilities struct 2011-11-30 10:12:30 +00:00
capabilities.h Remove powerMgmt_valid field from capabilities struct 2011-11-30 10:12:30 +00:00
cpu_conf.c virCPUDefCopy forgot to copy NUMA topology 2012-01-03 21:05:54 +01:00
cpu_conf.h XML definitions for guest NUMA and parsing routines 2011-11-17 13:34:42 -07:00
domain_audit.c Avoid using "devname" as an identifier. 2011-09-16 20:49:04 +08:00
domain_audit.h snapshot: make it possible to audit external snapshot 2011-09-05 07:03:05 -06:00
domain_conf.c config: report error when script given for inappropriate interface type 2012-01-08 10:52:24 -05:00
domain_conf.h config: report error when script given for inappropriate interface type 2012-01-08 10:52:24 -05:00
domain_event.c Only add the timer when a callback is registered 2011-12-19 11:08:25 +00:00
domain_event.h Only add the timer when a callback is registered 2011-12-19 11:08:25 +00:00
domain_nwfilter.c Pass the VM's UUID into the nwfilter subsystem 2011-12-08 21:35:20 -05:00
domain_nwfilter.h Pass the VM's UUID into the nwfilter subsystem 2011-12-08 21:35:20 -05:00
interface_conf.c conf: Improve incorrect root element error messages 2011-11-28 15:12:37 +01:00
interface_conf.h interface: implement a test driver for network config transaction API. 2011-05-27 14:34:13 -04:00
netdev_bandwidth_conf.c Split src/util/network.{c,h} into 5 pieces 2011-11-15 10:27:54 +00:00
netdev_bandwidth_conf.h Split src/util/network.{c,h} into 5 pieces 2011-11-15 10:27:54 +00:00
netdev_vport_profile_conf.c maint: typo fixes 2011-12-01 16:08:34 -07:00
netdev_vport_profile_conf.h Split src/util/network.{c,h} into 5 pieces 2011-11-15 10:27:54 +00:00
network_conf.c Implement DNS SRV record into the bridge driver 2012-01-02 23:05:55 +08:00
network_conf.h network_conf: Fix whitespace to pass syntax-check 2012-01-02 17:59:05 +01:00
node_device_conf.c npiv: Expose fabric_name outside 2011-12-07 18:42:08 +08:00
node_device_conf.h npiv: Expose fabric_name outside 2011-12-07 18:42:08 +08:00
nwfilter_conf.c nwfilter: cleanup return codes in nwfilter subsystem 2011-12-08 21:26:34 -05:00
nwfilter_conf.h nwfilter: remove virConnectPtr from internal API calls 2011-11-23 14:13:03 -05:00
nwfilter_params.c nwfilter: cleanup return codes in nwfilter subsystem 2011-12-08 21:26:34 -05:00
nwfilter_params.h Enable detection of multiple IP addresses 2011-11-22 19:05:45 -05:00
secret_conf.c conf: Improve incorrect root element error messages 2011-11-28 15:12:37 +01:00
secret_conf.h secret: add Ceph secret type 2011-10-28 11:34:17 -06:00
storage_conf.c Fix storage pool source comparison to avoid comparing with self 2011-11-01 11:13:29 +00:00
storage_conf.h storage: make previous leak less likely to regress 2011-10-24 19:42:49 -06:00
storage_encryption_conf.c snapshot: simplify indentation of disk encryption xml 2011-10-26 11:14:43 -06:00
storage_encryption_conf.h snapshot: simplify indentation of disk encryption xml 2011-10-26 11:14:43 -06:00