From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lgln2-0007Yd-9w for qemu-devel@nongnu.org; Mon, 09 Mar 2009 16:09:32 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lgln1-0007Wx-15 for qemu-devel@nongnu.org; Mon, 09 Mar 2009 16:09:31 -0400 Received: from [199.232.76.173] (port=36152 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lgln0-0007WI-G4 for qemu-devel@nongnu.org; Mon, 09 Mar 2009 16:09:30 -0400 Received: from mx20.gnu.org ([199.232.41.8]:2559) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lgln0-0006p0-3j for qemu-devel@nongnu.org; Mon, 09 Mar 2009 16:09:30 -0400 Received: from mx2.redhat.com ([66.187.237.31]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LggVO-0006Lg-2Q for qemu-devel@nongnu.org; Mon, 09 Mar 2009 10:30:58 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n29ERuCr030904 for ; Mon, 9 Mar 2009 10:27:56 -0400 Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH][RFC] Handling ':' on filenames From: Eduardo Habkost References: <20090306212830.GL5077@blackpad> <49B3ABDF.2080803@redhat.com> In-Reply-To: <49B3ABDF.2080803@redhat.com> Date: Mon, 09 Mar 2009 11:27:53 -0300 Message-Id: <1236608548-sup-9812@blackpad> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: kvm_autotest Cc: qemu-devel Excerpts from kvm_autotest's message of Dom Mar 08 08:28:31 -0300 2009: > > --- > > block.c | 8 ++++++++ > > 1 files changed, 8 insertions(+), 0 deletions(-) > > > > diff --git a/block.c b/block.c > > index 7c744c7..04488d6 100644 > > --- a/block.c > > +++ b/block.c > > @@ -236,6 +236,14 @@ static BlockDriver *find_protocol(const char *filename) > > is_windows_drive_prefix(filename)) > > return &bdrv_raw; > > #endif > > + > > + /* Protocol name will never start with a slash. > > + * This allows the user to specify absolute filenames > > + * containing a ":" character. > > + */ > > + if (*filename == '/') > > + return &bdrv_raw; > > 3. The patch limits protocols names to not start with '/' (full paths). > I think we should apply the same logic to relative paths, so > protocol names would not start with '.' as well (no protocol > starts with '.' today): > > + if ((*filename == '/') || (*filename == '.')) > + return &bdrv_raw; Is ':' a valid character for Windows filenames? In this case, we may want to check for backslashes also. The "./filename" approach for relative paths seems nice to complete the fix, but I still see this is a workaround to a more fundamental problem. > > 4. Note that this patch does not limit image formats to raw, it > just says "use no protocols for full/relative paths". > > > + > > p = strchr(filename, ':'); > > if (!p) > > return &bdrv_raw; > > > Regards, > Uri. -- Eduardo