From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WS5eq-0000vN-It for qemu-devel@nongnu.org; Mon, 24 Mar 2014 10:15:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WS5ek-0000FZ-1M for qemu-devel@nongnu.org; Mon, 24 Mar 2014 10:15:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30611) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WS5ej-0000E0-QG for qemu-devel@nongnu.org; Mon, 24 Mar 2014 10:15:13 -0400 Message-ID: <53303DDE.9020407@redhat.com> Date: Mon, 24 Mar 2014 08:14:54 -0600 From: Eric Blake MIME-Version: 1.0 References: <1395666264-12060-1-git-send-email-arei.gonglei@huawei.com> In-Reply-To: <1395666264-12060-1-git-send-email-arei.gonglei@huawei.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="HpBDj0fNpbNALHBr6vCi6rLoDE4qsB0HX" Subject: Re: [Qemu-devel] [PATCH] migration: Fix possible bug for migrate cancel List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: arei.gonglei@huawei.com, qemu-devel@nongnu.org Cc: quintela@redhat.com, zengjunliang , yanqiangjun@huawei.com, lefty.zhao@huawei.com, owasserm@redhat.com, pbonzini@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --HpBDj0fNpbNALHBr6vCi6rLoDE4qsB0HX Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/24/2014 07:04 AM, arei.gonglei@huawei.com wrote: > From: zengjunliang >=20 > 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. >=20 > Signed-off-by: zengjunliang > Signed-off-by: Gonglei > --- > include/qapi/qmp/qerror.h | 3 +++ > migration.c | 5 +++-- > 2 files changed, 6 insertions(+), 2 deletions(-) >=20 > 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 progres= s" > =20 > +#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 progre= ss" 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. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --HpBDj0fNpbNALHBr6vCi6rLoDE4qsB0HX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTMD3fAAoJEKeha0olJ0Nqz1gH/26rcpzpS3pilcerQuOK5gaV tRvTS28ypEIX5pXRSyT0ZMQIXjrGVDjjm8D+ziZj7eZNb3khBH6FgCqyShewq2Kf hrPRncwyDHpqXB6R3thdMcF2Psg+gS87cxACnb6WYis/9jje2V3mXcWM8w1dS9VF B1yRFUSKf2iaTkH6k3hU4PlfcLaPyMuIrRAkQ0an+mlbqV0qMsTfO2jwJPWlzhfv uGGe1Np/hf63z39nBoVr7yJPc481sF/SJQQ4nIQvNvHt/BS0bHVG5KijOz5Wx26p Rxq4dWM+wSWy2WUVcT9lRfPqTtDTa1yfSmrtJWVJDvZ5gTaRabtMi+aq2tudo7c= =fqFH -----END PGP SIGNATURE----- --HpBDj0fNpbNALHBr6vCi6rLoDE4qsB0HX--