aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2017-04-27 15:00:53 +0200
committerMichael Roth <mdroth@linux.vnet.ibm.com>2017-07-31 16:55:42 -0500
commit45b3eac7527d01c47f3474f47cf3add2f28bd6c8 (patch)
tree32c27aeb85ecdd5d6ea40056f973e5f46af1d2ef
parentc64d184584a0d0fdfd0c9669cf9d603491663b9c (diff)
replication: Make --disable-replication compile again
Broken in commit daa33c5. Cc: qemu-stable@nongnu.org Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com> Message-id: 1493298053-17140-1-git-send-email-armbru@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> (cherry picked from commit 38bb54f323bf7c83496b6a044cfd28896e997a00) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r--migration/colo.c12
-rw-r--r--monitor.c5
2 files changed, 17 insertions, 0 deletions
diff --git a/migration/colo.c b/migration/colo.c
index c19eb3f073..963c80256d 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -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,
diff --git a/monitor.c b/monitor.c
index be282ecb80..2799a377dd 100644
--- a/monitor.c
+++ b/monitor.c
@@ -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