]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuProcessCreatePretendCmd: Rework FIPS handling
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 25 Apr 2016 05:47:59 +0000 (07:47 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 25 Apr 2016 16:47:31 +0000 (18:47 +0200)
This function - in contrast with qemuBuildCommandLine - merely
constructs our internal command representation of a domain. This
is then later compared against expected output. Or, this function
is used also in virConnectDomainXMLToNative(). But due to a copy
paste error this function, just like its image - has @forceFips
argument that if enabled forces FIPS, otherwise mimics FIPS state
in the host. If FIPS is enabled or forced the generated command
line is different to state in which FIPS is disabled. Problem is,
while this could be desired in the virConnectDomainXMLToNative()
case, this is undesirable in the test suite as it will produce
unpredicted results.
Solution to this is to rename argument to @enableFips to
specifically tell whether we expect command line to be build in
either of fashions and make virConnectDomainXMLToNative()
implementation fetch FIPS state and pass it to
qemuProcessCreatePretendCmd().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_driver.c
src/qemu/qemu_process.c
src/qemu/qemu_process.h

index 91ed0fa4595a3a1ca443ee89d4854989794d31c4..542d13c2ac707e3d5fd373a7099ded5d432f574b 100644 (file)
@@ -7060,7 +7060,8 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn,
         }
     }
 
-    if (!(cmd = qemuProcessCreatePretendCmd(conn, driver, vm, NULL, false, true,
+    if (!(cmd = qemuProcessCreatePretendCmd(conn, driver, vm, NULL,
+                                            qemuCheckFips(), true,
                                             VIR_QEMU_PROCESS_START_COLD)))
         goto cleanup;
 
index 8a2f65fe7fa24cb25b8366c17793a969e23213bb..0ccc3ac64385de5d176a0887fb28e37bb5a9eb13 100644 (file)
@@ -5715,7 +5715,7 @@ qemuProcessCreatePretendCmd(virConnectPtr conn,
                             virQEMUDriverPtr driver,
                             virDomainObjPtr vm,
                             const char *migrateURI,
-                            bool forceFips,
+                            bool enableFips,
                             bool standalone,
                             unsigned int flags)
 {
@@ -5747,7 +5747,7 @@ qemuProcessCreatePretendCmd(virConnectPtr conn,
                                NULL,
                                VIR_NETDEV_VPORT_PROFILE_OP_NO_OP,
                                standalone,
-                               forceFips ? true : qemuCheckFips(),
+                               enableFips,
                                priv->autoNodeset,
                                NULL,
                                NULL,
index 98cc9a849f37bcc7efaccbb5627e9eec03014c67..b7262a7e0f37e33b013f250c6854f6bc8e993b48 100644 (file)
@@ -85,7 +85,7 @@ virCommandPtr qemuProcessCreatePretendCmd(virConnectPtr conn,
                                           virQEMUDriverPtr driver,
                                           virDomainObjPtr vm,
                                           const char *migrateURI,
-                                          bool forceFips,
+                                          bool enableFips,
                                           bool standalone,
                                           unsigned int flags);