WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] libxc: Add xc_domain_setdebugging in xenc

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxc: Add xc_domain_setdebugging in xenctrl API
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 27 Jul 2007 02:49:18 -0700
Delivery-date: Fri, 27 Jul 2007 02:47:19 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Alex Williamson <alex.williamson@xxxxxx>
# Date 1182896308 21600
# Node ID 2a7339251e4db9fda18c249651d958d651906a69
# Parent  8a6a6d4afcb31c24ee87a5d30bebec41e8d38126
libxc: Add xc_domain_setdebugging in xenctrl API

Use it in xc_ptrace.c

Signed-off-by: Tristan Gingold <tgingold@xxxxxxx>
Acked-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 tools/libxc/xc_domain.c |   12 ++++++++++++
 tools/libxc/xc_ptrace.c |   10 ++--------
 tools/libxc/xenctrl.h   |   12 ++++++++++++
 3 files changed, 26 insertions(+), 8 deletions(-)

diff -r 8a6a6d4afcb3 -r 2a7339251e4d 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   Tue Jun 26 16:18:28 2007 -0600
@@ -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 2a7339251e4d 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   Tue Jun 26 16:18:28 2007 -0600
@@ -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 2a7339251e4d tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h     Fri Jun 22 11:48:49 2007 -0600
+++ b/tools/libxc/xenctrl.h     Tue Jun 26 16:18:28 2007 -0600
@@ -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
  */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] libxc: Add xc_domain_setdebugging in xenctrl API, Xen patchbot-unstable <=