From nobody Thu May 15 10:04:10 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1509055463175902.3921544105652; Thu, 26 Oct 2017 15:04:23 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1101782100; Thu, 26 Oct 2017 22:04:21 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D77DD5E1C0; Thu, 26 Oct 2017 22:04:20 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 9EABE1805964; Thu, 26 Oct 2017 22:04:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9QM49Lm031953 for ; Thu, 26 Oct 2017 18:04:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id AA3421748A; Thu, 26 Oct 2017 22:04:09 +0000 (UTC) Received: from mamuti.net (ovpn-204-16.brq.redhat.com [10.40.204.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1046D17123 for ; Thu, 26 Oct 2017 22:04:09 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 90CBD101493; Fri, 27 Oct 2017 00:04:02 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1101782100 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 27 Oct 2017 00:03:58 +0200 Message-Id: <79b143964bb58c4bf31d6349c1d3e9dfc057b8cd.1509052291.git.jdenemar@redhat.com> In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 09/12] qemu: Add support for setting downtime-limit migration parameter X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 26 Oct 2017 22:04:21 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We already support setting the maximum downtime with a dedicated virDomainMigrateSetMaxDowntime API. This patch does not implement another way of setting the downtime by adding a new public migration parameter. It just makes sure any parameter we are able to get from a QEMU monitor by query-migrate-parameters can be passed back to QEMU via migrate-set-parameters. Signed-off-by: Jiri Denemark --- src/qemu/qemu_monitor.c | 5 +++-- src/qemu/qemu_monitor_json.c | 6 ++++++ tests/qemumonitorjsontest.c | 8 +++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 71069827e..c88726735 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2607,14 +2607,15 @@ qemuMonitorSetMigrationParams(qemuMonitorPtr mon, VIR_DEBUG("compressLevel=3D%d:%d compressThreads=3D%d:%d " "decompressThreads=3D%d:%d cpuThrottleInitial=3D%d:%d " "cpuThrottleIncrement=3D%d:%d tlsAlias=3D%s " - "tlsHostname=3D%s", + "tlsHostname=3D%s downtimeLimit=3D%d:%llu", params->compressLevel_set, params->compressLevel, params->compressThreads_set, params->compressThreads, params->decompressThreads_set, params->decompressThreads, params->cpuThrottleInitial_set, params->cpuThrottleInitial, params->cpuThrottleIncrement_set, params->cpuThrottleIncreme= nt, NULLSTR(params->migrateTLSAlias), - NULLSTR(params->migrateTLSHostname)); + NULLSTR(params->migrateTLSHostname), + params->downtimeLimit_set, params->downtimeLimit); =20 QEMU_CHECK_MONITOR_JSON(mon); =20 diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index d3c37ded8..a2f3e3317 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2753,6 +2753,10 @@ qemuMonitorJSONSetMigrationParams(qemuMonitorPtr mon, APPEND(params->VAR, = \ virJSONValueObjectAppendString, VAR, FIELD) =20 +#define APPEND_ULONG(VAR, FIELD) = \ + APPEND(params->VAR ## _set, = \ + virJSONValueObjectAppendNumberUlong, VAR, FIELD) + APPEND_INT(compressLevel, "compress-level"); APPEND_INT(compressThreads, "compress-threads"); APPEND_INT(decompressThreads, "decompress-threads"); @@ -2760,10 +2764,12 @@ qemuMonitorJSONSetMigrationParams(qemuMonitorPtr mo= n, APPEND_INT(cpuThrottleIncrement, "cpu-throttle-increment"); APPEND_STR(migrateTLSAlias, "tls-creds"); APPEND_STR(migrateTLSHostname, "tls-hostname"); + APPEND_ULONG(downtimeLimit, "downtime-limit"); =20 #undef APPEND #undef APPEND_INT #undef APPEND_STR +#undef APPEND_ULONG =20 if (virJSONValueObjectKeysNumber(args) =3D=3D 0) { ret =3D 0; diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 2cefdcac9..cc55b0c43 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1803,7 +1803,8 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationParams(= const void *data) " \"compress-level\": 1," " \"cpu-throttle-initial\": 20," " \"tls-creds\": \"tls0\"," - " \"tls-hostname\": \"\"" + " \"tls-hostname\": \"\"," + " \"downtime-limit\": 500" " }" "}") < 0) { goto cleanup; @@ -1830,6 +1831,9 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationParams(= const void *data) #define CHECK_INT(VAR, FIELD, VALUE) = \ CHECK_NUM(VAR, FIELD, VALUE, "%d") =20 +#define CHECK_ULONG(VAR, FIELD, VALUE) = \ + CHECK_NUM(VAR, FIELD, VALUE, "%llu") + #define CHECK_STR(VAR, FIELD, VALUE) = \ do { = \ if (!params.VAR) { = \ @@ -1851,9 +1855,11 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationParams= (const void *data) CHECK_INT(cpuThrottleIncrement, "cpu-throttle-increment", 10); CHECK_STR(migrateTLSAlias, "tls-creds", "tls0"); CHECK_STR(migrateTLSHostname, "tls-hostname", ""); + CHECK_ULONG(downtimeLimit, "downtime-limit", 500ULL); =20 #undef CHECK_NUM #undef CHECK_INT +#undef CHECK_ULONG #undef CHECK_STR =20 ret =3D 0; --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list