qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/6] libqblock public type defines


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 2/6] libqblock public type defines
Date: Mon, 03 Sep 2012 08:20:11 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120828 Thunderbird/15.0

On 09/03/2012 03:18 AM, Wenchao Xia wrote:
>   This patch contains public type and defines used in APIs.
> 
> Signed-off-by: Wenchao Xia <address@hidden>
> ---
>  libqblock/libqblock-types.h |  228 
> +++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 228 insertions(+), 0 deletions(-)
>  create mode 100644 libqblock/libqblock-types.h
> 
> diff --git a/libqblock/libqblock-types.h b/libqblock/libqblock-types.h
> new file mode 100644
> index 0000000..3389bda
> --- /dev/null
> +++ b/libqblock/libqblock-types.h
> @@ -0,0 +1,228 @@
> +#ifndef LIBQBLOCK_TYPES_H

Missing a copyright header.  Shame.

> +#define LIBQBLOCK_TYPES_H
> +
> +#include <stdio.h>
> +#include <stdint.h>
> +#include <stdlib.h>
> +#include <stdbool.h>

I see use of stdint (uint8_t) and stdbool (bool), but isn't
<sys/types.h> better than <stdio.h> and <stdlib.h> for size_t?

> +
> +/**
> + * QBlockInfoImageStatic: information about the block image.
> + *
> + * @loc: location info.
> + * @fmt_type: format type.
> + * @virt_size: virtual size in bytes.
> + * @backing_loc: backing file location, its type is QB_PROT_NONE if not 
> exist.
> + * @allocated_size: allocated size in bytes, negative if not available.

Reading this...

> + * @encrypt: encrypt flag.
> + */
> +struct QBlockInfoImageStatic {
> +    struct QBlockOptionLoc loc;
> +    enum QBlockFormat fmt_type;
> +    size_t virt_size;
> +    /* advance info */
> +    struct QBlockOptionLoc backing_loc;
> +    size_t allocated_size;

...negative is not possible for size_t.  Did you mean ssize_t?

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]