From nobody Sat Feb 7 08:13:39 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1591813537; cv=none; d=zohomail.com; s=zohoarc; b=ZoL/OX7d9afN2U9N20gy8fE3wvelzHu26eumrtz+U1vcz/xpEPrGmU5Fd72Zia77TQYFJLMYQgTiMvVdFS8zB/a0VehrfKsEf8BWekp3VszQQSbFhi9S9x2dGWqup5SI6FVw5n7B9vXr4zPe782m9OVJB8UdomrJnyx3VMPnicg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591813537; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=jCqq4j0E7P89AMDvNvOOkydlP6I04hw+4G1pc8kE/BQ=; b=mZaQ7y9MpDuv+/G0joOT/WqN1xbzMy3hda2ysfSuOthI20pbY/fNoBhk1VZT54cUU6PYUdn8db2snWNv9SaxCOuzEv5WGBQmMMKeFLIcpEgk5R9neURUvMYtHZI/IYGRXqsV+OJjoWhY8D8Dq80G8ImwNdcfM9ENmGC09Wk12UE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 159181353787156.75731303849625; Wed, 10 Jun 2020 11:25:37 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-344-PlxSJnNYMqSzKb8kLxhmAA-1; Wed, 10 Jun 2020 14:25:34 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0A7F2835BE5; Wed, 10 Jun 2020 18:25:27 +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 E08DD5D9FC; Wed, 10 Jun 2020 18:25:26 +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 AE86B180043A; Wed, 10 Jun 2020 18:25:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05AIPG9b022697 for ; Wed, 10 Jun 2020 14:25:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6CA6A600F7; Wed, 10 Jun 2020 18:25:16 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.40.193.140]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3CEEA7B91C for ; Wed, 10 Jun 2020 18:25:12 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id A9A1E2455C8; Wed, 10 Jun 2020 20:24:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591813536; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=jCqq4j0E7P89AMDvNvOOkydlP6I04hw+4G1pc8kE/BQ=; b=U7n6Wneeg90P15E65cEJJ4lN/w9owVLwmovTMIVvttWj4IoghrLecfBchJQDHQCvn0AQpy heIFEvCHBydZsHXWC1c8Hxjhc1iZf1Jm2oR/zQcJCSl+iX85ZNd6zm/Kfy2rTMEaCN9PjJ otCdq/5gp+rXz0GaVVYA2GJw9sqwmGE= X-MC-Unique: PlxSJnNYMqSzKb8kLxhmAA-1 From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH 4/5] qemu: Avoid deprecated query-migrate-cache-size QMP command Date: Wed, 10 Jun 2020 20:24:30 +0200 Message-Id: <44fd537d6bc5e340ad20a3a25b4cb092c7a05beb.1591813394.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com 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: , 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-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The same functionality can be achieved using query-migrate-parameters QMP command and checking the xbzrle-cache-size parameter. https://bugzilla.redhat.com/show_bug.cgi?id=3D1829544 Signed-off-by: Jiri Denemark --- src/qemu/qemu_driver.c | 21 +++++++++++++++++---- tests/qemumonitorjsontest.c | 2 +- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index c9a2081487..820a54ab2b 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -13967,7 +13967,9 @@ qemuDomainMigrateGetCompressionCache(virDomainPtr d= om, virQEMUDriverPtr driver =3D dom->conn->privateData; virDomainObjPtr vm; qemuDomainObjPrivatePtr priv; + g_autoptr(qemuMigrationParams) migParams =3D NULL; int ret =3D -1; + int rc; =20 virCheckFlags(0, -1); =20 @@ -13992,12 +13994,23 @@ qemuDomainMigrateGetCompressionCache(virDomainPtr= dom, goto endjob; } =20 - qemuDomainObjEnterMonitor(driver, vm); + if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATION_PARAM_CACHE_SIZ= E)) { + if (qemuMigrationParamsFetch(driver, vm, QEMU_ASYNC_JOB_NONE, + &migParams) < 0) + goto endjob; =20 - ret =3D qemuMonitorGetMigrationCacheSize(priv->mon, cacheSize); + if (qemuMigrationParamsGetULL(migParams, + QEMU_MIGRATION_PARAM_XBZRLE_CACHE_SI= ZE, + cacheSize) < 0) + goto endjob; + } else { + qemuDomainObjEnterMonitor(driver, vm); + rc =3D qemuMonitorGetMigrationCacheSize(priv->mon, cacheSize); + if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0) + goto endjob; + } =20 - if (qemuDomainObjExitMonitor(driver, vm) < 0) - ret =3D -1; + ret =3D 0; =20 endjob: qemuDomainObjEndJob(driver, vm); diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 1c58c333d5..d2cd054dbf 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1888,7 +1888,7 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationCacheSi= ze(const void *opaque) if (!(test =3D qemuMonitorTestNewSchema(xmlopt, data->schema))) return -1; =20 - qemuMonitorTestSkipDeprecatedValidation(test, false); + qemuMonitorTestSkipDeprecatedValidation(test, true); =20 if (qemuMonitorTestAddItem(test, "query-migrate-cache-size", "{" --=20 2.27.0