Re: [PATCH] config: report error when script given for inappropriate interface type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/06/2012 11:16 AM, Laine Stump wrote:
> This fixes https://bugzilla.redhat.com/show_bug.cgi?id=638633
> 

> 
> 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).

The idea for a VALIDATE flag is still independently useful, but I agree
with your assessment that it would not fix this particular case, because
the .rng does not distinguish between hypervisor-specific restrictions.

> +++ b/src/qemu/qemu_domain.c
> @@ -1167,10 +1167,12 @@ void qemuDomainObjCheckNetTaint(struct qemud_driver *driver,
>                                  virDomainNetDefPtr net,
>                                  int logFD)
>  {
> -    if ((net->type == VIR_DOMAIN_NET_TYPE_ETHERNET &&
> -         net->data.ethernet.script != NULL) ||
> -        (net->type == VIR_DOMAIN_NET_TYPE_BRIDGE &&
> -         net->data.bridge.script != NULL))
> +    /* script is only useful for NET_TYPE_ETHERNET (qemu) and
> +     * NET_TYPE_BRIDGE (xen), but could be (incorrectly) specified for
> +     * any interface type. In any case, it's adding user sauce into
> +     * the soup, so it should taint the domain.

Unusual that the comment mentions xen from inside the qemu directory,
but the comment is accurate, and I don't know of any better place to
stick it.

ACK.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]