From nobody Mon Feb 9 10:50:27 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1644971379495619.6215812480152; Tue, 15 Feb 2022 16:29:39 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-119-kTcik94qMPmtI9bmS6VeLQ-1; Tue, 15 Feb 2022 19:29:38 -0500 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 A9826100C66B; Wed, 16 Feb 2022 00:29:32 +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 8C207519DE; Wed, 16 Feb 2022 00:29:32 +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 5EBBE1806D1D; Wed, 16 Feb 2022 00:29:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21G0TJSg024625 for ; Tue, 15 Feb 2022 19:29:19 -0500 Received: by smtp.corp.redhat.com (Postfix) id B30BB5361F7; Wed, 16 Feb 2022 00:29:19 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AF0275361EA for ; Wed, 16 Feb 2022 00:29:19 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 96637185A79C for ; Wed, 16 Feb 2022 00:29:19 +0000 (UTC) Received: from chinatelecom.cn (prt-mail.chinatelecom.cn [42.123.76.227]) by relay.mimecast.com with ESMTP id us-mta-428-A3nzG0baNFWNL-Zr289Tew-1; Tue, 15 Feb 2022 19:29:17 -0500 Received: from clientip-171.223.98.212 (unknown [172.18.0.188]) by chinatelecom.cn (HERMES) with SMTP id B96D128009A; Wed, 16 Feb 2022 08:29:14 +0800 (CST) Received: from ([172.18.0.188]) by app0023 with ESMTP id 31ae219e68884695ab8784f2940691d3 for libvir-list@redhat.com; Wed, 16 Feb 2022 08:29:15 CST X-MC-Unique: kTcik94qMPmtI9bmS6VeLQ-1 X-MC-Unique: A3nzG0baNFWNL-Zr289Tew-1 HMM_SOURCE_IP: 172.18.0.188:46950.167132848 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP X-189-SAVE-TO-SEND: +huangy81@chinatelecom.cn X-Transaction-ID: 31ae219e68884695ab8784f2940691d3 X-Real-From: huangy81@chinatelecom.cn X-Receive-IP: 172.18.0.188 X-MEDUSA-Status: 0 From: huangy81@chinatelecom.cn To: libvir-list@redhat.com Subject: [PATCH v5 3/9] qemu_driver: Probe capability before calculating dirty page rate Date: Wed, 16 Feb 2022 08:28:59 +0800 Message-Id: <7aa2cec000317ff7c26a4a3bb5e1fdb0ec6f31a6.1644971072.git.huangy81@chinatelecom.cn> In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Mimecast-Spam-Signature: yes X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 21G0TJSg024625 X-loop: libvir-list@redhat.com Cc: huangy81@chinatelecom.cn 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1644971381838100006 From: Hyman Huang(=E9=BB=84=E5=8B=87) Probing QEMU_CAPS_CALC_DIRTY_RATE capability in advance in case of failure when calculating dirty page rate. Signed-off-by: Hyman Huang(=E9=BB=84=E5=8B=87) --- src/qemu/qemu_driver.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index a22646c..18775e7 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -20691,6 +20691,13 @@ qemuDomainStartDirtyRateCalc(virDomainPtr dom, if (virDomainStartDirtyRateCalcEnsureACL(dom->conn, vm->def) < 0) goto cleanup; =20 + priv =3D vm->privateData; + if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_CALC_DIRTY_RATE)) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("QEMU does not support calculating dirty page rat= e")); + goto cleanup; + } + if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) goto cleanup; =20 @@ -20702,7 +20709,6 @@ qemuDomainStartDirtyRateCalc(virDomainPtr dom, =20 VIR_DEBUG("Calculate dirty rate in next %d seconds", seconds); =20 - priv =3D vm->privateData; qemuDomainObjEnterMonitor(driver, vm); ret =3D qemuMonitorStartDirtyRateCalc(priv->mon, seconds); =20 --=20 1.8.3.1