]> xenbits.xensource.com Git - xen.git/commit
tools/xenstore: Don't assume conn->in points to the LU request
authorJulien Grall <jgrall@amazon.com>
Thu, 24 Jun 2021 08:06:58 +0000 (09:06 +0100)
committerJulien Grall <jgrall@amazon.com>
Thu, 24 Jun 2021 08:06:58 +0000 (09:06 +0100)
commit65f19ed62aa1efa75c0dfccbf5d0514daa85be18
treebb2fd78f4bdd0e2090a11241cd4960e5a78b8c5b
parent3ce271ef535cfe3c0839fdea56f33abf5fdbf23c
tools/xenstore: Don't assume conn->in points to the LU request

call_delayed() is currently assuming that conn->in is NULL when
handling delayed request. However, the connection is not paused.
Therefore new request can be processed and conn->in may be non-NULL
if we have only received a partial request.

Furthermore, as we overwrite conn->in, the current partial request
will not be transferred. This will result to corrupt the connection.

Rather than updating conn->in, stash the LU request in lu_status and
let each callback for delayed request to update conn->in when
necessary.

To keep a sane interface, the code to write the "OK" response the
LU request is moved in xenstored_core.c.

Fixes: c5ca1404b4 ("tools/xenstore: add support for delaying execution of a xenstore request")
Fixes: ed6eebf17d ("tools/xenstore: dump the xenstore state for live update")
Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
tools/xenstore/xenstored_control.c
tools/xenstore/xenstored_control.h
tools/xenstore/xenstored_core.c