All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: arei.gonglei@huawei.com, qemu-devel@nongnu.org
Cc: quintela@redhat.com, zengjunliang <zengjunliang@huawei.com>,
	yanqiangjun@huawei.com, lefty.zhao@huawei.com,
	owasserm@redhat.com, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH] migration: Fix possible bug for migrate cancel
Date: Mon, 24 Mar 2014 08:14:54 -0600	[thread overview]
Message-ID: <53303DDE.9020407@redhat.com> (raw)
In-Reply-To: <1395666264-12060-1-git-send-email-arei.gonglei@huawei.com>

[-- Attachment #1: Type: text/plain, Size: 1537 bytes --]

On 03/24/2014 07:04 AM, arei.gonglei@huawei.com wrote:
> From: zengjunliang <zengjunliang@huawei.com>
> 
> Return error for migrate cancel, when migration status is not
> MIG_STATE_SETUP or MIG_STATE_ACTIVE. Thus, libvirt can can
> perceive the operation fails.
> 
> Signed-off-by: zengjunliang <zengjunliang@huawei.com>
> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> ---
>  include/qapi/qmp/qerror.h | 3 +++
>  migration.c               | 5 +++--
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h
> index da75abf..b13e3e0 100644
> --- a/include/qapi/qmp/qerror.h
> +++ b/include/qapi/qmp/qerror.h
> @@ -164,6 +164,9 @@ void qerror_report_err(Error *err);
>  #define QERR_MIGRATION_ACTIVE \
>      ERROR_CLASS_GENERIC_ERROR, "There's a migration process in progress"
>  
> +#define QERR_MIGRATION_COMPLETED \

New code should NOT be adding macros in qerror.h, but just directly
report the error.

> +    ERROR_CLASS_GENERIC_ERROR, "There's no migration process in progress"

You use a generic error both for migration active and for no migration
in progress.  The error API documents that clients (such as libvirt)
must NOT parse the human-readable string.  If libvirt is actually going
to behave differently for this particular error, that argues that it may
need a different error category than GENERIC_ERROR.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2014-03-24 14:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-24 13:04 [Qemu-devel] [PATCH] migration: Fix possible bug for migrate cancel arei.gonglei
2014-03-24 14:14 ` Eric Blake [this message]
2014-03-24 15:47 ` Paolo Bonzini
2014-03-24 16:00   ` Eric Blake
2014-03-25 11:15     ` Gonglei (Arei)
2014-03-28  9:18     ` Gonglei (Arei)
2014-03-28  9:28       ` Paolo Bonzini
2014-03-28 11:30         ` Dr. David Alan Gilbert
2014-03-28 12:16           ` Paolo Bonzini

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=53303DDE.9020407@redhat.com \
    --to=eblake@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=lefty.zhao@huawei.com \
    --cc=owasserm@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=yanqiangjun@huawei.com \
    --cc=zengjunliang@huawei.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 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.