qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/5] block/raw-posix: bdrv_parse_filename() for


From: Benoît Canet
Subject: Re: [Qemu-devel] [PATCH 2/5] block/raw-posix: bdrv_parse_filename() for floppy
Date: Thu, 6 Mar 2014 23:38:53 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

The Thursday 06 Mar 2014 à 23:25:36 (+0100), Max Reitz wrote :
> The "host_floppy" protocol driver should strip the "host_floppy:" prefix
> from filenames if present.
> 
> Signed-off-by: Max Reitz <address@hidden>
> ---
>  block/raw-posix.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/block/raw-posix.c b/block/raw-posix.c
> index ab32ff9..4b8c183 100644
> --- a/block/raw-posix.c
> +++ b/block/raw-posix.c
> @@ -1844,6 +1844,15 @@ static BlockDriver bdrv_host_device = {
>  };
>  
>  #ifdef __linux__
> +static void floppy_parse_filename(const char *filename, QDict *options,
> +                                  Error **errp)
> +{
> +    /* The prefix is optional, just as for "file". */
> +    strstart(filename, "host_floppy:", &filename);
> +
> +    qdict_put_obj(options, "filename", QOBJECT(qstring_from_str(filename)));
> +}
> +
>  static int floppy_open(BlockDriverState *bs, QDict *options, int flags,
>                         Error **errp)
>  {
> @@ -1949,6 +1958,7 @@ static BlockDriver bdrv_host_floppy = {
>      .instance_size      = sizeof(BDRVRawState),
>      .bdrv_needs_filename = true,
>      .bdrv_probe_device       = floppy_probe_device,
> +    .bdrv_parse_filename = floppy_parse_filename,
>      .bdrv_file_open     = floppy_open,
>      .bdrv_close         = raw_close,
>      .bdrv_reopen_prepare = raw_reopen_prepare,
> -- 
> 1.9.0
> 
Reviewed-by: Benoit Canet <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]