From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com,
qemu-devel@nongnu.org, mreitz@redhat.com
Subject: [PATCH 1/3] backup: Improve error for bdrv_getlength() failure
Date: Wed, 29 Apr 2020 13:15:37 +0200 [thread overview]
Message-ID: <20200429111539.42103-2-kwolf@redhat.com> (raw)
In-Reply-To: <20200429111539.42103-1-kwolf@redhat.com>
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>
---
block/backup.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/backup.c b/block/backup.c
index a7a7dcaf4c..c4c3b8cd46 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;
}
--
2.25.3
next prev parent reply other threads:[~2020-04-29 11:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-29 11:15 [PATCH 0/3] backup: Make sure that source and target size match Kevin Wolf
2020-04-29 11:15 ` Kevin Wolf [this message]
2020-04-29 11:29 ` [PATCH 1/3] backup: Improve error for bdrv_getlength() failure Vladimir Sementsov-Ogievskiy
2020-04-29 12:31 ` Alberto Garcia
2020-04-29 11:15 ` [PATCH 2/3] backup: Make sure that source and target size match Kevin Wolf
2020-04-29 12:00 ` Vladimir Sementsov-Ogievskiy
2020-04-29 11:15 ` [PATCH 3/3] iotests: Backup with different source/target size Kevin Wolf
2020-04-29 12:28 ` Vladimir Sementsov-Ogievskiy
2020-04-30 11:41 ` Kevin Wolf
2020-04-30 12:16 ` Vladimir Sementsov-Ogievskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200429111539.42103-2-kwolf@redhat.com \
--to=kwolf@redhat.com \
--cc=jsnow@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).