qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Wayne Xia <xiawenc@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 7/7] migration: qemu_savevm_iterate has three return values
Date: Thu, 22 Sep 2011 17:50:41 +0800	[thread overview]
Message-ID: <4E7B04F1.8030605@linux.vnet.ibm.com> (raw)
In-Reply-To: <c85dcdeabcd873d3cec69321b34d8ed189550958.1316524908.git.quintela@redhat.com>

于 2011-9-20 21:24, Juan Quintela 写道:
> We were retrying when there was one error, entering a loop.
> 
> Signed-off-by: Juan Quintela<quintela@redhat.com>
> ---
>   migration.c |    6 +++++-
>   1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/migration.c b/migration.c
> index 7f8928a..0baed23 100644
> --- a/migration.c
> +++ b/migration.c
> @@ -362,6 +362,7 @@ void migrate_fd_connect(FdMigrationState *s)
>   void migrate_fd_put_ready(void *opaque)
>   {
>       FdMigrationState *s = opaque;
> +    int ret;
> 
>       if (s->state != MIG_STATE_ACTIVE) {
>           DPRINTF("put_ready returning because of non-active state\n");
> @@ -369,7 +370,10 @@ void migrate_fd_put_ready(void *opaque)
>       }
> 
>       DPRINTF("iterate\n");
> -    if (qemu_savevm_state_iterate(s->mon, s->file) == 1) {
> +    ret = qemu_savevm_state_iterate(s->mon, s->file);
> +    if (ret == -1) {
> +        migrate_fd_error(s);
> +    } else if (ret == 1) {
>           int old_vm_running = vm_running;
> 
>           DPRINTF("done iterating\n");
Maybe macro could be used in the situation that more than 2 possible
types of value may return.


-- 
Best Regards

Wayne Xia
mail:xiawenc@linux.vnet.ibm.com
tel:86-010-82450803

      reply	other threads:[~2011-09-22  9:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-20 13:24 [Qemu-devel] [PATCH 0/7] Handle errors during migration Juan Quintela
2011-09-20 13:24 ` [Qemu-devel] [PATCH 1/7] migration: simplify state assignmente Juan Quintela
2011-09-20 13:24 ` [Qemu-devel] [PATCH 2/7] migration: only flush when there are no errors Juan Quintela
2011-09-20 14:25   ` Daniel P. Berrange
2011-09-20 14:47     ` Juan Quintela
2011-09-20 15:48   ` Paolo Bonzini
2011-09-20 13:24 ` [Qemu-devel] [PATCH 3/7] migration: Check that migration is active before cancel it Juan Quintela
2011-09-20 13:24 ` [Qemu-devel] [PATCH 4/7] savevm: avoid qemu_savevm_state_iterate() to return 1 when qemu file has error Juan Quintela
2011-09-20 13:24 ` [Qemu-devel] [PATCH 5/7] migration: add error handling to migrate_fd_put_notify() Juan Quintela
2011-09-20 15:49   ` Paolo Bonzini
2011-09-20 13:24 ` [Qemu-devel] [PATCH 6/7] migration: If there is one error, it makes no sense to continue Juan Quintela
2011-09-20 13:24 ` [Qemu-devel] [PATCH 7/7] migration: qemu_savevm_iterate has three return values Juan Quintela
2011-09-22  9:50   ` Wayne Xia [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=4E7B04F1.8030605@linux.vnet.ibm.com \
    --to=xiawenc@linux.vnet.ibm.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).