{"id":2220144,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2220144/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260406141735.25844-8-armenon@redhat.com/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/1.1/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260406141735.25844-8-armenon@redhat.com>","date":"2026-04-06T14:17:32","name":"[v3,07/10] qtests: Enable starting swtpm with a given profile","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"9a0d632e1883b7ba1eb001b1c050c0b437a1e15e","submitter":{"id":91136,"url":"http://patchwork.ozlabs.org/api/1.1/people/91136/?format=json","name":"Arun Menon","email":"armenon@redhat.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260406141735.25844-8-armenon@redhat.com/mbox/","series":[{"id":498860,"url":"http://patchwork.ozlabs.org/api/1.1/series/498860/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=498860","date":"2026-04-06T14:17:28","name":"hw/tpm: CRB chunking capability to handle PQC","version":3,"mbox":"http://patchwork.ozlabs.org/series/498860/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2220144/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2220144/checks/","tags":{},"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=O88iymfW;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=google header.b=dic6bptG;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fqBK073BLz1yGn\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 07 Apr 2026 00:19:00 +1000 (AEST)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1w9kmu-000416-DC; Mon, 06 Apr 2026 10:18:48 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <armenon@redhat.com>)\n id 1w9kms-00040W-BC\n for qemu-devel@nongnu.org; Mon, 06 Apr 2026 10:18:46 -0400","from us-smtp-delivery-124.mimecast.com ([170.10.133.124])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <armenon@redhat.com>)\n id 1w9kmq-000553-S5\n for qemu-devel@nongnu.org; Mon, 06 Apr 2026 10:18:46 -0400","from mail-pl1-f198.google.com (mail-pl1-f198.google.com\n [209.85.214.198]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-204-MmoDrjCnOA6KYEZO75OgLg-1; Mon, 06 Apr 2026 10:18:43 -0400","by mail-pl1-f198.google.com with SMTP id\n d9443c01a7336-2b24af7ca99so52828555ad.1\n for <qemu-devel@nongnu.org>; Mon, 06 Apr 2026 07:18:42 -0700 (PDT)","from fedora.armenon-thinkpadp16vgen1.bengluru.csb ([152.59.100.84])\n by smtp.gmail.com with ESMTPSA id\n d9443c01a7336-2b27478cb4fsm156732905ad.29.2026.04.06.07.18.32\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 06 Apr 2026 07:18:40 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1775485124;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=+sg9BWtJy13Moaz54t3chkQyG4VgTEMPjkH1Yg9V5JY=;\n b=O88iymfWqmge8GX0H9yyk3pJkVrtwmBZNUo3ginRL2DbLDHBgbQ3zmYnDRTKI/dBCtJjDU\n EQxAZYetbDNhdLCu3EIBzDuAGKDp9nT+skt0K0M/MXhXC94RqO6OXMMZANEgqrqYcMl7zf\n RIkkTP0tX24yLcKUJKQno8v4MnKe+28=","v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=redhat.com; s=google; t=1775485122; x=1776089922; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=+sg9BWtJy13Moaz54t3chkQyG4VgTEMPjkH1Yg9V5JY=;\n b=dic6bptG4H4mQx5+zQbj8QVDov7pgkpbXj9wrQeKtGuvNLTwyan9yNwZp/ymbeY/d/\n 9riZwgdGixJU/VAOfh0aSiGuTHfpqUwdZRvlwPp1e8TcZHVbtadD5I4ibFLMbr7lJZO6\n mXtug2lgp76MA5YkBtA1dfJz3OPk1OxeN3Dgdwzp1skn3tTlbcAfrCvJlwxG25PggfJg\n nPJqJYx52Lcl3h4YoiGwW5wFoz62YHT60IY4GwNusI97QISGRDAg7qQQtcgSegN2PvL7\n P1dJcDquiSREoa4k3qBW5ctJgfvzkBcuiqCL6EXq3VeT+57lQ47y4IPoKw3FtC08MEmH\n 2PWw=="],"X-MC-Unique":"MmoDrjCnOA6KYEZO75OgLg-1","X-Mimecast-MFC-AGG-ID":"MmoDrjCnOA6KYEZO75OgLg_1775485122","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775485122; x=1776089922;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=+sg9BWtJy13Moaz54t3chkQyG4VgTEMPjkH1Yg9V5JY=;\n b=HGk0qCvlw/6RnGhe7AqLreye3T1SlPO2YIZMfz4DAnNWP2iC7CxoEB2dDJp7iaMnvx\n QBSafjYxfqH48zgJZaqVkyaGikl2lw3iVbD/5Gmmn5QDQnotMKPJTxnmSDfcOUrtyZw4\n 1ushc8XYbMKsNs1s85feYHA9lDrIKdzHQU7jN7L6qmYBTGyY2A1gscjjn0M9cXeWhHnA\n sqQxc9BVIaLSDA9NsaAYgNSpY+vEtuVnuNJzbq1fJQXvK9ZKA+hCp2+T9+PmuaDY+1uU\n oZ9l8wSLiTCoiKqARtWI46VAyeScy7HxBrB/pddYuJyJCYq+YgMS6MU07WlZ8jO7mMBT\n epKw==","X-Gm-Message-State":"AOJu0Yy0Zv16A8Y1DMQf/FjQvueFqptOSG5YO85/FA4UnjXouwetWA1g\n mXqQrRhP3qFr1PnenqxoXKXGkUJWtVonM36lmHma4KLYrn4XIWbgounbLOAcdX0RK5y1UYWVZ8H\n OfIHD5vemzj3M1EVz9U/BtUdE3LRDfFI/1eYQJ/cEyIAgZp/qhAoC7IhvEhLocmL9PUKNswwlMS\n SQZZQdddxwmJATyKLBPyifV/YZgu5wNr+0dvWD/ws=","X-Gm-Gg":"AeBDieslYHJ0Nz+vOGbRBgqKTsOpTHo3aWdYL/rnCAExmCNhm/wIwSdlp57670If7Iy\n fc0ggkh+IbHiXdYOuJXcwXOPS7Nwb7LIRnNDRXb7s5nX6yUIWNVZtlWRdavmWICwGxhRBQzyEmo\n 3rV0xmOy4Pit3Si818h+0oZP+TdsmxRWp7ZYY/10H5K6Ca9V9W7jQdkPs3g85/CbvhVX67RXXCQ\n 7TTttmtZpPJ1fo/2HmCUO9YCF77GxdA0CrpQi0970ko8pWVw/5K/i5IV7mJzrnhZo8VL0n4cZRT\n 87qGMaVgrf8hpDxLTArtNQOX8SmNzOcOnsjLCmrjDUWsV5SMbr/K9CY57Wlai/ZzPyVD1WtfSaB\n U6rymxfasJ5yBOqSWo4ywDbgnmpBt9Wo5JXNfXnwHg6HpX5NIXYDSuWgv8Cxgac1D/H0=","X-Received":["by 2002:a17:903:2ac5:b0:2b2:42da:25cc with SMTP id\n d9443c01a7336-2b28163ad55mr138537685ad.1.1775485121701;\n Mon, 06 Apr 2026 07:18:41 -0700 (PDT)","by 2002:a17:903:2ac5:b0:2b2:42da:25cc with SMTP id\n d9443c01a7336-2b28163ad55mr138537045ad.1.1775485120933;\n Mon, 06 Apr 2026 07:18:40 -0700 (PDT)"],"From":"Arun Menon <armenon@redhat.com>","To":"qemu-devel@nongnu.org","Cc":"Ani Sinha <anisinha@redhat.com>, Laurent Vivier <lvivier@redhat.com>,\n Zhao Liu <zhao1.liu@intel.com>, Stefan Berger <stefanb@linux.vnet.ibm.com>,\n Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,\n Paolo Bonzini <pbonzini@redhat.com>, Fabiano Rosas <farosas@suse.de>,\n marcandre.lureau@redhat.com, \"Michael S. Tsirkin\" <mst@redhat.com>,\n Yanan Wang <wangyanan55@huawei.com>, Igor Mammedov <imammedo@redhat.com>,\n\t=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>,\n Arun Menon <armenon@redhat.com>, Stefan Berger <stefanb@linux.ibm.com>","Subject":"[PATCH v3 07/10] qtests: Enable starting swtpm with a given profile","Date":"Mon,  6 Apr 2026 19:47:32 +0530","Message-ID":"<20260406141735.25844-8-armenon@redhat.com>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<20260406141735.25844-1-armenon@redhat.com>","References":"<20260406141735.25844-1-armenon@redhat.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Received-SPF":"pass client-ip=170.10.133.124; envelope-from=armenon@redhat.com;\n helo=us-smtp-delivery-124.mimecast.com","X-Spam_score_int":"-25","X-Spam_score":"-2.6","X-Spam_bar":"--","X-Spam_report":"(-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.54,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,\n SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"},"content":"From: Stefan Berger <stefanb@linux.ibm.com>\n\nEnable swtpm to start with a given profile by passing it to swtpm on the\ncommand line using\n\n   --profile name=<profile name>\n\nRemove any existing TPM 2 state file since applying a new profile to\nexisting state would be refused by swtpm.\n\nSigned-off-by: Stefan Berger <stefanb@linux.ibm.com>\nSigned-off-by: Arun Menon <armenon@redhat.com>\n---\n tests/qtest/tpm-tests.c | 6 +++---\n tests/qtest/tpm-util.c  | 9 ++++++++-\n tests/qtest/tpm-util.h  | 3 ++-\n 3 files changed, 13 insertions(+), 5 deletions(-)","diff":"diff --git a/tests/qtest/tpm-tests.c b/tests/qtest/tpm-tests.c\nindex 197714f8d9..f71d882990 100644\n--- a/tests/qtest/tpm-tests.c\n+++ b/tests/qtest/tpm-tests.c\n@@ -43,7 +43,7 @@ void tpm_test_swtpm_test(const char *src_tpm_path, tx_func *tx,\n         return;\n     }\n \n-    succ = tpm_util_swtpm_start(src_tpm_path, &swtpm_pid, &addr, &error);\n+    succ = tpm_util_swtpm_start(src_tpm_path, &swtpm_pid, &addr, NULL, &error);\n     g_assert_true(succ);\n \n     args = g_strdup_printf(\n@@ -91,11 +91,11 @@ void tpm_test_swtpm_migration_test(const char *src_tpm_path,\n     }\n \n     succ = tpm_util_swtpm_start(src_tpm_path, &src_tpm_pid,\n-                                &src_tpm_addr, &error);\n+                                &src_tpm_addr, NULL, &error);\n     g_assert_true(succ);\n \n     succ = tpm_util_swtpm_start(dst_tpm_path, &dst_tpm_pid,\n-                                &dst_tpm_addr, &error);\n+                                &dst_tpm_addr, NULL, &error);\n     g_assert_true(succ);\n \n     tpm_util_migration_start_qemu(&src_qemu, &dst_qemu,\ndiff --git a/tests/qtest/tpm-util.c b/tests/qtest/tpm-util.c\nindex 603c5a825d..24243065c1 100644\n--- a/tests/qtest/tpm-util.c\n+++ b/tests/qtest/tpm-util.c\n@@ -210,7 +210,8 @@ bool tpm_util_swtpm_has_tpm2(void)\n }\n \n gboolean tpm_util_swtpm_start(const char *path, GPid *pid,\n-                              SocketAddress **addr, GError **error)\n+                              SocketAddress **addr, const char *profilename,\n+                              GError **error)\n {\n     char *swtpm_argv_tpmstate = g_strdup_printf(\"dir=%s\", path);\n     char *swtpm_argv_ctrl = g_strdup_printf(\"type=unixio,path=%s/sock\",\n@@ -220,11 +221,17 @@ gboolean tpm_util_swtpm_start(const char *path, GPid *pid,\n         g_strdup(\"--tpmstate\"), swtpm_argv_tpmstate,\n         g_strdup(\"--ctrl\"), swtpm_argv_ctrl,\n         g_strdup(\"--tpm2\"),\n+        profilename ? g_strdup(\"--profile\") : NULL,\n+        profilename ? g_strdup_printf(\"name=%s\", profilename) : NULL,\n         NULL\n     };\n+    g_autofree char *swtpm_state_file;\n     gboolean succ;\n     unsigned i;\n \n+    swtpm_state_file = g_strdup_printf(\"%s/tpm2-00.permall\", path);\n+    g_unlink(swtpm_state_file);\n+\n     *addr = g_new0(SocketAddress, 1);\n     (*addr)->type = SOCKET_ADDRESS_TYPE_UNIX;\n     (*addr)->u.q_unix.path = g_build_filename(path, \"sock\", NULL);\ndiff --git a/tests/qtest/tpm-util.h b/tests/qtest/tpm-util.h\nindex 681544e7d8..ca2d7d173f 100644\n--- a/tests/qtest/tpm-util.h\n+++ b/tests/qtest/tpm-util.h\n@@ -41,7 +41,8 @@ void tpm_util_pcrread(QTestState *s, tx_func *tx,\n bool tpm_util_swtpm_has_tpm2(void);\n \n gboolean tpm_util_swtpm_start(const char *path, GPid *pid,\n-                              SocketAddress **addr, GError **error);\n+                              SocketAddress **addr, const char *profilename,\n+                              GError **error);\n void tpm_util_swtpm_kill(GPid pid);\n \n void tpm_util_migrate(QTestState *who, const char *uri);\n","prefixes":["v3","07/10"]}