Skip to contentSkip to conversation

Removing libxc xc_ptrace interface

RFC New Ian Campbell 1 participant 2 messages Aug 13, 2010 Arm/actions semi architecture

lore
Share & tools
lore
#0 lore raw

The last in-tree user of the xc_ptrace functionality was removed in

        changeset:   21732:eb34666befcc
        user:        Ian Jackson <[email protected]>
        date:        Fri Jul 02 17:46:01 2010 +0100
        files:       [...]

description:
tools/debugger/gdb: Remove gdb

This code is not maintained, does not work properly, and no-one is using it. Delete it, following discussion on xen-devel.

and has now been replaced with gdbsx.

We are having trouble tracking down all of the contributors to the ptrace code in libxc (as part of the effort to relicense libxc under the LGPL, see [0] or [1]) and if this functionality is no longer required it would be simplest to remove it. I will follow up shortly with a patch to disable the build by default and the code will be removed shortly unless anyone objects. If you have an out-of-tree project which is using this functionality (specifically the functions xc_register_event_handler() xc_ptrace() and xc_waitdomain()) then please tell us ASAP.

Ian.

[0] http://blog.xen.org/index.php/2010/07/26/xen-org-source-code-license-change-request/
[1] http://lists.xensource.com/archives/html/xen-devel/2010-07/msg01378.html

#1 lore raw

PATCH 1/1 libxc: disable xc_ptrace on x86 Linux

# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1281703976 -3600
# Node ID 38b000b7f5e41d92d7e46c2cb637ff216ffbf596 # Parent 1f00eaccf6ec579b63db199f764b229097b3c5cf
libxc: disable xc_ptrace on x86 Linux

It has been unused since 21732:eb34666befcc.

Removing the include of sys/ptrace.h and threaddb.h exposed a few places which were using time(2) or gettimeofday(2) without including time.h or sys/time.h respectively and were relying on an include.

tools/console/daemon/io.c +1 -1
diff -r 1f00eaccf6ec -r 38b000b7f5e4 tools/console/daemon/io.c
@@ -34,7 +34,7 @@
 #include <termios.h>
 #include <stdarg.h>
 #include <sys/mman.h>
-#include <sys/time.h>
+#include <time.h>
 #include <assert.h>
 #if defined(__NetBSD__) || defined(__OpenBSD__)
 #include <util.h>
tools/libxc/Makefile +1 -1
diff -r 1f00eaccf6ec -r 38b000b7f5e4 tools/libxc/Makefile
@@ -32,7 +32,7 @@ CTRL_SRCS-y       += xtl_logger_stdio.c
 CTRL_SRCS-$(CONFIG_X86) += xc_pagetab.c
 CTRL_SRCS-$(CONFIG_Linux) += xc_linux.c
 CTRL_SRCS-$(CONFIG_SunOS) += xc_solaris.c
-CTRL_SRCS-$(CONFIG_X86_Linux) += xc_ptrace.c xc_ptrace_core.c
+#CTRL_SRCS-$(CONFIG_X86_Linux) += xc_ptrace.c xc_ptrace_core.c
 CTRL_SRCS-$(CONFIG_NetBSD) += xc_netbsd.c
 CTRL_SRCS-$(CONFIG_MiniOS) += xc_minios.c
 
tools/libxc/xc_ptrace.h +2 -0
diff -r 1f00eaccf6ec -r 38b000b7f5e4 tools/libxc/xc_ptrace.h
@@ -1,3 +1,5 @@
+#error xc_ptrace is disabled.
+
 #ifndef XC_PTRACE_
 #define XC_PTRACE_
 
tools/libxc/xenctrl.h +1 -1
diff -r 1f00eaccf6ec -r 38b000b7f5e4 tools/libxc/xenctrl.h
@@ -150,7 +150,7 @@ typedef struct xc_core_header {
 #define XC_CORE_MAGIC     0xF00FEBED
 #define XC_CORE_MAGIC_HVM 0xF00FEBEE
 
-#ifdef __linux__
+#if 0 /*def __linux__*/
 
 #include <sys/ptrace.h>
 #include <thread_db.h>
tools/libxl/libxl.c +1 -0
diff -r 1f00eaccf6ec -r 38b000b7f5e4 tools/libxl/libxl.c
@@ -25,6 +25,7 @@
 #include <sys/select.h>
 #include <sys/mman.h>
 #include <sys/wait.h>
+#include <sys/time.h>
 #include <signal.h>
 #include <unistd.h> /* for write, unlink and close */
 #include <stdint.h>
tools/libxl/xl.c +1 -1
diff -r 1f00eaccf6ec -r 38b000b7f5e4 tools/libxl/xl.c
@@ -20,7 +20,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <sys/time.h> /* for time */
+#include <time.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
tools/libxl/xl_cmdimpl.c +2 -1
diff -r 1f00eaccf6ec -r 38b000b7f5e4 tools/libxl/xl_cmdimpl.c
@@ -21,10 +21,11 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <sys/time.h> /* for time */
+#include <time.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <sys/time.h>
 #include <fcntl.h>
 #include <signal.h>
 #include <sys/socket.h>
tools/python/xen/lowlevel/checkpoint/libcheckpoint.c +1 -1
diff -r 1f00eaccf6ec -r 38b000b7f5e4 tools/python/xen/lowlevel/checkpoint/libcheckpoint.c
@@ -4,7 +4,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <time.h>
+#include <sys/time.h>
 #include <signal.h>
 #include <sys/stat.h>
 #include <unistd.h>
tools/xenpaging/xenpaging.c +1 -0
diff -r 1f00eaccf6ec -r 38b000b7f5e4 tools/xenpaging/xenpaging.c
@@ -23,6 +23,7 @@
 #include <inttypes.h>
 #include <stdlib.h>
 #include <stdarg.h>
+#include <time.h>
 #include <xc_private.h>
 
 #include <xen/mem_event.h>