From nobody Fri Apr 26 07:31:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1609952319; cv=none; d=zohomail.com; s=zohoarc; b=YyZ6gH2t/D0heEvAD5hzFQsrmglL2s5R3ZHv9wlIItfPWnQ8Kk0RyBPJQgs6nYJsP++KqeO1ptqRMfnYX7tNhRgSUlRsUs39wOOfHTySPLW1w060EH5ko9PSGelZgSahrklEn8XiFu6REskqL8ueDJ8ZPC5/QP77m8bIQIDqMpU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609952319; 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=vZyRR++Zu7MuztoWdupW+Hv38BNWaGowaZ8fPO0L33k=; b=XWPaVFTt75AFC+TRFT0PAh8aPuvqmrx6a3H0VLp0+A/CmEyzDhqDC2dvFVlld+Un/JFD0AFNOdxsfGIqA6+ldEtwhLox4YUFQEfu2Njxd+oMm2iiZD/tY3ZgqeOdgYgPVg+JM6+zV802Ae0QnapnNBxb3VZ0UVRmOEO87PLM1uA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1609952319488799.9212118045805; Wed, 6 Jan 2021 08:58:39 -0800 (PST) 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-247-uLoTA9qgMiG3E9axZd5AkQ-1; Wed, 06 Jan 2021 11:58:36 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EAE0515720; Wed, 6 Jan 2021 16:58:29 +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 C991F60C04; Wed, 6 Jan 2021 16:58:29 +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 88AE05002D; Wed, 6 Jan 2021 16:58:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 106Gw7K6022374 for ; Wed, 6 Jan 2021 11:58:07 -0500 Received: by smtp.corp.redhat.com (Postfix) id CB0E95C1C4; Wed, 6 Jan 2021 16:58:07 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2495F5C72F for ; Wed, 6 Jan 2021 16:58:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609952318; 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=vZyRR++Zu7MuztoWdupW+Hv38BNWaGowaZ8fPO0L33k=; b=VhJs7Jkc7tP083XveB9tnVGbRH1FSHtYREQZ10v6YhBSKuvRfzi+mKO04ONPDCfPq/Rbvp NGzAx57hmPv3SJQT4bSRuGqXNG7q1LaQBXLG6YDcRGqkeoy3H3xXnEPAFqlShEBqlHPDvp 3PXl8IjkJDSAguUW9WuE2W4Ane5muOQ= X-MC-Unique: uLoTA9qgMiG3E9axZd5AkQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/7] virSecretDefParseUsage: Use g_autofree for type_str Date: Wed, 6 Jan 2021 17:57:55 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.79 on 10.5.11.12 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) Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/conf/secret_conf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/conf/secret_conf.c b/src/conf/secret_conf.c index 273987bdb4..9cacc43e28 100644 --- a/src/conf/secret_conf.c +++ b/src/conf/secret_conf.c @@ -52,7 +52,7 @@ static int virSecretDefParseUsage(xmlXPathContextPtr ctxt, virSecretDefPtr def) { - char *type_str; + g_autofree char *type_str =3D NULL; int type; type_str =3D virXPathString("string(./usage/@type)", ctxt); @@ -65,10 +65,8 @@ virSecretDefParseUsage(xmlXPathContextPtr ctxt, if (type < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("unknown secret usage type %s"), type_str); - VIR_FREE(type_str); return -1; } - VIR_FREE(type_str); def->usage_type =3D type; switch (def->usage_type) { case VIR_SECRET_USAGE_TYPE_NONE: --=20 2.29.2 From nobody Fri Apr 26 07:31:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1609952303; cv=none; d=zohomail.com; s=zohoarc; b=EGY/thOm3aoj9mYRIVKJTh7DwHwSX+OmE9NN9btQQP6vXQLqN7WaZygNRJNRNsg5vv3KIVwMR6xptHVWhf2MyEbMRpWAZGtfS3K/12/wexLw+zJcw/vhY94Ppl7WVIdpj8Ins2oijUMLaSXN+ISd0R4op9lT6oyYjfzZz6Hb3H4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609952303; 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=lhPQ+npMEDCMBH+dhaf3WduDDTSX2perTZ/vhUWB+4g=; b=QNMdQ5LNDx20Q0DigX/VY1N8ojdRcAyWjLvDh8eFbdHXb4cFQ85nxxuZZd6icdYAQPNGe3I35YxLUdIttNBRxxteYVzuqiPKakLo82BqahEXzl5SHxa7Fr0rV4nx/A5kXRt2Z72Fz5BKjylbAfHrjiVtgb20nd+JUc1xJBA8n6g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1609952303791844.4800429094261; Wed, 6 Jan 2021 08:58:23 -0800 (PST) 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-585-V7WAZbL5M2OAXgIUgItmJw-1; Wed, 06 Jan 2021 11:58:20 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6CDF8100558A; Wed, 6 Jan 2021 16:58:14 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2354B1894E; Wed, 6 Jan 2021 16:58:13 +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 40D071809C9F; Wed, 6 Jan 2021 16:58:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 106Gw9Vn022388 for ; Wed, 6 Jan 2021 11:58:09 -0500 Received: by smtp.corp.redhat.com (Postfix) id 000961802E; Wed, 6 Jan 2021 16:58:09 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4BB045C1C4 for ; Wed, 6 Jan 2021 16:58:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609952302; 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=lhPQ+npMEDCMBH+dhaf3WduDDTSX2perTZ/vhUWB+4g=; b=KgVjQBCo3pGWLeCgjl2CQ8z3ia6vrBRDqT85PXltxojsMBIHUxejfMiXo3sWw78VrK1y5o NAXcR5fq/p+CJ4sZ/szwywQ2MDKCDQkB3tUbD5LU/p2FkNHcDCaJpX8V+1Mp0gop61PGLX D0ADdiCEw9xpIVnVy6cNro4Tu4EG8ag= X-MC-Unique: V7WAZbL5M2OAXgIUgItmJw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/7] secretXMLParseNode: Clean up freeing of memory Date: Wed, 6 Jan 2021 17:57:56 +0100 Message-Id: <822109b44a36d227329ddd5528985bc3c5511280.1609952208.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.79 on 10.5.11.11 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) Content-Type: text/plain; charset="utf-8" Use one variable per extracted property instead of reusing strings and drop needless VIR_FREE calls. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/conf/secret_conf.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/conf/secret_conf.c b/src/conf/secret_conf.c index 9cacc43e28..4d7d685d6e 100644 --- a/src/conf/secret_conf.c +++ b/src/conf/secret_conf.c @@ -131,7 +131,8 @@ secretXMLParseNode(xmlDocPtr xml, xmlNodePtr root) { g_autoptr(xmlXPathContext) ctxt =3D NULL; g_autoptr(virSecretDef) def =3D NULL; - g_autofree char *prop =3D NULL; + g_autofree char *ephemeralstr =3D NULL; + g_autofree char *privatestr =3D NULL; g_autofree char *uuidstr =3D NULL; if (!virXMLNodeNameEqual(root, "secret")) { @@ -149,24 +150,20 @@ secretXMLParseNode(xmlDocPtr xml, xmlNodePtr root) def =3D g_new0(virSecretDef, 1); - prop =3D virXPathString("string(./@ephemeral)", ctxt); - if (prop !=3D NULL) { - if (virStringParseYesNo(prop, &def->isephemeral) < 0) { + if ((ephemeralstr =3D virXPathString("string(./@ephemeral)", ctxt))) { + if (virStringParseYesNo(ephemeralstr, &def->isephemeral) < 0) { virReportError(VIR_ERR_XML_ERROR, "%s", _("invalid value of 'ephemeral'")); return NULL; } - VIR_FREE(prop); } - prop =3D virXPathString("string(./@private)", ctxt); - if (prop !=3D NULL) { - if (virStringParseYesNo(prop, &def->isprivate) < 0) { + if ((privatestr =3D virXPathString("string(./@private)", ctxt))) { + if (virStringParseYesNo(privatestr, &def->isprivate) < 0) { virReportError(VIR_ERR_XML_ERROR, "%s", _("invalid value of 'private'")); return NULL; } - VIR_FREE(prop); } uuidstr =3D virXPathString("string(./uuid)", ctxt); @@ -182,7 +179,6 @@ secretXMLParseNode(xmlDocPtr xml, xmlNodePtr root) "%s", _("malformed uuid element")); return NULL; } - VIR_FREE(uuidstr); } def->description =3D virXPathString("string(./description)", ctxt); --=20 2.29.2 From nobody Fri Apr 26 07:31:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1609952344; cv=none; d=zohomail.com; s=zohoarc; b=juUxoZUJddpXTySAS8XCJzGBcjnapYJc3czK16XyU7RhTFKQ/GdrrAFZ58ONv7QjNL0+AtFJtUT5Q4XjzKSGwRri5jlQvlAH323q/JifSNdBGCQmY+e9AdWZKD7KcwGb/Hb7kLiQYOFXe2t6B8SAGRRvfamrOQfjvqD1ejo6tiY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609952344; 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=fNh/wC3yxTJPRp6FAUbFnqQgiu9lGW2Lvnr86EKETTQ=; b=CVbevtpkfGk6WamgUO79TAJe2+T3XEZEn0G/eX8v3GhICihTnsumsA+SmoHaE99sT0rkznbAK+8wFRC3umh0LwtLMvc1ORZnKnAJNW1hFzLRo+FTFtSezl47REqNMFdodOpoE3bBFxn3g37ZP4LT1TFq4yICYC97b/JilLyvVpE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1609952344001473.0724478818761; Wed, 6 Jan 2021 08:59:04 -0800 (PST) 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-247-CHY0qXL4N3qyIXoQy476YQ-1; Wed, 06 Jan 2021 11:58:35 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DFA9C800D53; Wed, 6 Jan 2021 16:58:29 +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 BDC20106D5C1; Wed, 6 Jan 2021 16:58:29 +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 868455002C; Wed, 6 Jan 2021 16:58:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 106GwA9g022402 for ; Wed, 6 Jan 2021 11:58:10 -0500 Received: by smtp.corp.redhat.com (Postfix) id A12D05C26D; Wed, 6 Jan 2021 16:58:10 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id DC6075C1C4 for ; Wed, 6 Jan 2021 16:58:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609952342; 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=fNh/wC3yxTJPRp6FAUbFnqQgiu9lGW2Lvnr86EKETTQ=; b=TlHQugz9BZFbXYCkciMexQlrgp8WkA6bxphmPdMd35XSmzBatBn8cYvz3qeOyapCKsMRIF 3bIgPfS8FEe79v/VuSZ9f1xs0rKM9rLP/OYa3+HsPgyvTxcr0jmlJgAZCwq9S0mCW5ZOx7 2+wl9pIA7SXdTU6+oPJXqjBdpera9kU= X-MC-Unique: CHY0qXL4N3qyIXoQy476YQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 3/7] virSecretLookupParseSecret: Use g_steal_pointer Date: Wed, 6 Jan 2021 17:57:57 +0100 Message-Id: <3133829a23ec40d861ebae73204a43a5a9bc6c05.1609952208.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.22 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) Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/util/virsecret.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/util/virsecret.c b/src/util/virsecret.c index 9ed803d45b..57c8583539 100644 --- a/src/util/virsecret.c +++ b/src/util/virsecret.c @@ -90,8 +90,7 @@ virSecretLookupParseSecret(xmlNodePtr secretnode, } def->type =3D VIR_SECRET_LOOKUP_TYPE_UUID; } else { - def->u.usage =3D usage; - usage =3D NULL; + def->u.usage =3D g_steal_pointer(&usage); def->type =3D VIR_SECRET_LOOKUP_TYPE_USAGE; } return 0; --=20 2.29.2 From nobody Fri Apr 26 07:31:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1609952304; cv=none; d=zohomail.com; s=zohoarc; b=Wj4awKBDZ/IRh2S1vI6JV6HHaFqQW2xO4vSxW5EWVqV14R6bMZ4AaIyB61vaCFqz7g5itM3yFBq1zlP7BoaTvtoj7z47GjcI5tdBIn7MjBx3caSFNIhTHoe0IdwuoRqnKDWP6TC0XaemglGa8GkEqfw62tLvy0hWmzMMJGvgCwM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609952304; 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=QJgTsdfrjYLOBgTO3mSAhwSezkSN05c1nWUkISxD4mQ=; b=i12J/riLFkPu0VIPeU/kul77KL05UsJhLTPFl0dZJAFgPbUfxuqJeWAz0+A1Lw/R7JApnomxlgkAhLuMFnLEOgWguU5/m3eWbrkLi3hYF1GZ01Zik/dkcVZhJNIetnqwEn4AbWyQkrbZ5JkLZA7+LRNVJnSUmZLcX8NnbhP1aBk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1609952304430160.45411475152525; Wed, 6 Jan 2021 08:58:24 -0800 (PST) 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-18-jtl-rhMONe6C1lbjdXgNoA-1; Wed, 06 Jan 2021 11:58:20 -0500 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 E6C4C879510; Wed, 6 Jan 2021 16:58:14 +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 B374E19D7D; Wed, 6 Jan 2021 16:58:14 +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 51F574E58E; Wed, 6 Jan 2021 16:58:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 106GwBbe022410 for ; Wed, 6 Jan 2021 11:58:11 -0500 Received: by smtp.corp.redhat.com (Postfix) id CAC135C72F; Wed, 6 Jan 2021 16:58:11 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1305F5C1C4 for ; Wed, 6 Jan 2021 16:58:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609952303; 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=QJgTsdfrjYLOBgTO3mSAhwSezkSN05c1nWUkISxD4mQ=; b=P+is4WreSS1hRqKW2TY4qOR6+Q1Lt7j3dJgFnklyHMoZ3bD7D7em9s6+myGkYMVmYu9TNE RBueoXAEk+DrqzL7JRgwtIILjJlaI1e52ComHkp+MfDcvwcc106aRmGlZFy02XSRjm0qAI MJgoE269kZFNqoUUcy0P34GkvFDaM18= X-MC-Unique: jtl-rhMONe6C1lbjdXgNoA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 4/7] schema: domaincommon: Remove pointless 'choice' from 'inituser'/'initgroup' Date: Wed, 6 Jan 2021 17:57:58 +0100 Message-Id: <766ccc127e20153025e2bc11e5bfa77edb2c8ed2.1609952208.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" 'genericName' allows arbitrary numeric strings so using an explicit 'unsignedInt' choice is pointless. The elements take an username or a uid which is prefixed by '+', both of which are covered by 'genericName'. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- docs/schemas/domaincommon.rng | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 24b4994670..bcbaee9db8 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -436,16 +436,10 @@ - - - - + - - - - + --=20 2.29.2 From nobody Fri Apr 26 07:31:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1609952326; cv=none; d=zohomail.com; s=zohoarc; b=LpZbekAE4/78fssKyfmqbn7dcwi8taz//cijGflWr7CngzpFswcHxp5Lwg2ydN+g6+DRGOu9eEYP7gkqhhKHL5qcOBouvLmv3kplpOotHPUhb8Yu9vaPk+vnHYuADL4zIxE4akIWjPQwkXmBzKFkYegEUoavGWm0GNugoE/M/K4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609952326; 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=J9MjUpB2D4Sk15eECmS2tuw184VGONP5dxy5MESmeLg=; b=N3lEgX6u82HbE5DX3debgwO2Ew+axQ40o0aOj4c/qUd5a7+A056zoXe+aY7lG1qz73vyOrtkoO0kvxZ1mqleI9nKPkii33wJZb1sz9ihPb13H6g2zbuH7OFAUEwRmotryujQ4kqEm77n9OYtS3B+ktiHaVahl84QOqLWo9ArE0E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1609952326571733.6254370348561; Wed, 6 Jan 2021 08:58:46 -0800 (PST) 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-593-kWofQrkZM9irGKO-e6BXrw-1; Wed, 06 Jan 2021 11:58:42 -0500 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 B14CD190A7AB; Wed, 6 Jan 2021 16:58:32 +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 82F3F19D7D; Wed, 6 Jan 2021 16:58:32 +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 4CF7A50032; Wed, 6 Jan 2021 16:58:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 106GwDPu022422 for ; Wed, 6 Jan 2021 11:58:13 -0500 Received: by smtp.corp.redhat.com (Postfix) id 03D0C5C72F; Wed, 6 Jan 2021 16:58:13 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4B5125C1C4 for ; Wed, 6 Jan 2021 16:58:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609952325; 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=J9MjUpB2D4Sk15eECmS2tuw184VGONP5dxy5MESmeLg=; b=W5+gp2+6P5+rRQ9zcKBUaGB2736JQID2lyvEfAHOvkIiHQiQNlDY5yinNoyrmQGJRoZb/Y hNOEW5MM2GcpBWk6RHo2NPFScDLZNmQt6flQJWyUe87uPmWtXxewvQFUSgIRJRPtClAALz 2tEofJq+HTbtrZDx7gu+Io/4lJ/HQOA= X-MC-Unique: kWofQrkZM9irGKO-e6BXrw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 5/7] schema: Remove workaround for bug in libxml2 2.7.6 Date: Wed, 6 Jan 2021 17:57:59 +0100 Message-Id: <22e1724ed533ed72a259983a89b88c8f6c65e30e.1609952208.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" New libxml2 handles '\n' properly so the literal newline is not necessary. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- docs/schemas/domaincommon.rng | 8 ++------ docs/schemas/storagecommon.rng | 4 +--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index bcbaee9db8..39bed92115 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -19,9 +19,7 @@ - - [^ -]+ + [^\n]+ @@ -6948,9 +6946,7 @@ - - [^ -]+ + [^\n]+ diff --git a/docs/schemas/storagecommon.rng b/docs/schemas/storagecommon.rng index 6597ebc824..54619d4cb0 100644 --- a/docs/schemas/storagecommon.rng +++ b/docs/schemas/storagecommon.rng @@ -8,9 +8,7 @@ - - [^/ -]+ + [^/\n]+ --=20 2.29.2 From nobody Fri Apr 26 07:31:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1609952318; cv=none; d=zohomail.com; s=zohoarc; b=FGdOkYwZqtZrcmjU/8tf01S9qHGx+LKr1cXByo1/K42qbhSDSvbA4XS1nYElKxNWjyyGFvhbv8KMTQO6rZh8m2fFuo7/ukUT40ycy9c/hrB2HtyxWU4p8sPNkM6ps4sLqKzaVeWv6QAa78gL8LVlhCtdIP/Kc9heL6EPeRGV6No= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609952318; 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=YOquAO85ARkWbIVgNRnCEhnhccQOegrv7fh69dv3vuM=; b=Cd+eTXk2sRnRSKo/LcJVp5VubjnDxNsfiwjRnTt3j0oYXatsR5HkuNqmvMEf4mSVe1wqqUVg32Uiso8i9NLRakBlWw6htEv1fJWhINkSm/oZVhTc1/4jZ3wQF0eRlmcRLEY6k75RuBi9uhJoMCUymxbkkDxmnYQyW8qx7nMOJSs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1609952318830708.2373705819651; Wed, 6 Jan 2021 08:58:38 -0800 (PST) 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-434-o09Py4mzOXy_CpFAMQoMdg-1; Wed, 06 Jan 2021 11:58:35 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DF040190A7A2; Wed, 6 Jan 2021 16:58:29 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BD2E01802E; Wed, 6 Jan 2021 16:58:29 +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 85E5D1809CA2; Wed, 6 Jan 2021 16:58:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 106GwHqt022441 for ; Wed, 6 Jan 2021 11:58:17 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6CD905C72F; Wed, 6 Jan 2021 16:58:17 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 99DFC5C1C4 for ; Wed, 6 Jan 2021 16:58:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609952317; 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=YOquAO85ARkWbIVgNRnCEhnhccQOegrv7fh69dv3vuM=; b=Mv5xeOCSms1demWj6/u7O5Q9ND3wTIVKAkQdzJrKM+VI0SWqpnBSeJQlKra2wQw59Y+cpP IEdtfGm5HOt6Z0OLOpB+J/dABvz7Cts5KMHc9/2KFOJgsjAw9p6JE72omJZzDct0sl1m+2 JyWwYSKyWJfStOoTudbqAU/aP+Q+LbA= X-MC-Unique: o09Py4mzOXy_CpFAMQoMdg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 6/7] schema: Add define for object names Date: Wed, 6 Jan 2021 17:58:00 +0100 Message-Id: <5e2d01f0b39d1477b21f383428f0788dd2448862.1609952208.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.79 on 10.5.11.16 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) Content-Type: text/plain; charset="utf-8" Objects such as domain, pool, etc re-define the regex for the format. Add more generic types for objects with/without a slash which we'll be able to reuse also for other objects. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- docs/schemas/basictypes.rng | 13 +++++++++++++ docs/schemas/domaincommon.rng | 17 +++++------------ docs/schemas/storagecommon.rng | 6 ------ docs/schemas/storagepool.rng | 4 ++-- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/docs/schemas/basictypes.rng b/docs/schemas/basictypes.rng index fc52799466..a221ff6295 100644 --- a/docs/schemas/basictypes.rng +++ b/docs/schemas/basictypes.rng @@ -261,6 +261,19 @@ + + + + [^\n]+ + + + + + + [^/\n]+ + + + [a-zA-Z0-9_\+\-]+ diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 39bed92115..4fc6a7ee7a 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -18,9 +18,7 @@ - - [^\n]+ - + @@ -559,7 +557,7 @@ - + @@ -1391,7 +1389,7 @@ - + @@ -2056,7 +2054,7 @@ - + @@ -3269,7 +3267,7 @@ - + @@ -6944,11 +6942,6 @@ 1000 - - - [^\n]+ - - [A-Za-z0-9_\.\+\- ]+ diff --git a/docs/schemas/storagecommon.rng b/docs/schemas/storagecommon.rng index 54619d4cb0..e3d08a8410 100644 --- a/docs/schemas/storagecommon.rng +++ b/docs/schemas/storagecommon.rng @@ -6,12 +6,6 @@ - - - [^/\n]+ - - - diff --git a/docs/schemas/storagepool.rng b/docs/schemas/storagepool.rng index a87d22f6fc..bd24b8b8d0 100644 --- a/docs/schemas/storagepool.rng +++ b/docs/schemas/storagepool.rng @@ -247,7 +247,7 @@ - + @@ -261,7 +261,7 @@ - + --=20 2.29.2 From nobody Fri Apr 26 07:31:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1609952326; cv=none; d=zohomail.com; s=zohoarc; b=P09KRl0LCSc66exOW2OWNksW8dS7Z4V51iOj/FFrHoiITmskOjkFdtj0MqEYV38ut/4XWgUf1UiX45Ih0OoXT6zXAfuzcpMBrT3pxVxeo4QJI2ebk3Tkm2OaVPjG79vkZi63Mf9/bmAnDYJ332tMT0s21ErWhHS6vVEaGkFGkzk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609952326; 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=B/mxbNJWF6WiVpG9+wRH0N8zWzTjy+WqvsFa59NfJrc=; b=BuKzzf7vZnkJP0fm/R4XFIJP8L+9TffTlf8BRQXttc6VbnNEtYi3q06RpenjaJLFIa8RwmeqDgEqVs6aAizcXKm9Br+z/i368QKINodsW893SQkRWOz32bYr7Zv/AqKDO7bC47Tlvaff1Cn2aIYMmXQiNCUvAfjIsldcXvPEjjg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1609952326361154.903894279356; Wed, 6 Jan 2021 08:58:46 -0800 (PST) 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-520-O25MP4xiOmK3O0mBK5xpEw-1; Wed, 06 Jan 2021 11:58:41 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 62398879500; Wed, 6 Jan 2021 16:58:35 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 383E41945C; Wed, 6 Jan 2021 16:58:35 +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 0105D180954D; Wed, 6 Jan 2021 16:58:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 106GwIbS022451 for ; Wed, 6 Jan 2021 11:58:18 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9942417264; Wed, 6 Jan 2021 16:58:18 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id D88C75C1C4 for ; Wed, 6 Jan 2021 16:58:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609952325; 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=B/mxbNJWF6WiVpG9+wRH0N8zWzTjy+WqvsFa59NfJrc=; b=dyAtejLWA6FOtERauXPh1dxOTxZU0kq2oFrzaZ3tj9nknyJggI2BIVeq+JE+vwxU4iqNfk XhOYg54WGm8EVW4/bN+oE5z8F7uqvqwEr1T3fY2wGG77FFfRR8vL39zdlaEaUloqnLk3cQ jW8+Fmwo40V7WmHU/bjszMgNtW4g/oU= X-MC-Unique: O25MP4xiOmK3O0mBK5xpEw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 7/7] schema: secret: Relax requirements for usage name Date: Wed, 6 Jan 2021 17:58:01 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.79 on 10.5.11.15 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) Content-Type: text/plain; charset="utf-8" There's plenty of existing documentation [1] which shows as example a name which contains a space and a dot ('client.admin secret') as ceph usage name. Use a more relaxed type in the RNG schema since the usage name is actually just a string used to look up the secret. [1]: https://docs.ceph.com/en/latest/rbd/libvirt/#configuring-the-vm https://documentation.suse.com/ses/6/html/ses-all/cha-ceph-libvirt.html#cep= h-libvirt-cfg-vm Libvirt docs were correct though: https://libvirt.org/formatsecret.html#CephUsageType Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1689168 Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- docs/schemas/domaincommon.rng | 2 +- docs/schemas/secret.rng | 8 ++--- .../disk-network-source-auth.args | 8 ++++- ...isk-network-source-auth.x86_64-2.12.0.args | 9 ++++++ ...isk-network-source-auth.x86_64-latest.args | 29 ++++++++++++++----- .../disk-network-source-auth.xml | 12 ++++++++ tests/qemuxml2argvtest.c | 3 +- .../disk-network-source-auth.xml | 13 +++++++++ tests/secretxml2xmlin/usage-ceph-space.xml | 7 +++++ tests/secretxml2xmltest.c | 1 + 10 files changed, 77 insertions(+), 15 deletions(-) create mode 100644 tests/secretxml2xmlin/usage-ceph-space.xml diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 4fc6a7ee7a..701db7e7d2 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -6261,7 +6261,7 @@ - + diff --git a/docs/schemas/secret.rng b/docs/schemas/secret.rng index 1aafe03e61..c90e2eb81f 100644 --- a/docs/schemas/secret.rng +++ b/docs/schemas/secret.rng @@ -60,7 +60,7 @@ ceph - + @@ -69,7 +69,7 @@ iscsi - + @@ -78,7 +78,7 @@ tls - + @@ -87,7 +87,7 @@ vtpm - + diff --git a/tests/qemuxml2argvdata/disk-network-source-auth.args b/tests/q= emuxml2argvdata/disk-network-source-auth.args index e68b81fde0..18d48b263f 100644 --- a/tests/qemuxml2argvdata/disk-network-source-auth.args +++ b/tests/qemuxml2argvdata/disk-network-source-auth.args @@ -35,4 +35,10 @@ key=3DQVFDVm41aE82SHpGQWhBQXEwTkN2OGp0SmNJY0UrSE9CbE1RMU= E=3D:\ auth_supported=3Dcephx\;none:mon_host=3Dmon1.example.org\:6321\;mon2.examp= le.org\:\ 6322\;mon3.example.org\:6322,format=3Draw,if=3Dnone,id=3Ddrive-virtio-disk= 1' \ -device virtio-blk-pci,bus=3Dpci.0,addr=3D0x4,drive=3Ddrive-virtio-disk1,\ -id=3Dvirtio-disk1 +id=3Dvirtio-disk1 \ +-drive 'file=3Drbd:pool/image2:id=3Dmyname:\ +key=3DQVFDVm41aE82SHpGQWhBQXEwTkN2OGp0SmNJY0UrSE9CbE1RMUE=3D:\ +auth_supported=3Dcephx\;none:mon_host=3Dmon1.example.org\:6321\;mon2.examp= le.org\:\ +6322\;mon3.example.org\:6322,format=3Draw,if=3Dnone,id=3Ddrive-virtio-disk= 2' \ +-device virtio-blk-pci,bus=3Dpci.0,addr=3D0x5,drive=3Ddrive-virtio-disk2,\ +id=3Dvirtio-disk2 diff --git a/tests/qemuxml2argvdata/disk-network-source-auth.x86_64-2.12.0.= args b/tests/qemuxml2argvdata/disk-network-source-auth.x86_64-2.12.0.args index 279d5c73ec..0ccf3df106 100644 --- a/tests/qemuxml2argvdata/disk-network-source-auth.x86_64-2.12.0.args +++ b/tests/qemuxml2argvdata/disk-network-source-auth.x86_64-2.12.0.args @@ -45,6 +45,15 @@ mon_host=3Dmon1.example.org\:6321\;mon2.example.org\:632= 2\;mon3.example.org\:\ id=3Ddrive-virtio-disk1' \ -device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x3,drive=3Ddrive-vir= tio-disk1,\ id=3Dvirtio-disk1 \ +-object secret,id=3Dvirtio-disk2-auth-secret0,\ +data=3D9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\ +keyid=3DmasterKey0,iv=3DAAECAwQFBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ +-drive 'file=3Drbd:pool/image2:id=3Dmyname:auth_supported=3Dcephx\;none:\ +mon_host=3Dmon1.example.org\:6321\;mon2.example.org\:6322\;mon3.example.or= g\:\ +6322,file.password-secret=3Dvirtio-disk2-auth-secret0,format=3Draw,if=3Dno= ne,\ +id=3Ddrive-virtio-disk2' \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x4,drive=3Ddrive-vir= tio-disk2,\ +id=3Dvirtio-disk2 \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ resourcecontrol=3Ddeny \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/disk-network-source-auth.x86_64-latest.= args b/tests/qemuxml2argvdata/disk-network-source-auth.x86_64-latest.args index 257ca1376c..879a52123c 100644 --- a/tests/qemuxml2argvdata/disk-network-source-auth.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-network-source-auth.x86_64-latest.args @@ -29,21 +29,34 @@ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -no-acpi \ -boot strict=3Don \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ --object secret,id=3Dlibvirt-2-storage-auth-secret0,\ +-object secret,id=3Dlibvirt-3-storage-auth-secret0,\ data=3D9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\ keyid=3DmasterKey0,iv=3DAAECAwQFBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ -blockdev '{"driver":"iscsi","portal":"example.org:6000",\ "target":"iqn.1992-01.com.example:storage","lun":1,"transport":"tcp",\ -"user":"myname","password-secret":"libvirt-2-storage-auth-secret0",\ -"node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \ +"user":"myname","password-secret":"libvirt-3-storage-auth-secret0",\ +"node-name":"libvirt-3-storage","auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-3-format","read-only":false,"driver":"raw= ",\ +"file":"libvirt-3-storage"}' \ +-device virtio-blk-pci,bus=3Dpci.0,addr=3D0x2,drive=3Dlibvirt-3-format,\ +id=3Dvirtio-disk0,bootindex=3D1 \ +-object secret,id=3Dlibvirt-2-storage-auth-secret0,\ +data=3D9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\ +keyid=3DmasterKey0,iv=3DAAECAwQFBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ +-blockdev '{"driver":"rbd","pool":"pool","image":"image",\ +"server":[{"host":"mon1.example.org","port":"6321"},{"host":"mon2.example.= org",\ +"port":"6322"},{"host":"mon3.example.org","port":"6322"}],"user":"myname",\ +"auth-client-required":["cephx","none"],\ +"key-secret":"libvirt-2-storage-auth-secret0","node-name":"libvirt-2-stora= ge",\ +"auto-read-only":true,"discard":"unmap"}' \ -blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"raw= ",\ "file":"libvirt-2-storage"}' \ --device virtio-blk-pci,bus=3Dpci.0,addr=3D0x2,drive=3Dlibvirt-2-format,\ -id=3Dvirtio-disk0,bootindex=3D1 \ +-device virtio-blk-pci,bus=3Dpci.0,addr=3D0x3,drive=3Dlibvirt-2-format,\ +id=3Dvirtio-disk1 \ -object secret,id=3Dlibvirt-1-storage-auth-secret0,\ data=3D9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\ keyid=3DmasterKey0,iv=3DAAECAwQFBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ --blockdev '{"driver":"rbd","pool":"pool","image":"image",\ +-blockdev '{"driver":"rbd","pool":"pool","image":"image2",\ "server":[{"host":"mon1.example.org","port":"6321"},{"host":"mon2.example.= org",\ "port":"6322"},{"host":"mon3.example.org","port":"6322"}],"user":"myname",\ "auth-client-required":["cephx","none"],\ @@ -51,8 +64,8 @@ keyid=3DmasterKey0,iv=3DAAECAwQFBgcICQoLDA0ODw=3D=3D,form= at=3Dbase64 \ "auto-read-only":true,"discard":"unmap"}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw= ",\ "file":"libvirt-1-storage"}' \ --device virtio-blk-pci,bus=3Dpci.0,addr=3D0x3,drive=3Dlibvirt-1-format,\ -id=3Dvirtio-disk1 \ +-device virtio-blk-pci,bus=3Dpci.0,addr=3D0x4,drive=3Dlibvirt-1-format,\ +id=3Dvirtio-disk2 \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ resourcecontrol=3Ddeny \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/disk-network-source-auth.xml b/tests/qe= muxml2argvdata/disk-network-source-auth.xml index 7cc5c96ae7..0f8d29070f 100644 --- a/tests/qemuxml2argvdata/disk-network-source-auth.xml +++ b/tests/qemuxml2argvdata/disk-network-source-auth.xml @@ -36,6 +36,18 @@ + + + + + + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index d2712e0dce..b63ba29739 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -64,7 +64,8 @@ fakeSecretLookupByUsage(virConnectPtr conn, usageID); return NULL; } - } else if (STRNEQ(usageID, "mycluster_myname")) { + } else if (STRNEQ(usageID, "mycluster_myname") && + STRNEQ(usageID, "client.admin secret")) { virReportError(VIR_ERR_INTERNAL_ERROR, "test provided incorrect usage '%s'", usageID); return NULL; diff --git a/tests/qemuxml2xmloutdata/disk-network-source-auth.xml b/tests/= qemuxml2xmloutdata/disk-network-source-auth.xml index b9f06448c1..d9c85c478d 100644 --- a/tests/qemuxml2xmloutdata/disk-network-source-auth.xml +++ b/tests/qemuxml2xmloutdata/disk-network-source-auth.xml @@ -38,6 +38,19 @@
+ + + + + + + + + + + +
+
diff --git a/tests/secretxml2xmlin/usage-ceph-space.xml b/tests/secretxml2x= mlin/usage-ceph-space.xml new file mode 100644 index 0000000000..557b12474d --- /dev/null +++ b/tests/secretxml2xmlin/usage-ceph-space.xml @@ -0,0 +1,7 @@ + + f52a81b2-424e-490c-823d-6bd4235bc573 + Ceph secret with space and dot + + client.admin secret + + diff --git a/tests/secretxml2xmltest.c b/tests/secretxml2xmltest.c index 9eb3c460e7..74a262e1e8 100644 --- a/tests/secretxml2xmltest.c +++ b/tests/secretxml2xmltest.c @@ -74,6 +74,7 @@ mymain(void) DO_TEST("ephemeral-usage-volume"); DO_TEST("usage-volume"); DO_TEST("usage-ceph"); + DO_TEST("usage-ceph-space"); DO_TEST("usage-iscsi"); DO_TEST("usage-tls"); DO_TEST("usage-vtpm"); --=20 2.29.2