block: Pass driver-specific options to .bdrv_refresh_filename()

In order to decide whether a blkdebug: filename can be produced or a
json: one is necessary, blkdebug checked whether bs->options had more
options than just "config", "x-image" or "image" (the latter including
nested options). That doesn't work well when generic block layer options
are present.

This patch passes an option QDict to the driver that contains only
driver-specific options, i.e. the options for the general block layer as
well as child nodes are already filtered out. Works much better this
way.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
This commit is contained in:
Kevin Wolf 2015-04-27 13:50:54 +02:00
parent 260fecf13b
commit 4cdd01d32e
6 changed files with 18 additions and 20 deletions

View file

@ -4027,7 +4027,10 @@ void bdrv_refresh_filename(BlockDriverState *bs)
bs->full_open_options = NULL;
}
drv->bdrv_refresh_filename(bs);
opts = qdict_new();
append_open_options(opts, bs);
drv->bdrv_refresh_filename(bs, opts);
QDECREF(opts);
} else if (bs->file) {
/* Try to reconstruct valid information from the underlying file */
bool has_open_options;