tools/xenstore: simplify xenstored main loop
authorJuergen Gross <jgross@suse.com>
Tue, 18 May 2021 06:19:07 +0000 (08:19 +0200)
committerJulien Grall <jgrall@amazon.com>
Tue, 18 May 2021 12:51:28 +0000 (13:51 +0100)
commitcaa9c4471d1d74b2d236467aaf7e63a806ac11a4
tree87c19c516dfca3d6e9f566e762a7219262c0248a
parent8b9890e1c0f5b35c199f40eb4e6cd0ce6c34829b
tools/xenstore: simplify xenstored main loop

The main loop of xenstored is rather complicated due to different
handling of socket and ring-page interfaces. Unify that handling by
introducing interface type specific functions can_read() and
can_write().

Take the opportunity to remove the empty list check before calling
write_messages() because the function is already able to cope with an
empty list.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
tools/xenstore/xenstored_core.c
tools/xenstore/xenstored_core.h
tools/xenstore/xenstored_domain.c