From nobody Sun Feb 8 17:41:42 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=1565274473; cv=none; d=zoho.com; s=zohoarc; b=XotpS1QKw6ARmCbioKRNF8gxjZZoYvARis214ZqyCE0kaub/fO3qsRDrbge+5ZdSYF+e/bNoL3tUEKDQH4TfOlawxbUjq8pfvCgOmvoq/F1PXWAi1/s7Z6zSrbnbNfAzInkGjElERurefUo9LgypZVVHxef1vHbyZwtIikk5J60= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565274473; 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=2A21KzZev9zurVVEyfiijsL6BPgZKSx6EB+4VMKMhvI=; b=Us6owN1o/ranh+h77Wq9aWRI8j/8VkySapX26h6u/z+v7Xitn2uKSq1wyhkqTX5Y9FVxorzJanPOLBUbaUJr0cljvKamrm+yc6jSClgKr3XPG4zN3wMwzuGSxda+8zscAXKW+cSHu2KZchCbhq+ReAmjlRfpXHiSBdvU2rhuO3M= 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 1565274472998438.8817247232772; Thu, 8 Aug 2019 07:27:52 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9A2CA30C01A3; Thu, 8 Aug 2019 14:27:51 +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 7755D5C219; Thu, 8 Aug 2019 14:27:51 +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 30CD31806B01; Thu, 8 Aug 2019 14:27:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x78EQmtV017453 for ; Thu, 8 Aug 2019 10:26:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id D0C245C231; Thu, 8 Aug 2019 14:26:48 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7F13C5C219 for ; Thu, 8 Aug 2019 14:26:48 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 40ADD1024F0; Thu, 8 Aug 2019 16:26:47 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 8 Aug 2019 16:26:38 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 04/10] qemu: Pass qemuCaps to qemuMigrationAnyPrepareDef 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Thu, 08 Aug 2019 14:27:52 +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 qemuMigrationAnyPrepareDef. Signed-off-by: Jiri Denemark --- src/qemu/qemu_driver.c | 12 ++++++------ src/qemu/qemu_migration.c | 8 ++++++-- src/qemu/qemu_migration.h | 1 + 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 14a20029dd..1139fde77a 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -12651,7 +12651,7 @@ qemuDomainMigratePrepareTunnel(virConnectPtr dconn, goto cleanup; } =20 - if (!(def =3D qemuMigrationAnyPrepareDef(driver, dom_xml, dname, &orig= name))) + if (!(def =3D qemuMigrationAnyPrepareDef(driver, NULL, dom_xml, dname,= &origname))) goto cleanup; =20 if (virDomainMigratePrepareTunnelEnsureACL(dconn, def) < 0) @@ -12712,7 +12712,7 @@ qemuDomainMigratePrepare2(virConnectPtr dconn, goto cleanup; } =20 - if (!(def =3D qemuMigrationAnyPrepareDef(driver, dom_xml, dname, &orig= name))) + if (!(def =3D qemuMigrationAnyPrepareDef(driver, NULL, dom_xml, dname,= &origname))) goto cleanup; =20 if (virDomainMigratePrepare2EnsureACL(dconn, def) < 0) @@ -12951,7 +12951,7 @@ qemuDomainMigratePrepare3(virConnectPtr dconn, QEMU_MIGRATION_DESTINAT= ION))) goto cleanup; =20 - if (!(def =3D qemuMigrationAnyPrepareDef(driver, dom_xml, dname, &orig= name))) + if (!(def =3D qemuMigrationAnyPrepareDef(driver, NULL, dom_xml, dname,= &origname))) goto cleanup; =20 if (virDomainMigratePrepare3EnsureACL(dconn, def) < 0) @@ -13038,7 +13038,7 @@ qemuDomainMigratePrepare3Params(virConnectPtr dconn, goto cleanup; } =20 - if (!(def =3D qemuMigrationAnyPrepareDef(driver, dom_xml, dname, &orig= name))) + if (!(def =3D qemuMigrationAnyPrepareDef(driver, NULL, dom_xml, dname,= &origname))) goto cleanup; =20 if (virDomainMigratePrepare3ParamsEnsureACL(dconn, def) < 0) @@ -13092,7 +13092,7 @@ qemuDomainMigratePrepareTunnel3(virConnectPtr dconn, QEMU_MIGRATION_DESTINAT= ION))) goto cleanup; =20 - if (!(def =3D qemuMigrationAnyPrepareDef(driver, dom_xml, dname, &orig= name))) + if (!(def =3D qemuMigrationAnyPrepareDef(driver, NULL, dom_xml, dname,= &origname))) goto cleanup; =20 if (virDomainMigratePrepareTunnel3EnsureACL(dconn, def) < 0) @@ -13151,7 +13151,7 @@ qemuDomainMigratePrepareTunnel3Params(virConnectPtr= dconn, QEMU_MIGRATION_DESTINAT= ION))) goto cleanup; =20 - if (!(def =3D qemuMigrationAnyPrepareDef(driver, dom_xml, dname, &orig= name))) + if (!(def =3D qemuMigrationAnyPrepareDef(driver, NULL, dom_xml, dname,= &origname))) goto cleanup; =20 if (virDomainMigratePrepareTunnel3ParamsEnsureACL(dconn, def) < 0) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 39e574ee30..d07482d9f2 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2861,6 +2861,7 @@ qemuMigrationDstPrepareDirect(virQEMUDriverPtr driver, =20 virDomainDefPtr qemuMigrationAnyPrepareDef(virQEMUDriverPtr driver, + virQEMUCapsPtr qemuCaps, const char *dom_xml, const char *dname, char **origname) @@ -2878,7 +2879,8 @@ qemuMigrationAnyPrepareDef(virQEMUDriverPtr driver, if (!(caps =3D virQEMUDriverGetCapabilities(driver, false))) return NULL; =20 - if (!(def =3D virDomainDefParseString(dom_xml, caps, driver->xmlopt, N= ULL, + if (!(def =3D virDomainDefParseString(dom_xml, caps, driver->xmlopt, + qemuCaps, VIR_DOMAIN_DEF_PARSE_INACTIVE | VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE= ))) goto cleanup; @@ -3422,7 +3424,9 @@ qemuMigrationSrcRun(virQEMUDriverPtr driver, =20 if (flags & VIR_MIGRATE_PERSIST_DEST) { if (persist_xml) { - if (!(persistDef =3D qemuMigrationAnyPrepareDef(driver, persis= t_xml, + if (!(persistDef =3D qemuMigrationAnyPrepareDef(driver, + priv->qemuCaps, + persist_xml, NULL, NULL))) goto error; } else { diff --git a/src/qemu/qemu_migration.h b/src/qemu/qemu_migration.h index bea7b1e688..188ccfa7fd 100644 --- a/src/qemu/qemu_migration.h +++ b/src/qemu/qemu_migration.h @@ -115,6 +115,7 @@ qemuMigrationSrcBegin(virConnectPtr conn, =20 virDomainDefPtr qemuMigrationAnyPrepareDef(virQEMUDriverPtr driver, + virQEMUCapsPtr qemuCaps, const char *dom_xml, const char *dname, char **origname); --=20 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list