From nobody Thu Nov 14 06:56:04 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=1632310557; cv=none; d=zohomail.com; s=zohoarc; b=ShRuubC3R2z/AlsYxIZJ4kR5+0TNBfn++C1XE+Fw9NJ1p0fEdfim9eOSHz2QgnKJ90LGX9F6goEhOq30MEJPc9YLjuy+MboUORz5jmJQmKWQdPCJ8Fp/paaN0qxnEq/+Iqu0EUE1j+/4uvIJ2+Tx+9H/SQOaSXLVH5nl3V60T14= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632310557; 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=vdi28/y4pSTY3ZUawvpPaQZXzVW4oIS8IquDV+jIxIM=; b=bv4Y4qkaAKyoL6kVtAfVX8cmxdkhfOZ0Ze1sVlRnCwns/FBATQFMkvGvgp/ZUO+0ltxOwrlF5Sbz4/lwH/A0xmLvHHaddH2ido3jqfp0Zj5/2c8QzNS39/y6q6NQR1A80bOOqwztBnP3HHIlaQtgYliUdZO2RwP5L33Z1T+01qI= 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) 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 1632310557061617.046950789165; Wed, 22 Sep 2021 04:35:57 -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-553-_HahuG2AOGiACemJuarsGQ-1; Wed, 22 Sep 2021 07:35:53 -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 E919118D6A25; Wed, 22 Sep 2021 11:35:48 +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 CC44C12D4A; Wed, 22 Sep 2021 11:35:48 +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 456571806D01; Wed, 22 Sep 2021 11:35:48 +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 18MBZhCJ006653 for ; Wed, 22 Sep 2021 07:35:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id 599A360854; Wed, 22 Sep 2021 11:35:43 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id AFC4860843 for ; Wed, 22 Sep 2021 11:35:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632310555; 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=vdi28/y4pSTY3ZUawvpPaQZXzVW4oIS8IquDV+jIxIM=; b=O0rmMgWKwfMJYl/lgzQjBMCF6raIWYiPL0A59x3yH3kQWuJcf/6gtXyHwaUU/OWjThNlT/ OH/LXt8s4m2i7Pgt1DwyOr3ekNyowcmZ63ONIpSN1qcbRPNVOOYfNlZbe5P/77rPD8Nh1u 7JwFQnHELPajWggTDtYs/wBR4ZsIx2c= X-MC-Unique: _HahuG2AOGiACemJuarsGQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 04/12] qemu: domain: Remove qemuDomainSupportsEncryptedSecret Date: Wed, 22 Sep 2021 13:35:23 +0200 Message-Id: <52dec4c6b2d687dc4d5d70522a56a1990e4f291f.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: 1632310558167100001 Content-Type: text/plain; charset="utf-8" The answer is now always 'true', so we can remove the function and simplify the logic in places where it's called. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 25 ++----------------------- src/qemu/qemu_domain.h | 2 -- 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 1340ed0d29..903e86f8dc 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1154,12 +1154,6 @@ qemuDomainSecretAESSetup(qemuDomainObjPrivate *priv, g_autofree uint8_t *ciphertext =3D NULL; size_t ciphertextlen =3D 0; - if (!qemuDomainSupportsEncryptedSecret(priv)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("encrypted secrets are not supported")); - return NULL; - } - secinfo =3D g_new0(qemuDomainSecretInfo, 1); secinfo->type =3D VIR_DOMAIN_SECRET_INFO_TYPE_AES; @@ -1235,20 +1229,6 @@ qemuDomainSecretAESSetupFromSecret(qemuDomainObjPriv= ate *priv, } -/** - * qemuDomainSupportsEncryptedSecret: - * @priv: qemu domain private data - * - * Returns true if libvirt can use encrypted 'secret' objects with VM which - * @priv belongs to. - */ -bool -qemuDomainSupportsEncryptedSecret(qemuDomainObjPrivate *priv) -{ - return !!priv->masterKey; -} - - /* qemuDomainSecretInfoNewPlain: * @usageType: Secret usage type * @username: username @@ -1404,8 +1384,7 @@ qemuDomainSecretStorageSourcePrepare(qemuDomainObjPri= vate *priv, if (src->protocol =3D=3D VIR_STORAGE_NET_PROTOCOL_RBD) usageType =3D VIR_SECRET_USAGE_TYPE_CEPH; - if (!qemuDomainSupportsEncryptedSecret(priv) || - (src->protocol =3D=3D VIR_STORAGE_NET_PROTOCOL_ISCSI && !iscsi= HasPS)) { + if (src->protocol =3D=3D VIR_STORAGE_NET_PROTOCOL_ISCSI && !iscsiH= asPS) { srcPriv->secinfo =3D qemuDomainSecretInfoNewPlain(usageType, src->auth->use= rname, &src->auth->se= clookupdef); @@ -10888,7 +10867,7 @@ qemuDomainPrepareHostdev(virDomainHostdevDef *hostd= ev, virSecretUsageType usageType =3D VIR_SECRET_USAGE_TYPE_ISC= SI; qemuDomainStorageSourcePrivate *srcPriv =3D qemuDomainStor= ageSourcePrivateFetch(src); - if (!qemuDomainSupportsEncryptedSecret(priv) || !iscsiHasP= S) { + if (!iscsiHasPS) { srcPriv->secinfo =3D qemuDomainSecretInfoNewPlain(usag= eType, src->a= uth->username, &src->= auth->seclookupdef); diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index ae9d76ec4a..08f33f0f9e 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -853,8 +853,6 @@ int qemuDomainMasterKeyCreate(virDomainObj *vm); void qemuDomainMasterKeyRemove(qemuDomainObjPrivate *priv); -bool qemuDomainSupportsEncryptedSecret(qemuDomainObjPrivate *priv); - void qemuDomainSecretInfoFree(qemuDomainSecretInfo *secinfo) ATTRIBUTE_NONNULL(1); --=20 2.31.1