All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Kevin Wolf" <kwolf@redhat.com>,
	"Benoît Canet" <benoit.canet@irqsave.net>,
	"Stefan Hajnoczi" <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 4/5] block/raw-posix: Strip protocol prefix on creation
Date: Thu, 06 Mar 2014 23:37:56 +0100	[thread overview]
Message-ID: <5318F8C4.5010104@redhat.com> (raw)
In-Reply-To: <1394144861-2403-1-git-send-email-mreitz@redhat.com>

Sorry for the duplicate 4/5 and the wrong in-reply-to for 5/5, but I 
deduced from the send-email output that 4/5 failed to send (and 5/5 
wasn't even attempted) and forgot --no-thread for the resend of 4 and 5.

Max


On 06.03.2014 23:27, Max Reitz wrote:
> The hdev_create() implementation in block/raw-posix.c is used by the
> "host_device", "host_cdrom" and "host_floppy" protocol block drivers
> together. Thus, it any of the associated prefixes may occur and exactly
> one should be stripped, if it does (thus,
> "host_device:host_cdrom:/dev/cdrom" is not shortened to "/dev/cdrom").
>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>   block/raw-posix.c | 12 ++++++++++++
>   1 file changed, 12 insertions(+)
>
> diff --git a/block/raw-posix.c b/block/raw-posix.c
> index 6c9b8f2..598d736 100644
> --- a/block/raw-posix.c
> +++ b/block/raw-posix.c
> @@ -1776,6 +1776,18 @@ static int hdev_create(const char *filename, QEMUOptionParameter *options,
>       int ret = 0;
>       struct stat stat_buf;
>       int64_t total_size = 0;
> +    bool has_prefix;
> +
> +    /* This function is used by all three protocol block drivers and therefore
> +     * any of these three prefixes may be given.
> +     * The return value has to be stored somewhere, otherwise this is an error
> +     * due to -Werror=unused-value. */
> +    has_prefix =
> +        strstart(filename, "host_device:", &filename) ||
> +        strstart(filename, "host_cdrom:" , &filename) ||
> +        strstart(filename, "host_floppy:", &filename);
> +
> +    (void)has_prefix;
>   
>       /* Read out options */
>       while (options && options->name) {

      parent reply	other threads:[~2014-03-06 22:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-06 22:25 [Qemu-devel] [PATCH 0/5] block: Strip protocol prefixes from filenames Max Reitz
2014-03-06 22:25 ` [Qemu-devel] [PATCH 1/5] block/raw-posix: bdrv_parse_filename() for hdev Max Reitz
2014-03-06 22:38   ` Benoît Canet
2014-03-06 22:25 ` [Qemu-devel] [PATCH 2/5] block/raw-posix: bdrv_parse_filename() for floppy Max Reitz
2014-03-06 22:38   ` Benoît Canet
2014-03-06 22:25 ` [Qemu-devel] [PATCH 3/5] block/raw-posix: bdrv_parse_filename() for cdrom Max Reitz
2014-03-06 22:37   ` Benoît Canet
2014-03-06 22:39     ` Max Reitz
2014-03-06 22:25 ` [Qemu-devel] [PATCH 4/5] block/raw-posix: Strip protocol prefix on creation Max Reitz
2014-03-06 22:45   ` Benoît Canet
2014-03-06 23:58   ` Eric Blake
2014-03-06 22:27 ` Max Reitz
2014-03-06 22:27   ` [Qemu-devel] [PATCH 5/5] block/raw-win32: bdrv_parse_filename() for hdev Max Reitz
2014-03-06 22:47     ` Benoît Canet
2014-03-06 22:37   ` Max Reitz [this message]

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=5318F8C4.5010104@redhat.com \
    --to=mreitz@redhat.com \
    --cc=benoit.canet@irqsave.net \
    --cc=kwolf@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.