qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] block: prefer protocol_name over format_name in


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH] block: prefer protocol_name over format_name in bdrv_iterate_format
Date: Thu, 24 Apr 2014 14:34:19 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Apr 15, 2014 at 04:00:54PM +0200, Kevin Wolf wrote:
> Am 15.04.2014 um 15:28 hat Jeff Cody geschrieben:
> > Some block drivers have multiple BlockDriver instances with identical
> > format_name fields (e.g. gluster, nbd).  In those cases, the
> > protocol_name is usually the more unique identifier (e.g. gluster+tcp).
> > 
> > Both qemu-img and qemu will use bdrv_iterate_format() to list the
> > supported formats when a help option is invoked.  When just the
> > format_name is used, redundant listings of formats occur (e.g.,
> > "Supported formats: ... gluster gluster gluster gluster ... ").
> > 
> > If we prefer the protocol_name over the format_name (when the
> > protocol name exists), then that provides a more informative
> > help message:
> > 
> > "Supported formats: ... gluster gluster+tcp gluster+unix
> > gluster+rdma ... "
> > 
> > Signed-off-by: Jeff Cody <address@hidden>
> 
> On the other hand, it means that you can't take any driver name from
> here as use it as -drive driver=... value any more.

I think this change is problematic because of this.  It doesn't make
sense that "Supported formats" lists names that actually
bdrv_find_format() is unable to find.

blockdev_init()'s format= code will break if we make this change.

How about we change bdrv_iterate_format() to process unique format names
only?  It doesn't make sense to process duplicate format names since the
callback function has no way of identifying the specific BlockDriver
from just the duplicate format name argument.

Stefan



reply via email to

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