From nobody Sun Feb 8 12:14:01 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1596407284; cv=none; d=zohomail.com; s=zohoarc; b=C67r5DMMArQoqCTN/mFKWbhnR24UeWbtl3qxBzgplWuFXTxn6bMK8iyDc9Eh4sHikcAeUOMNZRxtQ+uZVI+gYFz1cmmMrwBCZAHII1lRu3OJxrixzx/kmlnajSKDabCMVUX+KbVBcKZCHiMzFrw97gzi+ekAbPcm7zX3BYFom5o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596407284; 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=oeG7XOqW4u8fdzD9aWtl7Ellt9QHb7xweyldxOGfqJo=; b=YABJ8u/5l7oZnRISNsBTvXXS/hjsOwJBqrgwp40mQ3uRg12ruUIOdW7Ztg+qVMsKrKkVafFX4vF8FEhVwVWg1nPjSl/rnQ3RRy4kiQ9R/dpqL1nUzvcur6xPRs9/xtcgrh08HmWvKMAOtXy0VbtPwrwhanFA4V9PaFzjtWJlRww= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1596407284094957.870838972011; Sun, 2 Aug 2020 15:28:04 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-10-2NbiwBA6Mci8qwIAx5CbzA-1; Sun, 02 Aug 2020 18:25:55 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CB91D800470; Sun, 2 Aug 2020 22:25:46 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AA7F219C4F; Sun, 2 Aug 2020 22:25:46 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7B5D19A10E; Sun, 2 Aug 2020 22:25:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 072MPg0b011960 for ; Sun, 2 Aug 2020 18:25:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id B6EF887E27; Sun, 2 Aug 2020 22:25:42 +0000 (UTC) Received: from lpt.redhat.com (unknown [10.40.208.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id ECC39712EB for ; Sun, 2 Aug 2020 22:25:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596407282; 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=oeG7XOqW4u8fdzD9aWtl7Ellt9QHb7xweyldxOGfqJo=; b=UBylu4hLKQltAgREkKWRj0OQl+wBgQknhcb2ZN6wcpATs60E5sVYMBMf1llfHOrUF1zLeh phrjMZJI6Ygx0IkeFjP3jP6swlfPZCKTVf3q8wQzROvQVmzM/zZZuf7Nj39L6jMwsd1U9c LPC4xzXU5VFxl4QwJPPirRihealkrmU= X-MC-Unique: 2NbiwBA6Mci8qwIAx5CbzA-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 3/6] util: remove virStringListCopy Date: Mon, 3 Aug 2020 00:25:31 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) The g_strdupv function from GLib provides the same functionality. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Martin Kletzander --- src/util/virstring.c | 37 ------------------------------------- src/util/virstring.h | 3 --- 2 files changed, 40 deletions(-) diff --git a/src/util/virstring.c b/src/util/virstring.c index 2d7ddc4676..9da811b2ec 100644 --- a/src/util/virstring.c +++ b/src/util/virstring.c @@ -259,43 +259,6 @@ virStringListMerge(char ***dst, } =20 =20 -/** - * virStringListCopy: - * @dst: where to store the copy of @strings - * @src: a NULL-terminated array of strings - * - * Makes a deep copy of the @src string list and stores it in @dst. Callers - * are responsible for freeing @dst. - * - * Returns 0 on success, -1 on error. - */ -int -virStringListCopy(char ***dst, - const char **src) -{ - char **copy =3D NULL; - size_t i; - - *dst =3D NULL; - - if (!src) - return 0; - - if (VIR_ALLOC_N(copy, virStringListLength(src) + 1) < 0) - goto error; - - for (i =3D 0; src[i]; i++) - copy[i] =3D g_strdup(src[i]); - - *dst =3D copy; - return 0; - - error: - virStringListFree(copy); - return -1; -} - - /** * virStringListFree: * @strings: a NULL-terminated array of strings to free diff --git a/src/util/virstring.h b/src/util/virstring.h index 360c68395c..462a6c092c 100644 --- a/src/util/virstring.h +++ b/src/util/virstring.h @@ -47,9 +47,6 @@ void virStringListRemove(char ***strings, int virStringListMerge(char ***dst, char ***src); =20 -int virStringListCopy(char ***dst, - const char **src); - void virStringListFree(char **strings); void virStringListAutoFree(char ***strings); void virStringListFreeCount(char **strings, --=20 2.26.2