[PATCH 2/2] {libxl,xl}: Add xl trigger debug

Tu Dinh <[email protected]>
Newsgroups org.xenproject.lists.xen-devel
Message-ID <1784539672.8631fc262581453bbf619ec5b2062170.19f7eda70d8000edb5@vates.tech>
Use XEN_DOMCTL_SENDTRIGGER_DEBUG to allow printing diagnostics
information of a specific domain.

Signed-off-by: Tu Dinh <[email protected]>
---
 tools/libs/light/libxl_domain.c  | 4 ++++
 tools/libs/light/libxl_types.idl | 1 +
 tools/xl/xl_cmdtable.c           | 2 +-
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/tools/libs/light/libxl_domain.c b/tools/libs/light/libxl_domain.c
index 37fcd92871..2d8290dbfa 100644
--- a/tools/libs/light/libxl_domain.c
+++ b/tools/libs/light/libxl_domain.c
@@ -2190,6 +2190,10 @@ int libxl_send_trigger(libxl_ctx *ctx, uint32_t domid,
     case LIBXL_TRIGGER_S3RESUME:
         domain_s3_resume(ao, egc, domid); /* must be last */
         return AO_INPROGRESS;
+    case LIBXL_TRIGGER_DEBUG:
+        rc = xc_domain_send_trigger(ctx->xch, domid,
+                                    XEN_DOMCTL_SENDTRIGGER_DEBUG, vcpuid);
+        break;
     default:
         rc = -1;
         errno = EINVAL;
diff --git a/tools/libs/light/libxl_types.idl b/tools/libs/light/libxl_types.idl
index a7893460f0..4d53beab0e 100644
--- a/tools/libs/light/libxl_types.idl
+++ b/tools/libs/light/libxl_types.idl
@@ -179,6 +179,7 @@ libxl_trigger = Enumeration("trigger", [
     (4, "INIT"),
     (5, "RESET"),
     (6, "S3RESUME"),
+    (7, "DEBUG"),
     ])
 
 libxl_tsc_mode = Enumeration("tsc_mode", [
diff --git a/tools/xl/xl_cmdtable.c b/tools/xl/xl_cmdtable.c
index 502244f683..e0594cd507 100644
--- a/tools/xl/xl_cmdtable.c
+++ b/tools/xl/xl_cmdtable.c
@@ -321,7 +321,7 @@ const struct cmd_spec cmd_table[] = {
     { "trigger",
       &main_trigger, 0, 1,
       "Send a trigger to a domain",
-      "<Domain> <nmi|reset|init|power|sleep|s3resume> [<VCPU>]",
+      "<Domain> <nmi|reset|init|power|sleep|s3resume|debug> [<VCPU>]",
     },
     { "sysrq",
       &main_sysrq, 0, 1,
-- 
2.55.0



-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.