From nobody Mon Feb 9 20:59:08 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.24 as permitted sender) client-ip=209.132.183.24; envelope-from=libvir-list-bounces@redhat.com; helo=mx3-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.24 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by mx.zohomail.com with SMTPS id 1488161183768706.9670924618861; Sun, 26 Feb 2017 18:06:23 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1R22mit001181; Sun, 26 Feb 2017 21:02:49 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1R22kUY009160 for ; Sun, 26 Feb 2017 21:02:46 -0500 Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1R22k5C008792 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sun, 26 Feb 2017 21:02:46 -0500 Received: from smtp2.provo.novell.com (smtp2.provo.novell.com [137.65.250.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DCAEEC04B32C for ; Mon, 27 Feb 2017 02:02:45 +0000 (UTC) Received: from linux-tbji.provo.novell.com (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by smtp2.provo.novell.com with ESMTP (NOT encrypted); Sun, 26 Feb 2017 19:02:41 -0700 From: Jim Fehlig To: libvir-list@redhat.com Date: Sun, 26 Feb 2017 19:02:26 -0700 Message-Id: <20170227020227.15438-3-jfehlig@suse.com> In-Reply-To: <20170227020227.15438-1-jfehlig@suse.com> References: <20170227020227.15438-1-jfehlig@suse.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 202 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 27 Feb 2017 02:02:46 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 27 Feb 2017 02:02:46 +0000 (UTC) for IP:'137.65.250.81' DOMAIN:'smtp2.provo.novell.com' HELO:'smtp2.provo.novell.com' FROM:'jfehlig@suse.com' RCPT:'' X-RedHat-Spam-Score: -1.501 (BAYES_50, RCVD_IN_DNSWL_MED, SPF_PASS) 137.65.250.81 smtp2.provo.novell.com 137.65.250.81 smtp2.provo.novell.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/3] libxl: relax checks on 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Checking for the existence and execute permission of a user-specified emulator is fine when actually creating a VM, but is problematic when running unit tests since a development system may not have the emulator installed. Defer the emulator checks to libxl, when actually starting a VM. One downside is errors associated with non-existent or non-executable emulator are reported in the libxl driver log files instead of being returned through the libvirt API. E.g. before this change virsh create test.xml error: Failed to create domain from test.xml error: unsupported configuration: emulator '/foo/bar' not found After this change virsh create test.xml error: Failed to create domain from test.xml error: internal error: libxenlight failed to create new domain 'test' but the libxl driver log file contains 2017-02-23 22:04:18.319+0000: libxl: libxl_dm.c:2050:libxl__spawn_local_dm: device model /foo/bar is not executable: No such file or directory Signed-off-by: Jim Fehlig --- src/libxl/libxl_conf.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index 4bab651b3..2c10fbe25 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -435,20 +435,6 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, b_info->u.hvm.bios =3D LIBXL_BIOS_TYPE_OVMF; =20 if (def->emulator) { - if (!virFileExists(def->emulator)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("emulator '%s' not found"), - def->emulator); - return -1; - } - - if (!virFileIsExecutable(def->emulator)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("emulator '%s' is not executable"), - def->emulator); - return -1; - } - VIR_FREE(b_info->device_model); if (VIR_STRDUP(b_info->device_model, def->emulator) < 0) return -1; --=20 2.11.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list