diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2010-11-10 10:32:33 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2010-11-10 10:52:12 +0000 |
commit | eaedf025f5c45a4e05cbf25e145215d48bea8f8d (patch) | |
tree | adc65e022538c017cac945b4fbb781098ac6785e /src/launch.c | |
parent | 1c29849e0bdc731c023cff00d2c2354a41fd2a92 (diff) | |
download | libguestfs-eaedf025f5c45a4e05cbf25e145215d48bea8f8d.tar.gz libguestfs-eaedf025f5c45a4e05cbf25e145215d48bea8f8d.tar.xz libguestfs-eaedf025f5c45a4e05cbf25e145215d48bea8f8d.zip |
New API: debug-cmdline for printing QEMU command line (internal only).
This is an internal-only debugging API so may be changed or
removed at any time in the future.
Diffstat (limited to 'src/launch.c')
-rw-r--r-- | src/launch.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/launch.c b/src/launch.c index 48ddb8df..e4f4728f 100644 --- a/src/launch.c +++ b/src/launch.c @@ -120,6 +120,30 @@ guestfs___rollback_cmdline (guestfs_h *g, int pos) g->cmdline_size = pos; } +/* Internal command to return the command line. */ +char ** +guestfs__debug_cmdline (guestfs_h *g) +{ + int i; + char **r; + + if (g->cmdline == NULL) { + r = safe_malloc (g, sizeof (char *) * 1); + r[0] = NULL; + return r; + } + + r = safe_malloc (g, sizeof (char *) * (g->cmdline_size + 1)); + r[0] = safe_strdup (g, g->qemu); /* g->cmdline[0] is always NULL */ + + for (i = 1; i < g->cmdline_size; ++i) + r[i] = safe_strdup (g, g->cmdline[i]); + + r[g->cmdline_size] = NULL; + + return r; /* caller frees */ +} + int guestfs__config (guestfs_h *g, const char *qemu_param, const char *qemu_value) |