From: Tristan Gingold <tgingold@free.fr>
To: xen-devel@lists.xensource.com,
Xen-ia64-devel <xen-ia64-devel@lists.xensource.com>,
Alex Williamson <alex.williamson@hp.com>
Subject: PATCH: add xc_domain_setdebugging in xenctrl API
Date: Sat, 23 Jun 2007 19:04:16 +0200 [thread overview]
Message-ID: <20070623170416.GA5455@saphi> (raw)
[-- Attachment #1: Type: text/plain, Size: 436 bytes --]
Hi,
for ia64, I'd like to add xc_domain_setdebugging() in the xenctrl API.
This patch implements it and modifies xc_ptrace.c to use it.
The rationnal is enabling debugging tool not based on the ptrace API.
The ptrace API is based on Linux ptrace which (at least on ia64) doesn't
have many privilegied registers.
I'd prefer this patch being integrated on xen-ia64-unstable tree but we
need the OK from non-ia64 maintainers.
Tristan.
[-- Attachment #2: setdeb.diff --]
[-- Type: text/plain, Size: 2941 bytes --]
# HG changeset patch
# User Tristan Gingold <tgingold@free.fr>
# Date 1182617932 -7200
# Node ID 675ccf45dc630166ad374023e119a68c48918088
# Parent 8a6a6d4afcb31c24ee87a5d30bebec41e8d38126
Add xc_domain_setdebugging in the xenctrl API.
Use it in xc_ptrace.c
Signed-off-by: Tristan Gingold <tgingold@free.fr>
diff -r 8a6a6d4afcb3 -r 675ccf45dc63 tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c Fri Jun 22 11:48:49 2007 -0600
+++ b/tools/libxc/xc_domain.c Sat Jun 23 18:58:52 2007 +0200
@@ -696,6 +696,18 @@ int xc_get_hvm_param(int handle, domid_t
return rc;
}
+int xc_domain_setdebugging(int xc_handle,
+ uint32_t domid,
+ unsigned int enable)
+{
+ DECLARE_DOMCTL;
+
+ domctl.cmd = XEN_DOMCTL_setdebugging;
+ domctl.domain = domid;
+ domctl.u.setdebugging.enable = enable;
+ return do_domctl(xc_handle, &domctl);
+}
+
/*
* Local variables:
* mode: C
diff -r 8a6a6d4afcb3 -r 675ccf45dc63 tools/libxc/xc_ptrace.c
--- a/tools/libxc/xc_ptrace.c Fri Jun 22 11:48:49 2007 -0600
+++ b/tools/libxc/xc_ptrace.c Sat Jun 23 18:58:52 2007 +0200
@@ -566,10 +566,7 @@ xc_ptrace(
}
if ( request == PTRACE_DETACH )
{
- domctl.cmd = XEN_DOMCTL_setdebugging;
- domctl.domain = current_domid;
- domctl.u.setdebugging.enable = 0;
- if ((retval = do_domctl(xc_handle, &domctl)))
+ if ((retval = xc_domain_setdebugging(xc_handle, current_domid, 0)))
goto out_error_domctl;
}
regs_valid = 0;
@@ -593,10 +590,7 @@ xc_ptrace(
else if ((retval = xc_domain_pause(xc_handle, current_domid)))
goto out_error_domctl;
current_is_hvm = !!(domctl.u.getdomaininfo.flags&XEN_DOMINF_hvm_guest);
- domctl.cmd = XEN_DOMCTL_setdebugging;
- domctl.domain = current_domid;
- domctl.u.setdebugging.enable = 1;
- if ((retval = do_domctl(xc_handle, &domctl)))
+ if ((retval = xc_domain_setdebugging(xc_handle, current_domid, 1)))
goto out_error_domctl;
if (get_online_cpumap(xc_handle, &domctl.u.getdomaininfo, &cpumap))
diff -r 8a6a6d4afcb3 -r 675ccf45dc63 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h Fri Jun 22 11:48:49 2007 -0600
+++ b/tools/libxc/xenctrl.h Sat Jun 23 18:58:52 2007 +0200
@@ -433,6 +433,18 @@ int xc_domain_send_trigger(int xc_handle
uint32_t trigger,
uint32_t vcpu);
+/**
+ * This function enables or disable debugging of a domain.
+ *
+ * @parm xc_handle a handle to an open hypervisor interface
+ * @parm domid the domain id to send trigger
+ * @parm enable true to enable debugging
+ * return 0 on success, -1 on failure
+ */
+int xc_domain_setdebugging(int xc_handle,
+ uint32_t domid,
+ unsigned int enable);
+
/*
* EVENT CHANNEL FUNCTIONS
*/
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next reply other threads:[~2007-06-23 17:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-23 17:04 Tristan Gingold [this message]
2007-06-23 17:04 ` PATCH: add xc_domain_setdebugging in xenctrl API Keir Fraser
2007-07-02 18:13 ` Alex Williamson
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=20070623170416.GA5455@saphi \
--to=tgingold@free.fr \
--cc=alex.williamson@hp.com \
--cc=xen-devel@lists.xensource.com \
--cc=xen-ia64-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.