[libvirt] [PATCH] vmware: os x support is broken
Denis Kondratenko
denis.kondratenko at gmail.com
Fri Jan 3 17:57:37 UTC 2014
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;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140103/ff03ade3/attachment-0001.htm>
More information about the libvir-list
mailing list