From nobody Mon Feb 9 17:57:58 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1644000730; cv=none; d=zohomail.com; s=zohoarc; b=cji1/5qaW4dNIUYq26dlsEStMGnD+F124TLDx7r5jEStEa1XyfBiLs2XXF63qDto5Sp2qn2Ae6w7nQ93ryv8U+lsEQR7L9VXbLIQbZ4vJpMxHxn4QWZ6QlfKzL8unOrX7TPZzIyzuR/f7R0zHM+vanyJf9+YAc7ZFMlQSK6QZ+c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1644000730; 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=yKiSNkR1R9dUyH9sLFb6gjpJ7ZTnuVZMdTOiJZyutl8=; b=bSMLOTbEpN5kkFzQSda3iOQLG25i21VDIpnRAnzDHQ/QNcuDtNKNu7gsh0dfGJXPQy/KzDzI7PV8ofBeblauyigNUCVbbNpEmmNr46eriCzYSLOSKFuAh7qoDN9hAVmEPH+LnQ2dDQLEZwezJUJdmG/P2y04t9b9bC8QCTzNYnQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1644000730069700.2458713536121; Fri, 4 Feb 2022 10:52:10 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-433-plmUH9k3Nia6kOFVDzq_pw-1; Fri, 04 Feb 2022 13:52:06 -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 5DA9B1018724; Fri, 4 Feb 2022 18:52:00 +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 39BEF838D8; Fri, 4 Feb 2022 18:52:00 +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 04F501809CB8; Fri, 4 Feb 2022 18:52:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 214IpR2T002158 for ; Fri, 4 Feb 2022 13:51:27 -0500 Received: by smtp.corp.redhat.com (Postfix) id B1DE8703B5; Fri, 4 Feb 2022 18:51:27 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.193.119]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F19BA72416 for ; Fri, 4 Feb 2022 18:51:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644000729; 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=yKiSNkR1R9dUyH9sLFb6gjpJ7ZTnuVZMdTOiJZyutl8=; b=OTJE9/2Bs2EEJRUpys42uzQ36k7j/F6H32T9X17gxW68EqV9CYOZAkgo+UGf1pNpJB6w2e Og2lAksoAj5hPeQDIm5kpbkKUnxRnaR2FaYadSqLmyomTqm1O62y/bZHH6Ei5Vw+XwoXF8 6yRP5iI4AXHStDaDwX2/8cS7TK9jS2Y= X-MC-Unique: plmUH9k3Nia6kOFVDzq_pw-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 05/14] qemu: Drop qemuTPMEmulatorInitStorage() Date: Fri, 4 Feb 2022 19:51:08 +0100 Message-Id: <20220204185117.61149-6-abologna@redhat.com> In-Reply-To: <20220204185117.61149-1-abologna@redhat.com> References: <20220204185117.61149-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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) X-ZM-MESSAGEID: 1644000731689100001 Content-Type: text/plain; charset="utf-8" Absorb it into qemuTPMEmulatorCreateStorage(), its only caller. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_tpm.c | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c index 182209bda6..127a2c80be 100644 --- a/src/qemu/qemu_tpm.c +++ b/src/qemu/qemu_tpm.c @@ -99,30 +99,6 @@ qemuTPMCreateEmulatorLogPath(const char *logDir, } =20 =20 -/* - * qemuTPMEmulatorInitStorage - * - * Initialize the TPM Emulator storage by creating its root directory, - * which is typically found in /var/lib/libvirt/tpm. - * - */ -static int -qemuTPMEmulatorInitStorage(const char *swtpmStorageDir) -{ - int rc =3D 0; - - /* allow others to cd into this dir */ - if (g_mkdir_with_parents(swtpmStorageDir, 0711) < 0) { - virReportSystemError(errno, - _("Could not create TPM directory %s"), - swtpmStorageDir); - rc =3D -1; - } - - return rc; -} - - /** * qemuTPMEmulatorCreateStorage: * @storagepath: directory for swtpm's persistent state @@ -143,8 +119,13 @@ qemuTPMEmulatorCreateStorage(const char *storagepath, { g_autofree char *swtpmStorageDir =3D g_path_get_dirname(storagepath); =20 - if (qemuTPMEmulatorInitStorage(swtpmStorageDir) < 0) + /* allow others to cd into this dir */ + if (g_mkdir_with_parents(swtpmStorageDir, 0711) < 0) { + virReportSystemError(errno, + _("Could not create TPM directory %s"), + swtpmStorageDir); return -1; + } =20 *created =3D false; =20 --=20 2.34.1