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

Re: [libvirt] [PATCH] esx: Add support for storage volume cloning



On 12/06/2010 01:42 PM, Matthias Bolte wrote:
> ---
>  src/esx/esx_storage_driver.c   |  198 +++++++++++++++++++++++++++++++++++++++-
>  src/esx/esx_vi_generator.input |   11 ++
>  2 files changed, 208 insertions(+), 1 deletions(-)

ACK. Looks clean; but maybe one suggestion if you want:

> +    char *key = NULL;

> +        if (priv->primary->hasQueryVirtualDiskUuid) {
> +            if (VIR_ALLOC_N(key, VIR_UUID_STRING_BUFLEN) < 0) {
> +                virReportOOMError();
> +                goto cleanup;
> +            }

VIR_UUID_STRING_BUFLEN is small enough that you can stack-allocate key,
and avoid one place of malloc() failure:

char key[VIR_UUID_STRING_BUFLEN];

Up to you if you want to make that change, or check in as-is.

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