[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 10/12] block: Allow omitting the file name wh
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v2 10/12] block: Allow omitting the file name when using driver-specific options |
Date: |
Wed, 20 Mar 2013 15:31:59 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 |
On 03/20/2013 12:39 PM, Kevin Wolf wrote:
> After this patch, using -drive with an empty file name continues to open
> the file if driver-specific options are used. If no driver-specific
> options are specified, the semantics stay as it was: It defines a drive
> without an inserted medium.
>
> In order to achieve this, bdrv_open() must be made safe to work with a
> NULL filename parameter. The assumption that is made is that only block
> drivers which implement bdrv_parse_filename() support using driver
> specific options and could therefore work without a filename. These
> drivers must make sure to cope with NULL in their implementation of
> .bdrv_open() (this is only NBD for now). For all other drivers, the
> block layer code will make sure to error out before calling into their
> code - they can't possibly work without a filename.
>
> Now an NBD connection can be opened like this:
>
> qemu-system-x86_64 -drive file.driver=nbd,file.port=1234,file.host=::1
>
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v2 00/12] block: Driver-specific options for protocols, Kevin Wolf, 2013/03/20
- [Qemu-devel] [PATCH v2 02/12] block: Pass bdrv_file_open() options to block drivers, Kevin Wolf, 2013/03/20
- [Qemu-devel] [PATCH v2 03/12] qemu-socket: Make socket_optslist public, Kevin Wolf, 2013/03/20
- [Qemu-devel] [PATCH v2 01/12] block: Add options QDict to bdrv_file_open() prototypes, Kevin Wolf, 2013/03/20
- [Qemu-devel] [PATCH v2 05/12] nbd: Remove unused functions, Kevin Wolf, 2013/03/20
- [Qemu-devel] [PATCH v2 04/12] nbd: Keep hostname and port separate, Kevin Wolf, 2013/03/20
- [Qemu-devel] [PATCH v2 08/12] block: Rename variable to avoid shadowing, Kevin Wolf, 2013/03/20
- [Qemu-devel] [PATCH v2 09/12] block: Make find_image_format safe with NULL filename, Kevin Wolf, 2013/03/20
- [Qemu-devel] [PATCH v2 06/12] nbd: Accept -drive options for the network connection, Kevin Wolf, 2013/03/20
- [Qemu-devel] [PATCH v2 10/12] block: Allow omitting the file name when using driver-specific options, Kevin Wolf, 2013/03/20
- Re: [Qemu-devel] [PATCH v2 10/12] block: Allow omitting the file name when using driver-specific options,
Eric Blake <=
- [Qemu-devel] [PATCH v2 11/12] nbd: Use default port if only host is specified, Kevin Wolf, 2013/03/20
- [Qemu-devel] [PATCH v2 12/12] nbd: Check against invalid option combinations, Kevin Wolf, 2013/03/20
- [Qemu-devel] [PATCH v2 07/12] block: Introduce .bdrv_parse_filename callback, Kevin Wolf, 2013/03/20