2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-24 13:13:57 +08:00
linux-next/drivers/xen/xenbus
Konrad Rzeszutek Wilk 027bd7e899 xen/xenbus: Avoid synchronous wait on XenBus stalling shutdown/restart.
The 'read_reply' works with 'process_msg' to read of a reply in XenBus.
'process_msg' is running from within the 'xenbus' thread. Whenever
a message shows up in XenBus it is put on a xs_state.reply_list list
and 'read_reply' picks it up.

The problem is if the backend domain or the xenstored process is killed.
In which case 'xenbus' is still awaiting - and 'read_reply' if called -
stuck forever waiting for the reply_list to have some contents.

This is normally not a problem - as the backend domain can come back
or the xenstored process can be restarted. However if the domain
is in process of being powered off/restarted/halted - there is no
point of waiting on it coming back - as we are effectively being
terminated and should not impede the progress.

This patch solves this problem by checking whether the guest is the
right domain. If it is an initial domain and hurtling towards death -
there is no point of continuing the wait. All other type of guests
continue with their behavior (as Xenstore is expected to still be
running in another domain).

Fixes-Bug: http://bugs.xenproject.org/xen/bug/8
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
2014-04-15 17:41:28 +01:00
..
Makefile xen: Add xenbus_backend device 2011-12-16 13:29:41 -05:00
xenbus_client.c xen/xenbus: remove unused xenbus_bind_evtchn() 2014-02-28 15:26:23 -05:00
xenbus_comms.c xen: Convert printks to pr_<level> 2013-06-28 11:19:58 -04:00
xenbus_comms.h xenbus: save xenstore local status for later use 2013-05-29 09:04:20 -04:00
xenbus_dev_backend.c xen: Convert printks to pr_<level> 2013-06-28 11:19:58 -04:00
xenbus_dev_frontend.c xen: Convert printks to pr_<level> 2013-06-28 11:19:58 -04:00
xenbus_probe_backend.c xenbus: convert bus code to use dev_groups 2013-10-16 18:36:03 -07:00
xenbus_probe_frontend.c xen/pvhvm: If xen_platform_pci=0 is set don't blow up (v4). 2014-01-03 14:54:18 -05:00
xenbus_probe.c xenbus: convert bus code to use dev_groups 2013-10-16 18:36:03 -07:00
xenbus_probe.h xenbus: convert bus code to use dev_groups 2013-10-16 18:36:03 -07:00
xenbus_xs.c xen/xenbus: Avoid synchronous wait on XenBus stalling shutdown/restart. 2014-04-15 17:41:28 +01:00