Received: by 2002:a17:505:57c2:b0:1be9:327d:8ee3 with SMTP id yd2csp450546njb; Fri, 13 Dec 2024 05:48:36 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXPI+5x1pkoR6c2g7C+YqkmclNbawbX1afrqv6zAK+pGGIjE5iz3euj3AIrOqN8LQF9ii9TXXg4LJ/yag==@linaro.org X-Google-Smtp-Source: AGHT+IHjWTOcopsncjsur3JoLkjFZK1j8OYy2+j8stOfH8oegKw7JN3qPU9ARcCRqRB2ZPcedIvH X-Received: by 2002:a05:6122:2a05:b0:516:c0b:8bfe with SMTP id 71dfb90a1353d-518ca2171damr2369169e0c.1.1734097716155; Fri, 13 Dec 2024 05:48:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734097716; cv=none; d=google.com; s=arc-20240605; b=KWqORH1GxjarIfPOAdFzYDpGrIcKn6kKxGzfTK2fspwgJmL1y/D1/x/Ow+1eBQNTcs BjvjxpCBh31iC7J7qrOoib2+o3xWAGa9ay5nk+qT2+lDDCpLcRyHJ0w1/90Dx3xqgcLg W+T1iZ8UzTt7UOP+OANylLntiEcp/joVd7O/SMMnCLJfVBa6lUHoUKZdGKoQt7H1xVuB Scarkk9ylR0nP0xvde7Za6KDhrf6zz5yBJweFVRRuJXZ0ubLlOIysQuermJQLnNStW2k CAyhU/b1keZG3Qw1iu2Gr2pMEYzlRKZRP9ukFXFZtl7Sdx/mLVmzSadf+iB7t4JigfNr umGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:user-agent :in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=biw3ZHCGM0oKyrDpdXcfTuOF95X8YId5nqaWBpT3bUE=; fh=8K9UZ6PRzwLFXy/TiuOmWAng+Ot46AJ76JtfixCX4AA=; b=Z7A/KFtqsI2JnOUP06uoZiSKRU6HVCvwJjvInYR8i/vbQGpIFX1oj1LnAaoDLkXL8C PPqtr+X/cIUga37UAJD1y9YLx54KYiOLegt1kI1a8EsBj5LnpjE4GXVVMJBYGZ0liaPr VuxHWc/r+lconi5zkltXk8cheORQymUmIkO33SXD2MRvo+Hk+GaVRac5F0FieFixSovH rmazkAmQmpjDvXPyeuNabR+MrxKJE6duvYTu2BQoBCPZvFjCFxctcnPkLPNA8qRemca1 JUFmpdOpRB81SpKaoTwggTxiOzJtyfxmpZQuD2P9OxtpeLC13hlOc0Bg5OtexDVvfaJP 6png==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Px8+ZUZl; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 71dfb90a1353d-5160411bbdfsi3562871e0c.294.2024.12.13.05.48.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 05:48:36 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Px8+ZUZl; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tM61r-0005lX-Sj; Fri, 13 Dec 2024 08:48:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tM61k-0005kD-Lf for qemu-arm@nongnu.org; Fri, 13 Dec 2024 08:48:23 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tM61e-0003q0-14 for qemu-arm@nongnu.org; Fri, 13 Dec 2024 08:48:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1734097692; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=biw3ZHCGM0oKyrDpdXcfTuOF95X8YId5nqaWBpT3bUE=; b=Px8+ZUZl6t+XVspD1k8a+CaWCDPhZ9om2FdjzReEbS8/Ramrdw19yR/hE/HB3bCg/HEn1A x1Z6/i7DgR5GWro3LfmTQq4NWBb8UtYMhDDibvsrLJlH1xMQkZtn3Vb6FCtmf2GF+gLhh/ ++02o1UnfSk2RELzFlDYN8BEVXTqKic= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-445-Af7DvvmaM0iSXnQ7lNz_jg-1; Fri, 13 Dec 2024 08:48:09 -0500 X-MC-Unique: Af7DvvmaM0iSXnQ7lNz_jg-1 X-Mimecast-MFC-AGG-ID: Af7DvvmaM0iSXnQ7lNz_jg Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6899919560B1; Fri, 13 Dec 2024 13:48:07 +0000 (UTC) Received: from redhat.com (unknown [10.42.28.42]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6B516195605A; Fri, 13 Dec 2024 13:48:05 +0000 (UTC) Date: Fri, 13 Dec 2024 13:48:02 +0000 From: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= To: Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Cc: qemu-devel@nongnu.org, qemu-arm@nongnu.org, Gerd Hoffmann Subject: Re: [PATCH v2 3/7] hw/nvram/fw_cfg: Skip FW_CFG_DATA_GENERATOR when no data to generate Message-ID: References: <20241213133352.10915-1-philmd@linaro.org> <20241213133352.10915-4-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20241213133352.10915-4-philmd@linaro.org> User-Agent: Mutt/2.2.13 (2024-03-09) X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.495, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org X-TUID: 7t2C1fMgaRjO On Fri, Dec 13, 2024 at 02:33:48PM +0100, Philippe Mathieu-Daudé wrote: > Allow the FW_CFG_DATA_GENERATOR interface get_data() handler to > return NULL when there is nothing to generate. In that case > fw_cfg_add_file_from_generator() will not add any item and > return %true. > > Reported-by: Daniel P. Berrangé > Signed-off-by: Philippe Mathieu-Daudé > --- > include/hw/nvram/fw_cfg.h | 13 ++++++++----- > hw/nvram/fw_cfg.c | 10 ++++++---- > 2 files changed, 14 insertions(+), 9 deletions(-) > > diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h > index fcb06f18cc3..5211018fd8f 100644 > --- a/include/hw/nvram/fw_cfg.h > +++ b/include/hw/nvram/fw_cfg.h > @@ -30,8 +30,9 @@ struct FWCfgDataGeneratorClass { > * @obj: the object implementing this interface > * @errp: pointer to a NULL-initialized error object > * > - * Returns: reference to a byte array containing the data on success, > - * or NULL on error. > + * Returns: NULL on failure (errp set if not NULL). > + * A byte array containing the data (if any, > + * otherwise NULL) on success. Bit confusing wording, lets say Returns: A byte array containing data to add, or NULL without @errp set if no data is required, or NULL with @errp set on failure. With that change: Reviewed-by: Daniel P. Berrangé With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|