aboutsummaryrefslogtreecommitdiff
path: root/block/backup.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2020-04-30 16:27:53 +0200
committerKevin Wolf <kwolf@redhat.com>2020-05-08 13:26:35 +0200
commit58226634c4b02af7b10862f7fbd3610a344bfb7f (patch)
tree3b3f4982cd47516e6ae9b3fd19ace71c3b6471d4 /block/backup.c
parent813cc2545b82409fd504509f0ba2e96fab6edb9e (diff)
downloadqemu-58226634c4b02af7b10862f7fbd3610a344bfb7f.zip
qemu-58226634c4b02af7b10862f7fbd3610a344bfb7f.tar.gz
qemu-58226634c4b02af7b10862f7fbd3610a344bfb7f.tar.bz2
backup: Improve error for bdrv_getlength() failure
bdrv_get_device_name() will be an empty string with modern management tools that don't use -drive. Use bdrv_get_device_or_node_name() instead so that the node name is used if the BlockBackend is anonymous. While at it, start with upper case to make the message consistent with the rest of the function. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Message-Id: <20200430142755.315494-3-kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/backup.c')
-rw-r--r--block/backup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block/backup.c b/block/backup.c
index a7a7dca..c4c3b8c 100644
--- a/block/backup.c
+++ b/block/backup.c
@@ -400,8 +400,8 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
len = bdrv_getlength(bs);
if (len < 0) {
- error_setg_errno(errp, -len, "unable to get length for '%s'",
- bdrv_get_device_name(bs));
+ error_setg_errno(errp, -len, "Unable to get length for '%s'",
+ bdrv_get_device_or_node_name(bs));
goto error;
}