From nobody Thu Mar 28 13:04:52 2024 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 1531236951662434.21159111783925; Tue, 10 Jul 2018 08:35:51 -0700 (PDT) Received: from localhost ([::1]:48394 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcugA-0006u0-8f for importer@patchew.org; Tue, 10 Jul 2018 11:35:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcuaw-00035i-Ui for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcuas-0003GP-9Z for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:26 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:45232 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fcuar-0003G1-Ou for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:22 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 600B677889 for ; Tue, 10 Jul 2018 15:30:21 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-205.ams2.redhat.com [10.36.117.205]) by smtp.corp.redhat.com (Postfix) with ESMTP id A9B22111AF2D; Tue, 10 Jul 2018 15:30:20 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, peterx@redhat.com, quintela@redhat.com Date: Tue, 10 Jul 2018 16:30:02 +0100 Message-Id: <20180710153016.131258-2-dgilbert@redhat.com> In-Reply-To: <20180710153016.131258-1-dgilbert@redhat.com> References: <20180710153016.131258-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 10 Jul 2018 15:30:21 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 10 Jul 2018 15:30:21 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dgilbert@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 01/15] migration: delay postcopy paused state 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Peter Xu Before this patch we firstly setup the postcopy-paused state then we clean up the QEMUFile handles. That can be racy if there is a very fast "migrate-recover" command running in parallel. Fix that up. Reported-by: Peter Maydell Reviewed-by: Juan Quintela Signed-off-by: Peter Xu Message-Id: <20180627132246.5576-2-peterx@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- migration/savevm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index c2f34ffc7c..851d74e8b6 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -2194,9 +2194,6 @@ static bool postcopy_pause_incoming(MigrationIncoming= State *mis) /* Clear the triggered bit to allow one recovery */ mis->postcopy_recover_triggered =3D false; =20 - migrate_set_state(&mis->state, MIGRATION_STATUS_POSTCOPY_ACTIVE, - MIGRATION_STATUS_POSTCOPY_PAUSED); - assert(mis->from_src_file); qemu_file_shutdown(mis->from_src_file); qemu_fclose(mis->from_src_file); @@ -2209,6 +2206,9 @@ static bool postcopy_pause_incoming(MigrationIncoming= State *mis) mis->to_src_file =3D NULL; qemu_mutex_unlock(&mis->rp_mutex); =20 + migrate_set_state(&mis->state, MIGRATION_STATUS_POSTCOPY_ACTIVE, + MIGRATION_STATUS_POSTCOPY_PAUSED); + /* Notify the fault thread for the invalidated file handle */ postcopy_fault_thread_notify(mis); =20 --=20 2.17.1 From nobody Thu Mar 28 13:04:52 2024 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 1531236961471276.3558933643217; Tue, 10 Jul 2018 08:36:01 -0700 (PDT) Received: from localhost ([::1]:48395 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcugK-00075T-Aw for importer@patchew.org; Tue, 10 Jul 2018 11:36:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40736) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcuaw-00035h-UB for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcuat-0003Gz-2P for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:26 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:45234 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fcuas-0003GU-Mz for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:22 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 50C2677889 for ; Tue, 10 Jul 2018 15:30:22 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-205.ams2.redhat.com [10.36.117.205]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9BAD6111AF2D; Tue, 10 Jul 2018 15:30:21 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, peterx@redhat.com, quintela@redhat.com Date: Tue, 10 Jul 2018 16:30:03 +0100 Message-Id: <20180710153016.131258-3-dgilbert@redhat.com> In-Reply-To: <20180710153016.131258-1-dgilbert@redhat.com> References: <20180710153016.131258-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 10 Jul 2018 15:30:22 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 10 Jul 2018 15:30:22 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dgilbert@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 02/15] migration: move income process out of multifd 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Peter Xu Move the call to migration_incoming_process() out of multifd code. It's a bit strange that we can migration generic calls in multifd code. Instead, let multifd_recv_new_channel() return a boolean showing whether it's ready to continue the incoming migration. Signed-off-by: Peter Xu Message-Id: <20180627132246.5576-3-peterx@redhat.com> Reviewed-by: Juan Quintela Signed-off-by: Dr. David Alan Gilbert --- migration/migration.c | 5 ++++- migration/ram.c | 11 +++++------ migration/ram.h | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 94d71f8b24..aea6fb7444 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -507,7 +507,10 @@ void migration_ioc_process_incoming(QIOChannel *ioc) migration_incoming_setup(f); return; } - multifd_recv_new_channel(ioc); + + if (multifd_recv_new_channel(ioc)) { + migration_incoming_process(); + } } =20 /** diff --git a/migration/ram.c b/migration/ram.c index 1cd98d6398..23cea47090 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -1311,7 +1311,8 @@ bool multifd_recv_all_channels_created(void) return thread_count =3D=3D atomic_read(&multifd_recv_state->count); } =20 -void multifd_recv_new_channel(QIOChannel *ioc) +/* Return true if multifd is ready for the migration, otherwise false */ +bool multifd_recv_new_channel(QIOChannel *ioc) { MultiFDRecvParams *p; Error *local_err =3D NULL; @@ -1320,7 +1321,7 @@ void multifd_recv_new_channel(QIOChannel *ioc) id =3D multifd_recv_initial_packet(ioc, &local_err); if (id < 0) { multifd_recv_terminate_threads(local_err); - return; + return false; } =20 p =3D &multifd_recv_state->params[id]; @@ -1328,7 +1329,7 @@ void multifd_recv_new_channel(QIOChannel *ioc) error_setg(&local_err, "multifd: received id '%d' already setup'", id); multifd_recv_terminate_threads(local_err); - return; + return false; } p->c =3D ioc; object_ref(OBJECT(ioc)); @@ -1339,9 +1340,7 @@ void multifd_recv_new_channel(QIOChannel *ioc) qemu_thread_create(&p->thread, p->name, multifd_recv_thread, p, QEMU_THREAD_JOINABLE); atomic_inc(&multifd_recv_state->count); - if (multifd_recv_state->count =3D=3D migrate_multifd_channels()) { - migration_incoming_process(); - } + return multifd_recv_state->count =3D=3D migrate_multifd_channels(); } =20 /** diff --git a/migration/ram.h b/migration/ram.h index d386f4d641..457bf54b8c 100644 --- a/migration/ram.h +++ b/migration/ram.h @@ -46,7 +46,7 @@ int multifd_save_cleanup(Error **errp); int multifd_load_setup(void); int multifd_load_cleanup(Error **errp); bool multifd_recv_all_channels_created(void); -void multifd_recv_new_channel(QIOChannel *ioc); +bool multifd_recv_new_channel(QIOChannel *ioc); =20 uint64_t ram_pagesize_summary(void); int ram_save_queue_pages(const char *rbname, ram_addr_t start, ram_addr_t = len); --=20 2.17.1 From nobody Thu Mar 28 13:04:52 2024 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 153123713364470.38422191047084; Tue, 10 Jul 2018 08:38:53 -0700 (PDT) Received: from localhost ([::1]:48407 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcuj1-0000lu-0s for importer@patchew.org; Tue, 10 Jul 2018 11:38:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40740) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcuaw-00035k-Uv for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcuau-0003Jz-V4 for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:26 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38412 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fcuat-0003H7-LY for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:24 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 43C7B7C6A9 for ; Tue, 10 Jul 2018 15:30:23 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-205.ams2.redhat.com [10.36.117.205]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8D5C9111AF2D; Tue, 10 Jul 2018 15:30:22 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, peterx@redhat.com, quintela@redhat.com Date: Tue, 10 Jul 2018 16:30:04 +0100 Message-Id: <20180710153016.131258-4-dgilbert@redhat.com> In-Reply-To: <20180710153016.131258-1-dgilbert@redhat.com> References: <20180710153016.131258-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 10 Jul 2018 15:30:23 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 10 Jul 2018 15:30:23 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dgilbert@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 03/15] migration: unbreak postcopy recovery 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Peter Xu The whole postcopy recovery logic was accidentally broken. We need to fix it in two steps. This is the first step that we should do the recovery when needed. It was bypassed before after commit 36c2f8be2c. Introduce postcopy_try_recovery() helper for the postcopy recovery logic. Call it both in migration_fd_process_incoming() and migration_ioc_process_incoming(). Fixes: 36c2f8be2c ("migration: Delay start of migration main routines") Signed-off-by: Peter Xu Message-Id: <20180627132246.5576-4-peterx@redhat.com> Reviewed-by: Juan Quintela Signed-off-by: Dr. David Alan Gilbert --- migration/migration.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index aea6fb7444..eb3e09e899 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -466,7 +466,8 @@ void migration_incoming_process(void) qemu_coroutine_enter(co); } =20 -void migration_fd_process_incoming(QEMUFile *f) +/* Returns true if recovered from a paused migration, otherwise false */ +static bool postcopy_try_recover(QEMUFile *f) { MigrationIncomingState *mis =3D migration_incoming_get_current(); =20 @@ -491,11 +492,20 @@ void migration_fd_process_incoming(QEMUFile *f) * that source is ready to reply to page requests. */ qemu_sem_post(&mis->postcopy_pause_sem_dst); - } else { - /* New incoming migration */ - migration_incoming_setup(f); - migration_incoming_process(); + return true; + } + + return false; +} + +void migration_fd_process_incoming(QEMUFile *f) +{ + if (postcopy_try_recover(f)) { + return; } + + migration_incoming_setup(f); + migration_incoming_process(); } =20 void migration_ioc_process_incoming(QIOChannel *ioc) @@ -504,6 +514,9 @@ void migration_ioc_process_incoming(QIOChannel *ioc) =20 if (!mis->from_src_file) { QEMUFile *f =3D qemu_fopen_channel_input(ioc); + if (postcopy_try_recover(f)) { + return; + } migration_incoming_setup(f); return; } --=20 2.17.1 From nobody Thu Mar 28 13:04:52 2024 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 1531237289535112.96828866654039; Tue, 10 Jul 2018 08:41:29 -0700 (PDT) Received: from localhost ([::1]:48429 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fculc-0003NI-J3 for importer@patchew.org; Tue, 10 Jul 2018 11:41:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40739) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcuaw-00035j-Uu for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcuav-0003KG-0A for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:26 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38414 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fcuau-0003Ii-Li for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:24 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 361AD346F3 for ; Tue, 10 Jul 2018 15:30:24 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-205.ams2.redhat.com [10.36.117.205]) by smtp.corp.redhat.com (Postfix) with ESMTP id 80FC3111AF2D; Tue, 10 Jul 2018 15:30:23 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, peterx@redhat.com, quintela@redhat.com Date: Tue, 10 Jul 2018 16:30:05 +0100 Message-Id: <20180710153016.131258-5-dgilbert@redhat.com> In-Reply-To: <20180710153016.131258-1-dgilbert@redhat.com> References: <20180710153016.131258-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 10 Jul 2018 15:30:24 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 10 Jul 2018 15:30:24 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dgilbert@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 04/15] migration: unify incoming processing 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Peter Xu This is the 2nd patch to unbreak postcopy recovery. Let's unify the migration_incoming_process() call at a single place rather than calling it in connection setup codes. This fixes a problem that we will go into incoming migration procedure even if we are trying to recovery from a paused postcopy migration. Fixes: 36c2f8be2c ("migration: Delay start of migration main routines") Signed-off-by: Peter Xu Message-Id: <20180627132246.5576-5-peterx@redhat.com> Reviewed-by: Juan Quintela Signed-off-by: Dr. David Alan Gilbert --- migration/exec.c | 3 --- migration/fd.c | 3 --- migration/migration.c | 18 ++++++++++++++++-- migration/socket.c | 5 ----- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/migration/exec.c b/migration/exec.c index 0bbeb63c97..375d2e1b54 100644 --- a/migration/exec.c +++ b/migration/exec.c @@ -49,9 +49,6 @@ static gboolean exec_accept_incoming_migration(QIOChannel= *ioc, { migration_channel_process_incoming(ioc); object_unref(OBJECT(ioc)); - if (!migrate_use_multifd()) { - migration_incoming_process(); - } return G_SOURCE_REMOVE; } =20 diff --git a/migration/fd.c b/migration/fd.c index fee34ffdc0..a7c13df4ad 100644 --- a/migration/fd.c +++ b/migration/fd.c @@ -49,9 +49,6 @@ static gboolean fd_accept_incoming_migration(QIOChannel *= ioc, { migration_channel_process_incoming(ioc); object_unref(OBJECT(ioc)); - if (!migrate_use_multifd()) { - migration_incoming_process(); - } return G_SOURCE_REMOVE; } =20 diff --git a/migration/migration.c b/migration/migration.c index eb3e09e899..0404c53215 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -511,17 +511,31 @@ void migration_fd_process_incoming(QEMUFile *f) void migration_ioc_process_incoming(QIOChannel *ioc) { MigrationIncomingState *mis =3D migration_incoming_get_current(); + bool start_migration; =20 if (!mis->from_src_file) { + /* The first connection (multifd may have multiple) */ QEMUFile *f =3D qemu_fopen_channel_input(ioc); + + /* If it's a recovery, we're done */ if (postcopy_try_recover(f)) { return; } + migration_incoming_setup(f); - return; + + /* + * Common migration only needs one channel, so we can start + * right now. Multifd needs more than one channel, we wait. + */ + start_migration =3D !migrate_use_multifd(); + } else { + /* Multiple connections */ + assert(migrate_use_multifd()); + start_migration =3D multifd_recv_new_channel(ioc); } =20 - if (multifd_recv_new_channel(ioc)) { + if (start_migration) { migration_incoming_process(); } } diff --git a/migration/socket.c b/migration/socket.c index 3456eb76e9..f4c8174400 100644 --- a/migration/socket.c +++ b/migration/socket.c @@ -168,12 +168,7 @@ static void socket_accept_incoming_migration(QIONetLis= tener *listener, if (migration_has_all_channels()) { /* Close listening socket as its no longer needed */ qio_net_listener_disconnect(listener); - object_unref(OBJECT(listener)); - - if (!migrate_use_multifd()) { - migration_incoming_process(); - } } } =20 --=20 2.17.1 From nobody Thu Mar 28 13:04:52 2024 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 1531237408030813.9373827805972; Tue, 10 Jul 2018 08:43:28 -0700 (PDT) Received: from localhost ([::1]:48437 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcunW-0004nB-VJ for importer@patchew.org; Tue, 10 Jul 2018 11:43:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcuay-00037p-Nf for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcuax-0003MZ-Tb for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:28 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:45246 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fcuax-0003Lz-N9 for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:27 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 57DAF77889 for ; Tue, 10 Jul 2018 15:30:27 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-205.ams2.redhat.com [10.36.117.205]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7234A111AF2D; Tue, 10 Jul 2018 15:30:24 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, peterx@redhat.com, quintela@redhat.com Date: Tue, 10 Jul 2018 16:30:06 +0100 Message-Id: <20180710153016.131258-6-dgilbert@redhat.com> In-Reply-To: <20180710153016.131258-1-dgilbert@redhat.com> References: <20180710153016.131258-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 10 Jul 2018 15:30:27 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 10 Jul 2018 15:30:27 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dgilbert@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 05/15] migration: simplify check to use qemu file buffer 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Peter Xu Firstly, renaming the old matching_page_sizes variable to matches_target_page_size, which suites more to what it did (it only checks against target page size rather than multiple page sizes). Meanwhile, simplify the check logic a bit, and enhance the comments. Should have no functional change. Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Signed-off-by: Peter Xu Message-Id: <20180710091902.28780-2-peterx@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- migration/ram.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 23cea47090..49068e86d3 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -3580,7 +3580,7 @@ static int ram_load_postcopy(QEMUFile *f) { int flags =3D 0, ret =3D 0; bool place_needed =3D false; - bool matching_page_sizes =3D false; + bool matches_target_page_size =3D false; MigrationIncomingState *mis =3D migration_incoming_get_current(); /* Temporary page that is later 'placed' */ void *postcopy_host_page =3D postcopy_get_tmp_page(mis); @@ -3620,7 +3620,7 @@ static int ram_load_postcopy(QEMUFile *f) ret =3D -EINVAL; break; } - matching_page_sizes =3D block->page_size =3D=3D TARGET_PAGE_SI= ZE; + matches_target_page_size =3D block->page_size =3D=3D TARGET_PA= GE_SIZE; /* * Postcopy requires that we place whole host pages atomically; * these may be huge pages for RAMBlocks that are backed by @@ -3668,12 +3668,17 @@ static int ram_load_postcopy(QEMUFile *f) =20 case RAM_SAVE_FLAG_PAGE: all_zero =3D false; - if (!place_needed || !matching_page_sizes) { + if (!matches_target_page_size) { + /* For huge pages, we always use temporary buffer */ qemu_get_buffer(f, page_buffer, TARGET_PAGE_SIZE); } else { - /* Avoids the qemu_file copy during postcopy, which is - * going to do a copy later; can only do it when we - * do this read in one go (matching page sizes) + /* + * For small pages that matches target page size, we + * avoid the qemu_file copy. Instead we directly use + * the buffer of QEMUFile to place the page. Note: we + * cannot do any QEMUFile operation before using that + * buffer to make sure the buffer is valid when + * placing the page. */ qemu_get_buffer_in_place(f, (uint8_t **)&place_source, TARGET_PAGE_SIZE); --=20 2.17.1 From nobody Thu Mar 28 13:04:52 2024 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1531236768472724.7870398293812; Tue, 10 Jul 2018 08:32:48 -0700 (PDT) Received: from localhost ([::1]:48379 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcudD-0004Ji-A5 for importer@patchew.org; Tue, 10 Jul 2018 11:32:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcuaz-00038v-QF for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcuay-0003NK-QQ for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:29 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:60500 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fcuay-0003N0-MM for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:28 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4A3DC40214E2 for ; Tue, 10 Jul 2018 15:30:28 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-205.ams2.redhat.com [10.36.117.205]) by smtp.corp.redhat.com (Postfix) with ESMTP id 947D0111AF2D; Tue, 10 Jul 2018 15:30:27 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, peterx@redhat.com, quintela@redhat.com Date: Tue, 10 Jul 2018 16:30:07 +0100 Message-Id: <20180710153016.131258-7-dgilbert@redhat.com> In-Reply-To: <20180710153016.131258-1-dgilbert@redhat.com> References: <20180710153016.131258-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 10 Jul 2018 15:30:28 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 10 Jul 2018 15:30:28 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dgilbert@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 06/15] migration: loosen recovery check when load vm 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Peter Xu We were checking against -EIO, assuming that it will cover all IO failures. But actually it is not. One example is that in qemu_loadvm_section_start_full() we can have tons of places that will return -EINVAL even if the error is caused by IO failures on the network. Let's loosen the recovery check logic here to cover all the error cases happened by removing the explicit check against -EIO. After all we won't lose anything here if any other failure happened. Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Signed-off-by: Peter Xu Message-Id: <20180710091902.28780-3-peterx@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- migration/savevm.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index 851d74e8b6..efcc795071 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -2276,18 +2276,14 @@ out: qemu_file_set_error(f, ret); =20 /* - * Detect whether it is: - * - * 1. postcopy running (after receiving all device data, which - * must be in POSTCOPY_INCOMING_RUNNING state. Note that - * POSTCOPY_INCOMING_LISTENING is still not enough, it's - * still receiving device states). - * 2. network failure (-EIO) - * - * If so, we try to wait for a recovery. + * If we are during an active postcopy, then we pause instead + * of bail out to at least keep the VM's dirty data. Note + * that POSTCOPY_INCOMING_LISTENING stage is still not enough, + * during which we're still receiving device states and we + * still haven't yet started the VM on destination. */ if (postcopy_state_get() =3D=3D POSTCOPY_INCOMING_RUNNING && - ret =3D=3D -EIO && postcopy_pause_incoming(mis)) { + postcopy_pause_incoming(mis)) { /* Reset f to point to the newly created channel */ f =3D mis->from_src_file; goto retry; --=20 2.17.1 From nobody Thu Mar 28 13:04:52 2024 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 153123677319340.86222352881828; Tue, 10 Jul 2018 08:32:53 -0700 (PDT) Received: from localhost ([::1]:48378 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcudD-0004Jf-9O for importer@patchew.org; Tue, 10 Jul 2018 11:32:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcub0-00039c-I2 for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcuaz-0003Nr-Nw for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:30 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38424 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fcuaz-0003Nf-Jl for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:29 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3E7AD7C6A9 for ; Tue, 10 Jul 2018 15:30:29 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-205.ams2.redhat.com [10.36.117.205]) by smtp.corp.redhat.com (Postfix) with ESMTP id 868E2111AF2D; Tue, 10 Jul 2018 15:30:28 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, peterx@redhat.com, quintela@redhat.com Date: Tue, 10 Jul 2018 16:30:08 +0100 Message-Id: <20180710153016.131258-8-dgilbert@redhat.com> In-Reply-To: <20180710153016.131258-1-dgilbert@redhat.com> References: <20180710153016.131258-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 10 Jul 2018 15:30:29 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 10 Jul 2018 15:30:29 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dgilbert@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 07/15] migration: fix incorrect bitmap size calculation 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Peter Xu The calculation on size of received bitmap is incorrect for postcopy recovery. Here we wanted to let the size to cover all the valid bits in the bitmap, we should use DIV_ROUND_UP() instead of a division. For example, a RAMBlock with size=3D4K (which contains only one single 4K page) will have nbits=3D1, then nbits/8=3D0, then the real bitmap won't be sent to source at all. Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Signed-off-by: Peter Xu Message-Id: <20180710091902.28780-4-peterx@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- migration/ram.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 49068e86d3..52dd678092 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -235,7 +235,7 @@ int64_t ramblock_recv_bitmap_send(QEMUFile *file, bitmap_to_le(le_bitmap, block->receivedmap, nbits); =20 /* Size of the bitmap, in bytes */ - size =3D nbits / 8; + size =3D DIV_ROUND_UP(nbits, 8); =20 /* * size is always aligned to 8 bytes for 64bit machines, but it @@ -3944,7 +3944,7 @@ int ram_dirty_bitmap_reload(MigrationState *s, RAMBlo= ck *block) int ret =3D -EINVAL; QEMUFile *file =3D s->rp_state.from_dst_file; unsigned long *le_bitmap, nbits =3D block->used_length >> TARGET_PAGE_= BITS; - uint64_t local_size =3D nbits / 8; + uint64_t local_size =3D DIV_ROUND_UP(nbits, 8); uint64_t size, end_mark; =20 trace_ram_dirty_bitmap_reload_begin(block->idstr); --=20 2.17.1 From nobody Thu Mar 28 13:04:52 2024 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 1531236961666864.6999044307886; Tue, 10 Jul 2018 08:36:01 -0700 (PDT) Received: from localhost ([::1]:48396 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcugK-00075a-Ig for importer@patchew.org; Tue, 10 Jul 2018 11:36:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40834) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcub1-0003Aw-IK for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcub0-0003ON-NE for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:31 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:34020 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fcub0-0003O7-IY for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:30 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 34AB54023132 for ; Tue, 10 Jul 2018 15:30:30 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-205.ams2.redhat.com [10.36.117.205]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7E06A111AF2D; Tue, 10 Jul 2018 15:30:29 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, peterx@redhat.com, quintela@redhat.com Date: Tue, 10 Jul 2018 16:30:09 +0100 Message-Id: <20180710153016.131258-9-dgilbert@redhat.com> In-Reply-To: <20180710153016.131258-1-dgilbert@redhat.com> References: <20180710153016.131258-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 10 Jul 2018 15:30:30 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 10 Jul 2018 15:30:30 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dgilbert@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 08/15] migration: show pause/recover state on dst host 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Peter Xu These two states will be missing when doing "query-migrate" on destination VM. Add these states so that we can get the query results as expected. Signed-off-by: Peter Xu Message-Id: <20180710091902.28780-5-peterx@redhat.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/migration.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/migration/migration.c b/migration/migration.c index 0404c53215..8d56d56930 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -911,6 +911,8 @@ static void fill_destination_migration_info(MigrationIn= fo *info) case MIGRATION_STATUS_CANCELLED: case MIGRATION_STATUS_ACTIVE: case MIGRATION_STATUS_POSTCOPY_ACTIVE: + case MIGRATION_STATUS_POSTCOPY_PAUSED: + case MIGRATION_STATUS_POSTCOPY_RECOVER: case MIGRATION_STATUS_FAILED: case MIGRATION_STATUS_COLO: info->has_status =3D true; --=20 2.17.1 From nobody Thu Mar 28 13:04:52 2024 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 1531236783341363.02159858726543; Tue, 10 Jul 2018 08:33:03 -0700 (PDT) Received: from localhost ([::1]:48380 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcudS-0004Tm-6B for importer@patchew.org; Tue, 10 Jul 2018 11:33:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40861) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcub2-0003Bm-Pp for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcub1-0003P1-MF for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:32 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38426 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fcub1-0003Oe-Gl for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:31 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2800C7C6A9 for ; Tue, 10 Jul 2018 15:30:31 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-205.ams2.redhat.com [10.36.117.205]) by smtp.corp.redhat.com (Postfix) with ESMTP id 71AF1111AF2D; Tue, 10 Jul 2018 15:30:30 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, peterx@redhat.com, quintela@redhat.com Date: Tue, 10 Jul 2018 16:30:10 +0100 Message-Id: <20180710153016.131258-10-dgilbert@redhat.com> In-Reply-To: <20180710153016.131258-1-dgilbert@redhat.com> References: <20180710153016.131258-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 10 Jul 2018 15:30:31 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 10 Jul 2018 15:30:31 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dgilbert@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 09/15] tests: introduce migrate_postcopy_* helpers 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Peter Xu Separate the old postcopy UNIX socket test into three steps, provide a helper for each step. With these helpers, we can do more compliated tests like postcopy recovery, while keep the codes shared. Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Reviewed-by: Balamuruhan S Signed-off-by: Peter Xu Message-Id: <20180710091902.28780-6-peterx@redhat.com> Signed-off-by: Dr. David Alan Gilbert Fix up merge with 2e295789 / Skip tests for ppc tcg --- tests/migration-test.c | 42 +++++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index 331efb0fe5..193c7df94e 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -351,13 +351,19 @@ static void migrate(QTestState *who, const char *uri) qobject_unref(rsp); } =20 -static void migrate_start_postcopy(QTestState *who) +static void migrate_postcopy_start(QTestState *from, QTestState *to) { QDict *rsp; =20 - rsp =3D wait_command(who, "{ 'execute': 'migrate-start-postcopy' }"); + rsp =3D wait_command(from, "{ 'execute': 'migrate-start-postcopy' }"); g_assert(qdict_haskey(rsp, "return")); qobject_unref(rsp); + + if (!got_stop) { + qtest_qmp_eventwait(from, "STOP"); + } + + qtest_qmp_eventwait(to, "RESUME"); } =20 static int test_migrate_start(QTestState **from, QTestState **to, @@ -510,13 +516,14 @@ static void test_deprecated(void) qtest_quit(from); } =20 -static void test_postcopy(void) +static int migrate_postcopy_prepare(QTestState **from_ptr, + QTestState **to_ptr) { char *uri =3D g_strdup_printf("unix:%s/migsocket", tmpfs); QTestState *from, *to; =20 if (test_migrate_start(&from, &to, uri, false)) { - return; + return -1; } =20 migrate_set_capability(from, "postcopy-ram", "true"); @@ -534,28 +541,41 @@ static void test_postcopy(void) wait_for_serial("src_serial"); =20 migrate(from, uri); + g_free(uri); =20 wait_for_migration_pass(from); =20 - migrate_start_postcopy(from); + *from_ptr =3D from; + *to_ptr =3D to; =20 - if (!got_stop) { - qtest_qmp_eventwait(from, "STOP"); - } + return 0; +} =20 - qtest_qmp_eventwait(to, "RESUME"); +static void migrate_postcopy_complete(QTestState *from, QTestState *to) +{ + wait_for_migration_complete(from); =20 + /* Make sure we get at least one "B" on destination */ wait_for_serial("dest_serial"); - wait_for_migration_complete(from); =20 if (uffd_feature_thread_id) { read_blocktime(to); } - g_free(uri); =20 test_migrate_end(from, to, true); } =20 +static void test_postcopy(void) +{ + QTestState *from, *to; + + if (migrate_postcopy_prepare(&from, &to)) { + return; + } + migrate_postcopy_start(from, to); + migrate_postcopy_complete(from, to); +} + static void test_baddest(void) { QTestState *from, *to; --=20 2.17.1 From nobody Thu Mar 28 13:04:52 2024 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 1531237305608256.29995969192976; Tue, 10 Jul 2018 08:41:45 -0700 (PDT) Received: from localhost ([::1]:48431 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fculs-0003bw-JL for importer@patchew.org; Tue, 10 Jul 2018 11:41:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40911) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcub7-0003Ga-LB for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcub2-0003PZ-Io for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:37 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:34030 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fcub2-0003PH-EX for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:32 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1E326402315B for ; Tue, 10 Jul 2018 15:30:32 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-205.ams2.redhat.com [10.36.117.205]) by smtp.corp.redhat.com (Postfix) with ESMTP id 662DE111AF2D; Tue, 10 Jul 2018 15:30:31 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, peterx@redhat.com, quintela@redhat.com Date: Tue, 10 Jul 2018 16:30:11 +0100 Message-Id: <20180710153016.131258-11-dgilbert@redhat.com> In-Reply-To: <20180710153016.131258-1-dgilbert@redhat.com> References: <20180710153016.131258-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 10 Jul 2018 15:30:32 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 10 Jul 2018 15:30:32 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dgilbert@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 10/15] tests: allow migrate() to take extra flags 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Peter Xu For example, we can pass in '"resume": true' to resume a migration. Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Reviewed-by: Balamuruhan S Signed-off-by: Peter Xu Message-Id: <20180710091902.28780-7-peterx@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- tests/migration-test.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index 193c7df94e..0a1e2f0a09 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -337,14 +337,14 @@ static void migrate_set_capability(QTestState *who, c= onst char *capability, qobject_unref(rsp); } =20 -static void migrate(QTestState *who, const char *uri) +static void migrate(QTestState *who, const char *uri, const char *extra) { QDict *rsp; gchar *cmd; =20 cmd =3D g_strdup_printf("{ 'execute': 'migrate'," - "'arguments': { 'uri': '%s' } }", - uri); + " 'arguments': { 'uri': '%s' %s } }", + uri, extra ? extra : ""); rsp =3D qtest_qmp(who, cmd); g_free(cmd); g_assert(qdict_haskey(rsp, "return")); @@ -540,7 +540,7 @@ static int migrate_postcopy_prepare(QTestState **from_p= tr, /* Wait for the first serial output from the source */ wait_for_serial("src_serial"); =20 - migrate(from, uri); + migrate(from, uri, NULL); g_free(uri); =20 wait_for_migration_pass(from); @@ -586,7 +586,7 @@ static void test_baddest(void) if (test_migrate_start(&from, &to, "tcp:0:0", true)) { return; } - migrate(from, "tcp:0:0"); + migrate(from, "tcp:0:0", NULL); do { rsp =3D wait_command(from, "{ 'execute': 'query-migrate' }"); rsp_return =3D qdict_get_qdict(rsp, "return"); @@ -630,7 +630,7 @@ static void test_precopy_unix(void) /* Wait for the first serial output from the source */ wait_for_serial("src_serial"); =20 - migrate(from, uri); + migrate(from, uri, NULL); =20 wait_for_migration_pass(from); =20 --=20 2.17.1 From nobody Thu Mar 28 13:04:52 2024 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 1531237142691544.1828765895517; Tue, 10 Jul 2018 08:39:02 -0700 (PDT) Received: from localhost ([::1]:48408 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcujF-0000wq-HF for importer@patchew.org; Tue, 10 Jul 2018 11:39:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40909) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcub7-0003GV-Kf for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcub3-0003Q9-Nv for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:37 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:34032 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fcub3-0003Pn-Ec for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:33 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 10507402315B for ; Tue, 10 Jul 2018 15:30:33 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-205.ams2.redhat.com [10.36.117.205]) by smtp.corp.redhat.com (Postfix) with ESMTP id 59825111AF2D; Tue, 10 Jul 2018 15:30:32 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, peterx@redhat.com, quintela@redhat.com Date: Tue, 10 Jul 2018 16:30:12 +0100 Message-Id: <20180710153016.131258-12-dgilbert@redhat.com> In-Reply-To: <20180710153016.131258-1-dgilbert@redhat.com> References: <20180710153016.131258-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 10 Jul 2018 15:30:33 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 10 Jul 2018 15:30:33 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dgilbert@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 11/15] tests: introduce migrate_query*() helpers 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Peter Xu Introduce helpers to query migration states and use it. Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Reviewed-by: Balamuruhan S Signed-off-by: Peter Xu Message-Id: <20180710091902.28780-8-peterx@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- tests/migration-test.c | 64 ++++++++++++++++++++++++++++-------------- 1 file changed, 43 insertions(+), 21 deletions(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index 0a1e2f0a09..e2697efd01 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -168,6 +168,37 @@ static QDict *wait_command(QTestState *who, const char= *command) return response; } =20 +/* + * Note: caller is responsible to free the returned object via + * qobject_unref() after use + */ +static QDict *migrate_query(QTestState *who) +{ + QDict *rsp, *rsp_return; + + rsp =3D wait_command(who, "{ 'execute': 'query-migrate' }"); + rsp_return =3D qdict_get_qdict(rsp, "return"); + g_assert(rsp_return); + qobject_ref(rsp_return); + qobject_unref(rsp); + + return rsp_return; +} + +/* + * Note: caller is responsible to free the returned object via + * g_free() after use + */ +static gchar *migrate_query_status(QTestState *who) +{ + QDict *rsp_return =3D migrate_query(who); + gchar *status =3D g_strdup(qdict_get_str(rsp_return, "status")); + + g_assert(status); + qobject_unref(rsp_return); + + return status; +} =20 /* * It's tricky to use qemu's migration event capability with qtest, @@ -176,11 +207,10 @@ static QDict *wait_command(QTestState *who, const cha= r *command) =20 static uint64_t get_migration_pass(QTestState *who) { - QDict *rsp, *rsp_return, *rsp_ram; + QDict *rsp_return, *rsp_ram; uint64_t result; =20 - rsp =3D wait_command(who, "{ 'execute': 'query-migrate' }"); - rsp_return =3D qdict_get_qdict(rsp, "return"); + rsp_return =3D migrate_query(who); if (!qdict_haskey(rsp_return, "ram")) { /* Still in setup */ result =3D 0; @@ -188,33 +218,29 @@ static uint64_t get_migration_pass(QTestState *who) rsp_ram =3D qdict_get_qdict(rsp_return, "ram"); result =3D qdict_get_try_int(rsp_ram, "dirty-sync-count", 0); } - qobject_unref(rsp); + qobject_unref(rsp_return); return result; } =20 static void read_blocktime(QTestState *who) { - QDict *rsp, *rsp_return; + QDict *rsp_return; =20 - rsp =3D wait_command(who, "{ 'execute': 'query-migrate' }"); - rsp_return =3D qdict_get_qdict(rsp, "return"); + rsp_return =3D migrate_query(who); g_assert(qdict_haskey(rsp_return, "postcopy-blocktime")); - qobject_unref(rsp); + qobject_unref(rsp_return); } =20 static void wait_for_migration_complete(QTestState *who) { while (true) { - QDict *rsp, *rsp_return; bool completed; - const char *status; + char *status; =20 - rsp =3D wait_command(who, "{ 'execute': 'query-migrate' }"); - rsp_return =3D qdict_get_qdict(rsp, "return"); - status =3D qdict_get_str(rsp_return, "status"); + status =3D migrate_query_status(who); completed =3D strcmp(status, "completed") =3D=3D 0; g_assert_cmpstr(status, !=3D, "failed"); - qobject_unref(rsp); + g_free(status); if (completed) { return; } @@ -580,7 +606,7 @@ static void test_baddest(void) { QTestState *from, *to; QDict *rsp, *rsp_return; - const char *status; + char *status; bool failed; =20 if (test_migrate_start(&from, &to, "tcp:0:0", true)) { @@ -588,14 +614,10 @@ static void test_baddest(void) } migrate(from, "tcp:0:0", NULL); do { - rsp =3D wait_command(from, "{ 'execute': 'query-migrate' }"); - rsp_return =3D qdict_get_qdict(rsp, "return"); - - status =3D qdict_get_str(rsp_return, "status"); - + status =3D migrate_query_status(from); g_assert(!strcmp(status, "setup") || !(strcmp(status, "failed"))); failed =3D !strcmp(status, "failed"); - qobject_unref(rsp); + g_free(status); } while (!failed); =20 /* Is the machine currently running? */ --=20 2.17.1 From nobody Thu Mar 28 13:04:52 2024 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 1531236973445583.6792316231755; Tue, 10 Jul 2018 08:36:13 -0700 (PDT) Received: from localhost ([::1]:48397 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcugW-0007Dy-EL for importer@patchew.org; Tue, 10 Jul 2018 11:36:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcub7-0003GS-Jz for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcub4-0003Qc-Gz for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:37 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:45248 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fcub4-0003QQ-CQ for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:34 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 03D9C77889 for ; Tue, 10 Jul 2018 15:30:34 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-205.ams2.redhat.com [10.36.117.205]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4D9EF111AF2D; Tue, 10 Jul 2018 15:30:33 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, peterx@redhat.com, quintela@redhat.com Date: Tue, 10 Jul 2018 16:30:13 +0100 Message-Id: <20180710153016.131258-13-dgilbert@redhat.com> In-Reply-To: <20180710153016.131258-1-dgilbert@redhat.com> References: <20180710153016.131258-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 10 Jul 2018 15:30:34 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 10 Jul 2018 15:30:34 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dgilbert@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 12/15] tests: introduce wait_for_migration_status() 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Peter Xu It's generalized from wait_for_migration_complete() to allow us to wait for any migration status besides failure. Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Reviewed-by: Balamuruhan S Signed-off-by: Peter Xu Message-Id: <20180710091902.28780-9-peterx@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- tests/migration-test.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index e2697efd01..4c15071893 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -231,14 +231,15 @@ static void read_blocktime(QTestState *who) qobject_unref(rsp_return); } =20 -static void wait_for_migration_complete(QTestState *who) +static void wait_for_migration_status(QTestState *who, + const char *goal) { while (true) { bool completed; char *status; =20 status =3D migrate_query_status(who); - completed =3D strcmp(status, "completed") =3D=3D 0; + completed =3D strcmp(status, goal) =3D=3D 0; g_assert_cmpstr(status, !=3D, "failed"); g_free(status); if (completed) { @@ -248,6 +249,11 @@ static void wait_for_migration_complete(QTestState *wh= o) } } =20 +static void wait_for_migration_complete(QTestState *who) +{ + wait_for_migration_status(who, "completed"); +} + static void wait_for_migration_pass(QTestState *who) { uint64_t initial_pass =3D get_migration_pass(who); --=20 2.17.1 From nobody Thu Mar 28 13:04:52 2024 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 1531237153933640.4164710525017; Tue, 10 Jul 2018 08:39:13 -0700 (PDT) Received: from localhost ([::1]:48410 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcujO-00015P-Kr for importer@patchew.org; Tue, 10 Jul 2018 11:39:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40910) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcub7-0003GW-KI for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcub5-0003Ra-G9 for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:37 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:45250 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fcub5-0003RE-Ad for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:35 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EBF3E77889 for ; Tue, 10 Jul 2018 15:30:34 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-205.ams2.redhat.com [10.36.117.205]) by smtp.corp.redhat.com (Postfix) with ESMTP id 42514111AF2D; Tue, 10 Jul 2018 15:30:34 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, peterx@redhat.com, quintela@redhat.com Date: Tue, 10 Jul 2018 16:30:14 +0100 Message-Id: <20180710153016.131258-14-dgilbert@redhat.com> In-Reply-To: <20180710153016.131258-1-dgilbert@redhat.com> References: <20180710153016.131258-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 10 Jul 2018 15:30:34 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 10 Jul 2018 15:30:34 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dgilbert@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 13/15] tests: add postcopy recovery test 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Peter Xu Test the postcopy recovery procedure by emulating a network failure using migrate-pause command. Tested-by: Balamuruhan S Signed-off-by: Peter Xu Message-Id: <20180710091902.28780-10-peterx@redhat.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- tests/migration-test.c | 80 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/tests/migration-test.c b/tests/migration-test.c index 4c15071893..d8b2633fce 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -352,6 +352,29 @@ static void migrate_set_parameter(QTestState *who, con= st char *parameter, migrate_check_parameter(who, parameter, value); } =20 +static void migrate_pause(QTestState *who) +{ + QDict *rsp; + + rsp =3D wait_command(who, "{ 'execute': 'migrate-pause' }"); + g_assert(qdict_haskey(rsp, "return")); + qobject_unref(rsp); +} + +static void migrate_recover(QTestState *who, const char *uri) +{ + QDict *rsp; + gchar *cmd =3D g_strdup_printf( + "{ 'execute': 'migrate-recover', " + " 'id': 'recover-cmd', " + " 'arguments': { 'uri': '%s' } }", uri); + + rsp =3D wait_command(who, cmd); + g_assert(qdict_haskey(rsp, "return")); + g_free(cmd); + qobject_unref(rsp); +} + static void migrate_set_capability(QTestState *who, const char *capability, const char *value) { @@ -608,6 +631,62 @@ static void test_postcopy(void) migrate_postcopy_complete(from, to); } =20 +static void test_postcopy_recovery(void) +{ + QTestState *from, *to; + char *uri; + + if (migrate_postcopy_prepare(&from, &to)) { + return; + } + + /* Turn postcopy speed down, 4K/s is slow enough on any machines */ + migrate_set_parameter(from, "max-postcopy-bandwidth", "4096"); + + /* Now we start the postcopy */ + migrate_postcopy_start(from, to); + + /* + * Wait until postcopy is really started; we can only run the + * migrate-pause command during a postcopy + */ + wait_for_migration_status(from, "postcopy-active"); + + /* + * Manually stop the postcopy migration. This emulates a network + * failure with the migration socket + */ + migrate_pause(from); + + /* + * Wait for destination side to reach postcopy-paused state. The + * migrate-recover command can only succeed if destination machine + * is in the paused state + */ + wait_for_migration_status(to, "postcopy-paused"); + + /* + * Create a new socket to emulate a new channel that is different + * from the broken migration channel; tell the destination to + * listen to the new port + */ + uri =3D g_strdup_printf("unix:%s/migsocket-recover", tmpfs); + migrate_recover(to, uri); + + /* + * Try to rebuild the migration channel using the resume flag and + * the newly created channel + */ + wait_for_migration_status(from, "postcopy-paused"); + migrate(from, uri, ", 'resume': true"); + g_free(uri); + + /* Restore the postcopy bandwidth to unlimited */ + migrate_set_parameter(from, "max-postcopy-bandwidth", "0"); + + migrate_postcopy_complete(from, to); +} + static void test_baddest(void) { QTestState *from, *to; @@ -698,6 +777,7 @@ int main(int argc, char **argv) module_call_init(MODULE_INIT_QOM); =20 qtest_add_func("/migration/postcopy/unix", test_postcopy); + qtest_add_func("/migration/postcopy/recovery", test_postcopy_recovery); qtest_add_func("/migration/deprecated", test_deprecated); qtest_add_func("/migration/bad_dest", test_baddest); qtest_add_func("/migration/precopy/unix", test_precopy_unix); --=20 2.17.1 From nobody Thu Mar 28 13:04:52 2024 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 1531237650045158.54034490803986; Tue, 10 Jul 2018 08:47:30 -0700 (PDT) Received: from localhost ([::1]:48469 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcurR-0008ND-0W for importer@patchew.org; Tue, 10 Jul 2018 11:47:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40946) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcub9-0003IC-Rf for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcub8-0003Th-Rp for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:39 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:60502 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fcub8-0003TI-J8 for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:38 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 09D1040214E2 for ; Tue, 10 Jul 2018 15:30:38 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-205.ams2.redhat.com [10.36.117.205]) by smtp.corp.redhat.com (Postfix) with ESMTP id 34DD7111AF2D; Tue, 10 Jul 2018 15:30:35 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, peterx@redhat.com, quintela@redhat.com Date: Tue, 10 Jul 2018 16:30:15 +0100 Message-Id: <20180710153016.131258-15-dgilbert@redhat.com> In-Reply-To: <20180710153016.131258-1-dgilbert@redhat.com> References: <20180710153016.131258-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 10 Jul 2018 15:30:38 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 10 Jul 2018 15:30:38 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dgilbert@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 14/15] tests: hide stderr for postcopy recovery test 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Peter Xu We dumped something when network failure happens. We should avoid those messages to be dumped when running the tests: $ ./tests/migration-test -p /x86_64/migration/postcopy/recovery /x86_64/migration/postcopy/recovery: qemu-system-x86_64: check_section_fo= oter: Read section footer failed: -5 qemu-system-x86_64: Detected IO failure for postcopy. Migration paused. qemu-system-x86_64: Detected IO failure for postcopy. Migration paused. OK After the patch: $ ./tests/migration-test -p /x86_64/migration/postcopy/recovery /x86_64/migration/postcopy/recovery: OK Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Signed-off-by: Peter Xu Message-Id: <20180710091902.28780-11-peterx@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- tests/migration-test.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index d8b2633fce..086f727b34 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -572,12 +572,13 @@ static void test_deprecated(void) } =20 static int migrate_postcopy_prepare(QTestState **from_ptr, - QTestState **to_ptr) + QTestState **to_ptr, + bool hide_error) { char *uri =3D g_strdup_printf("unix:%s/migsocket", tmpfs); QTestState *from, *to; =20 - if (test_migrate_start(&from, &to, uri, false)) { + if (test_migrate_start(&from, &to, uri, hide_error)) { return -1; } =20 @@ -624,7 +625,7 @@ static void test_postcopy(void) { QTestState *from, *to; =20 - if (migrate_postcopy_prepare(&from, &to)) { + if (migrate_postcopy_prepare(&from, &to, false)) { return; } migrate_postcopy_start(from, to); @@ -636,7 +637,7 @@ static void test_postcopy_recovery(void) QTestState *from, *to; char *uri; =20 - if (migrate_postcopy_prepare(&from, &to)) { + if (migrate_postcopy_prepare(&from, &to, true)) { return; } =20 --=20 2.17.1 From nobody Thu Mar 28 13:04:52 2024 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 1531237145303104.02048066117948; Tue, 10 Jul 2018 08:39:05 -0700 (PDT) Received: from localhost ([::1]:48409 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcujG-0000ww-41 for importer@patchew.org; Tue, 10 Jul 2018 11:39:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40956) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcubA-0003IY-7D for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcub9-0003U3-EN for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:40 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:34036 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fcub9-0003Ts-Aa for qemu-devel@nongnu.org; Tue, 10 Jul 2018 11:30:39 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F24FE402315B for ; Tue, 10 Jul 2018 15:30:38 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-205.ams2.redhat.com [10.36.117.205]) by smtp.corp.redhat.com (Postfix) with ESMTP id 45F4F111AF2D; Tue, 10 Jul 2018 15:30:38 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, peterx@redhat.com, quintela@redhat.com Date: Tue, 10 Jul 2018 16:30:16 +0100 Message-Id: <20180710153016.131258-16-dgilbert@redhat.com> In-Reply-To: <20180710153016.131258-1-dgilbert@redhat.com> References: <20180710153016.131258-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 10 Jul 2018 15:30:39 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 10 Jul 2018 15:30:39 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dgilbert@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 15/15] migration: reorder MIG_CMD_POSTCOPY_RESUME 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Peter Xu It was accidently added before MIG_CMD_PACKAGED so it might break command compatibility when we run postcopy migration between old/new QEMUs. Fix that up quickly before the QEMU 3.0 release. Reported-by: Luk=C3=A1=C5=A1 Doktor Suggested-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu Message-Id: <20180710094424.30754-1-peterx@redhat.com> Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Signed-off-by: Dr. David Alan Gilbert --- migration/savevm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/savevm.c b/migration/savevm.c index efcc795071..7f92567a10 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -81,8 +81,8 @@ enum qemu_vm_cmd { MIG_CMD_POSTCOPY_RAM_DISCARD, /* A list of pages to discard that were previously sent during precopy but are dirty. */ - MIG_CMD_POSTCOPY_RESUME, /* resume postcopy on dest */ MIG_CMD_PACKAGED, /* Send a wrapped stream within this stream= */ + MIG_CMD_POSTCOPY_RESUME, /* resume postcopy on dest */ MIG_CMD_RECV_BITMAP, /* Request for recved bitmap on dst */ MIG_CMD_MAX }; --=20 2.17.1