data->keepalive_count = 5;
data->keepalive_required = 0;
- localhost = virGetHostname(NULL);
+ localhost = virGetHostname();
if (localhost == NULL) {
/* we couldn't resolve the hostname; assume that we are
* running in disconnected operation, and report a less
# External impls
next if $prefix eq "node";
- next if $prefix eq "vir";
if (defined $mainprefix) {
if ($mainprefix ne $prefix) {
return 0;
}
+
+static char *libxlConnectGetHostname(virConnectPtr conn ATTRIBUTE_UNUSED)
+{
+ return virGetHostname();
+}
+
+
static int
libxlConnectGetMaxVcpus(virConnectPtr conn, const char *type ATTRIBUTE_UNUSED)
{
.connectClose = libxlConnectClose, /* 0.9.0 */
.connectGetType = libxlConnectGetType, /* 0.9.0 */
.connectGetVersion = libxlConnectGetVersion, /* 0.9.0 */
- .connectGetHostname = virGetHostname, /* 0.9.0 */
+ .connectGetHostname = libxlConnectGetHostname, /* 0.9.0 */
.connectGetMaxVcpus = libxlConnectGetMaxVcpus, /* 0.9.0 */
.nodeGetInfo = libxlNodeGetInfo, /* 0.9.0 */
.connectGetCapabilities = libxlConnectGetCapabilities, /* 0.9.0 */
}
+static char *lxcConnectGetHostname(virConnectPtr conn ATTRIBUTE_UNUSED)
+{
+ return virGetHostname();
+}
+
+
+
/*
* check whether the host supports CFS bandwidth
*
.connectOpen = lxcConnectOpen, /* 0.4.2 */
.connectClose = lxcConnectClose, /* 0.4.2 */
.connectGetVersion = lxcConnectGetVersion, /* 0.4.6 */
- .connectGetHostname = virGetHostname, /* 0.6.3 */
+ .connectGetHostname = lxcConnectGetHostname, /* 0.6.3 */
.connectGetSysinfo = lxcConnectGetSysinfo, /* 1.0.5 */
.nodeGetInfo = nodeGetInfo, /* 0.6.5 */
.connectGetCapabilities = lxcConnectGetCapabilities, /* 0.6.5 */
return 0;
}
+
+static char *openvzConnectGetHostname(virConnectPtr conn ATTRIBUTE_UNUSED)
+{
+ return virGetHostname();
+}
+
+
static char *openvzDomainGetOSType(virDomainPtr dom)
{
struct openvz_driver *driver = dom->conn->privateData;
.connectClose = openvzConnectClose, /* 0.3.1 */
.connectGetType = openvzConnectGetType, /* 0.3.1 */
.connectGetVersion = openvzConnectGetVersion, /* 0.5.0 */
- .connectGetHostname = virGetHostname, /* 0.9.12 */
+ .connectGetHostname = openvzConnectGetHostname, /* 0.9.12 */
.connectGetMaxVcpus = openvzConnectGetMaxVcpus, /* 0.4.6 */
.nodeGetInfo = nodeGetInfo, /* 0.3.2 */
.nodeGetCPUStats = nodeGetCPUStats, /* 0.9.12 */
return ret;
}
+
+static char *parallelsConnectGetHostname(virConnectPtr conn ATTRIBUTE_UNUSED)
+{
+ return virGetHostname();
+}
+
+
static int
parallelsConnectListDomains(virConnectPtr conn, int *ids, int maxids)
{
.connectOpen = parallelsConnectOpen, /* 0.10.0 */
.connectClose = parallelsConnectClose, /* 0.10.0 */
.connectGetVersion = parallelsConnectGetVersion, /* 0.10.0 */
- .connectGetHostname = virGetHostname, /* 0.10.0 */
+ .connectGetHostname = parallelsConnectGetHostname, /* 0.10.0 */
.nodeGetInfo = nodeGetInfo, /* 0.10.0 */
.connectGetCapabilities = parallelsConnectGetCapabilities, /* 0.10.0 */
.connectListDomains = parallelsConnectListDomains, /* 0.10.0 */
return ret;
}
+
+static char *qemuConnectGetHostname(virConnectPtr conn ATTRIBUTE_UNUSED)
+{
+ return virGetHostname();
+}
+
+
static int qemuConnectListDomains(virConnectPtr conn, int *ids, int nids) {
virQEMUDriverPtr driver = conn->privateData;
int n;
.connectSupportsFeature = qemuConnectSupportsFeature, /* 0.5.0 */
.connectGetType = qemuConnectGetType, /* 0.2.0 */
.connectGetVersion = qemuConnectGetVersion, /* 0.2.0 */
- .connectGetHostname = virGetHostname, /* 0.3.3 */
+ .connectGetHostname = qemuConnectGetHostname, /* 0.3.3 */
.connectGetSysinfo = qemuConnectGetSysinfo, /* 0.8.8 */
.connectGetMaxVcpus = qemuConnectGetMaxVcpus, /* 0.2.1 */
.nodeGetInfo = nodeGetInfo, /* 0.2.0 */
goto no_memory;
memcpy(mig->uuid, dom->def->uuid, VIR_UUID_BUFLEN);
- if (!(mig->localHostname = virGetHostname(NULL)))
+ if (!(mig->localHostname = virGetHostname()))
goto error;
if (virGetHostUUID(mig->localHostuuid) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
if (port == QEMUD_MIGRATION_NUM_PORTS) port = 0;
/* Get hostname */
- if ((hostname = virGetHostname(NULL)) == NULL)
+ if ((hostname = virGetHostname()) == NULL)
goto cleanup;
if (STRPREFIX(hostname, "localhost")) {
return 0;
}
+static char *testConnectGetHostname(virConnectPtr conn ATTRIBUTE_UNUSED)
+{
+ return virGetHostname();
+}
+
+
static int testConnectIsSecure(virConnectPtr conn ATTRIBUTE_UNUSED)
{
return 1;
.connectOpen = testConnectOpen, /* 0.1.1 */
.connectClose = testConnectClose, /* 0.1.1 */
.connectGetVersion = testConnectGetVersion, /* 0.1.1 */
- .connectGetHostname = virGetHostname, /* 0.6.3 */
+ .connectGetHostname = testConnectGetHostname, /* 0.6.3 */
.connectGetMaxVcpus = testConnectGetMaxVcpus, /* 0.3.2 */
.nodeGetInfo = testNodeGetInfo, /* 0.1.1 */
.connectGetCapabilities = testConnectGetCapabilities, /* 0.2.1 */
return ret;
}
+
+static char *umlConnectGetHostname(virConnectPtr conn ATTRIBUTE_UNUSED)
+{
+ return virGetHostname();
+}
+
+
static int umlConnectListDomains(virConnectPtr conn, int *ids, int nids) {
struct uml_driver *driver = conn->privateData;
int n;
.connectClose = umlConnectClose, /* 0.5.0 */
.connectGetType = umlConnectGetType, /* 0.5.0 */
.connectGetVersion = umlConnectGetVersion, /* 0.5.0 */
- .connectGetHostname = virGetHostname, /* 0.5.0 */
+ .connectGetHostname = umlConnectGetHostname, /* 0.5.0 */
.nodeGetInfo = nodeGetInfo, /* 0.5.0 */
.connectGetCapabilities = umlConnectGetCapabilities, /* 0.5.0 */
.connectListDomains = umlConnectListDomains, /* 0.5.0 */
* we got from getaddrinfo(). Return the value from gethostname()
* and hope for the best.
*/
-char *virGetHostname(virConnectPtr conn ATTRIBUTE_UNUSED)
+char *virGetHostname(void)
{
int r;
char hostname[HOST_NAME_MAX+1], *result;
static inline int getgid (void) { return 0; }
# endif
-char *virGetHostname(virConnectPtr conn);
+char *virGetHostname(void);
char *virGetUserDirectory(void);
char *virGetUserConfigDirectory(void);
return 0;
}
+
+static char *vboxConnectGetHostname(virConnectPtr conn ATTRIBUTE_UNUSED)
+{
+ return virGetHostname();
+}
+
+
static int vboxConnectIsSecure(virConnectPtr conn ATTRIBUTE_UNUSED) {
/* Driver is using local, non-network based transport */
return 1;
.connectOpen = vboxConnectOpen, /* 0.6.3 */
.connectClose = vboxConnectClose, /* 0.6.3 */
.connectGetVersion = vboxConnectGetVersion, /* 0.6.3 */
- .connectGetHostname = virGetHostname, /* 0.6.3 */
+ .connectGetHostname = vboxConnectGetHostname, /* 0.6.3 */
.connectGetMaxVcpus = vboxConnectGetMaxVcpus, /* 0.6.3 */
.nodeGetInfo = nodeGetInfo, /* 0.6.3 */
.connectGetCapabilities = vboxConnectGetCapabilities, /* 0.6.3 */
return -1;
}
+
+static char *xenUnifiedConnectGetHostname(virConnectPtr conn ATTRIBUTE_UNUSED)
+{
+ return virGetHostname();
+}
+
+
static int
xenUnifiedConnectIsEncrypted(virConnectPtr conn ATTRIBUTE_UNUSED)
{
.connectSupportsFeature = xenUnifiedConnectSupportsFeature, /* 0.3.2 */
.connectGetType = xenUnifiedConnectGetType, /* 0.0.3 */
.connectGetVersion = xenUnifiedConnectGetVersion, /* 0.0.3 */
- .connectGetHostname = virGetHostname, /* 0.7.3 */
+ .connectGetHostname = xenUnifiedConnectGetHostname, /* 0.7.3 */
.connectGetMaxVcpus = xenUnifiedConnectGetMaxVcpus, /* 0.2.1 */
.nodeGetInfo = xenUnifiedNodeGetInfo, /* 0.1.0 */
.connectGetCapabilities = xenUnifiedConnectGetCapabilities, /* 0.2.1 */
}
int
-xenDaemonDomainMigratePrepare(virConnectPtr dconn,
+xenDaemonDomainMigratePrepare(virConnectPtr dconn ATTRIBUTE_UNUSED,
char **cookie ATTRIBUTE_UNUSED,
int *cookielen ATTRIBUTE_UNUSED,
const char *uri_in,
* deallocates this string.
*/
if (uri_in == NULL) {
- *uri_out = virGetHostname(dconn);
+ *uri_out = virGetHostname();
if (*uri_out == NULL)
return -1;
}