All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH 3/3] monitor: Convert do_migrate() to QError
Date: Wed, 24 Mar 2010 16:40:18 -0300	[thread overview]
Message-ID: <20100324164018.713345f6@redhat.com> (raw)
In-Reply-To: <1269367641-6241-4-git-send-email-armbru@redhat.com>

On Tue, 23 Mar 2010 19:07:21 +0100
Markus Armbruster <armbru@redhat.com> wrote:

> Human monitor error message changes from "unknown migration protocol:
> FOO" to "Invalid parameter uri".
> 
> The conversion is shallow: the FOO_start_outgoing_migration() aren't
> converted.  Converting them is a big job for relatively little
> practical benefit, so leave it for later.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  migration.c |    9 +++++----
>  1 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/migration.c b/migration.c
> index 05f6cc5..47d2ab5 100644
> --- a/migration.c
> +++ b/migration.c
> @@ -56,14 +56,14 @@ void qemu_start_incoming_migration(const char *uri)
>  
>  int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data)
>  {
> -    MigrationState *s = NULL;
> +    MigrationState *s;
>      const char *p;
>      int detach = qdict_get_int(qdict, "detach");
>      const char *uri = qdict_get_str(qdict, "uri");
>  
>      if (current_migration &&
>          current_migration->get_status(current_migration) == MIG_STATE_ACTIVE) {
> -        monitor_printf(mon, "migration already in progress\n");
> +        qerror_report(QERR_MIGRATION_IN_PROGRESS);
>          return -1;
>      }

 What about QERR_OPERATION_IN_PROGRESS? So that we have:

"Operation already in progress: migration".

>  
> @@ -86,12 +86,13 @@ int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data)
>                                          (int)qdict_get_int(qdict, "inc"));
>  #endif
>      } else {
> -        monitor_printf(mon, "unknown migration protocol: %s\n", uri);
> +        qerror_report(QERR_INVALID_PARAMETER, "uri");
>          return -1;
>      }
>  
>      if (s == NULL) {
> -        monitor_printf(mon, "migration failed\n");
> +        /* TODO push error reporting into the FOO_start_outgoing_migration() */
> +        qerror_report(QERR_MIGRATION_FAILED);
>          return -1;
>      }

 I think this one is no better than the automatic UndefinedError
which is going to be triggered. I would only touch this when/if
we get the migration functions converted.

  reply	other threads:[~2010-03-24 19:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-23 18:07 [Qemu-devel] [PATCH 0/3] Convert do_migrate() to QError Markus Armbruster
2010-03-23 18:07 ` [Qemu-devel] [PATCH 1/3] QError: New QERR_MIGRATION_IN_PROGRESS Markus Armbruster
2010-03-23 18:07 ` [Qemu-devel] [PATCH 2/3] QError: New QERR_MIGRATION_FAILED Markus Armbruster
2010-03-23 18:07 ` [Qemu-devel] [PATCH 3/3] monitor: Convert do_migrate() to QError Markus Armbruster
2010-03-24 19:40   ` Luiz Capitulino [this message]
2010-03-25 17:37     ` [Qemu-devel] " Markus Armbruster
2010-03-25 17:49       ` Luiz Capitulino
2010-03-25 19:30         ` Markus Armbruster
2010-03-26 12:31           ` Luiz Capitulino
2010-03-29 12:38             ` Markus Armbruster
2010-03-29 13:31               ` Luiz Capitulino

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=20100324164018.713345f6@redhat.com \
    --to=lcapitulino@redhat.com \
    --cc=armbru@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 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.