From nobody Thu May 15 11:34:35 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 1510235883794535.956678221776; Thu, 9 Nov 2017 05:58:03 -0800 (PST) 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 762915F176; Thu, 9 Nov 2017 13:58:02 +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 59DEA62460; Thu, 9 Nov 2017 13:58:02 +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 235EE1800FC4; Thu, 9 Nov 2017 13:58:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vA9DvtjA010194 for ; Thu, 9 Nov 2017 08:57:55 -0500 Received: by smtp.corp.redhat.com (Postfix) id 860425D9CA; Thu, 9 Nov 2017 13:57:55 +0000 (UTC) Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 806BD5D9C9 for ; Thu, 9 Nov 2017 13:57:55 +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 54583C047B94 for ; Thu, 9 Nov 2017 13:57:54 +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 vA9DJWRB009796 for ; Thu, 9 Nov 2017 16:19:32 +0300 (MSK) From: Nikolay Shirokovskiy To: libvir-list@redhat.com Date: Thu, 9 Nov 2017 16:18:49 +0300 Message-Id: <1510233537-848259-4-git-send-email-nshirokovskiy@virtuozzo.com> In-Reply-To: <1510233537-848259-1-git-send-email-nshirokovskiy@virtuozzo.com> References: <1510233537-848259-1-git-send-email-nshirokovskiy@virtuozzo.com> X-Greylist: Delayed for 00:38:03 by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 09 Nov 2017 13:57:54 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 09 Nov 2017 13:57:54 +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.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 03/11] qemu: enter interruptlible state where appropriate 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, 09 Nov 2017 13:58:02 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This is just places where async job drops vm lock besides for the purpose of sending command to qemu process. If I fail to identify one of these places it is not a big problem - vm will be unresponsive to queries etc sometimes and someone who cares report this issue and we fix it )) NB: Now there are some known places were enter/exit are not yet added as noted in the cover letter. These are end/begin of migration phases. --- src/qemu/qemu_domain.c | 2 ++ src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_migration.c | 18 +++++++----------- src/qemu/qemu_process.c | 2 ++ 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 21b8c8d..f8602b7 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4872,6 +4872,7 @@ void qemuDomainObjEnterRemote(virDomainObjPtr obj) { VIR_DEBUG("Entering remote (vm=3D%p name=3D%s)", obj, obj->def->name); + qemuDomainObjEnterInterruptible(obj); virObjectUnlock(obj); } =20 @@ -4880,6 +4881,7 @@ void qemuDomainObjExitRemote(virDomainObjPtr obj) virObjectLock(obj); VIR_DEBUG("Exited remote (vm=3D%p name=3D%s)", obj, obj->def->name); + qemuDomainObjExitInterruptible(obj); } =20 =20 diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 6132bc4..019ec33 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -16768,7 +16768,7 @@ qemuDomainBlockJobAbort(virDomainPtr dom, qemuDomainDiskPrivatePtr diskPriv =3D QEMU_DOMAIN_DISK_PRIVATE(dis= k); qemuBlockJobUpdate(driver, vm, QEMU_ASYNC_JOB_NONE, disk); while (diskPriv->blockjob) { - if (virDomainObjWait(vm) < 0) { + if (qemuDomainObjWait(vm) < 0) { ret =3D -1; goto endjob; } diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 69eb231..6082a5f 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -840,7 +840,7 @@ qemuMigrationCancelDriveMirror(virQEMUDriverPtr driver, if (failed && !err) err =3D virSaveLastError(); =20 - if (virDomainObjWait(vm) < 0) + if (qemuDomainObjWait(vm) < 0) goto cleanup; } =20 @@ -979,7 +979,7 @@ qemuMigrationDriveMirror(virQEMUDriverPtr driver, goto cleanup; } =20 - if (virDomainObjWait(vm) < 0) + if (qemuDomainObjWait(vm) < 0) goto cleanup; } =20 @@ -1335,7 +1335,7 @@ qemuMigrationWaitForSpice(virDomainObjPtr vm) =20 VIR_DEBUG("Waiting for SPICE to finish migration"); while (!priv->job.spiceMigrated && !priv->job.abortJob) { - if (virDomainObjWait(vm) < 0) + if (qemuDomainObjWait(vm) < 0) return -1; } return 0; @@ -1603,17 +1603,13 @@ qemuMigrationWaitForCompletion(virQEMUDriverPtr dri= ver, return rv; =20 if (events) { - if (virDomainObjWait(vm) < 0) { + if (qemuDomainObjWait(vm) < 0) { jobInfo->status =3D QEMU_DOMAIN_JOB_STATUS_FAILED; return -2; } } else { /* Poll every 50ms for progress & to allow cancellation */ - struct timespec ts =3D { .tv_sec =3D 0, .tv_nsec =3D 50 * 1000= * 1000ull }; - - virObjectUnlock(vm); - nanosleep(&ts, NULL); - virObjectLock(vm); + qemuDomainObjSleep(vm, 50 * 1000 * 1000ul); } } =20 @@ -1654,7 +1650,7 @@ qemuMigrationWaitForDestCompletion(virQEMUDriverPtr d= river, =20 while ((rv =3D qemuMigrationCompleted(driver, vm, asyncJob, NULL, flags)) !=3D 1) { - if (rv < 0 || virDomainObjWait(vm) < 0) + if (rv < 0 || qemuDomainObjWait(vm) < 0) return -1; } =20 @@ -3910,7 +3906,7 @@ qemuMigrationRun(virQEMUDriverPtr driver, if (priv->monJSON) { while (virDomainObjGetState(vm, NULL) =3D=3D VIR_DOMAIN_RUNNING) { priv->signalStop =3D true; - rc =3D virDomainObjWait(vm); + rc =3D qemuDomainObjWait(vm); priv->signalStop =3D false; if (rc < 0) goto error; diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 18dd3aa..24b7ba1 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -229,6 +229,7 @@ qemuConnectAgent(virQEMUDriverPtr driver, virDomainObjP= tr vm) * deleted while the agent is active */ virObjectRef(vm); =20 + qemuDomainObjEnterInterruptible(vm); virObjectUnlock(vm); =20 agent =3D qemuAgentOpen(vm, @@ -236,6 +237,7 @@ qemuConnectAgent(virQEMUDriverPtr driver, virDomainObjP= tr vm) &agentCallbacks); =20 virObjectLock(vm); + qemuDomainObjExitInterruptible(vm); =20 if (agent =3D=3D NULL) virObjectUnref(vm); --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list