]> xenbits.xensource.com Git - libvirt.git/commitdiff
Refactor qemuBuildSeccompSandboxCommandLine
authorJán Tomko <jtomko@redhat.com>
Tue, 10 Apr 2018 08:34:32 +0000 (10:34 +0200)
committerJán Tomko <jtomko@redhat.com>
Tue, 17 Apr 2018 14:29:38 +0000 (16:29 +0200)
Exit early if possible to simplify the logic.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/qemu/qemu_command.c

index ea0dc6f183f38840be2a54c491ccbbb670e6ae8f..c59d0a9ff1c10deea4abdce0c23b3f65ab822329 100644 (file)
@@ -9729,9 +9729,12 @@ qemuBuildSeccompSandboxCommandLine(virCommandPtr cmd,
                                    virQEMUDriverConfigPtr cfg,
                                    virQEMUCapsPtr qemuCaps ATTRIBUTE_UNUSED)
 {
-    if (cfg->seccompSandbox == 0)
+    if (cfg->seccompSandbox == 0) {
         virCommandAddArgList(cmd, "-sandbox", "off", NULL);
-    else if (cfg->seccompSandbox > 0)
+        return 0;
+    }
+
+    if (cfg->seccompSandbox > 0)
         virCommandAddArgList(cmd, "-sandbox", "on", NULL);
 
     return 0;