systemd: add wait_for_unit_removed
And split out the common code into a systemd_call() sub.
This connects to the systemd bus and waits for a UnitRemoved
event to occur for the specified unit, with an optional
timeout.
We'll use this in qemu-server to wait for a VM's scope to
disappear completely before trying to start a VM's scope
anew.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
(cherry picked from commit
b8d15bfd69ea6aa3ddcce9ffb496e3d52a509f31)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>