CA-35893: add delay to the VM.hard_shutdown retry loop.
CA-35893: add delay to the VM.hard_shutdown retry loop.

When performing a VM.hard_shutdown we initially call Xc.domain_shutdown Halt and then later check the domain actually has shutdown. If the domain is running we assume that something like a reboot has happened in between and we retry.

It turns out that there's sometimes a delay between calling Xc.domain_shutdown and Xc.domain_getinfo reporting a shutdown domain: paper over this crack with the retry loop.

Ideally in future we'd look for domid changes => reboots but this requires a bit more refactoring to remember the old domid.

Signed-off-by: David Scott <63c9eb0ea83039690fefa11afe17873ba8278a56@eu.citrix.com>

koushikcgit/xcp-networkd,koushikcgit/xcp-rrdd,sharady/xcp-networkd,johnelse/xcp-rrdd,johnelse/xcp-rrdd,djs55/xcp-networkd,koushikcgit/xcp-rrdd,djs55/squeezed,koushikcgit/xcp-networkd,sharady/xcp-networkd,robhoes/squeezed,simonjbeaumont/xcp-rrdd,djs55/xcp-rrdd,djs55/xcp-rrdd,djs55/xcp-networkd,simonjbeaumont/xcp-rrdd,koushikcgit/xcp-rrdd