Port-xen archive

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

Re: issues upgrading to 4.13



Hello,
it seems that this is due to a difference between linux and NetBSD poll
implementation. This causes sockets to never be closed on the xenstored
side, and instead loop ignoring the POLLIN event.

The attached patch fixes it for me, but I'm not sure at this
point if it's 100% correct. 

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--
--- xenstored_core.c.orig	2021-02-02 18:06:33.389316841 +0100
+++ xenstored_core.c	2021-02-02 19:27:43.761877371 +0100
@@ -397,9 +397,12 @@
 			     !list_empty(&conn->out_list)))
 				*ptimeout = 0;
 		} else {
-			short events = POLLIN|POLLPRI;
-			if (!list_empty(&conn->out_list))
-				events |= POLLOUT;
+			short events = 0;
+			if (!conn->is_ignored) {
+				events |= POLLIN|POLLPRI;
+			        if (!list_empty(&conn->out_list))
+				        events |= POLLOUT;
+			}
 			conn->pollfd_idx = set_fd(conn->fd, events);
 		}
 	}
@@ -1427,7 +1430,8 @@
 {
 	struct buffered_data *out, *tmp;
 
-	trace("CONN %p ignored\n", conn);
+	trace("CONN %p (fd %d) ignored %s\n", conn, conn->fd, strerror(errno));
+	log("CONN %p (fd %d) ignored %s\n", conn, conn->fd, strerror(errno));
 
 	conn->is_ignored = true;
 	conn_delete_all_watches(conn);
@@ -1561,6 +1565,8 @@
 
 bad_client:
 	ignore_connection(conn);
+	/* we don't want to keep this connection alive */
+	talloc_free(conn);
 }
 
 static void handle_output(struct connection *conn)


Home | Main Index | Thread Index | Old Index