From nobody Fri Dec 19 17:14:06 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1725439241960387.3350969319042; Wed, 4 Sep 2024 01:40:41 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id ECA4E1447; Wed, 4 Sep 2024 04:40:40 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 2C5B11540; Wed, 4 Sep 2024 04:39:56 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id AD03B1126; Wed, 4 Sep 2024 04:39:51 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 001CC1404 for ; Wed, 4 Sep 2024 04:39:50 -0400 (EDT) Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-114-DNZsgI1APgC7ZTzUoBqz9Q-1; Wed, 04 Sep 2024 04:39:49 -0400 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-42bbff6a0aeso42804995e9.3 for ; Wed, 04 Sep 2024 01:39:49 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bc00877c4sm150839115e9.6.2024.09.04.01.39.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 01:39:46 -0700 (PDT) Received: from wheatley.brq.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 018DC1FD3325 for ; Wed, 04 Sep 2024 10:39:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725439190; h=from:from: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; bh=5yCeXEzZFJ+YU+TC2gZXpVQFEaC+9uZYy5xQUj0v1CA=; b=LtEYNVpNp/5PdEgwFeUigFEnmuH+ese+5sHgZ8Rg0SwaoLPQ7ZiM40gxce64h0wtpyJ6n0 uP8OT0zTub+0B4AO1CInoEynkSSeTR4rNjlh5buzbOajA8BpTTFyAbsPJcQ3LwkPPgu8KZ 7zrMMmD7CBm1xsY3svbeZ80Ok4KTj8s= X-MC-Unique: DNZsgI1APgC7ZTzUoBqz9Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725439188; x=1726043988; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5yCeXEzZFJ+YU+TC2gZXpVQFEaC+9uZYy5xQUj0v1CA=; b=lIp3K8snl+UPjrg6h5H+2mp/NCc0D+8qLgoF4gjm5xzEiSOAwS7HTlxXOmJ2cfBHvH y1dY8A3TmJ8ugmRcn0NjkV7hflGLFOqyqAs0Kb3qbVHeZIj8EHD+Cokx4RTQOuKEhkk2 3mgw1kPDdtWmHHawsLnkRSVZMSCCqn/4SAgtkP/FyMIzC+qprZMPjh1vddq920hisvoo ZcDuHIFScZ9MRqW+9J5cKCkD7CbQMXON72piewTV7/ASVDgyZi1OrPoJ5v7ZlKguewDq 0JS6A6x8B1N8ddkDAzxdQNtxymUdiGNkdOKAhGpTcgIGDPbpivg+598a7umRWRzxYP9x JIVg== X-Gm-Message-State: AOJu0YzkUA4ipBJnvrFreAPbxXEVcIHTKV2Vlnitpj/v/aOSUiz+MVdF WrVXRXwuBXpuEhIlPfL0cv57SW/5CiKCUWRrFVeQJpPRW53BWL4eOQ8PuwqrAf+8bJzfrrV07ee onFfU0Lpy1oq1TFwj3cN5b/IdAEpn+uKienXjTgg9TnyODQ9Q68P6KX6RumZt4TVlpJXUntUtj5 219cmMe601ZfjVrCSpIkJ+r+hMzEUd2muGK25VysE= X-Received: by 2002:a05:600c:154e:b0:427:9922:4526 with SMTP id 5b1f17b1804b1-42c8de5f5e9mr24482395e9.7.1725439188344; Wed, 04 Sep 2024 01:39:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHeXv7dOQvmUzE7AAnzvzCoRDLPM30+TRdydOScr4fRm7NqdkbNTpVVKFUVZdmg/QahCsieIA== X-Received: by 2002:a05:600c:154e:b0:427:9922:4526 with SMTP id 5b1f17b1804b1-42c8de5f5e9mr24481965e9.7.1725439187158; Wed, 04 Sep 2024 01:39:47 -0700 (PDT) From: Martin Kletzander To: devel@lists.libvirt.org Subject: [PATCH 2/2] virnetdevtap: Add better error message for a possible common user error Date: Wed, 4 Sep 2024 10:39:44 +0200 Message-ID: <2bf1a9815b5390209906706be046ad1bcb8140de.1725439083.git.mkletzan@redhat.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: JJBHMKEP2GVJVTUVNPVHP25ORVGNWI65 X-Message-ID-Hash: JJBHMKEP2GVJVTUVNPVHP25ORVGNWI65 X-MailFrom: mkletzan@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1725439242715116600 Content-Type: text/plain; charset="utf-8"; x-default="true" When users pre-create a tap device to use with multiqueue interface that has `managed=3D"no"`, change the error so that it does not indicate we are trying to create the device, and on top of that hint at the most probable error cause. Resolves: https://issues.redhat.com/browse/RHEL-55749 Signed-off-by: Martin Kletzander --- src/util/virnetdevtap.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c index 55536b5f4be2..3df4dc129f0c 100644 --- a/src/util/virnetdevtap.c +++ b/src/util/virnetdevtap.c @@ -230,9 +230,16 @@ int virNetDevTapCreate(char **ifname, } =20 if (ioctl(fd, TUNSETIFF, &ifr) < 0) { - virReportSystemError(errno, - _("Unable to create tap device %1$s"), - *ifname); + if (flags & VIR_NETDEV_TAP_CREATE_ALLOW_EXISTING && + tapfdSize > 0) { + virReportSystemError(errno, + _("Unable to create multiple fds for = tap device %1$s (maybe existing device was created without multi_queue flag= )"), + *ifname); + } else { + virReportSystemError(errno, + _("Unable to create tap device %1$s"), + *ifname); + } goto cleanup; } =20 @@ -247,7 +254,7 @@ int virNetDevTapCreate(char **ifname, ioctl(fd, TUNSETPERSIST, 1) < 0) { virReportSystemError(errno, _("Unable to set tap device %1$s to persi= stent"), - *ifname); + NULLSTR(*ifname)); goto cleanup; } tapfd[i] =3D fd; --=20 2.46.0