From nobody Wed Nov 13 07:20:05 2024 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=1632310626; cv=none; d=zohomail.com; s=zohoarc; b=LQMg07Y/LQM+fMZZ161HWRZVd0gOqYSEQK/+Qn9RhlGAI10VPS1Ehvwivo9tDTV1eS4u6AnSuRx+u/RajDc57khOQZOM5wlGqhaavlaf7MGB38Y9v9xSWfmguyTOzUOr7W1sCBNaij6P/R4rRR/FNbEmZ6GWAfD3oWkkHbnacT4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632310626; 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=C9dh21wJ1ZjhnETTQH59Egz8D4GL6t8l/RiY8fGQNtE=; b=Bct1yMjP1Ucwe+z0U8uzWoYxkk+fprnOl3fPE9Oxh8VGquP/Im+c45lOEvfrTsbMJ9ICZnOuYL148nIhVURTOl1vjPRuvjCVqCKIta1+HA8J9MSLxF/z18aEocrg5cGuoFKbNfMyoFdj6EityNCcUZ3JXWJ0RNv5T40aUWtWros= 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 1632310626194220.16015079260546; Wed, 22 Sep 2021 04:37:06 -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-468-5vEX2kmDPp-uBRXBLNvhUw-1; Wed, 22 Sep 2021 07:36:22 -0400 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 73C0218D6A35; Wed, 22 Sep 2021 11:36:17 +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 5A3F5652B0; Wed, 22 Sep 2021 11:36:17 +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 2C7DF4EA44; Wed, 22 Sep 2021 11:36:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 18MBZpcG006727 for ; Wed, 22 Sep 2021 07:35:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0352360871; Wed, 22 Sep 2021 11:35:51 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 58C6A60843 for ; Wed, 22 Sep 2021 11:35:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632310625; 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=C9dh21wJ1ZjhnETTQH59Egz8D4GL6t8l/RiY8fGQNtE=; b=W6a7TOQuXAJQPM5kpy9H4d3OeUuNxpcNJZnR/kOdLtB2hc9Ob1+48CRjiYyz1VHazqB87U 24X67ibfCZgcEJ6qh0UuW53FRay8G5BsrHzZvFuY/v9QuMEUBsuj0dtz+2HTu3H9J8FFXW syO1PQwlOyKvPjDZqEbpZL7AWbGu84s= X-MC-Unique: 5vEX2kmDPp-uBRXBLNvhUw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 11/12] qemu: domain: Rename secrets setup function Date: Wed, 22 Sep 2021 13:35:30 +0200 Message-Id: <9b6e19289cea1c1d24543e4be87c489b4df2ad6a.1632310421.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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) X-ZM-MESSAGEID: 1632310627104100003 Content-Type: text/plain; charset="utf-8" Since there's just one type left, we can change the name to a more generic one. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 70 +++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index befe6bd476..9a20938417 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1065,7 +1065,7 @@ qemuDomainVideoPrivateDispose(void *obj) } -/* qemuDomainSecretAESSetup: +/* qemuDomainSecretInfoSetup: * @priv: pointer to domain private object * @alias: alias of the secret * @username: username to use (may be NULL) @@ -1077,11 +1077,11 @@ qemuDomainVideoPrivateDispose(void *obj) * Returns qemuDomainSecretInfo *filled with the necessary information. */ static qemuDomainSecretInfo * -qemuDomainSecretAESSetup(qemuDomainObjPrivate *priv, - const char *alias, - const char *username, - uint8_t *secret, - size_t secretlen) +qemuDomainSecretInfoSetup(qemuDomainObjPrivate *priv, + const char *alias, + const char *username, + uint8_t *secret, + size_t secretlen) { g_autoptr(qemuDomainSecretInfo) secinfo =3D NULL; g_autofree uint8_t *raw_iv =3D NULL; @@ -1117,7 +1117,7 @@ qemuDomainSecretAESSetup(qemuDomainObjPrivate *priv, /** - * qemuDomainSecretAESSetupFromSecret: + * qemuDomainSecretInfoSetupFromSecret: * @priv: pointer to domain private object * @srcalias: Alias of the disk/hostdev used to generate the secret alias * @secretuse: specific usage for the secret (may be NULL if main object i= s using it) @@ -1130,12 +1130,12 @@ qemuDomainSecretAESSetup(qemuDomainObjPrivate *priv, * secret in case if @srcalias requires more secrets for various usage cas= es. */ static qemuDomainSecretInfo * -qemuDomainSecretAESSetupFromSecret(qemuDomainObjPrivate *priv, - const char *srcalias, - const char *secretuse, - virSecretUsageType usageType, - const char *username, - virSecretLookupTypeDef *seclookupdef) +qemuDomainSecretInfoSetupFromSecret(qemuDomainObjPrivate *priv, + const char *srcalias, + const char *secretuse, + virSecretUsageType usageType, + const char *username, + virSecretLookupTypeDef *seclookupdef) { qemuDomainSecretInfo *secinfo; g_autofree char *alias =3D qemuAliasForSecret(srcalias, secretuse); @@ -1154,7 +1154,7 @@ qemuDomainSecretAESSetupFromSecret(qemuDomainObjPriva= te *priv, &secret, &secretlen) < 0) return NULL; - secinfo =3D qemuDomainSecretAESSetup(priv, alias, username, secret, se= cretlen); + secinfo =3D qemuDomainSecretInfoSetup(priv, alias, username, secret, s= ecretlen); virSecureErase(secret, secretlen); @@ -1188,9 +1188,9 @@ qemuDomainSecretInfoTLSNew(qemuDomainObjPrivate *priv, } seclookupdef.type =3D VIR_SECRET_LOOKUP_TYPE_UUID; - return qemuDomainSecretAESSetupFromSecret(priv, srcAlias, NULL, - VIR_SECRET_USAGE_TYPE_TLS, - NULL, &seclookupdef); + return qemuDomainSecretInfoSetupFromSecret(priv, srcAlias, NULL, + VIR_SECRET_USAGE_TYPE_TLS, + NULL, &seclookupdef); } @@ -1244,8 +1244,8 @@ qemuDomainSecretStorageSourcePrepareCookies(qemuDomai= nObjPrivate *priv, g_autofree char *secretalias =3D qemuAliasForSecret(aliasprotocol, "ht= tpcookie"); g_autofree char *cookies =3D qemuBlockStorageSourceGetCookieString(src= ); - return qemuDomainSecretAESSetup(priv, secretalias, NULL, - (uint8_t *) cookies, strlen(cookies)); + return qemuDomainSecretInfoSetup(priv, secretalias, NULL, + (uint8_t *) cookies, strlen(cookies)); } @@ -1287,20 +1287,20 @@ qemuDomainSecretStorageSourcePrepare(qemuDomainObjP= rivate *priv, if (src->protocol =3D=3D VIR_STORAGE_NET_PROTOCOL_RBD) usageType =3D VIR_SECRET_USAGE_TYPE_CEPH; - if (!(srcPriv->secinfo =3D qemuDomainSecretAESSetupFromSecret(priv= , aliasprotocol, - "auth", - usageT= ype, - src->a= uth->username, - &src->= auth->seclookupdef))) + if (!(srcPriv->secinfo =3D qemuDomainSecretInfoSetupFromSecret(pri= v, aliasprotocol, + "auth= ", + usage= Type, + src->= auth->username, + &src-= >auth->seclookupdef))) return -1; } if (hasEnc) { - if (!(srcPriv->encinfo =3D qemuDomainSecretAESSetupFromSecret(priv= , aliasformat, - "encry= ption", - VIR_SE= CRET_USAGE_TYPE_VOLUME, - NULL, - &src->= encryption->secrets[0]->seclookupdef))) + if (!(srcPriv->encinfo =3D qemuDomainSecretInfoSetupFromSecret(pri= v, aliasformat, + "encr= yption", + VIR_S= ECRET_USAGE_TYPE_VOLUME, + NULL, + &src-= >encryption->secrets[0]->seclookupdef))) return -1; } @@ -10740,12 +10740,12 @@ qemuDomainPrepareHostdev(virDomainHostdevDef *hos= tdev, virSecretUsageType usageType =3D VIR_SECRET_USAGE_TYPE_ISC= SI; qemuDomainStorageSourcePrivate *srcPriv =3D qemuDomainStor= ageSourcePrivateFetch(src); - if (!(srcPriv->secinfo =3D qemuDomainSecretAESSetupFromSec= ret(priv, - = backendalias, - = NULL, - = usageType, - = src->auth->username, - = &src->auth->seclookupdef))) + if (!(srcPriv->secinfo =3D qemuDomainSecretInfoSetupFromSe= cret(priv, + = backendalias, + = NULL, + = usageType, + = src->auth->username, + = &src->auth->seclookupdef))) return -1; } } --=20 2.31.1