[libvirt] [PATCH] esx: Make the domain part of the hostname optional
Matthias Bolte
matthias.bolte at googlemail.com
Mon Jan 18 00:26:44 UTC 2010
2010/1/17 Daniel P. Berrange <berrange at redhat.com>:
> On Sat, Jan 16, 2010 at 03:22:01PM +0100, Matthias Bolte wrote:
>> Before the driver assumed that there is always a domain part. That's
>> not true. Now the domain part is handled as optional.
>> ---
>> src/esx/esx_driver.c | 17 ++++++++++-------
>> 1 files changed, 10 insertions(+), 7 deletions(-)
>>
>> diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
>> index 4ed4533..aeb3d07 100644
>> --- a/src/esx/esx_driver.c
>> +++ b/src/esx/esx_driver.c
>> @@ -773,14 +773,17 @@ esxGetHostname(virConnectPtr conn)
>> }
>>
>> if (domainName == NULL || strlen(domainName) < 1) {
>> - ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
>> - "Missing or empty 'domainName' property");
>> - goto failure;
>> - }
>> + complete = strdup(hostName);
>>
>> - if (virAsprintf(&complete, "%s.%s", hostName, domainName) < 0) {
>> - virReportOOMError(NULL);
>> - goto failure;
>> + if (complete == NULL) {
>> + virReportOOMError(NULL);
>> + goto failure;
>> + }
>> + } else {
>> + if (virAsprintf(&complete, "%s.%s", hostName, domainName) < 0) {
>> + virReportOOMError(NULL);
>> + goto failure;
>> + }
>> }
>>
>> cleanup:
>> --
>
> ACK
>
>
> Daniel
>
Thanks, pushed.
Matthias
More information about the libvir-list
mailing list