]> xenbits.xensource.com Git - xen.git/commit
xenstore: add small default data buffer to internal struct
authorJuergen Gross <jgross@suse.com>
Mon, 5 Dec 2016 07:48:52 +0000 (08:48 +0100)
committerWei Liu <wei.liu2@citrix.com>
Mon, 5 Dec 2016 11:32:39 +0000 (11:32 +0000)
commitcc0612464896e7ecf93dd9a52c4c4348fcf33d0e
treed161f744d1da3348fdf4b0d54ffefab4a54cddd5
parent197e26043e639d4ed1060d30f44f101b719a78d4
xenstore: add small default data buffer to internal struct

Instead of always allocating a data buffer for incoming or outgoing
xenstore wire data add a small buffer to the buffered_data structure
of xenstored. This has the advantage that especially sending simple
response messages like errors or "OK" will no longer need allocating
a data buffer. This requires adding a memory context where the
allocated buffer was used for that purpose.

In order to avoid allocating a new buffered_data structure for each
response reuse the structure of the original request. This in turn
will avoid any new memory allocations for sending e.g. an ENOMEM
response making it possible to send it at all. To do this the
allocation of the buffered_data structure for the incoming request
must be done when a new request is recognized instead of doing it
when accepting a new connect.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/xenstore/xenstored_core.c
tools/xenstore/xenstored_core.h
tools/xenstore/xenstored_domain.c
tools/xenstore/xenstored_transaction.c
tools/xenstore/xenstored_watch.c