[PATCH] vmware: os x support is broken

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

 



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;

--
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]