[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] cow: make padding in the header explicit
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH] cow: make padding in the header explicit |
Date: |
Thu, 4 Sep 2014 11:26:41 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 04.09.2014 um 10:58 hat Stefan Hajnoczi geschrieben:
> On-disk structures should be marked packed so the compiler does not
> insert padding for field alignment. Padding should be explicit so
> on-disk layout is obvious and we don't rely on the architecture-specific
> ABI for alignment rules.
>
> The pahole(1) diff shows that the padding is now explicit and offsets
> are unchanged:
>
> char backing_file[1024]; /* 8 1024 */
> /* --- cacheline 16 boundary (1024 bytes) was 8 bytes ago --- */
> int32_t mtime; /* 1032 4 */
> -
> - /* XXX 4 bytes hole, try to pack */
> -
> + uint32_t padding; /* 1036 4 */
> uint64_t size; /* 1040 8 */
>
> Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>