From: Peter Xu <peterx@redhat.com>
To: Maksim Davydov <davydov-max@yandex-team.ru>
Cc: qemu-devel@nongnu.org, farosas@suse.de
Subject: Re: [PATCH] migration/ram: add additional check
Date: Tue, 5 Mar 2024 10:27:46 +0800 [thread overview]
Message-ID: <ZeaDIlpWo1XXMBrZ@x1n> (raw)
In-Reply-To: <20240304144203.158477-1-davydov-max@yandex-team.ru>
On Mon, Mar 04, 2024 at 05:42:03PM +0300, Maksim Davydov wrote:
> If a migration stream is broken, the address and flag reading can return
> zero. Thus, an irrelevant flag error will be returned instead of EIO.
> It can be fixed by additional check after the reading.
>
> Signed-off-by: Maksim Davydov <davydov-max@yandex-team.ru>
> ---
> migration/ram.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/migration/ram.c b/migration/ram.c
> index 45a00b45ed..95d8b19c3b 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -3902,6 +3902,12 @@ static int ram_load_precopy(QEMUFile *f)
> i++;
>
> addr = qemu_get_be64(f);
> + ret = qemu_file_get_error(f);
> + if (ret) {
> + error_report("Getting RAM address failed");
> + break;
> + }
> +
> flags = addr & ~TARGET_PAGE_MASK;
> addr &= TARGET_PAGE_MASK;
>
> --
> 2.34.1
>
>
Queued, thanks.
--
Peter Xu
prev parent reply other threads:[~2024-03-05 2:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-04 14:42 [PATCH] migration/ram: add additional check Maksim Davydov
2024-03-05 2:27 ` Peter Xu [this message]
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=ZeaDIlpWo1XXMBrZ@x1n \
--to=peterx@redhat.com \
--cc=davydov-max@yandex-team.ru \
--cc=farosas@suse.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.