From: Matthias Bolte Date: Sat, 16 Jan 2010 00:08:27 +0000 (+0100) Subject: esx: Make the domain part of the hostname optional X-Git-Tag: v0.7.6~170 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58fe995e5006c5a959e068704e1f2ee7e4cd3363;p=thirdparty%2Flibvirt.git 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. --- diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 2f346c36a6..a1cb04973b 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -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: