Re: [libvirt] [PATCH 05/10] Handle arbitrary qemu command-lines in qemuParseCommandLine.

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

 



On 04/21/2010 10:01 AM, Chris Lalancette wrote:
> Now that we have the ability to specify arbitrary qemu
> command-line parameters in the XML, use it to handle unknown
> command-line parameters when doing a native-to-xml conversion.
> 
> +++ b/src/conf/domain_conf.c
> @@ -3719,6 +3719,14 @@ static char *virDomainDefDefaultEmulator(virDomainDefPtr def,
>      return retemu;
>  }
>  
> +void virDomainDefAssignNamespace(virCapsPtr caps, virDomainDefPtr def)
> +{
> +    def->ns.parse = caps->ns->parse;
> +    def->ns.free = caps->ns->free;
> +    def->ns.format = caps->ns->format;
> +    def->ns.href = caps->ns->href;

My comments for 03/10 still apply; can this be simplified?
def->ns = *caps->ns;

> @@ -6203,6 +6211,13 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps,
>      if (virDomainDefAddImplicitControllers(def) < 0)
>          goto error;
>  
> +    if (cmd->num_extra || cmd->num_env) {
> +        virDomainDefAssignNamespace(caps, def);
> +        def->namespaceData = cmd;
> +    }
> +    else
> +        VIR_FREE(cmd);

Per Jim's recent request to update the style guidelines, this should be
rewritten as either:

if (cond) {
    ...
} else {
    VIR_FREE(cmd);
}

or:

if (!(cond))
    VIR_FREE(cmd);
else {
    ...
}

ACK, once nits are resolved.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
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]