On 19/09/2017 14:53, Daniel P. Berrange wrote: >> + /* Try to reconnect while sending the CDB. */ >> + for (attempts = 0; attempts < PR_MAX_RECONNECT_ATTEMPTS; attempts++) { > > I'm curious why you need to loop here. The helper daemon should be running > already, as you're not spawning it on demand IIUC. So it shoudl either > succeed first time, or fail every time.
You're focusing on the usecase where the helper daemon is spawned per-VM by the system libvirtd, which I agree is the most important one. However, the other usecase is the one with a global daemon, access to which is controlled via Unix permissions. This is not SELinux-friendly, but it is nicer for testing and it is also the only possibility for user libvirtd. In that case, upgrading QEMU on the host could result in a "systemctl restart qemu-pr-helper.service" (or, hopefully unlikely, a crash could result in systemd respawning the daemon). Reconnect is useful in that case. Paolo