From nobody Mon Feb 9 09:43:27 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; dmarc=fail(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1571150012; cv=none; d=zoho.com; s=zohoarc; b=FdOMNANxrlaylsqvEWVh4vf0qE0RJQua1EXYWe9AQ3m4K5/h66wknkER5wQtRMvTAeVSHvCczNr9PsO+QZ4yCBMlcgnGUnLrSzuNhuQxRs7eGXRbij+gQbMXQBVuhEm8391Xv6t96G5gLAL7e6CDcqb0oDRsSFUI9Dt89m34qIo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571150012; 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=EUrO613nfjS2i6lsvqRUSpMspchsPqp2jeadPqJnHLs=; b=QOz2b4XVr7dNlooDi7nKswzEi1Jml4a73TKJKkASyESYmUqfzp5MKdyqn6x75FqxHjcGEIYxXd8WsZRWNcZrKxm515XwfvbKaDO5sPu7pi6lQupsK5xo/U3xkltX/KpntJaiQ/nbDszGL0Y0UOl37p+kIu48KcmzjmQIO3N5kxY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571150012469408.0294812413923; Tue, 15 Oct 2019 07:33:32 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 77F432A09BA; Tue, 15 Oct 2019 14:33:30 +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 3DAFA60C57; Tue, 15 Oct 2019 14:33:30 +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 E735E18005A0; Tue, 15 Oct 2019 14:33:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9FEUBnX020774 for ; Tue, 15 Oct 2019 10:30:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8729F60C5D; Tue, 15 Oct 2019 14:30:11 +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 7FF4E60BE2 for ; Tue, 15 Oct 2019 14:30:11 +0000 (UTC) Received: from relay.sw.ru (relay.sw.ru [185.231.240.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2A7E7C065128 for ; Tue, 15 Oct 2019 14:30:10 +0000 (UTC) Received: from [172.16.24.106] (helo=shiny.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iKNpw-0002Ve-G1 for libvir-list@redhat.com; Tue, 15 Oct 2019 17:30:08 +0300 From: Nikolay Shirokovskiy To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:29:52 +0300 Message-Id: <20191015142956.30963-9-nshirokovskiy@virtuozzo.com> In-Reply-To: <20191015142956.30963-1-nshirokovskiy@virtuozzo.com> References: <20191015142956.30963-1-nshirokovskiy@virtuozzo.com> MIME-Version: 1.0 X-Greylist: Sender passed SPF test, ACL 264 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 15 Oct 2019 14:30:10 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 15 Oct 2019 14:30:10 +0000 (UTC) for IP:'185.231.240.75' DOMAIN:'relay.sw.ru' HELO:'relay.sw.ru' FROM:'nshirokovskiy@virtuozzo.com' RCPT:'' X-RedHat-Spam-Score: 0 (SPF_HELO_NONE, SPF_PASS) 185.231.240.75 relay.sw.ru 185.231.240.75 relay.sw.ru X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 REBASE 08/12] qemu: hotplug: update device list on device deleted event 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: , 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 15 Oct 2019 14:33:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" I guess this is the missing piece for [1]. It did not hurt before (like we didn't even see any errors/warns in logs) because in qemuProcessUpdateDevices function virDomainDefFindDevice does not find device deleted from libvirt config. But now in case of unpluggind usb device from host we leave device in config and thus needlessly try to call qemuDomainRemoveDevice second time. [1] 0dfb8a1b9: qemu: Unplug devices that disappeared when libvirtd was down Signed-off-by: Nikolay Shirokovskiy --- src/qemu/qemu_driver.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 030fe8a6c4..e268e2fd1e 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -4646,6 +4646,9 @@ processDeviceDeletedEvent(virQEMUDriverPtr driver, if (STRPREFIX(devAlias, "vcpu")) { qemuDomainRemoveVcpuAlias(driver, vm, devAlias); } else { + if (qemuDomainUpdateDeviceList(driver, vm, QEMU_ASYNC_JOB_NONE) < = 0) + goto cleanup; + if (virDomainDefFindDevice(vm->def, devAlias, &dev, true) < 0) goto endjob; =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list