[libvirt] [PATCH] esx: Make the domain part of the hostname optional

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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:
-- 
1.6.3.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]