From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLh52-0001xx-Kz for qemu-devel@nongnu.org; Thu, 06 Mar 2014 17:48:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLh4x-0006lx-AW for qemu-devel@nongnu.org; Thu, 06 Mar 2014 17:47:56 -0500 Received: from lnantes-156-75-100-125.w80-12.abo.wanadoo.fr ([80.12.84.125]:55881 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLh4x-0006ll-4b for qemu-devel@nongnu.org; Thu, 06 Mar 2014 17:47:51 -0500 Date: Thu, 6 Mar 2014 23:47:51 +0100 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140306224751.GE28835@irqsave.net> References: <1394144739-2294-1-git-send-email-mreitz@redhat.com> <1394144861-2403-1-git-send-email-mreitz@redhat.com> <1394144861-2403-2-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1394144861-2403-2-git-send-email-mreitz@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 5/5] block/raw-win32: bdrv_parse_filename() for hdev List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Kevin Wolf , =?iso-8859-1?Q?Beno=EEt?= Canet , qemu-devel@nongnu.org, Stefan Hajnoczi The Thursday 06 Mar 2014 =E0 23:27:41 (+0100), Max Reitz wrote : > The "host_device" protocol driver should strip the "host_device:" prefi= x > from filenames if present. >=20 > Signed-off-by: Max Reitz > --- > block/raw-win32.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) >=20 > diff --git a/block/raw-win32.c b/block/raw-win32.c > index 9954748..48cb2c2 100644 > --- a/block/raw-win32.c > +++ b/block/raw-win32.c > @@ -593,6 +593,15 @@ static int hdev_probe_device(const char *filename) > return 0; > } > =20 > +static void hdev_parse_filename(const char *filename, QDict *options, > + Error **errp) > +{ > + /* The prefix is optional, just as for "file". */ > + strstart(filename, "host_device:", &filename); > + > + qdict_put_obj(options, "filename", QOBJECT(qstring_from_str(filena= me))); > +} > + > static int hdev_open(BlockDriverState *bs, QDict *options, int flags, > Error **errp) > { > @@ -663,6 +672,7 @@ static BlockDriver bdrv_host_device =3D { > .protocol_name =3D "host_device", > .instance_size =3D sizeof(BDRVRawState), > .bdrv_needs_filename =3D true, > + .bdrv_parse_filename =3D hdev_parse_filename, > .bdrv_probe_device =3D hdev_probe_device, > .bdrv_file_open =3D hdev_open, > .bdrv_close =3D raw_close, > --=20 > 1.9.0 >=20 >=20 Reviewed-by: Benoit Canet