From nobody Thu Nov 6 14:17:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1542179866849510.36440139599665; Tue, 13 Nov 2018 23:17:46 -0800 (PST) Received: from localhost ([::1]:58621 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMpQi-0002jk-JF for importer@patchew.org; Wed, 14 Nov 2018 02:17:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33886) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMpPh-0002Rr-1e for qemu-devel@nongnu.org; Wed, 14 Nov 2018 02:16:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gMpPX-0001JX-VR for qemu-devel@nongnu.org; Wed, 14 Nov 2018 02:16:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45268) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gMpPV-0001Gw-9X for qemu-devel@nongnu.org; Wed, 14 Nov 2018 02:16:26 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 305AD369D2; Wed, 14 Nov 2018 07:16:19 +0000 (UTC) Received: from xz-x1.nay.redhat.com (dhcp-14-128.nay.redhat.com [10.66.14.128]) by smtp.corp.redhat.com (Postfix) with ESMTP id 82F515D9C7; Wed, 14 Nov 2018 07:16:13 +0000 (UTC) From: Peter Xu To: qemu-devel@nongnu.org Date: Wed, 14 Nov 2018 15:16:11 +0800 Message-Id: <20181114071611.5352-1-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 14 Nov 2018 07:16:19 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] replication: Make --disable-replication compile X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , zhanghailiang , Yanan Fu , Juan Quintela , "Dr. David Alan Gilbert" , peterx@redhat.com, Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We've fixed it before like 38bb54f323 ("replication: Make --disable-replication compile again", 2017-04-28) but it's failing again. So fix it again. There could be even cleaner way to fix this but current way is the simplest. Let's start from simple. CC: zhanghailiang CC: Juan Quintela CC: "Dr. David Alan Gilbert" CC: Peter Maydell CC: Yanan Fu CC: Markus Armbruster Reported-by: Yanan Fu Signed-off-by: Peter Xu --- migration/colo.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/migration/colo.c b/migration/colo.c index 956ac236b7..78b64ef0cb 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -33,8 +33,10 @@ #include "sysemu/cpus.h" #include "net/filter.h" =20 +#ifdef CONFIG_REPLICATION static bool vmstate_loading; static Notifier packets_compare_notifier; +#endif =20 #define COLO_BUFFER_BASE_SIZE (4 * 1024 * 1024) =20 @@ -59,6 +61,7 @@ static bool colo_runstate_is_stopped(void) =20 static void secondary_vm_do_failover(void) { +#ifdef CONFIG_REPLICATION int old_state; MigrationIncomingState *mis =3D migration_incoming_get_current(); Error *local_err =3D NULL; @@ -121,10 +124,14 @@ static void secondary_vm_do_failover(void) if (mis->migration_incoming_co) { qemu_coroutine_enter(mis->migration_incoming_co); } +#else + abort(); +#endif } =20 static void primary_vm_do_failover(void) { +#ifdef CONFIG_REPLICATION MigrationState *s =3D migrate_get_current(); int old_state; Error *local_err =3D NULL; @@ -165,6 +172,9 @@ static void primary_vm_do_failover(void) =20 /* Notify COLO thread that failover work is finished */ qemu_sem_post(&s->colo_exit_sem); +#else + abort(); +#endif } =20 COLOMode get_colo_mode(void) @@ -271,6 +281,8 @@ COLOStatus *qmp_query_colo_status(Error **errp) return s; } =20 +#ifdef CONFIG_REPLICATION + static void colo_send_message(QEMUFile *f, COLOMessage msg, Error **errp) { @@ -489,9 +501,11 @@ static void colo_compare_notify_checkpoint(Notifier *n= otifier, void *data) { colo_checkpoint_notify(data); } +#endif =20 static void colo_process_checkpoint(MigrationState *s) { +#ifdef CONFIG_REPLICATION QIOChannelBuffer *bioc; QEMUFile *fb =3D NULL; int64_t current_time =3D qemu_clock_get_ms(QEMU_CLOCK_HOST); @@ -603,6 +617,9 @@ out: if (s->rp_state.from_dst_file) { qemu_fclose(s->rp_state.from_dst_file); } +#else + abort(); +#endif } =20 void colo_checkpoint_notify(void *opaque) @@ -631,6 +648,7 @@ void migrate_start_colo_process(MigrationState *s) qemu_mutex_lock_iothread(); } =20 +#ifdef CONFIG_REPLICATION static void colo_wait_handle_message(QEMUFile *f, int *checkpoint_request, Error **errp) { @@ -653,9 +671,11 @@ static void colo_wait_handle_message(QEMUFile *f, int = *checkpoint_request, break; } } +#endif =20 void *colo_process_incoming_thread(void *opaque) { +#ifdef CONFIG_REPLICATION MigrationIncomingState *mis =3D opaque; QEMUFile *fb =3D NULL; QIOChannelBuffer *bioc =3D NULL; /* Cache incoming device state */ @@ -859,4 +879,7 @@ out: =20 rcu_unregister_thread(); return NULL; +#else + abort(); +#endif } --=20 2.17.1