[libvirt] [PATCH sandbox 3/4] Fix passing of strace option to guest kernel

Daniel P. Berrange berrange at redhat.com
Fri Sep 4 11:40:36 UTC 2015


The libvirt-sandbox-init-qemu command expects to see 'strace='
or 'strace=some,list,of,syscalls' but we only passed 'strace'.
This meant strace could never be enabled.

Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
---
 libvirt-sandbox/libvirt-sandbox-builder-machine.c | 7 ++-----
 libvirt-sandbox/libvirt-sandbox-init-qemu.c       | 2 +-
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/libvirt-sandbox/libvirt-sandbox-builder-machine.c b/libvirt-sandbox/libvirt-sandbox-builder-machine.c
index a458882..a142f68 100644
--- a/libvirt-sandbox/libvirt-sandbox-builder-machine.c
+++ b/libvirt-sandbox/libvirt-sandbox-builder-machine.c
@@ -239,11 +239,8 @@ static gchar *gvir_sandbox_builder_machine_cmdline(GVirSandboxConfig *config G_G
         g_string_append(str, " quiet loglevel=0");
 
     if ((tmp = getenv("LIBVIRT_SANDBOX_STRACE"))) {
-        g_string_append(str, " strace");
-        if (!g_str_equal(tmp, "1")) {
-            g_string_append(str, "=");
-            g_string_append(str, tmp);
-        }
+        g_string_append(str, " strace=");
+        g_string_append(str, tmp);
     }
 
     /* These make boot a little bit faster */
diff --git a/libvirt-sandbox/libvirt-sandbox-init-qemu.c b/libvirt-sandbox/libvirt-sandbox-init-qemu.c
index 8bde224..bbe70ad 100644
--- a/libvirt-sandbox/libvirt-sandbox-init-qemu.c
+++ b/libvirt-sandbox/libvirt-sandbox-init-qemu.c
@@ -414,7 +414,7 @@ main(int argc ATTR_UNUSED, char **argv ATTR_UNUSED)
         args[narg++] = "/tmp/sandbox.log";
         args[narg++] = "-f";
         args[narg++] = "-ff";
-        if (strace) {
+        if (strace && STRNEQ(strace, "1")) {
             args[narg++] = "-e";
             args[narg++] = strace;
         }
-- 
2.4.3




More information about the libvir-list mailing list