From nobody Mon Feb 9 12:42:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1692867491; cv=none; d=zohomail.com; s=zohoarc; b=lsS6/ybdsvSQICV2tOf9eqLme5l2rrNNOw8PL4c9WQUag1EF9918ycNJbP5iXj/EU7ejeInSKqwFVSze8SNycLjbIskgWEbiqCgT5tS37Wb0qjqd77ApoBAkZ5Cj31zUUSZ16tckZ3WP2uFYKBomx7+15T28MX/7jd8HGWh3n3U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692867491; 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=ZsJbq+CbFJtiDNVxcTYYl42YvoFsZkhHEnA96IJ7oVw=; b=WXnJSL/pF5Kv7oagBlKLFVnk7McRg88I321NYonTl5o0fpFbvM6glz6wUlG1wFMDtkc5xwpRsWVyaN2w4/e4EgXRyn5pb2z/xY2Z0NmwB++Nf88C9yZsR2hRqEeGMlpHK15TS+FS3pN8olnvlaK9E4XSe8gddT3dzrrK6IgVNtA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1692867491320726.3996546725434; Thu, 24 Aug 2023 01:58:11 -0700 (PDT) Received: from mimecast-mx02.redhat.com (66.187.233.73 [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-302-W3LM_KMkNN28JKqklgkVvA-1; Thu, 24 Aug 2023 04:57:51 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4401E1C08971; Thu, 24 Aug 2023 08:57:48 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 29787403163; Thu, 24 Aug 2023 08:57:48 +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 BDC4219465B5; Thu, 24 Aug 2023 08:57:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9F3831946589 for ; Thu, 24 Aug 2023 08:57:45 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 709DA1121315; Thu, 24 Aug 2023 08:57:45 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 182A11121314 for ; Thu, 24 Aug 2023 08:57:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692867490; 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=ZsJbq+CbFJtiDNVxcTYYl42YvoFsZkhHEnA96IJ7oVw=; b=RagoeB72YshYQpPokKRTmpaGDYtpyN0toYSNKItLZ6Es9ErcZ17aXrDL27jcv6wnoJLSaS NVXUJ0EeHwku7+jyVpGIv4iKEEStB8dfEcxDBAy/Snkn0nx7TsHc8ULt7ovZe0/vdFwyZ0 lLMeLGY6gLlTogeReL6zHE/xn1rrv+Q= X-MC-Unique: W3LM_KMkNN28JKqklgkVvA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 5/6] virMdevctlList: Don't check for !output Date: Thu, 24 Aug 2023 10:57:39 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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 3.1 on 10.11.54.10 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: 1692867491553100001 Content-Type: text/plain; charset="utf-8"; x-default="true" After 'mdevctl' was ran, its stdout is captured in @output which is then compared against NULL and if it is NULL a negative value is returned (to indicate error to the caller). But this is effectively a dead code, because virCommand (specifically virCommandProcessIO()) makes sure both stdout and stderr buffers are properly '\0' terminated. Therefore, this can never evaluate to true. Also, if there really is no output from 'mdevctl' (which was handled in one of earlier commits, but let just assume it wasn't), then we should not error out and treat such scenario as 'no mdevs defined/active'. Signed-off-by: Michal Privoznik --- src/node_device/node_device_driver.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_de= vice_driver.c index ac50c96837..a59cd0875d 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -1650,9 +1650,6 @@ virMdevctlList(bool defined, return -1; } =20 - if (!output) - return -1; - return nodeDeviceParseMdevctlJSON(output, devs); } =20 --=20 2.41.0