qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Yoshiaki Tamura <tamura.yoshiaki@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 05/11] migration: add error handling to migrate_fd_put_notify().
Date: Tue, 04 Oct 2011 22:48:56 +0200	[thread overview]
Message-ID: <m3r52s8ouf.fsf@trasno.mitica> (raw)
In-Reply-To: <4E7C8D77.8070301@redhat.com> (Paolo Bonzini's message of "Fri, 23 Sep 2011 15:45:27 +0200")


(Adding new Yoshiaki email address)

Paolo Bonzini <pbonzini@redhat.com> wrote:
> On 09/23/2011 02:50 PM, Juan Quintela wrote:
>> From: Yoshiaki Tamura<tamura.yoshiaki@lab.ntt.co.jp>
>>
>> Although migrate_fd_put_buffer() sets MIG_STATE_ERROR if it failed,
>> since migrate_fd_put_notify() isn't checking error of underlying
>> QEMUFile, those resources are kept open.  This patch checks it and
>> calls migrate_fd_error() in case of error.
>>
>> Signed-off-by: Yoshiaki Tamura<tamura.yoshiaki@lab.ntt.co.jp>
>> Signed-off-by: Juan Quintela<quintela@redhat.com>
>> ---
>>   migration.c |    6 +++---
>>   1 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/migration.c b/migration.c
>> index 9498e20..0b284ff 100644
>> --- a/migration.c
>> +++ b/migration.c
>> @@ -313,6 +313,9 @@ void migrate_fd_put_notify(void *opaque)
>>
>>       qemu_set_fd_handler2(s->fd, NULL, NULL, NULL, NULL);
>>       qemu_file_put_notify(s->file);
>> +    if (qemu_file_has_error(s->file)) {
>> +        migrate_fd_error(s);
>> +    }
>>   }
>>
>>   ssize_t migrate_fd_put_buffer(void *opaque, const void *data, size_t size)
>> @@ -329,9 +332,6 @@ ssize_t migrate_fd_put_buffer(void *opaque, const void *data, size_t size)
>>
>>       if (ret == -EAGAIN) {
>>           qemu_set_fd_handler2(s->fd, NULL, NULL, migrate_fd_put_notify, s);
>> -    } else if (ret<  0) {
>> -        s->state = MIG_STATE_ERROR;
>> -        notifier_list_notify(&migration_state_notifiers, NULL);
>>       }
>>
>>       return ret;
>
> Why not leave both (or even better, call migrate_fd_error in the else
> branch)?

In the big scheme of things, it don't matter.  migration_fd_put_buffer()
still returns the errno.  it is only called from buffered_put_buffer()
and buffered_flush(), both check the error handling and setup
s->has_error correctly (after this series).

Yoshi, do you remember better?

Later, Juan.

  reply	other threads:[~2011-10-04 20:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-23 12:50 [Qemu-devel] [PATCH v2 00/11] Handle errors during migration Juan Quintela
2011-09-23 12:50 ` [Qemu-devel] [PATCH 01/11] ds1225y: Use stdio instead of QEMUFile Juan Quintela
2011-09-23 12:50 ` [Qemu-devel] [PATCH 02/11] migration: simplify state assignmente Juan Quintela
2011-09-23 12:50 ` [Qemu-devel] [PATCH 03/11] migration: Check that migration is active before cancel it Juan Quintela
2011-09-23 12:50 ` [Qemu-devel] [PATCH 04/11] migration: return real error code Juan Quintela
2011-10-04 18:08   ` Anthony Liguori
2011-10-04 18:35     ` Juan Quintela
2011-10-05 19:52       ` Anthony Liguori
2011-10-05 20:07         ` Juan Quintela
2011-09-23 12:50 ` [Qemu-devel] [PATCH 05/11] migration: add error handling to migrate_fd_put_notify() Juan Quintela
2011-09-23 13:45   ` Paolo Bonzini
2011-10-04 20:48     ` Juan Quintela [this message]
2011-09-23 12:50 ` [Qemu-devel] [PATCH 06/11] migration: If there is one error, it makes no sense to continue Juan Quintela
2011-09-23 12:50 ` [Qemu-devel] [PATCH 07/11] buffered_file: Use right "opaque" Juan Quintela
2011-09-23 12:50 ` [Qemu-devel] [PATCH 08/11] buffered_file: reuse QEMUFile has_error field Juan Quintela
2011-09-23 12:50 ` [Qemu-devel] [PATCH 09/11] migration: don't "write" when migration is not active Juan Quintela
2011-09-23 13:46   ` Paolo Bonzini
2011-09-23 12:50 ` [Qemu-devel] [PATCH 10/11] migration: set error if select return one error Juan Quintela
2011-09-23 12:50 ` [Qemu-devel] [PATCH 11/11] migration: change has_error to contain errno values Juan Quintela

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=m3r52s8ouf.fsf@trasno.mitica \
    --to=quintela@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=tamura.yoshiaki@gmail.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).