]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Drop _virQEMUDriver::hostFips
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 27 Jun 2024 15:01:17 +0000 (17:01 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 2 Jul 2024 07:14:24 +0000 (09:14 +0200)
The 'hostFips' member of _virQEMUDriver struct is not used
really, due to previous cleanups. Drop it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_conf.h
src/qemu/qemu_driver.c
tests/qemuxmlconftest.c
tests/testutilsqemu.h

index 36049b4bfac05c445195c2e917fa714bbea1c5da..aa1e1a626c1aa054a1a773e45af0741f48d130d2 100644 (file)
@@ -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;
index fc1704f4fc14e3fe04216f88548d70e73841fd4e..cd5ddf2eac0df98def079395dd760e5f6cf43427 100644 (file)
@@ -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;
 
index e584e0d9e520d8f58a70ea7099b2c7e1417315f5..2ede8cd29dd290202ef3b9181fef5a1cf7376617 100644 (file)
@@ -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");
index 89148bd529500cb3eedc00b8896798bd67a2ed09..a5806f244b1767eb8cb322c7638ca09b3b598979 100644 (file)
@@ -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 {