diff --git a/sys/dev/xen/control/control.c b/sys/dev/xen/control/control.c index d4249886332b..d5aa97e03b73 100644 --- a/sys/dev/xen/control/control.c +++ b/sys/dev/xen/control/control.c @@ -199,7 +199,9 @@ xctrl_suspend() #endif EVENTHANDLER_INVOKE(power_suspend_early); + xs_lock(); stop_all_proc(); + xs_unlock(); EVENTHANDLER_INVOKE(power_suspend); #ifdef EARLY_AP_STARTUP diff --git a/sys/dev/xen/xenstore/xenstore.c b/sys/dev/xen/xenstore/xenstore.c index 4f89b7457d0e..9289adfc1a79 100644 --- a/sys/dev/xen/xenstore/xenstore.c +++ b/sys/dev/xen/xenstore/xenstore.c @@ -1699,3 +1699,20 @@ xs_unregister_watch(struct xs_watch *watch) 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; +} + diff --git a/sys/xen/xenstore/xenstorevar.h b/sys/xen/xenstore/xenstorevar.h index 208e5bf09b8e..4c612b4b6881 100644 --- a/sys/xen/xenstore/xenstorevar.h +++ b/sys/xen/xenstore/xenstorevar.h @@ -338,4 +338,15 @@ void xs_unregister_watch(struct xs_watch *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 */ +