All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Max Reitz <mreitz@redhat.com>
Cc: qemu-devel@nongnu.org, "Stefan Hajnoczi" <stefanha@redhat.com>,
	"Benoît Canet" <benoit@irqsave.net>
Subject: Re: [Qemu-devel] [PATCH v3 1/2] block: Do not prematurely remove "filename"
Date: Mon, 30 Jun 2014 11:42:24 +0200	[thread overview]
Message-ID: <20140630094224.GA4334@noname.str.redhat.com> (raw)
In-Reply-To: <1403818727-11215-2-git-send-email-mreitz@redhat.com>

Am 26.06.2014 um 23:38 hat Max Reitz geschrieben:
> If "filename" is removed from the options QDict before entering
> bdrv_open_common(), it cannot be stored in the BDS.  Therefore, wait
> until it has been copied there and remove it from the options only
> afterwards.
> 
> This fixes "filename" in the BDS being empty for block drivers which do
> not need the filename because they have parsed it already (e.g. NBD).
> 
> Signed-off-by: Max Reitz <mreitz@redhat.com>

I can't say I like this approach. It looks a bit odd to pass a boolean
variable to bdrv_open(), and in some other function called from there
the cleanup is done that logically really belong to bdrv_fill_options().

More importantly, the goal was to get rid of the filename and handle
everything through the options so that we get a uniform state again.
This would involve replacing bs->filename by a new callback function in
BlockDriver that constructs a filename that describes the BDS. This way
we would get useful output not only for "nbd:localhost:10809", but also
for "driver=nbd,host=localhost".

In hard cases, the callback might just use "json:{...}" syntax. This
suggests that maybe in the end we'll want to have two different
callbacks, one giving a short human-readable description
('localhost:10809') and another one giving something that can be used on
the command line ('json:{"driver": "nbd", "host": "localhost", "ipv6":
true}').

Kevin

  reply	other threads:[~2014-06-30  9:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-26 21:38 [Qemu-devel] [PATCH v3 0/2] block: Fix unset "filename" for certain drivers Max Reitz
2014-06-26 21:38 ` [Qemu-devel] [PATCH v3 1/2] block: Do not prematurely remove "filename" Max Reitz
2014-06-30  9:42   ` Kevin Wolf [this message]
2014-07-01 11:46     ` Max Reitz
2014-06-26 21:38 ` [Qemu-devel] [PATCH v3 2/2] iotests: Add test for set "filename" for NBD Max Reitz
2014-06-26 21:54 ` [Qemu-devel] [PATCH for 2.1 v3 0/2] block: Fix unset "filename" for certain drivers Eric Blake

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=20140630094224.GA4334@noname.str.redhat.com \
    --to=kwolf@redhat.com \
    --cc=benoit@irqsave.net \
    --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.