aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2006-06-12 22:21:04 +0000
committerDaniel P. Berrange <berrange@redhat.com>2006-06-12 22:21:04 +0000
commit1213bedf6d9953b9d4fb5e40ac95bbc435cd3e89 (patch)
tree0f767d3e26ce51b2c16b33b4d785fe4e9b8a95a6 /src
parentAdded 'mock' hypervisor driver for use by unit tests (diff)
downloadlibvirt-1213bedf6d9953b9d4fb5e40ac95bbc435cd3e89.tar.gz
libvirt-1213bedf6d9953b9d4fb5e40ac95bbc435cd3e89.tar.bz2
libvirt-1213bedf6d9953b9d4fb5e40ac95bbc435cd3e89.zip
Do a 'ping' test when opening connection to verify XenD really is there & alive
Diffstat (limited to 'src')
-rw-r--r--src/xend_internal.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/xend_internal.c b/src/xend_internal.c
index 64cd72edd..37e5934f1 100644
--- a/src/xend_internal.c
+++ b/src/xend_internal.c
@@ -1651,6 +1651,7 @@ xenDaemonOpen(virConnectPtr conn, const char *name, int flags)
{
xmlURIPtr uri;
int ret;
+ unsigned long version;
if (name == NULL) {
name = "http://localhost:8000/";
@@ -1663,8 +1664,17 @@ xenDaemonOpen(virConnectPtr conn, const char *name, int flags)
}
xmlFreeURI(uri);
-
- return (xenDaemonOpen_tcp(conn, "localhost", 8000));
+
+ ret = xenDaemonOpen_tcp(conn, "localhost", 8000);
+ if (ret < 0) {
+ return ret;
+ }
+
+ /* A sort of "ping" to make sure the daemon is actually
+ alive & well, rather than just assuming it is */
+ if ((ret = xenDaemonGetVersion(conn, &version)) < 0) {
+ return ret;
+ }
/* return(xenDaemonOpen_unix(conn, "/var/lib/xend/xend-socket")); */