From nobody Tue Feb 10 00:59:01 2026 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 15042496775174.432871407625726; Fri, 1 Sep 2017 00:07:57 -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 3B39C8124F; Fri, 1 Sep 2017 07:07:55 +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 1C14B6E8B1; Fri, 1 Sep 2017 07:07:55 +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 DC5213FAD1; Fri, 1 Sep 2017 07:07:54 +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 v816nr1g018604 for ; Fri, 1 Sep 2017 02:49:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id 606875E1A9; Fri, 1 Sep 2017 06:49:53 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5BA4265EAF for ; Fri, 1 Sep 2017 06:49:51 +0000 (UTC) Received: from relay.sw.ru (mailhub.sw.ru [195.214.232.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CC29D81E05 for ; Fri, 1 Sep 2017 06:49:49 +0000 (UTC) Received: from dim-vz7.qa.sw.ru (msk-vpn.virtuozzo.com [195.214.232.6]) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id v816nlK5010656 for ; Fri, 1 Sep 2017 09:49:47 +0300 (MSK) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3B39C8124F Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 3B39C8124F DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CC29D81E05 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=pass (p=none dis=none) header.from=virtuozzo.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=nshirokovskiy@virtuozzo.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com CC29D81E05 From: Nikolay Shirokovskiy To: libvir-list@redhat.com Date: Fri, 1 Sep 2017 09:49:29 +0300 Message-Id: <1504248571-571673-12-git-send-email-nshirokovskiy@virtuozzo.com> In-Reply-To: <1504248571-571673-1-git-send-email-nshirokovskiy@virtuozzo.com> References: <1504248571-571673-1-git-send-email-nshirokovskiy@virtuozzo.com> X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 01 Sep 2017 06:49:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 01 Sep 2017 06:49:50 +0000 (UTC) for IP:'195.214.232.25' DOMAIN:'mailhub.sw.ru' HELO:'relay.sw.ru' FROM:'nshirokovskiy@virtuozzo.com' RCPT:'' X-RedHat-Spam-Score: -0.001 (SPF_PASS) 195.214.232.25 mailhub.sw.ru 195.214.232.25 mailhub.sw.ru X-Scanned-By: MIMEDefang 2.78 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v4 11/13] qemu: always get job condition on getting job stats 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]); Fri, 01 Sep 2017 07:07:55 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Looks like it is more simple to drop this optimization as we are going to add getting disks stats during migration via quering qemu process and checking if we have to acquire job condition becomes more complicate. --- src/qemu/qemu_driver.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 17ccd9e..11226b1 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -12985,7 +12985,7 @@ qemuDomainGetJobStatsInternal(virQEMUDriverPtr driv= er, qemuDomainJobInfoPtr jobInfo) { qemuDomainObjPrivatePtr priv =3D vm->privateData; - bool fetch =3D virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATION_EVEN= T); + bool events =3D virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATION_EVE= NT); int ret =3D -1; =20 if (completed) { @@ -13004,12 +13004,7 @@ qemuDomainGetJobStatsInternal(virQEMUDriverPtr dri= ver, return -1; } =20 - /* Do not ask QEMU if migration is not even running yet */ - if (!priv->job.current || - priv->job.current->status =3D=3D QEMU_DOMAIN_JOB_STATUS_ACTIVE) - fetch =3D false; - - if (fetch && qemuDomainObjBeginJob(driver, vm, QEMU_JOB_QUERY) < 0) + if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_QUERY) < 0) return -1; =20 if (!virDomainObjIsActive(vm)) { @@ -13028,7 +13023,8 @@ qemuDomainGetJobStatsInternal(virQEMUDriverPtr driv= er, if (jobInfo->status =3D=3D QEMU_DOMAIN_JOB_STATUS_ACTIVE || jobInfo->status =3D=3D QEMU_DOMAIN_JOB_STATUS_MIGRATING || jobInfo->status =3D=3D QEMU_DOMAIN_JOB_STATUS_POSTCOPY) { - if (fetch && + if (events && + jobInfo->status !=3D QEMU_DOMAIN_JOB_STATUS_ACTIVE && qemuMigrationFetchStats(driver, vm, QEMU_ASYNC_JOB_NONE, jobIn= fo) < 0) goto cleanup; =20 @@ -13039,8 +13035,7 @@ qemuDomainGetJobStatsInternal(virQEMUDriverPtr driv= er, ret =3D 0; =20 cleanup: - if (fetch) - qemuDomainObjEndJob(driver, vm); + qemuDomainObjEndJob(driver, vm); return ret; } =20 --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list