From nobody Fri Oct 24 20:19: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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1519747254514646.1289939033948; Tue, 27 Feb 2018 08:00:54 -0800 (PST) Received: from localhost ([::1]:38308 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqhgT-0006Ib-0t for importer@patchew.org; Tue, 27 Feb 2018 11:00:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44541) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqdsr-0000OG-BK for qemu-devel@nongnu.org; Tue, 27 Feb 2018 06:57:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eqdsq-0000Bp-Nj for qemu-devel@nongnu.org; Tue, 27 Feb 2018 06:57:25 -0500 Received: from mx2.suse.de ([195.135.220.15]:60229) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eqdsk-00006y-DM; Tue, 27 Feb 2018 06:57:18 -0500 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4D9DDADC9; Tue, 27 Feb 2018 11:57:16 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Richard Palethorpe To: qemu-devel@nongnu.org Date: Tue, 27 Feb 2018 12:56:50 +0100 Message-Id: <20180227115651.30762-2-rpalethorpe@suse.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180227115651.30762-1-rpalethorpe@suse.com> References: <20180227115651.30762-1-rpalethorpe@suse.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 195.135.220.15 X-Mailman-Approved-At: Tue, 27 Feb 2018 10:58:35 -0500 Subject: [Qemu-devel] [RFC PATCH 1/2] migrate: Allow incoming migration without defer 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: qemu-block@nongnu.org, quintela@redhat.com, armbru@redhat.com, dgilbert@redhat.com, mreitz@redhat.com, Richard Palethorpe 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" Allow a QEMU instance which has been started and used without the "-incomin= g" flag to accept an incoming migration with the "migrate-incoming" QMP command. This allows the user to dump the VM state to an external file then revert to that state at a later time without restarting QEMU. --- migration/migration.c | 12 +++++------- vl.c | 2 ++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 0aa596f867..05595a4cec 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1321,14 +1321,14 @@ void migrate_del_blocker(Error *reason) void qmp_migrate_incoming(const char *uri, Error **errp) { Error *local_err =3D NULL; - static bool once =3D true; =20 - if (!deferred_incoming) { - error_setg(errp, "For use with '-incoming defer'"); + if (runstate_check(RUN_STATE_INMIGRATE)) { + error_setg(errp, "The incoming migration has already been started"= ); return; } - if (!once) { - error_setg(errp, "The incoming migration has already been started"= ); + + if (!deferred_incoming) { + vm_stop(RUN_STATE_INMIGRATE); } =20 qemu_start_incoming_migration(uri, &local_err); @@ -1337,8 +1337,6 @@ void qmp_migrate_incoming(const char *uri, Error **er= rp) error_propagate(errp, local_err); return; } - - once =3D false; } =20 bool migration_is_blocked(Error **errp) diff --git a/vl.c b/vl.c index 9e7235df6d..a91eda039e 100644 --- a/vl.c +++ b/vl.c @@ -634,6 +634,7 @@ static const RunStateTransition runstate_transitions_de= f[] =3D { { RUN_STATE_PAUSED, RUN_STATE_POSTMIGRATE }, { RUN_STATE_PAUSED, RUN_STATE_PRELAUNCH }, { RUN_STATE_PAUSED, RUN_STATE_COLO}, + { RUN_STATE_PAUSED, RUN_STATE_INMIGRATE }, =20 { RUN_STATE_POSTMIGRATE, RUN_STATE_RUNNING }, { RUN_STATE_POSTMIGRATE, RUN_STATE_FINISH_MIGRATE }, @@ -665,6 +666,7 @@ static const RunStateTransition runstate_transitions_de= f[] =3D { { RUN_STATE_RUNNING, RUN_STATE_WATCHDOG }, { RUN_STATE_RUNNING, RUN_STATE_GUEST_PANICKED }, { RUN_STATE_RUNNING, RUN_STATE_COLO}, + { RUN_STATE_RUNNING, RUN_STATE_INMIGRATE }, =20 { RUN_STATE_SAVE_VM, RUN_STATE_RUNNING }, =20 --=20 2.16.2