qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v5 12/15] block: Remove the "bs->file" test in b


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH v5 12/15] block: Remove the "bs->file" test in bdrv_co_get_block_status
Date: Wed, 6 Jan 2016 17:52:40 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

On 05.01.2016 09:11, Fam Zheng wrote:
> Now that all drivers return the right "file" pointer, we can remove this
> check.
> 
> Signed-off-by: Fam Zheng <address@hidden>
> ---
>  block/io.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block/io.c b/block/io.c
> index 492c291..1ca4e61 100644
> --- a/block/io.c
> +++ b/block/io.c
> @@ -1550,7 +1550,7 @@ static int64_t coroutine_fn 
> bdrv_co_get_block_status(BlockDriverState *bs,
>          }
>      }
>  
> -    if (bs->file && *file && *file != bs &&
> +    if (*file && *file != bs &&
>          (ret & BDRV_BLOCK_DATA) && !(ret & BDRV_BLOCK_ZERO) &&
>          (ret & BDRV_BLOCK_OFFSET_VALID)) {
>          BlockDriverState *file2;

Fine by itself, but I think patch 1 needs a change, so this should be

-    if (bs->file &&
+    if (*file && *file != bs &&

instead; and the first parameter of the subsequent
bdrv_co_get_block_status() call then needs to be changed to *file here
(instead of in patch 1).

Max

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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