All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Benoît Canet" <benoit.canet@irqsave.net>
To: Max Reitz <mreitz@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 4/5] block/raw-win32: Implement bdrv_parse_filename()
Date: Thu, 6 Mar 2014 14:05:38 +0100	[thread overview]
Message-ID: <20140306130537.GE3132@irqsave.net> (raw)
In-Reply-To: <1394055700-5988-5-git-send-email-mreitz@redhat.com>

The Wednesday 05 Mar 2014 à 22:41:39 (+0100), Max Reitz wrote :
> The "file" protocol driver should strip the "file:" prefix from
> filenames if present.
> 
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>  block/raw-win32.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> 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)
>      }
>  }
>  
> +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(filename)));
> +}
> +
>  static QemuOptsList raw_runtime_opts = {
>      .name = "raw",
>      .head = QTAILQ_HEAD_INITIALIZER(raw_runtime_opts.head),
> @@ -504,6 +515,7 @@ static BlockDriver bdrv_file = {
>      .protocol_name	= "file",
>      .instance_size	= sizeof(BDRVRawState),
>      .bdrv_needs_filename = true,
> +    .bdrv_parse_filename = raw_parse_filename,
>      .bdrv_file_open	= raw_open,
>      .bdrv_close		= raw_close,
>      .bdrv_create	= raw_create,
> -- 
> 1.9.0
> 
> 
Reviewed-by: Benoit Canet <benoit@irqsave.net>

  reply	other threads:[~2014-03-06 13:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-05 21:41 [Qemu-devel] [PATCH 0/5] block/raw: Strip "file:" prefix from filenames Max Reitz
2014-03-05 21:41 ` [Qemu-devel] [PATCH 1/5] block: Keep "filename" option after parsing Max Reitz
2014-03-06 13:00   ` Benoît Canet
2014-03-05 21:41 ` [Qemu-devel] [PATCH 2/5] block/raw-posix: Implement bdrv_parse_filename() Max Reitz
2014-03-06 13:03   ` Benoît Canet
2014-03-05 21:41 ` [Qemu-devel] [PATCH 3/5] block/raw-posix: Strip "file:" prefix on creation Max Reitz
2014-03-06 13:04   ` Benoît Canet
2014-03-05 21:41 ` [Qemu-devel] [PATCH 4/5] block/raw-win32: Implement bdrv_parse_filename() Max Reitz
2014-03-06 13:05   ` Benoît Canet [this message]
2014-03-05 21:41 ` [Qemu-devel] [PATCH 5/5] block/raw-win32: Strip "file:" prefix on creation Max Reitz
2014-03-06 13:06   ` Benoît Canet
2014-03-05 21:52 ` [Qemu-devel] [PATCH 0/5] block/raw: Strip "file:" prefix from filenames Eric Blake
2014-03-06 12:57 ` Kevin Wolf
2014-03-06 13:07   ` Benoît Canet
2014-03-06 20:10   ` Max Reitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140306130537.GE3132@irqsave.net \
    --to=benoit.canet@irqsave.net \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.