From nobody Mon Feb 9 08:30:51 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=1652196305; cv=none; d=zohomail.com; s=zohoarc; b=AszNDyGyFirwHuhQNig746eE7uqYlC4BktvXKvdKZHZ2zmw+4qe3wEpTJs/FMMkIlRJw7K9Hi+lKxw3Z7gfP9nu0GSSG3DhEGVdJ0Eq6a7dkWppL5qlA3XvM+NOkBac4zY1kjSQe8Oe392+ci1WBXGrJyooK48X0NGzH3YZpsic= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652196305; 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=J+YMOpGGqm10NTpuNDM+Qbk+ZLtAtcXQfLPyaa6cZso=; b=VbuLVstJCMkSqIKgMLEDvk/vmt2HQmh+fhod7YaYQCxy24I9isJALnEeqpUV/3FLMFs3YcjaHd9E48aBjC+VU/RVN9VtCefuvPBpleCXOQp7j52Hxw413CLyg+eZLdz8gQywKLxmYHkDQ9qvgADBrzGQw2lX4wxaYwe9odEx3X0= 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 1652196305555953.2792580189715; Tue, 10 May 2022 08:25:05 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-245-naApR2MANOmJXtVOzYQiCA-1; Tue, 10 May 2022 11:23:36 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E05DE1C161C3; Tue, 10 May 2022 15:23:14 +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 BF5D414DFBB4; Tue, 10 May 2022 15:23:14 +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 9020F1947062; Tue, 10 May 2022 15:23:14 +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 58C3B194705D for ; Tue, 10 May 2022 15:23:13 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4839A200BCE9; Tue, 10 May 2022 15:23:13 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id B725E202699A for ; Tue, 10 May 2022 15:23:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652196304; 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=J+YMOpGGqm10NTpuNDM+Qbk+ZLtAtcXQfLPyaa6cZso=; b=Tx0LR8yu8E2gyS++yNvjYBeA98luVVrRe7Pf56+zjMH1Tn9FDI4KYcHtmrFPJ05MKswjYe tQQcGREu5rEfMi60G/Ab0bVTAGgw/TpBRb5wywjTTNqEMPBFtc2txTvtKwrXoeng6w04an /p4grFdFelsAHGffW9hRJzLae9w4Suw= X-MC-Unique: naApR2MANOmJXtVOzYQiCA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 25/37] qemuMonitorAddNetdev: Remove 'vhostfd' machinery Date: Tue, 10 May 2022 17:20:01 +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.85 on 10.11.54.7 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: 1652196306350100005 Content-Type: text/plain; charset="utf-8" All callers now pass NULL/0 as arguments for vhostfd passing so we can remove all the associated code. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 3 +-- src/qemu/qemu_monitor.c | 14 ++------------ src/qemu/qemu_monitor.h | 1 - 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 17fe072e02..f7d3b38a6a 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1461,7 +1461,6 @@ qemuDomainAttachNetDevice(virQEMUDriver *driver, if (qemuMonitorAddNetdev(priv->mon, &netprops, tapfd, tapfdName, tapfdSize, - NULL, NULL, 0, slirpfd, slirpfdName) < 0) { qemuDomainObjExitMonitor(vm); virDomainAuditNet(vm, NULL, net, "attach", false); @@ -2242,7 +2241,7 @@ qemuDomainAttachChrDevice(virQEMUDriver *driver, if (netdevprops) { if (qemuMonitorAddNetdev(priv->mon, &netdevprops, - NULL, NULL, 0, NULL, NULL, 0, -1, NULL) <= 0) + NULL, NULL, 0, -1, NULL) < 0) goto exit_monitor; } diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 39004201c0..57a9e9af62 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2631,17 +2631,15 @@ int qemuMonitorAddNetdev(qemuMonitor *mon, virJSONValue **props, int *tapfd, char **tapfdName, int tapfdSize, - int *vhostfd, char **vhostfdName, int vhostfdSize, int slirpfd, char *slirpfdName) { int ret =3D -1; - size_t i =3D 0, j =3D 0; + size_t i =3D 0; VIR_DEBUG("props=3D%p tapfd=3D%p tapfdName=3D%p tapfdSize=3D%d" - "vhostfd=3D%p vhostfdName=3D%p vhostfdSize=3D%d" "slirpfd=3D%d slirpfdName=3D%s", props, tapfd, tapfdName, tapfdSize, - vhostfd, vhostfdName, vhostfdSize, slirpfd, slirpfdName); + slirpfd, slirpfdName); QEMU_CHECK_MONITOR(mon); @@ -2649,10 +2647,6 @@ qemuMonitorAddNetdev(qemuMonitor *mon, if (qemuMonitorSendFileHandle(mon, tapfdName[i], tapfd[i]) < 0) goto cleanup; } - for (j =3D 0; j < vhostfdSize; j++) { - if (qemuMonitorSendFileHandle(mon, vhostfdName[j], vhostfd[j]) < 0) - goto cleanup; - } if (slirpfd > 0 && qemuMonitorSendFileHandle(mon, slirpfdName, slirpfd) < 0) @@ -2666,10 +2660,6 @@ qemuMonitorAddNetdev(qemuMonitor *mon, if (qemuMonitorCloseFileHandle(mon, tapfdName[i]) < 0) VIR_WARN("failed to close device handle '%s'", tapfdName[i= ]); } - while (j--) { - if (qemuMonitorCloseFileHandle(mon, vhostfdName[j]) < 0) - VIR_WARN("failed to close device handle '%s'", vhostfdName= [j]); - } if (qemuMonitorCloseFileHandle(mon, slirpfdName) < 0) VIR_WARN("failed to close device handle '%s'", slirpfdName); } diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 79d8486d08..1008b33671 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -984,7 +984,6 @@ int qemuMonitorCloseFileHandle(qemuMonitor *mon, int qemuMonitorAddNetdev(qemuMonitor *mon, virJSONValue **props, int *tapfd, char **tapfdName, int tapfdSize, - int *vhostfd, char **vhostfdName, int vhostfdSize, int slirpfd, char *slirpfdName); int qemuMonitorRemoveNetdev(qemuMonitor *mon, --=20 2.35.1