Skip to contentSkip to conversation

replication: Make --disable-replication compile again

PATCH Applied Markus Armbruster 4 participants 5 messages Apr 27, 2017 – Apr 28, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 replication: Make --disable-replication compile again

Broken in commit daa33c5.

---
 migration/colo.c | 12 ++++++++++++
 monitor.c        |  5 +++++
 2 files changed, 17 insertions(+)
migration/colo.c +12 -0
index c19eb3f..963c802 100644
@@ -153,6 +153,7 @@ void qmp_xen_set_replication(bool enable, bool primary,
                              bool has_failover, bool failover,
                              Error **errp)
 {
+#ifdef CONFIG_REPLICATION
     ReplicationMode mode = primary ?
                            REPLICATION_MODE_PRIMARY :
                            REPLICATION_MODE_SECONDARY;
@@ -171,10 +172,14 @@ void qmp_xen_set_replication(bool enable, bool primary,
         }
         replication_stop_all(failover, failover ? NULL : errp);
     }
+#else
+    abort();
+#endif
 }
 
 ReplicationStatus *qmp_query_xen_replication_status(Error **errp)
 {
+#ifdef CONFIG_REPLICATION
     Error *err = NULL;
     ReplicationStatus *s = g_new0(ReplicationStatus, 1);
 
@@ -189,11 +194,18 @@ ReplicationStatus *qmp_query_xen_replication_status(Error **errp)
 
     error_free(err);
     return s;
+#else
+    abort();
+#endif
 }
 
 void qmp_xen_colo_do_checkpoint(Error **errp)
 {
+#ifdef CONFIG_REPLICATION
     replication_do_checkpoint_all(errp);
+#else
+    abort();
+#endif
 }
 
 static void colo_send_message(QEMUFile *f, COLOMessage msg,
monitor.c +5 -0
index 6289e52..62c9f81 100644
@@ -974,6 +974,11 @@ static void qmp_unregister_commands_hack(void)
 #ifndef CONFIG_SPICE
     qmp_unregister_command(&qmp_commands, "query-spice");
 #endif
+#ifndef CONFIG_REPLICATION
+    qmp_unregister_command(&qmp_commands, "xen-set-replication");
+    qmp_unregister_command(&qmp_commands, "query-xen-replication-status");
+    qmp_unregister_command(&qmp_commands, "xen-colo-do-checkpoint");
+#endif
 #ifndef TARGET_I386
     qmp_unregister_command(&qmp_commands, "rtc-reset-reinjection");
 #endif
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#2 lore raw
In reply to Markus Armbruster
Quoted 4 lines · Markus Armbruster

Broken in commit daa33c5.

About this bug I remember have discussed with paolo.

https://lists.nongnu.org/archive/html/qemu-devel/2017-03/msg01326.html

And about this patch content.

Thanks
Zhang Chen

Quoted 67 lines
---
  migration/colo.c | 12 ++++++++++++
  monitor.c        |  5 +++++
  2 files changed, 17 insertions(+)
migration/colo.c +12 -0
index c19eb3f..963c802 100644
@@ -153,6 +153,7 @@ void qmp_xen_set_replication(bool enable, bool primary,
                               bool has_failover, bool failover,
                               Error **errp)
  {
+#ifdef CONFIG_REPLICATION
      ReplicationMode mode = primary ?
                             REPLICATION_MODE_PRIMARY :
                             REPLICATION_MODE_SECONDARY;
@@ -171,10 +172,14 @@ void qmp_xen_set_replication(bool enable, bool primary,
          }
          replication_stop_all(failover, failover ? NULL : errp);
      }
+#else
+    abort();
+#endif
  }
 
  ReplicationStatus *qmp_query_xen_replication_status(Error **errp)
  {
+#ifdef CONFIG_REPLICATION
      Error *err = NULL;
      ReplicationStatus *s = g_new0(ReplicationStatus, 1);
 
@@ -189,11 +194,18 @@ ReplicationStatus *qmp_query_xen_replication_status(Error **errp)
 
      error_free(err);
      return s;
+#else
+    abort();
+#endif
  }
 
  void qmp_xen_colo_do_checkpoint(Error **errp)
  {
+#ifdef CONFIG_REPLICATION
      replication_do_checkpoint_all(errp);
+#else
+    abort();
+#endif
  }
 
  static void colo_send_message(QEMUFile *f, COLOMessage msg,
monitor.c +5 -0
index 6289e52..62c9f81 100644
@@ -974,6 +974,11 @@ static void qmp_unregister_commands_hack(void)
  #ifndef CONFIG_SPICE
      qmp_unregister_command(&qmp_commands, "query-spice");
  #endif
+#ifndef CONFIG_REPLICATION
+    qmp_unregister_command(&qmp_commands, "xen-set-replication");
+    qmp_unregister_command(&qmp_commands, "query-xen-replication-status");
+    qmp_unregister_command(&qmp_commands, "xen-colo-do-checkpoint");
+#endif
  #ifndef TARGET_I386
      qmp_unregister_command(&qmp_commands, "rtc-reset-reinjection");
  #endif
Signature · 2 lines
Thanks
Zhang Chen
#3 lore raw
Quoted 9 lines · Zhang Chen
Quoted 4 lines · Markus Armbruster

Broken in commit daa33c5.

About this bug I remember have discussed with paolo.

https://lists.nongnu.org/archive/html/qemu-devel/2017-03/msg01326.html

If I understand that discussion correctly, it's about replacing --enable-replication (and possibly other stuff) by --enable-colo. Sounds fair to me, patches welcome.

Quoted 3 lines

And about this patch content.

Thanks!