From nobody Tue Sep 9 19:23:51 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1752748557; cv=none; d=zohomail.com; s=zohoarc; b=azbu56U90OzUWqh4H3sSC9/UJ5usz/maKD8q9t/Zs0/VQ3oNj6IQAWkS9akoSsKzT46IG71Vv31zOv2w/ATymcmdZ86BDFUQw1yvd3mB+X9FTujq3sChyIuJKnoHidivCbuEmaU+ZxYDSJLH3K57asDqYMSqj+4BZkBykE7TQuE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752748557; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=YvKDJLf+84lvo5Az+NBDQVu9j2XUuXwFzPm01eQzaIs=; b=fuu5/CtUeZqACdgNhLS4MIMJkNsxAaXpoOuS/8Ci3MgEqh33d3gIVI4XLc/KRZd4wUsK9BYNP0K15bOXTUHW2N/mvTdrsLgcMZncdZLayuM7ioarAF+6xB4W5yOZGNu8iXk9DC6YlpBuUbl/f9WsL9yiyH4ulNAXX5g4nQBhUqE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1752748557871581.2789901781331; Thu, 17 Jul 2025 03:35:57 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id ECD6F11C9; Thu, 17 Jul 2025 06:35:56 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id A0AD41485; Thu, 17 Jul 2025 06:34:59 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 51A2C1182; Thu, 17 Jul 2025 06:34:51 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id D161FD46 for ; Thu, 17 Jul 2025 06:34:50 -0400 (EDT) Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-389-KNXBpb8fN9ug1KtH_jaFnA-1; Thu, 17 Jul 2025 06:34:49 -0400 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-454dee17a91so6606865e9.3 for ; Thu, 17 Jul 2025 03:34:48 -0700 (PDT) Received: from wheatley.localdomain ([85.93.96.130]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4562e886113sm47330815e9.23.2025.07.17.03.34.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jul 2025 03:34:46 -0700 (PDT) Received: from wheatley.pinto-pinecone.ts.net (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 54EB8C3A28CC for ; Thu, 17 Jul 2025 12:34:45 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752748490; h=from:from: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; bh=xWhyc8UPM3OtWphJ0bH7jExrdcZ2ZHQcgTHAR1TUSFM=; b=CItrlXVWdkW9C6ZAZgIIr4tGPBvBK/VX73Wbs2qXyC+1ZXhAPOjrLnBAaXUM7b+171FSjn DtaSPZd2S2YZ6dFatWApvnq1yGhpugWjHF1BSCEoDcAC9aW8R7C9GbBVn0bF8OIxCb/lqG gtc3moKwuMlM2U9mQulNvrqBmcUhTeg= X-MC-Unique: KNXBpb8fN9ug1KtH_jaFnA-1 X-Mimecast-MFC-AGG-ID: KNXBpb8fN9ug1KtH_jaFnA_1752748488 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752748488; x=1753353288; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xWhyc8UPM3OtWphJ0bH7jExrdcZ2ZHQcgTHAR1TUSFM=; b=gIuoPGOxn8MSFZdi1NL/GEVSm4fhnGLltIGLXFhn21EbccxPZqy4cVvp6wPu2XP52f 9Mr50obfO2WpcZzI4vJAYytGBpnLlPZnf8hyOTW0MTfb5WS0+XdE/hKTAoajqA6bfu2A WZgEjhrD6jwGcHPLIoGVu2NrADUMyomDeQnv/B4DIqv6dX8cTj09RlAqwYYEKuTW918d GpFxahFr2KE3N+rXWjiINor+QmT1roz4bFmjLDT4kUafPPHqvvZBB2BHFN5JGE+TdoQd 5k/oDjB02sK85Eq++V6sHDU1jDv/dbCrWwi5DWZwC5u6AU9SJY8ew2AnThHdfvoQX3DJ yojg== X-Gm-Message-State: AOJu0YzPK6ixmx4TbLmLcFdH+Y6LlV70ib4bpp2wMsYz5drrQ9JHAm7B jAvq2oUjXnOqMp+da2WmgGY6b1l35KP+mW5uWfDYSKCphcubaUcCZIP/F73hjTb89eDqhtnUqB4 m/sNDPLPW5uxDDr5KZ0aD6hMCDKCjANBe25ODbF7QkjTXIVSTSz+bEAdrYXggg1Jr/HHCtDn5l3 xT1lMq2v4LBIO/hu4ZHJqdLlu4E7CKW42O+GsoK7kgiFo= X-Gm-Gg: ASbGncs4EV4bO9wSGiaTxBpF5ry7JzIG5ipZzhHwSCPj67OJKorV51bqQUhUv+LVmqO RZmcrmR/QsEW16dxsvtQEVEVfpiIl181JIgsPryiwK4a66tbVXJ5R0T76tjmPNheUhegVmJcOP4 DC+ap5T10o8HhcdT3xm0pzJxON6m2/vFtnc7x9Ll8II5KmcGJFft/2sPWt1HC/4q8EWn781pwKu N7lQqLDfIpstRCY7WaZfAINxJdMM0IIiz7nf1qPFgu6lul7iqcM1ZQiBjnkATUHZ5xpLJ7amOUn mVu/1GEasFlitEFlslI0oiXMNRwEtFb0fPx85ForvRkUvDZw X-Received: by 2002:a05:600c:3491:b0:454:ab1a:8c39 with SMTP id 5b1f17b1804b1-4562e3a3a12mr42878985e9.26.1752748487712; Thu, 17 Jul 2025 03:34:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFWvTjFNft3lKW03Wh7b6/bJ4CD2uHRSFlolWQqA1pOe3mvXtX8sHLm2eehzDk2/f8uxwuULw== X-Received: by 2002:a05:600c:3491:b0:454:ab1a:8c39 with SMTP id 5b1f17b1804b1-4562e3a3a12mr42878655e9.26.1752748487077; Thu, 17 Jul 2025 03:34:47 -0700 (PDT) To: devel@lists.libvirt.org Subject: [PATCH 1/3] qemu_tpm: Rename qemuTPMHasSharedStorage -> qemuTPMDomainHasSharedStorage Date: Thu, 17 Jul 2025 12:34:41 +0200 Message-ID: X-Mailer: git-send-email 2.50.1 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: hwgjcwjCmWl7YJoFDppLeEp69z3SHe2PqSmawZdn6B8_1752748488 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: NIQBZAK7GWDUHZ3EF4CSBTLMG6END2WX X-Message-ID-Hash: NIQBZAK7GWDUHZ3EF4CSBTLMG6END2WX X-MailFrom: mkletzan@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Martin Kletzander via Devel Reply-To: Martin Kletzander X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1752748558483116600 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Martin Kletzander The function deals with the whole domain and the part that handles one TPM will be useful elsewhere and hence extracted later. This rename makes it possible for the new function to use the original name of this renamed one. Signed-off-by: Martin Kletzander --- src/qemu/qemu_migration.c | 2 +- src/qemu/qemu_tpm.c | 8 ++++---- src/qemu/qemu_tpm.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index c8974dbc5b97..b22248e3b92f 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1721,7 +1721,7 @@ qemuMigrationSrcIsAllowed(virDomainObj *vm, } } =20 - if (qemuTPMHasSharedStorage(driver, vm->def) && + if (qemuTPMDomainHasSharedStorage(driver, vm->def) && !qemuTPMCanMigrateSharedStorage(vm->def)) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", _("the running swtpm does not support migration= with shared storage")); diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c index b2f76e6b8b31..8c104ab1b303 100644 --- a/src/qemu/qemu_tpm.c +++ b/src/qemu/qemu_tpm.c @@ -1150,7 +1150,7 @@ qemuTPMEmulatorStart(virQEMUDriver *driver, virCommandSetPidFile(cmd, pidfile); virCommandSetErrorFD(cmd, &errfd); =20 - if (incomingMigration && qemuTPMHasSharedStorage(driver, vm->def)) { + if (incomingMigration && qemuTPMDomainHasSharedStorage(driver, vm->def= )) { /* If the TPM is being migrated over shared storage, we can't * lock all files before labeling them: the source swtpm * process is still holding on to the lock file, and it will @@ -1219,8 +1219,8 @@ qemuTPMEmulatorStart(virQEMUDriver *driver, =20 =20 bool -qemuTPMHasSharedStorage(virQEMUDriver *driver, - virDomainDef *def) +qemuTPMDomainHasSharedStorage(virQEMUDriver *driver, + virDomainDef *def) { g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); size_t i; @@ -1346,7 +1346,7 @@ qemuExtTPMStop(virQEMUDriver *driver, return; =20 qemuTPMEmulatorStop(cfg->swtpmStateDir, shortName); - if (migration && qemuTPMHasSharedStorage(driver, vm->def)) + if (migration && qemuTPMDomainHasSharedStorage(driver, vm->def)) restoreTPMStateLabel =3D false; =20 if (qemuSecurityRestoreTPMLabels(driver, vm, restoreTPMStateLabel, fal= se) < 0) diff --git a/src/qemu/qemu_tpm.h b/src/qemu/qemu_tpm.h index f0f16392a165..2d633fe36b84 100644 --- a/src/qemu/qemu_tpm.h +++ b/src/qemu/qemu_tpm.h @@ -61,8 +61,8 @@ int qemuExtTPMSetupCgroup(virQEMUDriver *driver, ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) G_GNUC_WARN_UNUSED_RESULT; =20 -bool qemuTPMHasSharedStorage(virQEMUDriver *driver, - virDomainDef *def) +bool qemuTPMDomainHasSharedStorage(virQEMUDriver *driver, + virDomainDef *def) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; =20 --=20 2.50.1