From nobody Sun Feb 8 18:31:40 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1565274477; cv=none; d=zoho.com; s=zohoarc; b=OUDoUdYVGBEcR1pF6wkLSFo8GqJZOuXqah3FbakY1D/Rnat5ZASpll5Pu26bmz+ZGXLDKb+QCTtuRcffJtHvTYkl/1ac70Vh7B3jHoxg9gk4Czbc8cZa3zRHhbI5lLWrWFCBnKBtHZVKPlHcijnFdMKTApaK3x3jC69RniS3WJs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565274477; 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:ARC-Authentication-Results; bh=3AL62375Ea+PBmeK9kboL8MF2IpNy4HSak55zpG64eI=; b=lKKmjB67ciHzmcn8wVnIc+R9WEKCutkga5aHIPFCF3+4vGLvju1cQzce/rIjPNiuWQjyeE4jjrbwCHInBisHcjKXlDcM/5yfFsTPaP2f+PN5o7grRmbLocCLgbJskdnirI0VKa7xO7G8B4IDQc+WXtMVK53o1Tte9R0nJnz8zo8= 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=pass 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 1565274477416970.819010832782; Thu, 8 Aug 2019 07:27:57 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9DFFA30253EC; Thu, 8 Aug 2019 14:27: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 75AACF6EA; Thu, 8 Aug 2019 14:27: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 323844EEB9; Thu, 8 Aug 2019 14:27:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x78EQoRV017463 for ; Thu, 8 Aug 2019 10:26:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 545751001956; Thu, 8 Aug 2019 14:26:50 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 29EA810016E9 for ; Thu, 8 Aug 2019 14:26:50 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 43D471024F4; Thu, 8 Aug 2019 16:26:47 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 8 Aug 2019 16:26:39 +0200 Message-Id: <7c16be24a7235dadcd0ee9b422923dc98786bcb7.1565271790.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 05/10] qemu: Pass correct qemuCaps to virDomainDefParseString 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 08 Aug 2019 14:27:56 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Since qemuDomainDefPostParse callback requires qemuCaps, we need to make sure it gets the capabilities stored in the domain's private data if the domain is running. Passing NULL may cause QEMU capabilities probing to be triggered in case QEMU binary changed in the meantime. When this happens while a running domain object is locked, QMP event delivered to the domain before QEMU capabilities probing finishes will deadlock the event loop. This patch fixes all paths leading to virDomainDefParseString. Signed-off-by: Jiri Denemark --- src/qemu/qemu_driver.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 1139fde77a..3004433aa5 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -3437,7 +3437,8 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, if (xmlin) { virDomainDefPtr def =3D NULL; =20 - if (!(def =3D virDomainDefParseString(xmlin, caps, driver->xmlopt,= NULL, + if (!(def =3D virDomainDefParseString(xmlin, caps, driver->xmlopt, + priv->qemuCaps, VIR_DOMAIN_DEF_PARSE_INACTIVE | VIR_DOMAIN_DEF_PARSE_SKIP_VALI= DATE))) { goto endjob; @@ -15907,7 +15908,8 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain, if (!(xml =3D qemuDomainDefFormatLive(driver, priv->qemuCaps, vm->def, priv->origCPU, true, true)) || - !(def->parent.dom =3D virDomainDefParseString(xml, caps, drive= r->xmlopt, NULL, + !(def->parent.dom =3D virDomainDefParseString(xml, caps, drive= r->xmlopt, + priv->qemuCaps, VIR_DOMAIN_DEF_PAR= SE_INACTIVE | VIR_DOMAIN_DEF_PAR= SE_SKIP_VALIDATE))) goto endjob; @@ -17008,7 +17010,8 @@ qemuDomainCheckpointPrepare(virQEMUDriverPtr driver= , virCapsPtr caps, if (!(xml =3D qemuDomainDefFormatLive(driver, priv->qemuCaps, vm->def, priv->origCPU, true, true)) || - !(def->parent.dom =3D virDomainDefParseString(xml, caps, driver->x= mlopt, NULL, + !(def->parent.dom =3D virDomainDefParseString(xml, caps, driver->x= mlopt, + priv->qemuCaps, VIR_DOMAIN_DEF_PARSE_I= NACTIVE | VIR_DOMAIN_DEF_PARSE_S= KIP_VALIDATE))) goto cleanup; --=20 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list