QError: Introduce new errors for the migration command
authorLuiz Capitulino <lcapitulino@redhat.com>
Fri, 2 Dec 2011 16:58:12 +0000 (14:58 -0200)
committerLuiz Capitulino <lcapitulino@redhat.com>
Thu, 15 Mar 2012 13:39:51 +0000 (10:39 -0300)
The new errors are QERR_MIGRATION_ACTIVE and QERR_MIGRATION_NOT_SUPPORTED,
which are going to be used by the QAPI converted migration command.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
qerror.c
qerror.h

index f55d435d11e0e95b826780a5905f65ed01624847..41c729a01fcae468f547d6ea797fe63eb67f5729 100644 (file)
--- a/qerror.c
+++ b/qerror.c
@@ -192,6 +192,14 @@ static const QErrorStringTable qerror_table[] = {
         .error_fmt = QERR_KVM_MISSING_CAP,
         .desc      = "Using KVM without %(capability), %(feature) unavailable",
     },
+    {
+        .error_fmt = QERR_MIGRATION_ACTIVE,
+        .desc      = "There's a migration process in progress",
+    },
+    {
+        .error_fmt = QERR_MIGRATION_NOT_SUPPORTED,
+        .desc      = "State blocked by non-migratable device '%(device)'",
+    },
     {
         .error_fmt = QERR_MIGRATION_EXPECTED,
         .desc      = "An incoming migration is expected before this command can be executed",
index e26c63598d907815a3ed2328efbc4d87656984c8..e16f9c27e1d35bd010a90c623ccf025da976d5d5 100644 (file)
--- a/qerror.h
+++ b/qerror.h
@@ -166,6 +166,12 @@ QError *qobject_to_qerror(const QObject *obj);
 #define QERR_KVM_MISSING_CAP \
     "{ 'class': 'KVMMissingCap', 'data': { 'capability': %s, 'feature': %s } }"
 
+#define QERR_MIGRATION_ACTIVE \
+    "{ 'class': 'MigrationActive', 'data': {} }"
+
+#define QERR_MIGRATION_NOT_SUPPORTED \
+    "{ 'class': 'MigrationNotSupported', 'data': {'device': %s} }"
+
 #define QERR_MIGRATION_EXPECTED \
     "{ 'class': 'MigrationExpected', 'data': {} }"