From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Juan Quintela <quintela@redhat.com>
Cc: Laurent Vivier <lvivier@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Thomas Huth <thuth@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [PATCH 2/4] multifd: Make sure that we don't do any IO after an error
Date: Wed, 18 Dec 2019 13:57:54 +0000 [thread overview]
Message-ID: <20191218135754.GG3707@work-vm> (raw)
In-Reply-To: <20191218050439.5989-3-quintela@redhat.com>
* Juan Quintela (quintela@redhat.com) wrote:
> Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
I wonder if the fflush's should happen anyway?
> ---
> migration/ram.c | 22 +++++++++++++---------
> 1 file changed, 13 insertions(+), 9 deletions(-)
>
> diff --git a/migration/ram.c b/migration/ram.c
> index db90237977..4b44578e57 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -4132,7 +4132,7 @@ static int ram_save_iterate(QEMUFile *f, void *opaque)
> {
> RAMState **temp = opaque;
> RAMState *rs = *temp;
> - int ret;
> + int ret = 0;
> int i;
> int64_t t0;
> int done = 0;
> @@ -4203,12 +4203,14 @@ static int ram_save_iterate(QEMUFile *f, void *opaque)
> ram_control_after_iterate(f, RAM_CONTROL_ROUND);
>
> out:
> - multifd_send_sync_main(rs);
> - qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
> - qemu_fflush(f);
> - ram_counters.transferred += 8;
> + if (ret >= 0) {
> + multifd_send_sync_main(rs);
> + qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
> + qemu_fflush(f);
> + ram_counters.transferred += 8;
>
> - ret = qemu_file_get_error(f);
> + ret = qemu_file_get_error(f);
> + }
> if (ret < 0) {
> return ret;
> }
> @@ -4260,9 +4262,11 @@ static int ram_save_complete(QEMUFile *f, void *opaque)
> ram_control_after_iterate(f, RAM_CONTROL_FINISH);
> }
>
> - multifd_send_sync_main(rs);
> - qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
> - qemu_fflush(f);
> + if (ret >= 0) {
> + multifd_send_sync_main(rs);
> + qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
> + qemu_fflush(f);
> + }
>
> return ret;
> }
> --
> 2.23.0
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2019-12-18 13:58 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-18 5:04 [PATCH 0/4] Fix multifd + cancel + multifd Juan Quintela
2019-12-18 5:04 ` [PATCH 1/4] qemu-file: Don't do IO after shutdown Juan Quintela
2019-12-18 12:27 ` Dr. David Alan Gilbert
2019-12-18 14:35 ` Juan Quintela
2019-12-18 15:24 ` Dr. David Alan Gilbert
2019-12-29 18:20 ` Juan Quintela
2020-01-08 9:49 ` Dr. David Alan Gilbert
2020-01-08 12:40 ` Juan Quintela
2020-01-16 10:04 ` Juan Quintela
2019-12-18 5:04 ` [PATCH 2/4] multifd: Make sure that we don't do any IO after an error Juan Quintela
2019-12-18 13:57 ` Dr. David Alan Gilbert [this message]
2019-12-18 14:15 ` Juan Quintela
2019-12-18 5:04 ` [PATCH 3/4] migration-test: Make sure that multifd and cancel works Juan Quintela
2019-12-18 16:25 ` Dr. David Alan Gilbert
2019-12-29 18:27 ` Juan Quintela
2019-12-18 5:04 ` [PATCH 4/4] migration: Make sure that we don't call write() in case of error Juan Quintela
2019-12-18 16:33 ` Dr. David Alan Gilbert
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=20191218135754.GG3707@work-vm \
--to=dgilbert@redhat.com \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=thuth@redhat.com \
/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).