From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44768) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLXzd-0003gy-Mc for qemu-devel@nongnu.org; Thu, 06 Mar 2014 08:05:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLXzX-0002PC-6Q for qemu-devel@nongnu.org; Thu, 06 Mar 2014 08:05:45 -0500 Received: from lnantes-156-75-100-125.w80-12.abo.wanadoo.fr ([80.12.84.125]:55832 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLXzW-0002P8-RD for qemu-devel@nongnu.org; Thu, 06 Mar 2014 08:05:39 -0500 Date: Thu, 6 Mar 2014 14:05:38 +0100 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140306130537.GE3132@irqsave.net> References: <1394055700-5988-1-git-send-email-mreitz@redhat.com> <1394055700-5988-5-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1394055700-5988-5-git-send-email-mreitz@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 4/5] block/raw-win32: Implement bdrv_parse_filename() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi The Wednesday 05 Mar 2014 =E0 22:41:39 (+0100), Max Reitz wrote : > The "file" protocol driver should strip the "file:" prefix from > filenames if present. >=20 > Signed-off-by: Max Reitz > --- > block/raw-win32.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) >=20 > diff --git a/block/raw-win32.c b/block/raw-win32.c > index ae1c8e6..0755434 100644 > --- a/block/raw-win32.c > +++ b/block/raw-win32.c > @@ -251,6 +251,17 @@ static void raw_parse_flags(int flags, int *access= _flags, DWORD *overlapped) > } > } > =20 > +static void raw_parse_filename(const char *filename, QDict *options, > + Error **errp) > +{ > + /* The filename does not have to be prefixed by the protocol name,= since > + * "file" is the default protocol; therefore, the return value of = this > + * function call can be ignored. */ > + strstart(filename, "file:", &filename); > + > + qdict_put_obj(options, "filename", QOBJECT(qstring_from_str(filena= me))); > +} > + > static QemuOptsList raw_runtime_opts =3D { > .name =3D "raw", > .head =3D QTAILQ_HEAD_INITIALIZER(raw_runtime_opts.head), > @@ -504,6 +515,7 @@ static BlockDriver bdrv_file =3D { > .protocol_name =3D "file", > .instance_size =3D sizeof(BDRVRawState), > .bdrv_needs_filename =3D true, > + .bdrv_parse_filename =3D raw_parse_filename, > .bdrv_file_open =3D raw_open, > .bdrv_close =3D raw_close, > .bdrv_create =3D raw_create, > --=20 > 1.9.0 >=20 >=20 Reviewed-by: Benoit Canet