mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
esx: Make the domain part of the hostname optional
Before the driver assumed that there is always a domain part. That's not true. Now the domain part is handled as optional.
This commit is contained in:
parent
d6c40aaec8
commit
58fe995e50
@ -783,14 +783,17 @@ esxGetHostname(virConnectPtr conn)
|
||||
}
|
||||
|
||||
if (domainName == NULL || strlen(domainName) < 1) {
|
||||
ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
"Missing or empty 'domainName' property");
|
||||
goto failure;
|
||||
}
|
||||
complete = strdup(hostName);
|
||||
|
||||
if (virAsprintf(&complete, "%s.%s", hostName, domainName) < 0) {
|
||||
virReportOOMError(conn);
|
||||
goto failure;
|
||||
if (complete == NULL) {
|
||||
virReportOOMError(conn);
|
||||
goto failure;
|
||||
}
|
||||
} else {
|
||||
if (virAsprintf(&complete, "%s.%s", hostName, domainName) < 0) {
|
||||
virReportOOMError(conn);
|
||||
goto failure;
|
||||
}
|
||||
}
|
||||
|
||||
cleanup:
|
||||
|
Loading…
x
Reference in New Issue
Block a user