提交 5acdb576 编写于 作者: G Guido Günther

Prefer xenstore driver for listDomains, since xen HV reports ghost ids of

already shutdown domains in some xen versions
上级 d88d459d
Fri Nov 28 16:16:54 CET 2008 Guido Günther <agx@sigxcpu.org>
Prefer xenstore driver for listDomains, since xen HV reports ghost ids
of already shutdown domains in some xen versions
* src/proxy_internal.c, src/proxy_internal.h: declare
xenProxyListDomains non static
* src/xend_internal.c, src/xend_internal.h: declare
xenDaemonListDomains non static
* src/xen_unified.c: prefer xenStoreListDomains over
xenHypervisorListDomains for xenUnifiedListDomains
Fri Nov 28 11:58:40 GMT 2008 Daniel P. Berrange <berrange@redhat.com>
Allow generic remote://hostname/ URI for automatic probe
......
......@@ -40,7 +40,6 @@ static int xenProxyOpen(virConnectPtr conn, virConnectAuthPtr auth, int flags);
static int xenProxyGetVersion(virConnectPtr conn, unsigned long *hvVer);
static int xenProxyNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info);
static char *xenProxyGetCapabilities(virConnectPtr conn);
static int xenProxyListDomains(virConnectPtr conn, int *ids, int maxids);
static int xenProxyNumOfDomains(virConnectPtr conn);
static unsigned long xenProxyDomainGetMaxMemory(virDomainPtr domain);
static int xenProxyDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info);
......@@ -566,7 +565,7 @@ xenProxyGetVersion(virConnectPtr conn, unsigned long *hvVer)
*
* Returns the number of domain found or -1 in case of error
*/
static int
int
xenProxyListDomains(virConnectPtr conn, int *ids, int maxids)
{
virProxyPacket req;
......
......@@ -94,4 +94,6 @@ extern virDomainPtr xenProxyLookupByName(virConnectPtr conn,
extern char * xenProxyDomainDumpXML(virDomainPtr domain,
int flags);
extern int xenProxyListDomains(virConnectPtr conn, int *ids,
int maxids);
#endif /* __LIBVIR_PROXY_H__ */
......@@ -516,14 +516,31 @@ static int
xenUnifiedListDomains (virConnectPtr conn, int *ids, int maxids)
{
GET_PRIVATE(conn);
int i, ret;
int ret;
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
if (priv->opened[i] && drivers[i]->listDomains) {
ret = drivers[i]->listDomains (conn, ids, maxids);
if (ret >= 0) return ret;
}
/* Try xenstore. */
if (priv->opened[XEN_UNIFIED_XS_OFFSET]) {
ret = xenStoreListDomains (conn, ids, maxids);
if (ret >= 0) return ret;
}
/* Try HV. */
if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET]) {
ret = xenHypervisorListDomains (conn, ids, maxids);
if (ret >= 0) return ret;
}
/* Try xend. */
if (priv->opened[XEN_UNIFIED_XEND_OFFSET]) {
ret = xenDaemonListDomains (conn, ids, maxids);
if (ret >= 0) return ret;
}
/* Try proxy. */
if (priv->opened[XEN_UNIFIED_PROXY_OFFSET]) {
ret = xenProxyListDomains (conn, ids, maxids);
if (ret >= 0) return ret;
}
return -1;
}
......
......@@ -3411,7 +3411,7 @@ xenDaemonGetVersion(virConnectPtr conn, unsigned long *hvVer)
*
* Returns the number of domain found or -1 in case of error
*/
static int
int
xenDaemonListDomains(virConnectPtr conn, int *ids, int maxids)
{
struct sexpr *root = NULL;
......
......@@ -179,5 +179,6 @@ int xenDaemonDomainMigratePrepare (virConnectPtr dconn, char **cookie, int *cook
int xenDaemonDomainMigratePerform (virDomainPtr domain, const char *cookie, int cookielen, const char *uri, unsigned long flags, const char *dname, unsigned long resource);
int xenDaemonDomainBlockPeek (virDomainPtr domain, const char *path, unsigned long long offset, size_t size, void *buffer);
int xenDaemonListDomains(virConnectPtr conn, int *ids, int maxids);
#endif /* __XEND_INTERNAL_H_ */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册