Re: [libvirt] [PATCH sandbox 3/4] Fix passing of strace option to guest kernel
On Fri, 2015-09-04 at 12:40 +0100, Daniel P. Berrange wrote: > 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 > --- > 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; > } ACK -- Cedric -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH sandbox 3/4] Fix passing of strace option to guest kernel
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 --- 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 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list