From owner-svn-src-head@freebsd.org Fri May 27 11:46:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A0C2B4C566; Fri, 27 May 2016 11:46:55 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B2AE1FB7; Fri, 27 May 2016 11:46:55 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RBksMK045213; Fri, 27 May 2016 11:46:54 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RBkspo045212; Fri, 27 May 2016 11:46:54 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605271146.u4RBkspo045212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 27 May 2016 11:46:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300843 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 11:46:55 -0000 Author: bapt Date: Fri May 27 11:46:54 2016 New Revision: 300843 URL: https://svnweb.freebsd.org/changeset/base/300843 Log: Improve error message when failing to open a backing file When bhyve cannot open a backing file, it now says explicitly which file could not be opened Note that the change has only be maed in block_if.c and not in pci_virtio_block.c as the error will always be catched by the first PR: 202321 (different patch) Reviewed by: grehan MFC after: 3 day Sponsored by: Gandi.net Differential Revision: https://reviews.freebsd.org/D6576 Modified: head/usr.sbin/bhyve/block_if.c Modified: head/usr.sbin/bhyve/block_if.c ============================================================================== --- head/usr.sbin/bhyve/block_if.c Fri May 27 11:46:35 2016 (r300842) +++ head/usr.sbin/bhyve/block_if.c Fri May 27 11:46:54 2016 (r300843) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -447,12 +448,12 @@ blockif_open(const char *optstr, const c } if (fd < 0) { - perror("Could not open backing file"); + warn("Could not open backing file: %s", nopt); goto err; } if (fstat(fd, &sbuf) < 0) { - perror("Could not stat backing file"); + warn("Could not stat backing file %s", nopt); goto err; }