On 03/24/2014 07:04 AM, [email protected] wrote: > From: zengjunliang <[email protected]> > > 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 <[email protected]> > Signed-off-by: Gonglei <[email protected]> > --- > 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
signature.asc
Description: OpenPGP digital signature
