From 4cdd01d32ee6fe04f8d909bfd3708be6864873a2 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Mon, 27 Apr 2015 13:50:54 +0200 Subject: 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 Reviewed-by: Max Reitz Reviewed-by: Alberto Garcia --- block/nbd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'block/nbd.c') diff --git a/block/nbd.c b/block/nbd.c index cd6a587..416f42b 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -342,13 +342,13 @@ static void nbd_attach_aio_context(BlockDriverState *bs, nbd_client_attach_aio_context(bs, new_context); } -static void nbd_refresh_filename(BlockDriverState *bs) +static void nbd_refresh_filename(BlockDriverState *bs, QDict *options) { QDict *opts = qdict_new(); - const char *path = qdict_get_try_str(bs->options, "path"); - const char *host = qdict_get_try_str(bs->options, "host"); - const char *port = qdict_get_try_str(bs->options, "port"); - const char *export = qdict_get_try_str(bs->options, "export"); + const char *path = qdict_get_try_str(options, "path"); + const char *host = qdict_get_try_str(options, "host"); + const char *port = qdict_get_try_str(options, "port"); + const char *export = qdict_get_try_str(options, "export"); qdict_put_obj(opts, "driver", QOBJECT(qstring_from_str("nbd"))); -- cgit v1.1