From nobody Mon Feb 9 09:18:25 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1681907322; cv=none; d=zohomail.com; s=zohoarc; b=WrvteOodXi8Z6vDDep9681IMQLufyrVFsvV6r7I9pT1rDuQInUWcgwHKbu3wsbr2KJ9c2Ulp7tUCcAbTJkCIj+nTuHeMyCvEijWOHYoDtnV/AfjdLgkSem/JtE0h0qNXcHW3HUA2bqrn5KTnRMrAoNqsY4oLdp/M+pTxQpNzQmY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681907322; 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=CUCqhcrEZtVFjgYhhJi2gMdhOU42ijzzsPuhqfdsFM8=; b=OoBGcl2U1DOadJhVeTN11tam0ZyUqlCB80ldPOHrTTBIDiui9NtuGTl1G776CYTYZj8YWMdngAMv0Rc4GXcEZH7uC7wXzNuQOjx9S8fPiGKnTqjma12mBVdACJ4RQh1mK7h4hcZOrLeS4yA+lpUg7JPDbz1edvcGiPvi5b3peg0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1681907322096853.510820461766; Wed, 19 Apr 2023 05:28:42 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-515-_xnUwfVXOZGx8Tg6X2rQ7Q-1; Wed, 19 Apr 2023 08:28:35 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6AB4B811E7D; Wed, 19 Apr 2023 12:28:32 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 56FD0C16024; Wed, 19 Apr 2023 12:28:32 +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 A036419465B3; Wed, 19 Apr 2023 12:28:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3C3A919465B1 for ; Wed, 19 Apr 2023 12:04:53 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 13703492B05; Wed, 19 Apr 2023 12:04:53 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8E400492B04 for ; Wed, 19 Apr 2023 12:04:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681907321; 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=CUCqhcrEZtVFjgYhhJi2gMdhOU42ijzzsPuhqfdsFM8=; b=SgwRjPwz1++rcwI/+oqBlfrK+gc2/gbk1tx5s6y+qBFPdjtk1MkApAzOmvnAMDeqkhKAHz uSvlabUxLq1ynRJPd+k0L2PCIOYahSMARyemaJHyIbddZZjULA2Iq3coxwcsfypF2FNl7b BZYXYLBqG6p3pxas4cNzmG7/bLlpUkU= X-MC-Unique: _xnUwfVXOZGx8Tg6X2rQ7Q-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH v3 10/25] util: virtypedparam: Introduce 'virTypedParamListFetch' Date: Wed, 19 Apr 2023 14:04:27 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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.8 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: 1681907323197100003 Content-Type: text/plain; charset="utf-8" Introduce a helper that fetches the typed parameters from the list while still preserving ownership of the pointer by the list. In the future this will be also able to report errors stored in the list. Signed-off-by: Peter Krempa par; + + if (npar) + *npar =3D list->npar; + + return 0; +} + + size_t virTypedParamListStealParams(virTypedParamList *list, virTypedParameterPtr *params) diff --git a/src/util/virtypedparam.h b/src/util/virtypedparam.h index 45422c2673..628c951432 100644 --- a/src/util/virtypedparam.h +++ b/src/util/virtypedparam.h @@ -152,6 +152,12 @@ size_t virTypedParamListStealParams(virTypedParamList *list, virTypedParameterPtr *params); +int +virTypedParamListFetch(virTypedParamList *list, + virTypedParameterPtr *par, + size_t *npar) + G_GNUC_WARN_UNUSED_RESULT; + virTypedParamList * virTypedParamListFromParams(virTypedParameterPtr *params, size_t nparams); --=20 2.39.2