tools/xenstored: Limit the number of requests a connection can delay
authorJulien Grall <jgrall@amazon.com>
Thu, 24 Jun 2021 08:07:30 +0000 (09:07 +0100)
committerJulien Grall <jgrall@amazon.com>
Thu, 24 Jun 2021 08:07:30 +0000 (09:07 +0100)
commit2aa9e00bd3d0431fc99d4baaee2cddbf40bbee61
treeb3ca837744deadbf0c38a58acca704e2ac7f6568
parent65f19ed62aa1efa75c0dfccbf5d0514daa85be18
tools/xenstored: Limit the number of requests a connection can delay

Currently, only liveupdate request can be delayed. The request can only
be performed by a privileged connection (e.g. dom0). So it is fine to
have no limits.

In a follow-up patch we will want to delay request for unprivileged
connection as well. So it is best to apply a limit.

For now and for simplicity, only a single request can be delayed
for a given unprivileged connection.

Take the opportunity to tweak the prototype and provide a way to
bypass the quota check. This would be useful when the function
is called from the restore code.

Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
tools/xenstore/xenstored_control.c
tools/xenstore/xenstored_core.c
tools/xenstore/xenstored_core.h