From nobody Mon Feb 9 00:30:47 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=1652865743; cv=none; d=zohomail.com; s=zohoarc; b=mWit9L8XsEevfCwfVrg503/5jCqnbVc2SgY2yuy7kXHrVfzwoe29K67BUYpDOharUC6PR0WJWirlnbIeG+BXIkBuXD0rfTJh60KIjlQLmtV/YaQ+p6TC/8vXBVL54eBZLokAsn5lld2QGj4miw1rGaZZb7kUeRPn+qCjzkupGA4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652865743; 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=KpsIeU9kHYUt6/l3BCOhr0jGIhVXum1YEAeSMEzc2o4=; b=FKaBo9owocX/xHRTElpwGix/iAfks4d59+ZrMLlUtH3nJH4+T8cBSjQ5kjJl4owFKRUUvkhfaKC7H/neO4ugpByk+KKm7NU8O+Q7jIv/ByytbNwpuiYeYOkvBDNy6m5iNQruJb3cJt78wb1EzkreHZ9TJpzheTadA4xiHpWXBWE= 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 1652865743798722.7308081777393; Wed, 18 May 2022 02:22:23 -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-574-R-5hbL-HO9akCJeFe2o3Ew-1; Wed, 18 May 2022 05:22:21 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 242B1100DDF4; Wed, 18 May 2022 09:22:19 +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 0DD021410DD5; Wed, 18 May 2022 09:22:18 +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 4738E194975B; Wed, 18 May 2022 09:22:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 183741947B92 for ; Wed, 18 May 2022 09:22:16 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id E0C5E400DE5E; Wed, 18 May 2022 09:22:15 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6758F40CF8EE for ; Wed, 18 May 2022 09:22:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652865742; 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=KpsIeU9kHYUt6/l3BCOhr0jGIhVXum1YEAeSMEzc2o4=; b=Hft1O2h1099SJq6Q+x0csxBJMa34MFa6YkaP08DROYWgoTRcCWSzNg1WdT9Ne4o1ktTBz1 +yxLRzeP3t9sNj1Rk+djcuqetC2F10+N59o8rWI2mI6JgdEdvQpFNqwWeEZssjv5ZRJYy5 LWd5Sg9m4iU51q7dEvfRbfig03dvBTU= X-MC-Unique: R-5hbL-HO9akCJeFe2o3Ew-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/4] util: typedparam: Introduce virTypedParamListFromParams Date: Wed, 18 May 2022 11:22:10 +0200 Message-Id: <5035ba46d49422cd739191923135f0dcf4e9d736.1652865683.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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 2.85 on 10.11.54.7 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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: 1652865744882100001 Content-Type: text/plain; charset="utf-8" The helper constructs a virTypedParamList from loose params. Signed-off-by: Peter Krempa --- src/libvirt_private.syms | 1 + src/util/virtypedparam.c | 13 +++++++++++++ src/util/virtypedparam.h | 4 ++++ 3 files changed, 18 insertions(+) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index d95c181793..3711e33cf5 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -3493,6 +3493,7 @@ virTypedParamListAddString; virTypedParamListAddUInt; virTypedParamListAddULLong; virTypedParamListFree; +virTypedParamListFromParams; virTypedParamListStealParams; virTypedParamsCheck; virTypedParamsCopy; diff --git a/src/util/virtypedparam.c b/src/util/virtypedparam.c index aa6a871049..2d7e4ab354 100644 --- a/src/util/virtypedparam.c +++ b/src/util/virtypedparam.c @@ -738,6 +738,19 @@ virTypedParamListStealParams(virTypedParamList *list, return ret; } +virTypedParamList * +virTypedParamListFromParams(virTypedParameterPtr *params, + size_t nparams) +{ + virTypedParamList *l =3D g_new0(virTypedParamList, 1); + + l->par =3D g_steal_pointer(params); + l->npar =3D nparams; + l->par_alloc =3D nparams; + + return l; +} + static int G_GNUC_PRINTF(2, 0) virTypedParamSetNameVPrintf(virTypedParameterPtr par, diff --git a/src/util/virtypedparam.h b/src/util/virtypedparam.h index f4b3921c38..c4bc58ee8f 100644 --- a/src/util/virtypedparam.h +++ b/src/util/virtypedparam.h @@ -138,6 +138,10 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(virTypedParamList, virTy= pedParamListFree); size_t virTypedParamListStealParams(virTypedParamList *list, virTypedParameterPtr *params); +virTypedParamList * +virTypedParamListFromParams(virTypedParameterPtr *params, + size_t nparams); + int virTypedParamListAddInt(virTypedParamList *list, int value, const char *namefmt, --=20 2.35.3