qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [sheepdog] [PATCH 1/2] sheepdog: explicitly set copies


From: MORITA Kazutaka
Subject: Re: [Qemu-devel] [sheepdog] [PATCH 1/2] sheepdog: explicitly set copies as type uint8_t
Date: Wed, 23 Oct 2013 16:13:24 +0900
User-agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/23.4 Mule/6.0 (HANACHIRUSATO)

At Wed, 16 Oct 2013 15:38:37 +0800,
Liu Yuan wrote:
> 
> 'copies' is actually uint8_t since day one, but request headers and some 
> helper
> functions parameterize it as uint32_t for unknown reasons and effectively
> reserve 24 bytes for possible future use. This patch explicitly set the 
> correct
> for copies and reserve the left bytes.
> 
> This is a preparation patch that allow passing copy_policy in request header.
> 
> Cc: Kevin Wolf <address@hidden>
> Cc: Stefan Hajnoczi <address@hidden>
> Signed-off-by: Liu Yuan <address@hidden>
> ---
>  block/sheepdog.c |   15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/block/sheepdog.c b/block/sheepdog.c
> index 5f81c93..ca4f98b 100644
> --- a/block/sheepdog.c
> +++ b/block/sheepdog.c
> @@ -125,7 +125,8 @@ typedef struct SheepdogObjReq {
>      uint32_t data_length;
>      uint64_t oid;
>      uint64_t cow_oid;
> -    uint32_t copies;
> +    uint8_t copies;
> +    uint8_t reserved[3];
>      uint32_t rsvd;
>      uint64_t offset;
>  } SheepdogObjReq;

Having both 'reserved' and 'rsvd' looks confusing.  I'd suggest
merging them into 'uint8_t reserved[7]'.

Thanks,

Kazutaka



reply via email to

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