Port-xen archive

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

Re: issues upgrading to 4.13



On Wed, Feb 03, 2021 at 01:06:56PM +0100, Matthias Petermann wrote:
> Hello Manuel,
> 
> Am 02.02.2021 um 19:39 schrieb Manuel Bouyer:
> > 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.
> 
> Thanks so much - this sounds good and I'm going to try this out right after
> work today!

Things are still in discussion with Xen - the new version of the
patch is attached. But it's possible that the first chunk will be dropped,
keeping only the patch to ignore_connection() (this is the one that
really matters).

-- 
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-03 12:46:17.204376338 +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);
 		}
 	}
@@ -1440,6 +1443,9 @@
 
 	talloc_free(conn->in);
 	conn->in = NULL;
+	/* if this is a socket connection, drop it now */
+	if (conn->fd >= 0)
+		talloc_free(conn);
 }
 
 static const char *sockmsg_string(enum xsd_sockmsg_type type)


Home | Main Index | Thread Index | Old Index