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: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 2/6] libqblock public type defines
Date: Tue, 04 Sep 2012 09:37:11 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0

Il 04/09/2012 09:10, Wenchao Xia ha scritto:
> 
>>> +
>>> +/**
>>> + * 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?
>>
>   you are right.

size_t is a *pointer* size.  It is 32-bits on

Use int64_t or uint64_t always when dealing with file sizes and offsets.

In particular, do not use off_t, it is a recipe for pain and ABI
incompatibilities.

Paolo



reply via email to

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