qemu/include
Kevin Wolf c2ad1b0c46 block: Allow omitting the file name when using driver-specific options
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 <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2013-03-22 17:51:32 +01:00
..
block block: Allow omitting the file name when using driver-specific options 2013-03-22 17:51:32 +01:00
bt softmmu: move remaining include files to include/ subdirectories 2012-12-19 08:32:46 +01:00
char char: Fix return type of qemu_chr_fe_add_watch() 2013-03-19 07:56:07 -05:00
disas build: kill libdis, move disassemblers to disas/ 2012-12-19 08:29:06 +01:00
exec cpu: Pass CPUState to cpu_interrupt() 2013-03-12 10:35:55 +01:00
fpu softfloat: Implement uint64_to_float128 2013-01-05 10:12:50 +00:00
migration stubs: Add a vmstate_dummy struct for CONFIG_USER_ONLY 2013-03-12 10:35:54 +01:00
monitor hw: move qdev-monitor.o to toplevel directory 2013-03-01 13:54:10 +01:00
net net: reduce the unnecessary memory allocation of multiqueue 2013-02-27 16:10:47 +01:00
qapi Add qdict_clone_shallow() 2013-03-15 16:07:49 +01:00
qemu nbd: Keep hostname and port separate 2013-03-22 17:51:31 +01:00
qom cpu: Replace do_interrupt() by CPUClass::do_interrupt method 2013-03-12 10:35:55 +01:00
sysemu blockdev: Keep a copy of DriveInfo.serial 2013-03-15 16:07:49 +01:00
tpm Support for TPM command line options 2013-03-12 13:40:11 -05:00
ui console: remove ds_get_* helper functions 2013-03-18 10:21:59 +01:00
config.h janitor: move remaining public headers to include/ 2012-12-19 08:32:46 +01:00
elf.h janitor: move remaining public headers to include/ 2012-12-19 08:32:46 +01:00
libfdt_env.h fdt: Use bswapN instead of bswap_N 2013-01-12 12:22:58 +00:00
qemu-common.h iov: Factor out hexdumper 2013-03-15 16:41:58 +00:00
trace.h build: some simplifications for "trace/Makefile.objs" 2013-01-12 18:42:51 +01:00