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

[libvirt] [PATCH] vmware: os x support is broken



Incorrect usage of virAsprintf and vmware-vmx reports to stderr.
--- https://bugzilla.redhat.com/show_bug.cgi?id=1036248

diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_conf.c
index 027e245..477dc72 100644
--- a/src/vmware/vmware_conf.c
+++ b/src/vmware/vmware_conf.c
@@ -271,17 +271,17 @@ vmwareExtractVersion(struct vmware_driver *driver)
 
     switch (driver->type) {
         case VMWARE_DRIVER_PLAYER:
-            if (virAsprintf(&bin, "%s/%s", vmwarePath, "vmplayer"))
+            if (virAsprintf(&bin, "%s/%s", vmwarePath, "vmplayer") < 0)
                 goto cleanup;
             break;
 
         case VMWARE_DRIVER_WORKSTATION:
-            if (virAsprintf(&bin, "%s/%s", vmwarePath, "vmware"))
+            if (virAsprintf(&bin, "%s/%s", vmwarePath, "vmware") < 0)
                 goto cleanup;
             break;
 
         case VMWARE_DRIVER_FUSION:
-            if (virAsprintf(&bin, "%s/%s", vmwarePath, "vmware-vmx"))
+            if (virAsprintf(&bin, "%s/%s", vmwarePath, "vmware-vmx") < 0)
                 goto cleanup;
             break;
 
@@ -293,6 +293,9 @@ vmwareExtractVersion(struct vmware_driver *driver)
 
     cmd = virCommandNewArgList(bin, "-v", NULL);
     virCommandSetOutputBuffer(cmd, &outbuf);
+    
+    // OS X 10.9.1 and some earlier ver: vmware-vmx reports ver to stderr   
+    virCommandSetErrorBuffer(cmd, &outbuf);
 
     if (virCommandRun(cmd, NULL) < 0)
         goto cleanup;


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