From patchwork Tue Nov 30 15:14:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 73723 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3E8BF1007D1 for ; Wed, 1 Dec 2010 17:22:46 +1100 (EST) Received: from localhost ([127.0.0.1]:46881 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PNg5T-0007fV-6c for incoming@patchwork.ozlabs.org; Wed, 01 Dec 2010 01:22:43 -0500 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 Received: from stefan-thinkpad.manchester-maybrook.uk.ibm.com (dyn-9-174-219-22.manchester-maybrook.uk.ibm.com [9.174.219.22]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id oAUFEQ4b013659; Tue, 30 Nov 2010 08:14:32 -0700 From: Stefan Hajnoczi To: Date: Tue, 30 Nov 2010 15:14:14 +0000 Message-Id: <1291130056-32441-2-git-send-email-stefanha@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.2.3 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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: Kevin Wolf , Anthony Liguori , Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 1/3] block: Make bdrv_create_file() ':' handling consistent X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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);