From bfb197e0d998bea8741c65492b2b42f443729249 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 7 Oct 2014 13:59:11 +0200 Subject: block: Eliminate BlockDriverState member device_name[] device_name[] can become non-empty only in bdrv_new_root() and bdrv_move_feature_fields(). The latter is used only to undo damage done by bdrv_swap(). The former is called only by blk_new_with_bs(). Therefore, when a BlockDriverState's device_name[] is non-empty, then it's been created with a BlockBackend, and vice versa. Furthermore, blk_new_with_bs() keeps the two names equal. Therefore, device_name[] is redundant. Eliminate it. Signed-off-by: Markus Armbruster Reviewed-by: Max Reitz Signed-off-by: Kevin Wolf --- block/qcow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'block/qcow.c') diff --git a/block/qcow.c b/block/qcow.c index a87bd69..ece2269 100644 --- a/block/qcow.c +++ b/block/qcow.c @@ -124,7 +124,7 @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags, snprintf(version, sizeof(version), "QCOW version %" PRIu32, header.version); error_set(errp, QERR_UNKNOWN_BLOCK_FORMAT_FEATURE, - bs->device_name, "qcow", version); + bdrv_get_device_name(bs), "qcow", version); ret = -ENOTSUP; goto fail; } @@ -231,7 +231,7 @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags, /* Disable migration when qcow images are used */ error_set(&s->migration_blocker, QERR_BLOCK_FORMAT_FEATURE_NOT_SUPPORTED, - "qcow", bs->device_name, "live migration"); + "qcow", bdrv_get_device_name(bs), "live migration"); migrate_add_blocker(s->migration_blocker); qemu_co_mutex_init(&s->lock); -- cgit v1.1