qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/5] qcow1: Make padding in the header explicit


From: Benoît Canet
Subject: Re: [Qemu-devel] [PATCH 1/5] qcow1: Make padding in the header explicit
Date: Mon, 12 May 2014 16:39:12 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

The Monday 12 May 2014 à 15:04:07 (+0200), Kevin Wolf wrote :
> We were relying on all compilers inserting the same padding in the
> header struct that is used for the on-disk format. Let's not do that.
> Mark the struct as packed and insert an explicit padding field for
> compatibility.
> 
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
>  block/qcow.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/block/qcow.c b/block/qcow.c
> index 937dd6d..3684794 100644
> --- a/block/qcow.c
> +++ b/block/qcow.c
> @@ -48,9 +48,10 @@ typedef struct QCowHeader {
>      uint64_t size; /* in bytes */
>      uint8_t cluster_bits;
>      uint8_t l2_bits;
> +    uint16_t padding;
>      uint32_t crypt_method;
>      uint64_t l1_table_offset;
> -} QCowHeader;
> +} QEMU_PACKED QCowHeader;
>  
>  #define L2_CACHE_SIZE 16
>  
> -- 
> 1.8.3.1
> 
> 
Reviewed-by: Benoit Canet <address@hidden>



reply via email to

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