remote_driver: don't fail if keepalive check fails
This fixes remote connections to older libvirt versions.
Guido Günther
12 years ago
0 | From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org> | |
1 | Date: Sun, 4 Dec 2011 15:26:23 +0100 | |
2 | Subject: remote_driver: don't fail if keepalive check fails | |
3 | ||
4 | Otherwise connections to older libvirt abort with: | |
5 | ||
6 | $ virsh -c qemu+ssh://host.example.com/system list | |
7 | error: invalid connection pointer in virDrvSupportsFeature | |
8 | error: failed to connect to the hypervisor | |
9 | ||
10 | Tested against 0.8.3 and 0.9.8-rc2. | |
11 | --- | |
12 | src/remote/remote_driver.c | 4 +--- | |
13 | 1 files changed, 1 insertions(+), 3 deletions(-) | |
14 | ||
15 | diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c | |
16 | index 556c90c..1fb0eca 100644 | |
17 | --- a/src/remote/remote_driver.c | |
18 | +++ b/src/remote/remote_driver.c | |
19 | @@ -678,10 +678,8 @@ doRemoteOpen (virConnectPtr conn, | |
20 | rc = call(conn, priv, 0, REMOTE_PROC_SUPPORTS_FEATURE, | |
21 | (xdrproc_t)xdr_remote_supports_feature_args, (char *) &args, | |
22 | (xdrproc_t)xdr_remote_supports_feature_ret, (char *) &ret); | |
23 | - if (rc == -1) | |
24 | - goto failed; | |
25 | ||
26 | - if (ret.supported) { | |
27 | + if (rc != -1 && ret.supported) { | |
28 | priv->serverKeepAlive = true; | |
29 | } else { | |
30 | VIR_INFO("Disabling keepalive protocol since it is not supported" |