svn commit: r315667 - in stable/11/sys: dev/xen/control dev/xen/xenstore xen/xenstore
Roger Pau Monné
royger at FreeBSD.org
Tue Mar 21 08:36:27 UTC 2017
Author: royger
Date: Tue Mar 21 08:36:25 2017
New Revision: 315667
URL: https://svnweb.freebsd.org/changeset/base/315667
Log:
MFC r314841:
xenstore: fix suspension when using the xenstore device
Submitted by: Liuyingdong <liuyingdong at huawei.com>
Reviewed by: royger
Modified:
stable/11/sys/dev/xen/control/control.c
stable/11/sys/dev/xen/xenstore/xenstore.c
stable/11/sys/xen/xenstore/xenstorevar.h
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/dev/xen/control/control.c
==============================================================================
--- stable/11/sys/dev/xen/control/control.c Tue Mar 21 08:34:41 2017 (r315666)
+++ stable/11/sys/dev/xen/control/control.c Tue Mar 21 08:36:25 2017 (r315667)
@@ -199,7 +199,9 @@ xctrl_suspend()
int suspend_cancelled;
EVENTHANDLER_INVOKE(power_suspend_early);
+ xs_lock();
stop_all_proc();
+ xs_unlock();
EVENTHANDLER_INVOKE(power_suspend);
#ifdef EARLY_AP_STARTUP
Modified: stable/11/sys/dev/xen/xenstore/xenstore.c
==============================================================================
--- stable/11/sys/dev/xen/xenstore/xenstore.c Tue Mar 21 08:34:41 2017 (r315666)
+++ stable/11/sys/dev/xen/xenstore/xenstore.c Tue Mar 21 08:36:25 2017 (r315667)
@@ -1699,3 +1699,20 @@ xs_unregister_watch(struct xs_watch *wat
sx_xunlock(&xs.xenwatch_mutex);
}
}
+
+void
+xs_lock(void)
+{
+
+ sx_xlock(&xs.request_mutex);
+ return;
+}
+
+void
+xs_unlock(void)
+{
+
+ sx_xunlock(&xs.request_mutex);
+ return;
+}
+
Modified: stable/11/sys/xen/xenstore/xenstorevar.h
==============================================================================
--- stable/11/sys/xen/xenstore/xenstorevar.h Tue Mar 21 08:34:41 2017 (r315666)
+++ stable/11/sys/xen/xenstore/xenstorevar.h Tue Mar 21 08:36:25 2017 (r315667)
@@ -338,4 +338,15 @@ void xs_unregister_watch(struct xs_watch
*/
struct sbuf *xs_join(const char *, const char *);
+/**
+ * Lock the xenstore request mutex.
+ */
+void xs_lock(void);
+
+/**
+ * Unlock the xenstore request mutex.
+ */
+void xs_unlock(void);
+
#endif /* _XEN_XENSTORE_XENSTOREVAR_H */
+
More information about the svn-src-stable
mailing list