svn commit: r361580 - head/sys/dev/xen/control

Roger Pau Monné royger at FreeBSD.org
Thu May 28 08:20:17 UTC 2020


Author: royger
Date: Thu May 28 08:20:16 2020
New Revision: 361580
URL: https://svnweb.freebsd.org/changeset/base/361580

Log:
  xen/control: short circuit xctrl_on_watch_event on spurious event
  
  If there's no data to read from xenstore short-circuit
  xctrl_on_watch_event to return early, there's no reason to continue
  since the lack of data would prevent matching against any known event
  type.
  
  Sponsored by:	Citrix Systems R&D
  MFC with:	r352925
  MFC after:	1 week

Modified:
  head/sys/dev/xen/control/control.c

Modified: head/sys/dev/xen/control/control.c
==============================================================================
--- head/sys/dev/xen/control/control.c	Thu May 28 08:19:13 2020	(r361579)
+++ head/sys/dev/xen/control/control.c	Thu May 28 08:20:16 2020	(r361580)
@@ -360,7 +360,7 @@ xctrl_on_watch_event(struct xs_watch *watch, const cha
 	
 	error = xs_read(XST_NIL, "control", "shutdown",
 			&result_len, (void **)&result);
-	if (error != 0)
+	if (error != 0 || result_len == 0)
 		return;
 
 	/* Acknowledge the request by writing back an empty string. */


More information about the svn-src-all mailing list