moved from pve-storage, we need to reuse it in another module there,
as it's a general method lets just move it here already.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
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>