From nobody Wed May 14 12:24:39 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1523779400235214.22683945664153; Sun, 15 Apr 2018 01:03:20 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0A2C9C049D5C; Sun, 15 Apr 2018 08:03:18 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CBC305EDE9; Sun, 15 Apr 2018 08:03:17 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7E56118033EB; Sun, 15 Apr 2018 08:03:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3E9QB9c030621 for ; Sat, 14 Apr 2018 05:26:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id A844717A66; Sat, 14 Apr 2018 09:26:11 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A17D66090A for ; Sat, 14 Apr 2018 09:26:09 +0000 (UTC) Received: from donkey.codingfarm.de (donkey.codingfarm.de [5.9.138.198]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A85EC81DE1 for ; Sat, 14 Apr 2018 09:26:08 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by donkey.codingfarm.de (Postfix) with ESMTPSA id 8B02383BF8; Sat, 14 Apr 2018 11:26:06 +0200 (CEST) Received: by eunomia.codingfarm.de (Postfix, from userid 501) id 3D0C3D779373; Sat, 14 Apr 2018 11:26:06 +0200 (CEST) From: =?UTF-8?q?Rainer=20M=C3=BCller?= To: libvir-list@redhat.com Date: Sat, 14 Apr 2018 11:25:42 +0200 Message-Id: <20180414092543.12954-2-raimue@codingfarm.de> In-Reply-To: <20180414092543.12954-1-raimue@codingfarm.de> References: <20180414092543.12954-1-raimue@codingfarm.de> MIME-Version: 1.0 X-Greylist: Sender passed SPF test, ACL 227 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Sat, 14 Apr 2018 09:26:08 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Sat, 14 Apr 2018 09:26:08 +0000 (UTC) for IP:'5.9.138.198' DOMAIN:'donkey.codingfarm.de' HELO:'donkey.codingfarm.de' FROM:'raimue@codingfarm.de' RCPT:'' X-RedHat-Spam-Score: -0.001 (SPF_PASS) 5.9.138.198 donkey.codingfarm.de 5.9.138.198 donkey.codingfarm.de X-Scanned-By: MIMEDefang 2.83 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?Rainer=20M=C3=BCller?= Subject: [libvirt] [PATCH v2 1/2] vmware: Fix initialization of VMware Fusion X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sun, 15 Apr 2018 08:03:19 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 The vmware driver wants to execute vmware-vmx from the same directory in which vmrun was found. However, on VMware Fusion 10 vmrun at /Applications/VMware Fusion.app/Contents/Public/vmrun is a symlink pointing to ../Library/vmrun. vmware-vmx cannot be found, as it is not in PATH, but only in this Library directory. Therefore, follow the vmrun symlink and use the resulting path. Then the assumption that vmware-vmx is right next to it will still work. Signed-off-by: Rainer M=C3=BCller --- src/vmware/vmware_driver.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/vmware/vmware_driver.c b/src/vmware/vmware_driver.c index c8a3151fa..b4b809f1a 100644 --- a/src/vmware/vmware_driver.c +++ b/src/vmware/vmware_driver.c @@ -127,6 +127,7 @@ vmwareConnectOpen(virConnectPtr conn, struct vmware_driver *driver; size_t i; char *tmp; + char *vmrun =3D NULL; =20 virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); =20 @@ -149,7 +150,14 @@ vmwareConnectOpen(virConnectPtr conn, * for auto detection of the backend */ for (i =3D 0; i < ARRAY_CARDINALITY(vmrun_candidates); i++) { - driver->vmrun =3D virFindFileInPath(vmrun_candidates[i]); + vmrun =3D virFindFileInPath(vmrun_candidates[i]); + if (vmrun =3D=3D NULL) + continue; + if (virFileResolveLink(vmrun, &driver->vmrun) < 0) { + virReportSystemError(errno, _("unable to resolve symlink '%s'"= ), vmrun); + goto cleanup; + } + VIR_FREE(vmrun); /* If we found one, we can stop looking */ if (driver->vmrun) break; @@ -200,6 +208,7 @@ vmwareConnectOpen(virConnectPtr conn, =20 cleanup: vmwareFreeDriver(driver); + VIR_FREE(vmrun); return VIR_DRV_OPEN_ERROR; }; =20 --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list