From: Pekka Enberg Date: Thu, 2 Jun 2011 09:11:28 +0000 (+0300) Subject: kvm tools: Add 'kvm debug' command X-Git-Tag: next-20110824~3^2~235 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5b652ac6f9efbbb2f767578c5fcd121651e1f83d;p=karo-tx-linux.git kvm tools: Add 'kvm debug' command This patch adds a 'kvm debug' command that's currently an alias for kill -3 `pidof kvm` which prints out debugging diagnostics for guests. Suggested-by: Ingo Molnar Signed-off-by: Pekka Enberg --- diff --git a/tools/kvm/Makefile b/tools/kvm/Makefile index 8fa7ca83c3de..a05a6b1613ba 100644 --- a/tools/kvm/Makefile +++ b/tools/kvm/Makefile @@ -16,16 +16,17 @@ CSCOPE = cscope TAGS = ctags OBJS += cpuid.o -OBJS += read-write.o +OBJS += disk/core.o +OBJS += hw/rtc.o +OBJS += hw/serial.o OBJS += interrupt.o OBJS += ioport.o -OBJS += kvm.o OBJS += kvm-cpu.o +OBJS += kvm.o OBJS += main.o OBJS += mmio.o OBJS += pci.o -OBJS += hw/rtc.o -OBJS += hw/serial.o +OBJS += read-write.o OBJS += term.o OBJS += util.o OBJS += virtio/blk.o @@ -33,22 +34,22 @@ OBJS += virtio/console.o OBJS += virtio/core.o OBJS += virtio/net.o OBJS += virtio/rng.o -OBJS += util/parse-options.o -OBJS += util/strbuf.o -OBJS += kvm-help.o -OBJS += kvm-cmd.o -OBJS += kvm-run.o -OBJS += disk/qcow.o -OBJS += disk/core.o -OBJS += disk/raw.o -OBJS += disk/blk.o -OBJS += mptable.o -OBJS += threadpool.o -OBJS += irq.o -OBJS += rbtree.o -OBJS += util/rbtree-interval.o -OBJS += virtio/9p.o -OBJS += ioeventfd.o +OBJS += disk/blk.o +OBJS += disk/qcow.o +OBJS += disk/raw.o +OBJS += ioeventfd.o +OBJS += irq.o +OBJS += kvm-cmd.o +OBJS += kvm-debug.o +OBJS += kvm-help.o +OBJS += kvm-run.o +OBJS += mptable.o +OBJS += rbtree.o +OBJS += threadpool.o +OBJS += util/parse-options.o +OBJS += util/rbtree-interval.o +OBJS += util/strbuf.o +OBJS += virtio/9p.o FLAGS_BFD=$(CFLAGS) -lbfd diff --git a/tools/kvm/include/kvm/kvm-debug.h b/tools/kvm/include/kvm/kvm-debug.h new file mode 100644 index 000000000000..190cf3189fd7 --- /dev/null +++ b/tools/kvm/include/kvm/kvm-debug.h @@ -0,0 +1,6 @@ +#ifndef KVM__DEBUG_H +#define KVM__DEBUG_H + +int kvm_cmd_debug(int argc, const char **argv, const char *prefix); + +#endif diff --git a/tools/kvm/kvm-cmd.c b/tools/kvm/kvm-cmd.c index e545d149f556..2ea51a57ca5f 100644 --- a/tools/kvm/kvm-cmd.c +++ b/tools/kvm/kvm-cmd.c @@ -5,11 +5,13 @@ #include /* user defined header files */ -#include -#include -#include +#include "kvm/kvm-debug.h" +#include "kvm/kvm-help.h" +#include "kvm/kvm-cmd.h" +#include "kvm/kvm-run.h" struct cmd_struct kvm_commands[] = { + { "debug", kvm_cmd_debug, NULL, 0 }, { "help", kvm_cmd_help, NULL, 0 }, { "run", kvm_cmd_run, kvm_run_help, 0 }, { NULL, NULL, NULL, 0 }, diff --git a/tools/kvm/kvm-debug.c b/tools/kvm/kvm-debug.c new file mode 100644 index 000000000000..58782ddb6d6f --- /dev/null +++ b/tools/kvm/kvm-debug.c @@ -0,0 +1,11 @@ +#include +#include + +#include +#include +#include + +int kvm_cmd_debug(int argc, const char **argv, const char *prefix) +{ + return system("kill -3 $(pidof kvm)"); +}