From nobody Mon Feb 9 07:39:47 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1652196087; cv=none; d=zohomail.com; s=zohoarc; b=ZNjU7BHMrhdEC6HUL/A7qngkmF2mlLo+czImi/ss8DuLNJA0SArwCMoTuCyYnIFkwhCRb/OWe6udQ9vh0Pd7U1yzdwsdxSkFoE3iKYurr7Kw4oD02R0OMrb3AGzUuENeibJT7xV5sky0877ZN56gSc4up00z2aJQyw7ooR6ONeI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652196087; 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=hYVom7ACsgqRvE8JWa6BPC+1fklsOkRP8gqkF7gyf9I=; b=QLbm1ZISbcPgq/vPWm9MLwVw9socUah19etezt4+AB6QZp3SQfI7ejkrhj499gP7V3Fq++fCabl6qY+0kiYJFILPnZVjwPBWmcpIUHuQ6KxykX8INpKpRobjcQFYh2PLOFn9NjmeWRWh5Pxt6JA/imXAE8226FFxiQFNglLzG98= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 165219608733478.24803233934722; Tue, 10 May 2022 08:21:27 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-441-K5qqRBn1OVeNRuj04wXpbQ-1; Tue, 10 May 2022 11:21:22 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E7C9285A5A8; Tue, 10 May 2022 15:21:19 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D50F040D0161; Tue, 10 May 2022 15:21:19 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id AC63C1947055; Tue, 10 May 2022 15:21:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id EBC2C194704D for ; Tue, 10 May 2022 15:21:17 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id DD7232024CBD; Tue, 10 May 2022 15:21:17 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 529502024CBB for ; Tue, 10 May 2022 15:21:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652196086; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=hYVom7ACsgqRvE8JWa6BPC+1fklsOkRP8gqkF7gyf9I=; b=KUBT/25FDJyhKekZtTIFs2qRyCbzisBb2aoud0Nx7nyCT/vQgTceHGwtcuPGupxzYseV18 AIG4bWuEaHWsFqwsFpsBR9K6QyOMWXlkse0WBz/a2PbHG03gkY5ubhAJblF39PUMrQGNQB i4bo5D6OYI0Y3baClZerOburYO/ThHA= X-MC-Unique: K5qqRBn1OVeNRuj04wXpbQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 17/37] qemuDomainAttachNetDevice: Don't construct network device properties under monitor lock Date: Tue, 10 May 2022 17:19:53 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1652196088296100001 Content-Type: text/plain; charset="utf-8" After the 'qemuFDPass' code was refactored we no longer need to hand off the FD to qemu before we know the path for it. Thus the call to qemuBuildHostNetProps can be moved outside of the monitor critical section. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index d5bdeb83ae..525c55baf2 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1452,17 +1452,15 @@ qemuDomainAttachNetDevice(virQEMUDriver *driver, for (i =3D 0; i < vhostfdSize; i++) vhostfdName[i] =3D g_strdup_printf("vhostfd-%s%zu", net->info.alia= s, i); - qemuDomainObjEnterMonitor(driver, vm); - - if (qemuFDPassTransferMonitor(netpriv->vdpafd, priv->mon) < 0) { - qemuDomainObjExitMonitor(vm); - goto cleanup; - } - if (!(netprops =3D qemuBuildHostNetProps(net, tapfdName, tapfdSize, vhostfdName, vhostfdSize, - slirpfdName))) { + slirpfdName))) + goto cleanup; + + qemuDomainObjEnterMonitor(driver, vm); + + if (qemuFDPassTransferMonitor(netpriv->vdpafd, priv->mon) < 0) { qemuDomainObjExitMonitor(vm); goto cleanup; } --=20 2.35.1