Skip to contentSkip to conversation

fips: fix build on !Linux

PATCH Applied Anthony Liguori 2 participants 3 messages Aug 3, 2012 – Aug 6, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fips: fix build on !Linux

Commit 0f66998 makes -enable-fips conditional on Linux hosts but then uses it unconditionally in vl.c.

Fix this by moving the fips handling to os-posix.c and adding a condition.

---
 os-posix.c |    5 +++++
 vl.c       |    3 ---
 2 files changed, 5 insertions(+), 3 deletions(-)
os-posix.c +5 -0
index daf3d6f..79fa228 100644
@@ -188,6 +188,11 @@ void os_parse_cmd_args(int index, const char *optarg)
     case QEMU_OPTION_daemonize:
         daemonize = 1;
         break;
+#if defined(CONFIG_LINUX)
+    case QEMU_OPTION_enablefips:
+        fips_set_state(true);
+        break;
+#endif
     }
     return;
 }
vl.c +0 -3
index 8cda85f..6d2ce45 100644
@@ -3199,9 +3199,6 @@ int main(int argc, char **argv, char **envp)
             case QEMU_OPTION_qtest_log:
                 qtest_log = optarg;
                 break;
-            case QEMU_OPTION_enablefips:
-                fips_set_state(true);
-                break;
             default:
                 os_parse_cmd_args(popt->index, optarg);
             }
Signature · 1 line
1.7.5.4
author Applied
#1 lore raw
Quoted 5 lines · Anthony Liguori

Commit 0f66998 makes -enable-fips conditional on Linux hosts but then uses it unconditionally in vl.c.

Fix this by moving the fips handling to os-posix.c and adding a condition.

Applied.

Regards,

Anthony Liguori

Quoted 40 lines
---
 os-posix.c |    5 +++++
 vl.c       |    3 ---
 2 files changed, 5 insertions(+), 3 deletions(-)
os-posix.c +5 -0
index daf3d6f..79fa228 100644
@@ -188,6 +188,11 @@ void os_parse_cmd_args(int index, const char *optarg)
     case QEMU_OPTION_daemonize:
         daemonize = 1;
         break;
+#if defined(CONFIG_LINUX)
+    case QEMU_OPTION_enablefips:
+        fips_set_state(true);
+        break;
+#endif
     }
     return;
 }
vl.c +0 -3
index 8cda85f..6d2ce45 100644
@@ -3199,9 +3199,6 @@ int main(int argc, char **argv, char **envp)
             case QEMU_OPTION_qtest_log:
                 qtest_log = optarg;
                 break;
-            case QEMU_OPTION_enablefips:
-                fips_set_state(true);
-                break;
             default:
                 os_parse_cmd_args(popt->index, optarg);
             }
Signature · 1 line
1.7.5.4
#2 lore raw
In reply to Anthony Liguori
Quoted 4 lines · Anthony Liguori

Commit 0f66998 makes -enable-fips conditional on Linux hosts but then uses it unconditionally in vl.c.

Fix this by moving the fips handling to os-posix.c and adding a condition.

Sorry for not catching this, thanks for the fix.

Quoted 37 lines
---
 os-posix.c |    5 +++++
 vl.c       |    3 ---
 2 files changed, 5 insertions(+), 3 deletions(-)
os-posix.c +5 -0
index daf3d6f..79fa228 100644
@@ -188,6 +188,11 @@ void os_parse_cmd_args(int index, const char *optarg)
     case QEMU_OPTION_daemonize:
         daemonize = 1;
         break;
+#if defined(CONFIG_LINUX)
+    case QEMU_OPTION_enablefips:
+        fips_set_state(true);
+        break;
+#endif
     }
     return;
 }
vl.c +0 -3
index 8cda85f..6d2ce45 100644
@@ -3199,9 +3199,6 @@ int main(int argc, char **argv, char **envp)
             case QEMU_OPTION_qtest_log:
                 qtest_log = optarg;
                 break;
-            case QEMU_OPTION_enablefips:
-                fips_set_state(true);
-                break;
             default:
                 os_parse_cmd_args(popt->index, optarg);
             }
Signature · 2 lines
paul moore
security and virtualization @ redhat