From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57770) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WALGQ-0002Ti-N8 for qemu-devel@nongnu.org; Mon, 03 Feb 2014 10:16:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WALGJ-0005ET-8R for qemu-devel@nongnu.org; Mon, 03 Feb 2014 10:16:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36706) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WALGJ-0005EN-0C for qemu-devel@nongnu.org; Mon, 03 Feb 2014 10:16:39 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s13FGbea018503 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 3 Feb 2014 10:16:38 -0500 Date: Mon, 3 Feb 2014 16:16:35 +0100 From: Stefan Hajnoczi Message-ID: <20140203151634.GC17247@stefanha-thinkpad.redhat.com> References: <1391435731-25948-1-git-send-email-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1391435731-25948-1-git-send-email-kwolf@redhat.com> Subject: Re: [Qemu-devel] [PATCH] block: Fail gracefully with missing filename List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, mreitz@redhat.com On Mon, Feb 03, 2014 at 02:55:31PM +0100, Kevin Wolf wrote: > This fixes a regression introduced in commit 2a05cbe42 ('block: Allow > block devices without files'): > > $ qemu-system-x86_64 -drive driver=file > qemu-system-x86_64: block.c:892: bdrv_open_common: Assertion > `!drv->bdrv_needs_filename || filename != ((void *)0)' failed. > > Now the respective check must be performed not only in bdrv_file_open(), > but also in bdrv_open(). > > Signed-off-by: Kevin Wolf > --- > block.c | 11 ++++++----- > tests/qemu-iotests/051 | 12 ++++++++++++ > tests/qemu-iotests/051.out | 24 ++++++++++++++++++++++++ > 3 files changed, 42 insertions(+), 5 deletions(-) Ouch! Nice to have tests that protect us in the future. Reviewed-by: Stefan Hajnoczi