Patchwork [1/4] QError: Introduce new errors for the migration command

login
register
mail settings
Submitter Luiz Capitulino
Date March 9, 2012, 6:13 p.m.
Message ID <1331316786-7752-2-git-send-email-lcapitulino@redhat.com>
Download mbox | patch
Permalink /patch/145744/
State New
Headers show

Comments

Luiz Capitulino - March 9, 2012, 6:13 p.m.
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 |    8 ++++++++
 qerror.h |    6 ++++++
 2 files changed, 14 insertions(+)

Patch

diff --git a/qerror.c b/qerror.c
index f55d435..41c729a 100644
--- a/qerror.c
+++ b/qerror.c
@@ -193,6 +193,14 @@  static const QErrorStringTable qerror_table[] = {
         .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",
     },
diff --git a/qerror.h b/qerror.h
index e26c635..e16f9c2 100644
--- 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': {} }"