From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1OA0dV-0005Ho-4s for qemu-devel@nongnu.org; Thu, 06 May 2010 08:57:05 -0400 Received: from [140.186.70.92] (port=43046 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OA0dU-0005GD-22 for qemu-devel@nongnu.org; Thu, 06 May 2010 08:57:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OA0dS-00023R-Se for qemu-devel@nongnu.org; Thu, 06 May 2010 08:57:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16015) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OA0dS-00023E-Ju for qemu-devel@nongnu.org; Thu, 06 May 2010 08:57:02 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o46Cv1Cd029238 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 6 May 2010 08:57:01 -0400 From: Kevin Wolf Date: Thu, 6 May 2010 14:56:38 +0200 Message-Id: <1273150598-1749-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH] block: Fix protocol detection for Windows devices List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com We can't assume the file protocol for Windows devices, they need the same detection as other files for which an explicit protocol is not specified. Signed-off-by: Kevin Wolf --- block.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/block.c b/block.c index 10a2b31..adb3e5d 100644 --- a/block.c +++ b/block.c @@ -287,16 +287,18 @@ static BlockDriver *find_protocol(const char *filename) char protocol[128]; int len; const char *p; + int is_drive; /* TODO Drivers without bdrv_file_open must be specified explicitly */ #ifdef _WIN32 - if (is_windows_drive(filename) || - is_windows_drive_prefix(filename)) - return bdrv_find_format("file"); + is_drive = is_windows_drive(filename) || + is_windows_drive_prefix(filename); +#else + is_drive = 0; #endif p = strchr(filename, ':'); - if (!p) { + if (!p || is_drive) { drv1 = find_hdev_driver(filename); if (!drv1) { drv1 = bdrv_find_format("file"); -- 1.6.6.1