CA-222974: PVS-proxy: Add module to track the state of local proxies
CA-222974: PVS-proxy: Add module to track the state of local proxies

This module maintains a record in xenstore about whether a given proxy is
running on the host, or about to be running or stopped.

The immediate purpose for this is to solve a race condition that occurs when
multiple proxied VMs are started up at the same time. The
`update_site_on_localhost` function currently sends a `configure_site` command
to the proxy daemon, for all proxies that are running based on the
currently_attached field, plus the newly started proxy. This is racy, because
the currently_attached field is set quite late.

This new module allow us to define a proxy as "starting up" before calling
`update_site_on_localhost`, and have `update_site_on_localhost` take all such
proxies into account (as well as the running ones). This is done in the
following patches.

For this purpose, we could have maintained the state in memory, but then we'd
have to somehow rebuild it if xapi restarts (which can be any time). Also, we'd
like to make these records available to the setup-pvs-proxy-rules script to
solve another issue.

Signed-off-by: Rob Hoes <8783b3376fb07d39edffc8d7da68a6de3874a7e6@citrix.com>

euanh/xen-api,srowe/xen-api,Frezzle/xen-api,euanh/xen-api,euanh/xen-api,thomassa/xen-api,srowe/xen-api,euanh/xen-api,thomassa/xen-api,srowe/xen-api,euanh/xen-api,Frezzle/xen-api,Frezzle/xen-api,thomassa/xen-api,Frezzle/xen-api,thomassa/xen-api,Frezzle/xen-api,srowe/xen-api,thomassa/xen-api,srowe/xen-api,euanh/xen-api,thomassa/xen-api