[libvirt] [PATCH] util: make it more robust to calculate timeout value