From nobody Tue Oct 28 17:28:41 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=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1760423982; cv=none; d=zohomail.com; s=zohoarc; b=hv6cZbm5Z8W0hoqUAWToVHaEPpHZD09E4GmgM72gItyrx4Maco1WJH3m+J3uTsqOrq71WBXGjaSrq8PhfFqkVwabtNhH4X5JeKggYWXVYikX+jg44htwO0ch7Na755rMI6bvmYS9gH8yS/332yyE4Ly1QeXtxgRRxAOy968QYQg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1760423982; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=fhyeqzBaTPcOkqO8/9UBVqkHZEf1N5jyLEMAa+UpAsE=; b=PU9ptabjWPFHGYyCayP+iwwyWpP43+oKthrfbfY13/WN7QsKY+FYGNSE5mloeM2t45fbGtvPI0gWSYqiUoxf95rTrcXMscsH+vN7tx8GWV2eS+WKAWAIRYMb68ncD1GvucKupj8KOP6TwTEqAO65yder2oeo4xjgEQvIAf1aCBo= ARC-Authentication-Results: i=1; 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=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1760423982880181.63556648237216; Mon, 13 Oct 2025 23:39:42 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id F143E44426; Tue, 14 Oct 2025 02:39:41 -0400 (EDT) Received: from [172.19.199.20] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 3BA8544648; Tue, 14 Oct 2025 02:37:32 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id C17E341B73; Tue, 14 Oct 2025 02:32:01 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 09F0D43DB1 for ; Tue, 14 Oct 2025 02:32:01 -0400 (EDT) Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-445-5M9k8vEXOnymoDhvSglmAA-1; Tue, 14 Oct 2025 02:31:59 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4C5A31800578 for ; Tue, 14 Oct 2025 06:31:58 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.3.236]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A86D0300018D for ; Tue, 14 Oct 2025 06:31:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1760423520; 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=fhyeqzBaTPcOkqO8/9UBVqkHZEf1N5jyLEMAa+UpAsE=; b=NZrVV70UnCV3Q57TvXZdq1B5mvnDJUkqbqcVsGXjO7NBMW3hNGWVJNdg+flKCaxvo848EV 1iYVdiIUitfPpdzFqi7RkUb6Fwns9I5X9pH7RM3pYORrDa6KDFqg0WU2HXyV219uKAzwe7 Rp1tKGqykDo4qEqyCFYHKXv8GjisfbU= X-MC-Unique: 5M9k8vEXOnymoDhvSglmAA-1 X-Mimecast-MFC-AGG-ID: 5M9k8vEXOnymoDhvSglmAA_1760423518 To: devel@lists.libvirt.org Subject: [PATCH 5/8] wireshark: Don't special case retval of get_program_data() in dissect_libvirt_message() Date: Tue, 14 Oct 2025 08:31:44 +0200 Message-ID: <7f2dc07e23c71d5823560a8ab3fe5502e624d121.1760423277.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: fHjLhWR6fcNRlnQ-VHAxYaOiZVKkQamEjWkRdw9jQ-0_1760423518 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: C4OEIVVR3HSQ5YLY6PJNZKTCXUZ6KHVI X-Message-ID-Hash: C4OEIVVR3HSQ5YLY6PJNZKTCXUZ6KHVI X-MailFrom: mprivozn@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Michal Privoznik via Devel Reply-To: Michal Privoznik X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1760423985067158500 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik The get_program_data() function returns a pointer (in this specific case to an array of procedure strings) which, if non-NULL is then passed val_to_str(). Well, if val_to_str() sees NULL it is treated gracefully, i.e. like if the numeric value 'proc' wasn't found in the array. Therefore, there's no need to special case call to col_append_fstr(). Both result into the same behaviour. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- tools/wireshark/src/packet-libvirt.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tools/wireshark/src/packet-libvirt.c b/tools/wireshark/src/pac= ket-libvirt.c index af14c6bed7..6c729801d4 100644 --- a/tools/wireshark/src/packet-libvirt.c +++ b/tools/wireshark/src/packet-libvirt.c @@ -469,11 +469,7 @@ dissect_libvirt_message(tvbuff_t *tvb, packet_info *pi= nfo, proto_tree *tree, val_to_str(prog, program_strings, "%x")); =20 vs =3D get_program_data(prog, VIR_PROGRAM_PROCSTRINGS); - if (vs =3D=3D NULL) { - col_append_fstr(pinfo->cinfo, COL_INFO, " Proc=3D%d", proc); - } else { - col_append_fstr(pinfo->cinfo, COL_INFO, " Proc=3D%s", val_to_str(p= roc, vs, "%d")); - } + col_append_fstr(pinfo->cinfo, COL_INFO, " Proc=3D%s", val_to_str(proc,= vs, "%d")); =20 col_append_fstr(pinfo->cinfo, COL_INFO, " Type=3D%s Serial=3D%u Status= =3D%s", val_to_str(type, type_strings, "%d"), serial, --=20 2.49.1