CA-200924: Avoid premature cache invalidation
CA-200924: Avoid premature cache invalidation

The 2 caches (xapi and xenopsd) should be populated whenever there
is metadata in xenopsd. This fix populates it at start-of-day
by asking xenopsd which VMs it knows about, and prevents premature
removal of the caches. Previously the 'maybe_cleanup_vm' function
was removing the caches whether or not it managed to cleanup the
VM from xenopsd.

The caches are now removed in only one place - when the VM metadata
is removed from xenopsd.

Signed-off-by: Jon Ludlam <e7e3380887a8f95cc9dc4f0d51dedc7e849a287a@citrix.com>

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