diff --git a/docs/drvvmware.html.in b/docs/drvvmware.html.in index 9ee0ebdc4a0d9ee605db4b4d9f6cbd42af70918c..240afd0050f93f6bac58c518c19348943a22f8d4 100644 --- a/docs/drvvmware.html.in +++ b/docs/drvvmware.html.in @@ -2,10 +2,11 @@ -

VMware Workstation / Player hypervisors driver

+

VMware Workstation / Player / Fusion hypervisors driver

- The libvirt VMware Workstation driver should be able to manage any Workstation and - Player version supported by the VMware VIX API. See the compatibility list + The libvirt VMware driver should be able to manage any Workstation, + Player, Fusion version supported by the VMware VIX API. See the + compatibility list here.

@@ -21,17 +22,22 @@ The VMware Workstation and Player hypervisors +

  • + The VMware Fusion + hypervisor +
  • Connections to VMware driver

    The libvirt VMware driver provides per-user drivers (the "session" instance). - Two uris are available: + Three uris are available:

    Some example connection URIs for the driver are: @@ -40,6 +46,7 @@

     vmwareplayer:///session                  (local access to VMware Player per-user instance)
     vmwarews:///session                      (local access to VMware Workstation per-user instance)
    +vmwarefusion:///session                      (local access to VMware Fusion per-user instance)
     vmwarews+tcp://user@example.com/session  (remote access to VMware Workstation, SASl/Kerberos)
     vmwarews+ssh://user@example.com/session  (remote access to VMware Workstation, SSH tunnelled)
     
    diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_conf.c index c11c92d34fdc3cc37d91238e8455d6528c4c2a8b..027e245bf54c9c3f999f233f3370f9d57fff30d3 100644 --- a/src/vmware/vmware_conf.c +++ b/src/vmware/vmware_conf.c @@ -37,7 +37,8 @@ VIR_ENUM_IMPL(vmwareDriver, VMWARE_DRIVER_LAST, "player", - "ws"); + "ws", + "fusion"); /* Free all memory associated with a vmware_driver structure */ void @@ -231,6 +232,9 @@ vmwareParseVersionStr(int type, const char *verbuf, unsigned long *version) case VMWARE_DRIVER_WORKSTATION: pattern = "VMware Workstation "; break; + case VMWARE_DRIVER_FUSION: + pattern = "\nVMware Fusion Information:\nVMware Fusion "; + break; default: virReportError(VIR_ERR_INTERNAL_ERROR, _("Invalid driver type: %d"), type); @@ -276,6 +280,11 @@ vmwareExtractVersion(struct vmware_driver *driver) goto cleanup; break; + case VMWARE_DRIVER_FUSION: + if (virAsprintf(&bin, "%s/%s", vmwarePath, "vmware-vmx")) + goto cleanup; + break; + default: virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("invalid driver type for version detection")); diff --git a/src/vmware/vmware_conf.h b/src/vmware/vmware_conf.h index a4fd8550ab60c7f6de2500347a4ea96e718d0551..b9fca6cc5ead56843c6ac325d9b96e3f66de2627 100644 --- a/src/vmware/vmware_conf.h +++ b/src/vmware/vmware_conf.h @@ -33,6 +33,7 @@ enum vmwareDriverType { VMWARE_DRIVER_PLAYER = 0, /* VMware Player */ VMWARE_DRIVER_WORKSTATION = 1, /* VMware Workstation */ + VMWARE_DRIVER_FUSION = 2, /* VMware Fusion */ VMWARE_DRIVER_LAST, /* required last item */ }; diff --git a/src/vmware/vmware_driver.c b/src/vmware/vmware_driver.c index 23576fa793118797b391b2d9227ad7b92fb1f4e7..c27821411176d970640b2b90a85f97877fecdf86 100644 --- a/src/vmware/vmware_driver.c +++ b/src/vmware/vmware_driver.c @@ -40,6 +40,10 @@ */ static const char * const vmrun_candidates[] = { "vmrun", +#ifdef __APPLE__ + "/Applications/VMware Fusion.app/Contents/Library/vmrun", + "/Library/Application Support/VMware Fusion/vmrun", +#endif /* __APPLE__ */ }; static void @@ -103,7 +107,8 @@ vmwareConnectOpen(virConnectPtr conn, } else { if (conn->uri->scheme == NULL || (STRNEQ(conn->uri->scheme, "vmwareplayer") && - STRNEQ(conn->uri->scheme, "vmwarews"))) + STRNEQ(conn->uri->scheme, "vmwarews") && + STRNEQ(conn->uri->scheme, "vmwarefusion"))) return VIR_DRV_OPEN_DECLINED; /* If server name is given, its for remote driver */ @@ -113,7 +118,7 @@ vmwareConnectOpen(virConnectPtr conn, /* If path isn't /session, then they typoed, so tell them correct path */ if (conn->uri->path == NULL || STRNEQ(conn->uri->path, "/session")) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected VMware URI path '%s', try vmwareplayer:///session or vmwarews:///session"), + _("unexpected VMware URI path '%s', try vmwareplayer:///session, vmwarews:///session or vmwarefusion:///session"), NULLSTR(conn->uri->path)); return VIR_DRV_OPEN_ERROR; }