[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 08/11] Debugging machinery for synthesising POLLHUP



---
 tools/libxl/libxl_bootloader.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_bootloader.c b/tools/libxl/libxl_bootloader.c
index e103ee9..2e65383 100644
--- a/tools/libxl/libxl_bootloader.c
+++ b/tools/libxl/libxl_bootloader.c
@@ -447,6 +447,19 @@ static void bootloader_disk_attached_cb(libxl__egc *egc,
     bootloader_callback(egc, bl, rc);
 }
 
+static int tst_blfd;
+static void tst_sigh(int dummy) {
+    int r, e = errno;
+    int p[2];
+    write(2,"tst_sigh\n",9);
+    r = pipe(p);  assert(!r);
+    close(p[1]);
+if (getenv("TST_EXTRADUP")) dup(tst_blfd);
+    dup2(p[0], tst_blfd);
+    close(p[0]);
+    errno = e;
+}
+
 static void bootloader_gotptys(libxl__egc *egc, libxl__openpty_state *op)
 {
     libxl__bootloader_state *bl = CONTAINER_OF(op, *bl, openpty);
@@ -503,6 +516,9 @@ static void bootloader_gotptys(libxl__egc *egc, 
libxl__openpty_state *op)
     int bootloader_master = libxl__carefd_fd(bl->ptys[0].master);
     int xenconsole_master = libxl__carefd_fd(bl->ptys[1].master);
 
+tst_blfd = bootloader_master;
+signal(SIGUSR2,tst_sigh);
+
     libxl_fd_set_nonblock(CTX, bootloader_master, 1);
     libxl_fd_set_nonblock(CTX, xenconsole_master, 1);
 
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.