Received: from eggs.gnu.org ([2001:4830:134:3::10]:59417) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VfsWf-0005s9-V8 for qemu-devel@nongnu.org; Mon, 11 Nov 2013 09:31:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VfsWa-00087n-0c for qemu-devel@nongnu.org; Mon, 11 Nov 2013 09:31:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:64480) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VfsWZ-00087b-NV for qemu-devel@nongnu.org; Mon, 11 Nov 2013 09:31:31 -0500 Date: Mon, 11 Nov 2013 15:31:25 +0100 From: Kevin Wolf Message-ID: <20131111143125.GF3046@dhcp-200-207.str.redhat.com> References: <1383881209-24318-1-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1383881209-24318-1-git-send-email-famz@redhat.com> Subject: Re: [Qemu-devel] [PATCH for-1.7 v2] block: Print its file name if backing file opening failed List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: qemu-devel@nongnu.org, stefanha@redhat.com, Benoit Canet Am 08.11.2013 um 04:26 hat Fam Zheng geschrieben: > If backing file doesn't exist, the error message is confusing and > misleading: > > $ qemu /tmp/a.qcow2 > qemu: could not open disk image /tmp/a.qcow2: Could not open file: No > such file or directory > > But... > > $ ls /tmp/a.qcow2 > /tmp/a.qcow2 > > $ qemu-img info /tmp/a.qcow2 > image: /tmp/a.qcow2 > file format: qcow2 > virtual size: 8.0G (8589934592 bytes) > disk size: 196K > cluster_size: 65536 > backing file: /tmp/b.qcow2 > > Because... > > $ ls /tmp/b.qcow2 > ls: cannot access /tmp/b.qcow2: No such file or directory > > This is not intuitive. It's better to have the missing file's name in > the error message. With this patch: > > $ qemu-io -c 'read 0 512' /tmp/a.qcow2 > qemu-io: can't open device /tmp/a.qcow2: Could not open backing > file: Could not open '/stor/vm/arch.raw': No such file or directory > no file open, try 'help open' > > Which is a little bit better. > > Signed-off-by: Fam Zheng Thanks, applied to the block branch. However, while this may be an improvement, it's certainly not what we'd want the error message to look like in the final state. Consider a chain with multiple backing files: qemu-system-x86_64: -drive file=/tmp/d.qcow2: could not open disk image /tmp/d.qcow2: Could not open backing file: Could not open backing file: Could not open backing file: Could not open backing file: Could not open '/tmp/blubber': No such file or directory Kevin