The test needs a real QEMU connection as this feature is not supported
by the test driver. Also, the documentation mentions the return code is
-1 for generic errors and 1 if the remote end doesn't support
keepalives. However, a quick test shows that the test backend will just
return -1. virsh is just testing if the return code is different of
Therefore, it seems safer to trigger an error if return code != 0.
The test needs a real QEMU connection as this feature is not supported by the test driver. Also, the documentation mentions the return code is -1 for generic errors and 1 if the remote end doesn't support keepalives. However, a quick test shows that the test backend will just return -1. virsh is just testing if the return code is different of