From nobody Wed May 1 20:10:04 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) client-ip=209.132.183.25; envelope-from=libvir-list-bounces@redhat.com; helo=mx4-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by mx.zohomail.com with SMTPS id 1488554078372993.2958211468646; Fri, 3 Mar 2017 07:14:38 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v23FB5qF017205; Fri, 3 Mar 2017 10:11:05 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v23FB4QJ030806 for ; Fri, 3 Mar 2017 10:11:04 -0500 Received: from angien.brq.redhat.com (dhcp129-47.brq.redhat.com [10.34.129.47]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v23FB1g6023395; Fri, 3 Mar 2017 10:11:03 -0500 From: Peter Krempa To: libvir-list@redhat.com Date: Fri, 3 Mar 2017 16:11:49 +0100 Message-Id: <4bf0c64079230644e557ed40da1c7e6cae1e50e1.1488553799.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 1/2] qemu: hotplug: Add debug log when dispatching device removal to existing thread 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-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Note that the waiting thread is singalled in the debug logs to simplify debugging. --- src/qemu/qemu_hotplug.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 0c0885695..889f110a9 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -4362,6 +4362,7 @@ qemuDomainSignalDeviceRemoval(virDomainObjPtr vm, qemuDomainObjPrivatePtr priv =3D vm->privateData; if (STREQ_NULLABLE(priv->unplug.alias, devAlias)) { + VIR_DEBUG("Removal of device '%s' continues in waiting thread", de= vAlias); qemuDomainResetDeviceRemoval(vm); priv->unplug.status =3D status; virDomainObjBroadcast(vm); --=20 2.12.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 1 20:10:04 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) client-ip=209.132.183.25; envelope-from=libvir-list-bounces@redhat.com; helo=mx4-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by mx.zohomail.com with SMTPS id 1488554072144612.488535472072; Fri, 3 Mar 2017 07:14:32 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v23FB6gP017208; Fri, 3 Mar 2017 10:11:06 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v23FB5eM030816 for ; Fri, 3 Mar 2017 10:11:05 -0500 Received: from angien.brq.redhat.com (dhcp129-47.brq.redhat.com [10.34.129.47]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v23FB1g7023395; Fri, 3 Mar 2017 10:11:04 -0500 From: Peter Krempa To: libvir-list@redhat.com Date: Fri, 3 Mar 2017 16:11:50 +0100 Message-Id: <77996c4e4f7e3391b62767248538c88840dac499.1488553799.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 2/2] qemu: hotplug: Reset device removal waiting code after vCPU unplug 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-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" If the delivery of the DEVICE_DELETED event for the vCPU being deleted would time out, the code would not call 'qemuDomainResetDeviceRemoval'. Since the waiting thread did not unregister itself prior to stopping the waiting the monitor code would try to wake it up instead of dispatching it to the event worker. As a result the unplug process would not be completed and the definition would not be updated. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1428893 https://bugzilla.redhat.com/show_bug.cgi?id=3D1427801 --- src/qemu/qemu_hotplug.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 889f110a9..636a806f0 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -5334,6 +5334,7 @@ qemuDomainHotplugDelVcpu(virQEMUDriverPtr driver, int oldvcpus =3D virDomainDefGetVcpus(vm->def); unsigned int nvcpus =3D vcpupriv->vcpus; int rc; + int ret =3D -1; if (!vcpupriv->alias) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, @@ -5348,11 +5349,11 @@ qemuDomainHotplugDelVcpu(virQEMUDriverPtr driver, rc =3D qemuMonitorDelDevice(qemuDomainGetMonitor(vm), vcpupriv->alias); if (qemuDomainObjExitMonitor(driver, vm) < 0) - return -1; + goto cleanup; if (rc < 0) { virDomainAuditVcpu(vm, oldvcpus, oldvcpus - nvcpus, "update", fals= e); - return -1; + goto cleanup; } if ((rc =3D qemuDomainWaitForDeviceRemoval(vm)) <=3D 0) { @@ -5360,10 +5361,17 @@ qemuDomainHotplugDelVcpu(virQEMUDriverPtr driver, virReportError(VIR_ERR_OPERATION_FAILED, "%s", _("vcpu unplug request timed out")); - return -1; + goto cleanup; } - return qemuDomainRemoveVcpu(driver, vm, vcpu); + if (qemuDomainRemoveVcpu(driver, vm, vcpu) < 0) + goto cleanup; + + ret =3D 0; + + cleanup: + qemuDomainResetDeviceRemoval(vm); + return ret; } --=20 2.12.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list