[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-stable] [Qemu-devel] [PATCH v2 1/5] qcow1: Make padding in the
From: |
Eric Blake |
Subject: |
Re: [Qemu-stable] [Qemu-devel] [PATCH v2 1/5] qcow1: Make padding in the header explicit |
Date: |
Fri, 16 May 2014 06:42:30 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 |
On 05/16/2014 04:41 AM, Kevin Wolf wrote:
>>> +} QEMU_PACKED QCowHeader;
>>
>> Is it worth a compile-time assertion that the correct size is achieved?
>>
>
> QEMU_BUILD_BUG_ON() is what you're looking for.
Ah, thanks.
>
> Do you think that would be a useful addition? With packed structs there
> should be little that could make it go wrong. But if we want to add
> this, I'd do it in a separate patch and for all image formats.
Definitely a separate patch. But yes, I think that it can't hurt - even
with packed structs, it's a bit of insurance against someone
accidentally adding a field or using a wrong type, particularly for any
packed structs where a newer version converts reserved space into a
named purpose.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
[Qemu-stable] [PATCH v2 5/5] qcow1: Stricter backing file length check, Kevin Wolf, 2014/05/15