From nobody Tue Nov 4 16:07:11 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 1504082824468326.8867151649373; Wed, 30 Aug 2017 01:47:04 -0700 (PDT) Received: from localhost ([::1]:49077 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmyeM-00026K-9Z for importer@patchew.org; Wed, 30 Aug 2017 04:47:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmyRS-0007Sl-Th for qemu-devel@nongnu.org; Wed, 30 Aug 2017 04:33:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmyRO-0003Qd-1I for qemu-devel@nongnu.org; Wed, 30 Aug 2017 04:33:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47936) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dmyRN-0003QK-Nk for qemu-devel@nongnu.org; Wed, 30 Aug 2017 04:33:37 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B29AB7E433; Wed, 30 Aug 2017 08:33:36 +0000 (UTC) Received: from pxdev.xzpeter.org.com (dhcp-14-103.nay.redhat.com [10.66.14.103]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4F9CE8479A; Wed, 30 Aug 2017 08:33:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B29AB7E433 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=peterx@redhat.com From: Peter Xu To: qemu-devel@nongnu.org Date: Wed, 30 Aug 2017 16:32:11 +0800 Message-Id: <1504081950-2528-15-git-send-email-peterx@redhat.com> In-Reply-To: <1504081950-2528-1-git-send-email-peterx@redhat.com> References: <1504081950-2528-1-git-send-email-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 30 Aug 2017 08:33:36 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [RFC v2 14/33] qmp: hmp: add migrate "resume" option 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: Laurent Vivier , Andrea Arcangeli , Juan Quintela , Alexey Perevalov , peterx@redhat.com, "Dr . David Alan Gilbert" 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" It will be used when we want to resume one paused migration. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu --- hmp-commands.hx | 7 ++++--- hmp.c | 4 +++- migration/migration.c | 2 +- qapi-schema.json | 5 ++++- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index 1941e19..7adb029 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -928,13 +928,14 @@ ETEXI =20 { .name =3D "migrate", - .args_type =3D "detach:-d,blk:-b,inc:-i,uri:s", - .params =3D "[-d] [-b] [-i] uri", + .args_type =3D "detach:-d,blk:-b,inc:-i,resume:-r,uri:s", + .params =3D "[-d] [-b] [-i] [-r] uri", .help =3D "migrate to URI (using -d to not wait for completi= on)" "\n\t\t\t -b for migration without shared storage with" " full copy of disk\n\t\t\t -i for migration without " "shared storage with incremental copy of disk " - "(base image shared between src and destination)", + "(base image shared between src and destination)" + "\n\t\t\t -r to resume a paused migration", .cmd =3D hmp_migrate, }, =20 diff --git a/hmp.c b/hmp.c index fd80dce..ebc1563 100644 --- a/hmp.c +++ b/hmp.c @@ -1891,10 +1891,12 @@ void hmp_migrate(Monitor *mon, const QDict *qdict) bool detach =3D qdict_get_try_bool(qdict, "detach", false); bool blk =3D qdict_get_try_bool(qdict, "blk", false); bool inc =3D qdict_get_try_bool(qdict, "inc", false); + bool resume =3D qdict_get_try_bool(qdict, "resume", false); const char *uri =3D qdict_get_str(qdict, "uri"); Error *err =3D NULL; =20 - qmp_migrate(uri, !!blk, blk, !!inc, inc, false, false, &err); + qmp_migrate(uri, !!blk, blk, !!inc, inc, + false, false, true, resume, &err); if (err) { error_report_err(err); return; diff --git a/migration/migration.c b/migration/migration.c index 722f8ac..394e84b 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1238,7 +1238,7 @@ bool migration_is_blocked(Error **errp) =20 void qmp_migrate(const char *uri, bool has_blk, bool blk, bool has_inc, bool inc, bool has_detach, bool detach, - Error **errp) + bool has_resume, bool resume, Error **errp) { Error *local_err =3D NULL; MigrationState *s =3D migrate_get_current(); diff --git a/qapi-schema.json b/qapi-schema.json index 368b592..ba41f2c 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -3208,6 +3208,8 @@ # @detach: this argument exists only for compatibility reasons and # is ignored by QEMU # +# @resume: resume one paused migration, default "off". (since 2.11) +# # Returns: nothing on success # # Since: 0.14.0 @@ -3229,7 +3231,8 @@ # ## { 'command': 'migrate', - 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool'= } } + 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', + '*detach': 'bool', '*resume': 'bool' } } =20 ## # @migrate-incoming: --=20 2.7.4