On 09/30/2014 05:59 AM, Markus Armbruster wrote:
> IDs have long spread beyond QemuOpts: not everything with an ID
> necessarily goes through QemuOpts.  Commit 9aebf3b is about such a
> case: block layer names are meant to be well-formed IDs, but some of
> them don't go through QemuOpts, and thus weren't checked.  The commit
> fixed that the straightforward way: rename the internal QemuOpts
> helper id_wellformed() to qemu_opts_id_wellformed() and give it
> external linkage.
> 
> Instead of using it directly in block.c, the commit adds wrapper
> bdrv_is_valid_name(), probably to hide the connection to QemuOpts.
> 
> Go one logical step further: emancipate IDs from QemuOpts.  Rename the
> function back to id_wellformed(), and put it in another file.  While
> there, clean up its value to bool.  Peel off the bdrv_is_valid_name()
> wrapper.
> ---
>  block.c               |  9 ++-------
>  include/qemu-common.h |  3 +++
>  include/qemu/option.h |  1 -
>  util/Makefile.objs    |  1 +
>  util/id.c             | 28 ++++++++++++++++++++++++++++
>  util/qemu-option.c    | 17 +----------------
>  6 files changed, 35 insertions(+), 24 deletions(-)
>  create mode 100644 util/id.c

Reviewed-by: Eric Blake <ebl...@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to