From patchwork Fri Jan 10 02:39:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 22508 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 2C971C32F5 for ; Fri, 10 Jan 2025 02:39:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9C450684E1; Fri, 10 Jan 2025 03:39:26 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="COZ7zzdM"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AF1A1684E1 for ; Fri, 10 Jan 2025 03:39:24 +0100 (CET) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9F10778C; Fri, 10 Jan 2025 03:38:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1736476710; bh=NgOmw+Q0MvISgl9DgSN25qEcRbaSDn27DbXQW2oWkYc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=COZ7zzdM+M2h0LsX/7mwHFlIDtGQxYO/Z+anuP0SW0zt+bXSKSU577CDbf089Zmt7 1a2VcAdeAngX/1vVlWLwSVtWy867I3TfcCqRDhoo9abciYL/jqyvtu28jDkYMFP0/n mbLaNbVpAHSoLMRCkYE8iISxOMPviJqwzXuVs668= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= , Julien Vuillaumier , Harvey Yang Subject: [PATCH 2/2] libcamera: pipeline: virtual: Demote config file error message to debug Date: Fri, 10 Jan 2025 04:39:20 +0200 Message-ID: <20250110023920.28502-2-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250110023920.28502-1-laurent.pinchart@ideasonboard.com> References: <20250110023920.28502-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The virtual pipeline handler prints an error message when its configuration file can't be opened. Not providing a configuration file is the default method to disable virtual cameras, so this error is confusing for users. Replace it with a debug message when the configuration file is not found, and keep an error message when it exists but can't be opened. Signed-off-by: Laurent Pinchart --- src/libcamera/pipeline/virtual/virtual.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/libcamera/pipeline/virtual/virtual.cpp b/src/libcamera/pipeline/virtual/virtual.cpp index e692a5433dde8cd5..469f56556f5eb40d 100644 --- a/src/libcamera/pipeline/virtual/virtual.cpp +++ b/src/libcamera/pipeline/virtual/virtual.cpp @@ -329,10 +329,17 @@ bool PipelineHandlerVirtual::match([[maybe_unused]] DeviceEnumerator *enumerator created_ = true; - File file(configurationFile("virtual", "virtual.yaml")); - bool isOpen = file.open(File::OpenModeFlag::ReadOnly); - if (!isOpen) { - LOG(Virtual, Error) << "Failed to open config file: " << file.fileName(); + std::string configFile = configurationFile("virtual", "virtual.yaml", true); + if (configFile.empty()) { + LOG(Virtual, Debug) + << "Configuration file not found, skipping virtual cameras"; + return false; + } + + File file(configFile); + if (!file.open(File::OpenModeFlag::ReadOnly)) { + LOG(Virtual, Error) + << "Failed to open config file `" << file.fileName() << "`"; return false; }