[libvirt] PATCH: Support SDL configuration for QEMU driver
Jim Meyering
jim at meyering.net
Fri Oct 10 15:28:28 UTC 2008
"Daniel P. Berrange" <berrange at redhat.com> 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.
More information about the libvir-list
mailing list