Re: [libvirt] PATCH: Support SDL configuration for QEMU driver

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

 



"Daniel P. Berrange" <berrange@xxxxxxxxxx> wrote:
...
> diff --git a/src/qemu_conf.c b/src/qemu_conf.c
...
> +#define ADD_ENV_SPACE                                                   \
> +    do {                                                                \
> +        if (qenvc == qenva) {                                           \
> +            qenva += 10;                                                \
> +            if (VIR_REALLOC_N(qenv, qenva) < 0)                         \
> +                goto no_memory;                                         \
> +        }                                                               \
> +    } while (0)
...
> +#define ADD_ENV_COPY(envname)                                           \
> +    do {                                                                \
> +        char *val = getenv(envname);                                    \
> +        char *envval;                                                   \
> +        ADD_ENV_SPACE;                                                  \
> +        if (val != NULL) {                                              \
> +            if (asprintf(&envval, "%s=%s", envname, val) < 0)           \
> +                goto no_memory;                                         \
> +            qenv[qenvc++] = envval;                                     \
> +        }                                                               \
> +    } while (0)

All looks good.
You might as well move the ADD_ENV_SPACE down into the "if" block.

--
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]