Blame SOURCES/kvm-replication-Make-disable-replication-compile-again.patch

76daa3
From 6001217743cc106f781ef7b4c6ca14be0c15fd91 Mon Sep 17 00:00:00 2001
76daa3
From: Markus Armbruster <armbru@redhat.com>
76daa3
Date: Fri, 5 May 2017 08:46:53 +0200
76daa3
Subject: [PATCH 10/11] replication: Make --disable-replication compile again
76daa3
76daa3
RH-Author: Markus Armbruster <armbru@redhat.com>
76daa3
Message-id: <1493974015-21314-2-git-send-email-armbru@redhat.com>
76daa3
Patchwork-id: 75021
76daa3
O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH 1/2] replication: Make --disable-replication compile again
76daa3
Bugzilla: 1422846
76daa3
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
76daa3
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
76daa3
RH-Acked-by: Thomas Huth <thuth@redhat.com>
76daa3
76daa3
Broken in commit daa33c5.
76daa3
76daa3
Cc: qemu-stable@nongnu.org
76daa3
Signed-off-by: Markus Armbruster <armbru@redhat.com>
76daa3
Reviewed-by: Eric Blake <eblake@redhat.com>
76daa3
Reviewed-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
76daa3
Message-id: 1493298053-17140-1-git-send-email-armbru@redhat.com
76daa3
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
76daa3
(cherry picked from commit 38bb54f323bf7c83496b6a044cfd28896e997a00)
76daa3
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
76daa3
---
76daa3
 migration/colo.c | 12 ++++++++++++
76daa3
 monitor.c        |  5 +++++
76daa3
 2 files changed, 17 insertions(+)
76daa3
76daa3
diff --git a/migration/colo.c b/migration/colo.c
76daa3
index c19eb3f..963c802 100644
76daa3
--- a/migration/colo.c
76daa3
+++ b/migration/colo.c
76daa3
@@ -153,6 +153,7 @@ void qmp_xen_set_replication(bool enable, bool primary,
76daa3
                              bool has_failover, bool failover,
76daa3
                              Error **errp)
76daa3
 {
76daa3
+#ifdef CONFIG_REPLICATION
76daa3
     ReplicationMode mode = primary ?
76daa3
                            REPLICATION_MODE_PRIMARY :
76daa3
                            REPLICATION_MODE_SECONDARY;
76daa3
@@ -171,10 +172,14 @@ void qmp_xen_set_replication(bool enable, bool primary,
76daa3
         }
76daa3
         replication_stop_all(failover, failover ? NULL : errp);
76daa3
     }
76daa3
+#else
76daa3
+    abort();
76daa3
+#endif
76daa3
 }
76daa3
 
76daa3
 ReplicationStatus *qmp_query_xen_replication_status(Error **errp)
76daa3
 {
76daa3
+#ifdef CONFIG_REPLICATION
76daa3
     Error *err = NULL;
76daa3
     ReplicationStatus *s = g_new0(ReplicationStatus, 1);
76daa3
 
76daa3
@@ -189,11 +194,18 @@ ReplicationStatus *qmp_query_xen_replication_status(Error **errp)
76daa3
 
76daa3
     error_free(err);
76daa3
     return s;
76daa3
+#else
76daa3
+    abort();
76daa3
+#endif
76daa3
 }
76daa3
 
76daa3
 void qmp_xen_colo_do_checkpoint(Error **errp)
76daa3
 {
76daa3
+#ifdef CONFIG_REPLICATION
76daa3
     replication_do_checkpoint_all(errp);
76daa3
+#else
76daa3
+    abort();
76daa3
+#endif
76daa3
 }
76daa3
 
76daa3
 static void colo_send_message(QEMUFile *f, COLOMessage msg,
76daa3
diff --git a/monitor.c b/monitor.c
76daa3
index 896d669..d4fbc07 100644
76daa3
--- a/monitor.c
76daa3
+++ b/monitor.c
76daa3
@@ -974,6 +974,11 @@ static void qmp_unregister_commands_hack(void)
76daa3
 #ifndef CONFIG_SPICE
76daa3
     qmp_unregister_command(&qmp_commands, "query-spice");
76daa3
 #endif
76daa3
+#ifndef CONFIG_REPLICATION
76daa3
+    qmp_unregister_command(&qmp_commands, "xen-set-replication");
76daa3
+    qmp_unregister_command(&qmp_commands, "query-xen-replication-status");
76daa3
+    qmp_unregister_command(&qmp_commands, "xen-colo-do-checkpoint");
76daa3
+#endif
76daa3
 #ifndef TARGET_I386
76daa3
     qmp_unregister_command(&qmp_commands, "rtc-reset-reinjection");
76daa3
 #endif
76daa3
-- 
76daa3
1.8.3.1
76daa3