From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=44529 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQeN3-0006Fy-TL for qemu-devel@nongnu.org; Thu, 09 Dec 2010 06:09:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQeN2-0000Do-Dw for qemu-devel@nongnu.org; Thu, 09 Dec 2010 06:09:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54247) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQeN2-0000Dc-6j for qemu-devel@nongnu.org; Thu, 09 Dec 2010 06:09:08 -0500 From: Kevin Wolf Date: Thu, 9 Dec 2010 12:09:57 +0100 Message-Id: <1291893010-29223-2-git-send-email-kwolf@redhat.com> In-Reply-To: <1291893010-29223-1-git-send-email-kwolf@redhat.com> References: <1291893010-29223-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 01/14] block: Make bdrv_create_file() ':' handling consistent List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: 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 Signed-off-by: Kevin Wolf --- 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