qemu-devel.nongnu.org archive mirror
 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: Mon, 29 Mar 2010 10:31:08 -0300	[thread overview]
Message-ID: <20100329103108.5608bbee@redhat.com> (raw)
In-Reply-To: <m3634fpak4.fsf@blackfin.pond.sub.org>

On Mon, 29 Mar 2010 14:38:35 +0200
Markus Armbruster <armbru@redhat.com> wrote:

> Luiz Capitulino <lcapitulino@redhat.com> writes:
> 
> > On Thu, 25 Mar 2010 20:30:33 +0100
> > Markus Armbruster <armbru@redhat.com> wrote:
> >
> >> Luiz Capitulino <lcapitulino@redhat.com> writes:
> >> 
> >> > On Thu, 25 Mar 2010 18:37:25 +0100
> >> > Markus Armbruster <armbru@redhat.com> wrote:
> >> >
> >> > [...]
> >> >
> >> >> >> @@ -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.
> >> >> 
> >> >> I feel it is a bit better, because:
> >> >> 
> >> >> * It doesn't dilute the nice "this is a bug, and I should report it"
> >> >>   property of UndefinedError.
> >> >> 
> >> >> * It avoids the "returned failure but did not pass an error" message.
> >> >>   Minor, because it's under CONFIG_DEBUG_MONITOR.
> >> >
> >> >  But this is exactly what we want because having QERR_MIGRATION_FAILED
> >> > there doesn't fix the problems those warnings are making us aware of.
> >> 
> >> Except we are already aware of the problem, and additional warnings are
> >> just noise.
> >
> >  Our memory is not the best place for it, not only because we can forget,
> > but also because it's limited on you and me.
> >
> >  Anyone who enables QMP's debugging support should be able to know what's
> > there to be done.
> 
> That's what TODO comments are for.

 It's case by case and in this very case I'd only add QERR_MIGRATION_FAILED
if it makes difference for clients, because besides silencing the warning
w/o the proper fix, this error is probably going to be dropped when the
*_outgoing_migration() functions are converted.

      reply	other threads:[~2010-03-29 13:34 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   ` [Qemu-devel] " Luiz Capitulino
2010-03-25 17:37     ` 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 [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=20100329103108.5608bbee@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 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).