block: Allow reference for bdrv_file_open()

Allow specifying a reference to an existing block device (by name) for
bdrv_file_open() instead of a filename and/or options.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Max Reitz 2013-12-20 19:28:08 +01:00 committed by Kevin Wolf
parent 89f2b21e36
commit 72daa72eee
12 changed files with 41 additions and 19 deletions

View file

@ -59,7 +59,7 @@ static int openfile(char *name, int flags, int growable, QDict *opts)
}
if (growable) {
if (bdrv_file_open(&qemuio_bs, name, opts, flags, &local_err)) {
if (bdrv_file_open(&qemuio_bs, name, NULL, opts, flags, &local_err)) {
fprintf(stderr, "%s: can't open device %s: %s\n", progname, name,
error_get_pretty(local_err));
error_free(local_err);