From cf7d495324680513fd3a0e4fba0d532bffedc3b5 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Thu, 27 Jun 2024 17:01:17 +0200 Subject: [PATCH] qemu: Drop _virQEMUDriver::hostFips The 'hostFips' member of _virQEMUDriver struct is not used really, due to previous cleanups. Drop it. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/qemu/qemu_conf.h | 1 - src/qemu/qemu_driver.c | 9 --------- tests/qemuxmlconftest.c | 5 +---- tests/testutilsqemu.h | 7 +++---- 4 files changed, 4 insertions(+), 18 deletions(-) diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h index 36049b4bfa..aa1e1a626c 100644 --- a/src/qemu/qemu_conf.h +++ b/src/qemu/qemu_conf.h @@ -261,7 +261,6 @@ struct _virQEMUDriver { /* Immutable values */ bool privileged; char *embeddedRoot; - bool hostFips; /* FIPS mode is enabled on the host */ /* Immutable pointers. Caller must provide locking */ virStateInhibitCallback inhibitCallback; diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index fc1704f4fc..cd5ddf2eac 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -732,15 +732,6 @@ qemuStateInitialize(bool privileged, if (qemuMigrationDstErrorInit(qemu_driver) < 0) goto error; - /* qemu-5.1 and older requires use of '-enable-fips' flag when the host - * is in FIPS mode. We store whether FIPS is enabled */ - if (virFileExists("/proc/sys/crypto/fips_enabled")) { - g_autofree char *buf = NULL; - - if (virFileReadAll("/proc/sys/crypto/fips_enabled", 10, &buf) > 0) - qemu_driver->hostFips = STREQ(buf, "1\n"); - } - if (privileged) { g_autofree char *channeldir = NULL; diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index e584e0d9e5..2ede8cd29d 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -369,7 +369,6 @@ testCheckExclusiveFlags(int flags) { virCheckFlags(FLAG_EXPECT_FAILURE | FLAG_EXPECT_PARSE_ERROR | - FLAG_FIPS_HOST | FLAG_REAL_CAPS | FLAG_SLIRP_HELPER | FLAG_ALLOW_DUPLICATE_OUTPUT | @@ -389,8 +388,6 @@ testCompareXMLToArgvCreateArgs(virQEMUDriver *drv, qemuDomainObjPrivate *priv = vm->privateData; size_t i; - drv->hostFips = flags & FLAG_FIPS_HOST; - if (qemuProcessCreatePretendCmdPrepare(drv, vm, migrateURI, VIR_QEMU_PROCESS_START_COLD) < 0) return NULL; @@ -2619,7 +2616,7 @@ mymain(void) DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR("pvpanic-pci-invalid-address-aarch64", "aarch64"); DO_TEST_CAPS_ARCH_LATEST("pvpanic-pci-no-address-aarch64", "aarch64"); - DO_TEST_CAPS_ARCH_LATEST_FULL("fips-enabled", "x86_64", ARG_FLAGS, FLAG_FIPS_HOST); + DO_TEST_CAPS_LATEST("fips-enabled"); DO_TEST_CAPS_LATEST("shmem-plain-doorbell"); DO_TEST_CAPS_LATEST_PARSE_ERROR("shmem-invalid-size"); diff --git a/tests/testutilsqemu.h b/tests/testutilsqemu.h index 89148bd529..a5806f244b 100644 --- a/tests/testutilsqemu.h +++ b/tests/testutilsqemu.h @@ -58,10 +58,9 @@ typedef enum { typedef enum { FLAG_EXPECT_FAILURE = 1 << 0, FLAG_EXPECT_PARSE_ERROR = 1 << 1, - FLAG_FIPS_HOST = 1 << 2, /* simulate host with FIPS mode enabled */ - FLAG_REAL_CAPS = 1 << 3, - FLAG_SLIRP_HELPER = 1 << 4, - FLAG_ALLOW_DUPLICATE_OUTPUT = 1 << 5, /* allow multiple tests with the same output file */ + FLAG_REAL_CAPS = 1 << 2, + FLAG_SLIRP_HELPER = 1 << 3, + FLAG_ALLOW_DUPLICATE_OUTPUT = 1 << 4, /* allow multiple tests with the same output file */ } testQemuInfoFlags; struct testQemuConf { -- 2.39.5