提交 1213bedf 编写于 作者: D Daniel P. Berrange

Do a 'ping' test when opening connection to verify XenD really is there & alive

上级 e5bb0cb0
Mon Jun 12 17:22:24 EDT 2006 Daniel P. Berrange <berrange@redhat.com>
* src/xend_internal.c: Call 'xenDomainGetVersion' when trying
to open a connection, as a sort of "ping" test to verify the
Xen daemon connection - fail the open method, if the "ping" is
not successful.
Mon Jun 05 22:31:20 EDT 2006 Daniel P. Berrange <berrange@redhat.com> Mon Jun 05 22:31:20 EDT 2006 Daniel P. Berrange <berrange@redhat.com>
* src/test.c, src/test.h: New 'mock' hypervisor driver providing * src/test.c, src/test.h: New 'mock' hypervisor driver providing
......
...@@ -1651,6 +1651,7 @@ xenDaemonOpen(virConnectPtr conn, const char *name, int flags) ...@@ -1651,6 +1651,7 @@ xenDaemonOpen(virConnectPtr conn, const char *name, int flags)
{ {
xmlURIPtr uri; xmlURIPtr uri;
int ret; int ret;
unsigned long version;
if (name == NULL) { if (name == NULL) {
name = "http://localhost:8000/"; name = "http://localhost:8000/";
...@@ -1663,8 +1664,17 @@ xenDaemonOpen(virConnectPtr conn, const char *name, int flags) ...@@ -1663,8 +1664,17 @@ xenDaemonOpen(virConnectPtr conn, const char *name, int flags)
} }
xmlFreeURI(uri); 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")); */ /* return(xenDaemonOpen_unix(conn, "/var/lib/xend/xend-socket")); */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册