From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=44312 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PNePT-0006nD-DP for qemu-devel@nongnu.org; Tue, 30 Nov 2010 23:35:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PNRux-0005Qz-L1 for qemu-devel@nongnu.org; Tue, 30 Nov 2010 10:14:56 -0500 Received: from mtagate3.uk.ibm.com ([194.196.100.163]:55370) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PNRux-0004td-7g for qemu-devel@nongnu.org; Tue, 30 Nov 2010 10:14:55 -0500 Received: from d06nrmr1806.portsmouth.uk.ibm.com (d06nrmr1806.portsmouth.uk.ibm.com [9.149.39.193]) by mtagate3.uk.ibm.com (8.13.1/8.13.1) with ESMTP id oAUFEXYX030789 for ; Tue, 30 Nov 2010 15:14:33 GMT Received: from d06av12.portsmouth.uk.ibm.com (d06av12.portsmouth.uk.ibm.com [9.149.37.247]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id oAUFEahF3653706 for ; Tue, 30 Nov 2010 15:14:36 GMT Received: from d06av12.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id oAUFEWWj013894 for ; Tue, 30 Nov 2010 08:14:32 -0700 From: Stefan Hajnoczi Date: Tue, 30 Nov 2010 15:14:14 +0000 Message-Id: <1291130056-32441-2-git-send-email-stefanha@linux.vnet.ibm.com> In-Reply-To: <1291130056-32441-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1291130056-32441-1-git-send-email-stefanha@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 1/3] block: Make bdrv_create_file() ':' handling consistent List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Anthony Liguori , Stefan Hajnoczi Filenames may start with ":" to explicitly use a protocol like nbd. Filenames with unknown protocols are rejected in most of QEMU except for bdrv_create_file(). Even if a file with an invalid filename can be created, QEMU cannot use it since all the other relevant functions reject such paths. Make bdrv_create_file() consistent. Signed-off-by: Stefan Hajnoczi --- block.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/block.c b/block.c index 63effd8..e7a986c 100644 --- a/block.c +++ b/block.c @@ -215,7 +215,7 @@ int bdrv_create_file(const char* filename, QEMUOptionParameter *options) drv = bdrv_find_protocol(filename); if (drv == NULL) { - drv = bdrv_find_format("file"); + return -ENOENT; } return bdrv_create(drv, filename, options); -- 1.7.2.3