All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yu Zhiguo <yuzg@cn.fujitsu.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Keir Fraser <keir.fraser@eu.citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: xl: Add subcommand "xl debug-keys"
Date: Wed, 19 May 2010 17:37:40 +0800	[thread overview]
Message-ID: <4BF3B164.8000004@cn.fujitsu.com> (raw)

Can be used to send debug keys to Xen.

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>

diff -r baccadfd9418 -r 60150e519923 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Fri May 14 08:05:05 2010 +0100
+++ b/tools/libxl/libxl.c	Thu May 20 01:39:03 2010 +0800
@@ -2807,6 +2807,15 @@
     return 0;
 }
 
+int libxl_send_debug_keys(struct libxl_ctx *ctx, char *keys)
+{
+    int rc;
+
+    rc = xc_send_debug_keys(ctx->xch, keys);
+
+    return rc;
+}
+
 uint32_t libxl_vm_get_start_time(struct libxl_ctx *ctx, uint32_t domid)
 {
     char *dompath = libxl_xs_get_dompath(ctx, domid);
diff -r baccadfd9418 -r 60150e519923 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Fri May 14 08:05:05 2010 +0100
+++ b/tools/libxl/libxl.h	Thu May 20 01:39:03 2010 +0800
@@ -511,6 +511,7 @@
 int libxl_send_trigger(struct libxl_ctx *ctx, uint32_t domid,
                        char *trigger_name, uint32_t vcpuid);
 int libxl_send_sysrq(struct libxl_ctx *ctx, uint32_t domid, char sysrq);
+int libxl_send_debug_keys(struct libxl_ctx *ctx, char *keys);
 uint32_t libxl_vm_get_start_time(struct libxl_ctx *ctx, uint32_t domid);
 
 #endif /* LIBXL_H */
diff -r baccadfd9418 -r 60150e519923 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Fri May 14 08:05:05 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Thu May 20 01:39:03 2010 +0800
@@ -3167,6 +3167,38 @@
     exit(0);
 }
 
+int main_debug_keys(int argc, char **argv)
+{
+    int opt = 0;
+    char *keys;
+    int rc;
+
+    while ((opt = getopt(argc, argv, "h")) != -1) {
+        switch (opt) {
+        case 'h':
+            help("debug-keys");
+            exit(0);
+        default:
+            fprintf(stderr, "option not supported\n");
+            break;
+        }
+    }
+    if (optind >= argc) {
+        help("debug-keys");
+        exit(2);
+    }
+
+    keys = argv[optind];
+
+    rc = libxl_send_debug_keys(&ctx, keys);
+    if (rc) {
+        fprintf(stderr, "cannot send debug keys: %s\n", keys);
+        exit(1);
+    }
+
+    exit(0);
+}
+
 int main_top(int argc, char **argv)
 {
     int opt;
diff -r baccadfd9418 -r 60150e519923 tools/libxl/xl_cmdimpl.h
--- a/tools/libxl/xl_cmdimpl.h	Fri May 14 08:05:05 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.h	Thu May 20 01:39:03 2010 +0800
@@ -44,6 +44,7 @@
 int main_rename(int argc, char **argv);
 int main_trigger(int argc, char **argv);
 int main_sysrq(int argc, char **argv);
+int main_debug_keys(int argc, char **argv);
 int main_top(int argc, char **argv);
 int main_networkattach(int argc, char **argv);
 int main_networklist(int argc, char **argv);
diff -r baccadfd9418 -r 60150e519923 tools/libxl/xl_cmdtable.c
--- a/tools/libxl/xl_cmdtable.c	Fri May 14 08:05:05 2010 +0100
+++ b/tools/libxl/xl_cmdtable.c	Thu May 20 01:39:03 2010 +0800
@@ -182,6 +182,11 @@
       "Send a sysrq to a domain",
       "<Domain> <letter>",
     },
+    { "debug-keys",
+      &main_debug_keys,
+      "Send debug keys to Xen",
+      "<Keys>",
+    },
     { "top",
       &main_top,
       "Monitor a host and the domains in real time",

                 reply	other threads:[~2010-05-19  9:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BF3B164.8000004@cn.fujitsu.com \
    --to=yuzg@cn.fujitsu.com \
    --cc=keir.fraser@eu.citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.