qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: "Cédric Le Goater" <clg@kaod.org>,
	qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>, Kevin Wolf <kwolf@redhat.com>
Subject: Re: [PULL 2/5] pflash: Fix blk_pread_nonzeroes()
Date: Tue, 7 Mar 2023 17:22:59 +0100	[thread overview]
Message-ID: <be44cfd0-d107-76a3-abe5-fba82d15a646@linaro.org> (raw)
In-Reply-To: <20230307155528.3655534-3-clg@kaod.org>

On 7/3/23 16:55, Cédric Le Goater wrote:
> From: Kevin Wolf <kwolf@redhat.com>
> 
> Commit a4b15a8b introduced a new function blk_pread_nonzeroes(). Instead
> of reading directly from the root node of the BlockBackend, it reads
> from its 'file' child node. This can happen to mostly work for raw
> images (as long as the 'raw' format driver is in use, but not actually
> doing anything), but it breaks everything else.
> 
> Fix it to read from the root node instead.
> 
> Fixes: a4b15a8b9ef25b44fa92a4825312622600c1f37c

You missed:

Tested-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Fixes: a4b15a8b9e ("pflash: Only read non-zero parts of backend image")

by 3min:
https://lore.kernel.org/qemu-devel/c5c82d88-df2a-e968-4d81-0da1cfa2ab09@maciej.szmigiero.name/

> Reported-by: Cédric Le Goater <clg@kaod.org>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> Message-Id: <20230307140230.59158-1-kwolf@redhat.com>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
>   hw/block/block.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/hw/block/block.c b/hw/block/block.c
> index af0710e477..9f52ee6e72 100644
> --- a/hw/block/block.c
> +++ b/hw/block/block.c
> @@ -39,8 +39,7 @@ static int blk_pread_nonzeroes(BlockBackend *blk, hwaddr size, void *buf)
>               return ret;
>           }
>           if (!(ret & BDRV_BLOCK_ZERO)) {
> -            ret = bdrv_pread(bs->file, offset, bytes,
> -                             (uint8_t *) buf + offset, 0);
> +            ret = blk_pread(blk, offset, bytes, (uint8_t *) buf + offset, 0);
>               if (ret < 0) {
>                   return ret;
>               }



  reply	other threads:[~2023-03-07 16:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-07 15:55 [PULL 0/5] aspeed queue Cédric Le Goater
2023-03-07 15:55 ` [PULL 1/5] m25p80: Improve error when the backend file size does not match the device Cédric Le Goater
2023-03-07 15:55 ` [PULL 2/5] pflash: Fix blk_pread_nonzeroes() Cédric Le Goater
2023-03-07 16:22   ` Philippe Mathieu-Daudé [this message]
2023-03-07 16:37     ` Cédric Le Goater
2023-03-07 15:55 ` [PULL 3/5] hw/arm/aspeed: Added TMP421 type sensor's support in yosemitev2 Cédric Le Goater
2023-03-07 15:55 ` [PULL 4/5] hw/arm/aspeed: Added TMP421 type sensor's support in tiogapass Cédric Le Goater
2023-03-07 15:55 ` [PULL 5/5] hw/arm/aspeed: Modified BMC FRU byte data in yosemitev2 Cédric Le Goater
2023-03-09 13:13 ` [PULL 0/5] aspeed queue Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=be44cfd0-d107-76a3-abe5-fba82d15a646@linaro.org \
    --to=philmd@linaro.org \
    --cc=clg@kaod.org \
    --cc=kwolf@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).