From nobody Thu May 15 09:57:21 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 1509055489583967.1017712607182; Thu, 26 Oct 2017 15:04:49 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2F3A66A7CE; Thu, 26 Oct 2017 22:04:48 +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 101005D728; Thu, 26 Oct 2017 22:04:48 +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 D46951805973; Thu, 26 Oct 2017 22:04:25 +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 v9QM4A03031974 for ; Thu, 26 Oct 2017 18:04:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4C76F173B1; Thu, 26 Oct 2017 22:04:10 +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 A9B0A173DE for ; Thu, 26 Oct 2017 22:04:09 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 99F90101498; Fri, 27 Oct 2017 00:04:02 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2F3A66A7CE 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=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 27 Oct 2017 00:04:01 +0200 Message-Id: <535c6dcddfdd5f7b5cdac4eb92d7fb557ec80672.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 12/12] qemu: Add support for block-incremental 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 26 Oct 2017 22:04:48 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We handle incremental storage migration in a different way. The support for this new (as of QEMU 2.10) parameter is only needed for full coverage of migration parameters used by QEMU. Signed-off-by: Jiri Denemark --- src/qemu/qemu_monitor.c | 6 ++++-- src/qemu/qemu_monitor.h | 3 +++ src/qemu/qemu_monitor_json.c | 10 ++++++++++ tests/qemumonitorjsontest.c | 8 +++++++- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 04b18baf9..611876ff8 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2607,7 +2607,8 @@ 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= " - "maxBandwidth=3D%d:%llu downtimeLimit=3D%d:%llu", + "maxBandwidth=3D%d:%llu downtimeLimit=3D%d:%llu " + "blockIncremental=3D%d:%d", params->compressLevel_set, params->compressLevel, params->compressThreads_set, params->compressThreads, params->decompressThreads_set, params->decompressThreads, @@ -2615,7 +2616,8 @@ qemuMonitorSetMigrationParams(qemuMonitorPtr mon, params->cpuThrottleIncrement_set, params->cpuThrottleIncreme= nt, NULLSTR(params->tlsCreds), NULLSTR(params->tlsHostname), params->maxBandwidth_set, params->maxBandwidth, - params->downtimeLimit_set, params->downtimeLimit); + params->downtimeLimit_set, params->downtimeLimit, + params->blockIncremental_set, params->blockIncremental); =20 QEMU_CHECK_MONITOR_JSON(mon); =20 diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 7836dd332..f81fb7f2a 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -633,6 +633,9 @@ struct _qemuMonitorMigrationParams { =20 bool downtimeLimit_set; unsigned long long downtimeLimit; + + bool blockIncremental_set; + bool blockIncremental; }; =20 int qemuMonitorGetMigrationParams(qemuMonitorPtr mon, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 115610e50..aa2599209 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2690,6 +2690,9 @@ qemuMonitorJSONGetMigrationParams(qemuMonitorPtr mon, #define PARSE_ULONG(VAR, FIELD) = \ PARSE_SET(virJSONValueObjectGetNumberUlong, VAR, FIELD) =20 +#define PARSE_BOOL(VAR, FIELD) = \ + PARSE_SET(virJSONValueObjectGetBoolean, VAR, FIELD) + #define PARSE_STR(VAR, FIELD) = \ do { = \ const char *str; = \ @@ -2708,10 +2711,12 @@ qemuMonitorJSONGetMigrationParams(qemuMonitorPtr mo= n, PARSE_STR(tlsHostname, "tls-hostname"); PARSE_ULONG(maxBandwidth, "max-bandwidth"); PARSE_ULONG(downtimeLimit, "downtime-limit"); + PARSE_BOOL(blockIncremental, "block-incremental"); =20 #undef PARSE_SET #undef PARSE_INT #undef PARSE_ULONG +#undef PARSE_BOOL #undef PARSE_STR =20 ret =3D 0; @@ -2758,6 +2763,10 @@ qemuMonitorJSONSetMigrationParams(qemuMonitorPtr mon, APPEND(params->VAR ## _set, = \ virJSONValueObjectAppendNumberUlong, VAR, FIELD) =20 +#define APPEND_BOOL(VAR, FIELD) = \ + APPEND(params->VAR ## _set, = \ + virJSONValueObjectAppendBoolean, VAR, FIELD) + APPEND_INT(compressLevel, "compress-level"); APPEND_INT(compressThreads, "compress-threads"); APPEND_INT(decompressThreads, "decompress-threads"); @@ -2767,6 +2776,7 @@ qemuMonitorJSONSetMigrationParams(qemuMonitorPtr mon, APPEND_STR(tlsHostname, "tls-hostname"); APPEND_ULONG(maxBandwidth, "max-bandwidth"); APPEND_ULONG(downtimeLimit, "downtime-limit"); + APPEND_BOOL(blockIncremental, "block-incremental"); =20 #undef APPEND #undef APPEND_INT diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 488c79cc3..aa2f67947 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1805,7 +1805,8 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationParams(= const void *data) " \"tls-creds\": \"tls0\"," " \"tls-hostname\": \"\"," " \"max-bandwidth\": 1234567890," - " \"downtime-limit\": 500" + " \"downtime-limit\": 500," + " \"block-incremental\": true" " }" "}") < 0) { goto cleanup; @@ -1835,6 +1836,9 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationParams(= const void *data) #define CHECK_ULONG(VAR, FIELD, VALUE) = \ CHECK_NUM(VAR, FIELD, VALUE, "%llu") =20 +#define CHECK_BOOL(VAR, FIELD, VALUE) = \ + CHECK_NUM(VAR, FIELD, VALUE, "%d") + #define CHECK_STR(VAR, FIELD, VALUE) = \ do { = \ if (!params.VAR) { = \ @@ -1858,10 +1862,12 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationParam= s(const void *data) CHECK_STR(tlsHostname, "tls-hostname", ""); CHECK_ULONG(maxBandwidth, "max-bandwidth", 1234567890ULL); CHECK_ULONG(downtimeLimit, "downtime-limit", 500ULL); + CHECK_BOOL(blockIncremental, "block-incremental", true); =20 #undef CHECK_NUM #undef CHECK_INT #undef CHECK_ULONG +#undef CHECK_BOOL #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