From nobody Thu May 15 10:16:37 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 1509055462019760.4622505217358; Thu, 26 Oct 2017 15:04:22 -0700 (PDT) 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 7066681E09; Thu, 26 Oct 2017 22:04:20 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4CDAC176A7; 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 1873C6EF28; Thu, 26 Oct 2017 22:04:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9QM49VE031954 for ; Thu, 26 Oct 2017 18:04:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id AB4CD58858; 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 13C675C886 for ; Thu, 26 Oct 2017 22:04:09 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 96D41101495; Fri, 27 Oct 2017 00:04:02 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7066681E09 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.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:04:00 +0200 Message-Id: <166c31616b2adf2db41f9a92abab2a5e0c07290f.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.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 11/12] qemu: Add support for max-bandwidth 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 26 Oct 2017 22:04:20 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We already support several ways of setting migration bandwidth and this is not adding another one. With this patch we are able to read and write this parameter using query-migrate-parameters and migrate-set-parameters in one call with all other parameters. Signed-off-by: Jiri Denemark --- src/qemu/qemu_monitor.c | 3 ++- src/qemu/qemu_monitor.h | 3 +++ src/qemu/qemu_monitor_json.c | 2 ++ tests/qemumonitorjsontest.c | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 3e2c69a9a..04b18baf9 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2607,13 +2607,14 @@ 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 tlsCreds=3D%s tlsHostname=3D%s= " - "downtimeLimit=3D%d:%llu", + "maxBandwidth=3D%d:%llu 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->tlsCreds), NULLSTR(params->tlsHostname), + params->maxBandwidth_set, params->maxBandwidth, params->downtimeLimit_set, params->downtimeLimit); =20 QEMU_CHECK_MONITOR_JSON(mon); diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index e123baaae..7836dd332 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -628,6 +628,9 @@ struct _qemuMonitorMigrationParams { char *tlsCreds; char *tlsHostname; =20 + bool maxBandwidth_set; + unsigned long long maxBandwidth; + bool downtimeLimit_set; unsigned long long downtimeLimit; }; diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 9f238bc30..115610e50 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2706,6 +2706,7 @@ qemuMonitorJSONGetMigrationParams(qemuMonitorPtr mon, PARSE_INT(cpuThrottleIncrement, "cpu-throttle-increment"); PARSE_STR(tlsCreds, "tls-creds"); PARSE_STR(tlsHostname, "tls-hostname"); + PARSE_ULONG(maxBandwidth, "max-bandwidth"); PARSE_ULONG(downtimeLimit, "downtime-limit"); =20 #undef PARSE_SET @@ -2764,6 +2765,7 @@ qemuMonitorJSONSetMigrationParams(qemuMonitorPtr mon, APPEND_INT(cpuThrottleIncrement, "cpu-throttle-increment"); APPEND_STR(tlsCreds, "tls-creds"); APPEND_STR(tlsHostname, "tls-hostname"); + APPEND_ULONG(maxBandwidth, "max-bandwidth"); APPEND_ULONG(downtimeLimit, "downtime-limit"); =20 #undef APPEND diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index aa5da8be9..488c79cc3 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1804,6 +1804,7 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationParams(= const void *data) " \"cpu-throttle-initial\": 20," " \"tls-creds\": \"tls0\"," " \"tls-hostname\": \"\"," + " \"max-bandwidth\": 1234567890," " \"downtime-limit\": 500" " }" "}") < 0) { @@ -1855,6 +1856,7 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationParams(= const void *data) CHECK_INT(cpuThrottleIncrement, "cpu-throttle-increment", 10); CHECK_STR(tlsCreds, "tls-creds", "tls0"); CHECK_STR(tlsHostname, "tls-hostname", ""); + CHECK_ULONG(maxBandwidth, "max-bandwidth", 1234567890ULL); CHECK_ULONG(downtimeLimit, "downtime-limit", 500ULL); =20 #undef CHECK_NUM --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list