From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Ensure migrate_cancel does not block doing I/O
Date: Fri, 26 Aug 2011 15:48:28 +0200 [thread overview]
Message-ID: <j3887d$roq$1@dough.gmane.org> (raw)
In-Reply-To: <20110826112506.GM3944@redhat.com>
On 08/26/2011 01:25 PM, Daniel P. Berrange wrote:
> diff --git a/migration.c b/migration.c
> index f5959b4..6448d0b 100644
> --- a/migration.c
> +++ b/migration.c
> @@ -319,6 +319,11 @@ ssize_t migrate_fd_put_buffer(void *opaque, const void *data, size_t size)
> FdMigrationState *s = opaque;
> ssize_t ret;
>
> + if (s->state == MIG_STATE_ERROR ||
> + s->state == MIG_STATE_CANCELLED) {
> + return -EIO;
> + }
> +
> do {
> ret = s->write(s, data, size);
> } while (ret == -1&& ((s->get_error(s)) == EINTR));
>
>
> I think I slightly prefer this second option, since it avoids the EBADF
> scenario. Other opinions ?
I agree.
Paolo
next prev parent reply other threads:[~2011-08-26 13:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-26 10:59 [Qemu-devel] [PATCH] Ensure migrate_cancel does not block doing I/O Daniel P. Berrange
2011-08-26 11:25 ` Daniel P. Berrange
2011-08-26 13:48 ` Paolo Bonzini [this message]
2012-06-01 5:04 ` Amos Kong
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='j3887d$roq$1@dough.gmane.org' \
--to=pbonzini@redhat.com \
--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).