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

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



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 redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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