From 81e5f78a9f4f13548ec1edddaf780d339f18e2d2 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Date: Wed, 8 Apr 2015 12:29:19 +0300 Subject: block: use bdrv_get_device_or_node_name() in error messages There are several error messages that identify a BlockDriverState by its device name. However those errors can be produced in nodes that don't have a device name associated. In those cases we should use bdrv_get_device_or_node_name() to fall back to the node name and produce a more meaningful message. The messages are also updated to use the more generic term 'node' instead of 'device'. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz Reviewed-by: Eric Blake Message-id: 9823a1f0514fdb0692e92868661c38a9e00a12d6.1428485266.git.berto@igalia.com Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- block/vvfat.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'block/vvfat.c') diff --git a/block/vvfat.c b/block/vvfat.c index 9be632f404..e803589675 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -1180,9 +1180,10 @@ static int vvfat_open(BlockDriverState *bs, QDict *options, int flags, /* Disable migration when vvfat is used rw */ if (s->qcow) { - error_set(&s->migration_blocker, - QERR_BLOCK_FORMAT_FEATURE_NOT_SUPPORTED, - "vvfat (rw)", bdrv_get_device_name(bs), "live migration"); + error_setg(&s->migration_blocker, + "The vvfat (rw) format used by node '%s' " + "does not support live migration", + bdrv_get_device_or_node_name(bs)); migrate_add_blocker(s->migration_blocker); } -- cgit v1.2.3