From nobody Fri Apr 19 00:16:54 2024 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 15205479772251002.3825950680732; Thu, 8 Mar 2018 14:26:17 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A54F35D5E9; Thu, 8 Mar 2018 22:26:14 +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 76D69608F0; Thu, 8 Mar 2018 22:26:13 +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 25EAF181B9FC; Thu, 8 Mar 2018 22:26:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w28MQ8Mg007090 for ; Thu, 8 Mar 2018 17:26:08 -0500 Received: by smtp.corp.redhat.com (Postfix) id D99AC60180; Thu, 8 Mar 2018 22:26:08 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CF0B86134B; Thu, 8 Mar 2018 22:26:06 +0000 (UTC) Received: from smtp2.provo.novell.com (smtp2.provo.novell.com [137.65.250.81]) (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 F2DA937E6E; Thu, 8 Mar 2018 22:26:04 +0000 (UTC) Received: from linux-tbji.provo.novell.com (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by smtp2.provo.novell.com with ESMTP (NOT encrypted); Thu, 08 Mar 2018 15:26:01 -0700 From: Jim Fehlig To: libvir-list@redhat.com Date: Thu, 8 Mar 2018 15:25:51 -0700 Message-Id: <20180308222551.3436-1-jfehlig@suse.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 207 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 08 Mar 2018 22:26:05 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 08 Mar 2018 22:26:05 +0000 (UTC) for IP:'137.65.250.81' DOMAIN:'smtp2.provo.novell.com' HELO:'smtp2.provo.novell.com' FROM:'jfehlig@suse.com' RCPT:'' X-RedHat-Spam-Score: -2.301 (RCVD_IN_DNSWL_MED, SPF_PASS) 137.65.250.81 smtp2.provo.novell.com 137.65.250.81 smtp2.provo.novell.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] libvirtd: fix potential deadlock when reloading 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 08 Mar 2018 22:26:15 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" It is possible to deadlock libvirtd when concurrently starting a domain and restarting the daemon. Threads involved in the deadlock are Thread 4 (Thread 0x7fc13b53e700 (LWP 64084)): #0 0x00007fc13fba10bf in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0 #1 0x00007fc14310213c in virCondWait (c=3D0x7fc110017fa8, m=3D0x7fc110017f= 80) at util/virthread.c:154 #2 0x00007fc1280244e9 in qemuMonitorSend (mon=3D0x7fc110017f70, msg=3D0x7f= c13b53d240) at qemu/qemu_monitor.c:1083 #3 0x00007fc12803bf5a in qemuMonitorJSONCommandWithFd (mon=3D0x7fc110017f7= 0, cmd=3D0x7fc110017700, scm_fd=3D-1, reply=3D0x7fc13b53d318) at qemu/qemu_monitor_json.c:305 #4 0x00007fc12803c09c in qemuMonitorJSONCommand (mon=3D0x7fc110017f70, cmd=3D0x7fc110017700, reply=3D0x7fc13b53d318) at qemu/qemu_monitor_json.c:335 #5 0x00007fc12803f116 in qemuMonitorJSONSetCapabilities (mon=3D0x7fc110017= f70) at qemu/qemu_monitor_json.c:1298 #6 0x00007fc128026e14 in qemuMonitorSetCapabilities (mon=3D0x7fc110017f70) at qemu/qemu_monitor.c:1697 #7 0x00007fc127ffe250 in qemuProcessInitMonitor (driver=3D0x7fc12004e1e0, vm=3D0x7fc110003d00, asyncJob=3DQEMU_ASYNC_JOB_START) at qemu/qemu_proc= ess.c:1763 #8 0x00007fc127ffe564 in qemuConnectMonitor (driver=3D0x7fc12004e1e0, vm=3D0x7fc110003d00, asyncJob=3D6, logCtxt=3D0x7fc1100089c0) at qemu/qemu_process.c:1835 #9 0x00007fc127fff386 in qemuProcessWaitForMonitor (driver=3D0x7fc12004e1e= 0, vm=3D0x7fc110003d00, asyncJob=3D6, logCtxt=3D0x7fc1100089c0) at qemu/qemu_process.c:2180 #10 0x00007fc128009269 in qemuProcessLaunch (conn=3D0x7fc1100009a0, driver=3D0x7fc12004e1e0, vm=3D0x7fc110003d00, asyncJob=3DQEMU_ASYNC_JOB_START, incoming=3D0x0, s= napshot=3D0x0, vmop=3DVIR_NETDEV_VPORT_PROFILE_OP_CREATE, flags=3D17) at qemu/qemu_pro= cess.c:6111 #11 0x00007fc128009e85 in qemuProcessStart (conn=3D0x7fc1100009a0, driver=3D0x7fc12004e1e0, vm=3D0x7fc110003d00, updatedCPU=3D0x0, asyncJob=3DQEMU_ASYNC_JOB_START, migrateFrom=3D0x0, migrateFd=3D-1, migratePath=3D0x0, snapshot=3D0x0, vmop=3DVIR_NETDEV_VPORT_PROFILE_OP_CREATE, flags=3D17) at qemu/qemu_process.c:6334 #12 0x00007fc1280552f1 in qemuDomainCreateXML (conn=3D0x7fc1100009a0, xml=3D0x7fc110000ed0 "