thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-backup-Improve-error-for-bdrv_getlength-failure.patch

77c23f
From fba183faf8ce819262a1a47f8531ea68051cdce7 Mon Sep 17 00:00:00 2001
77c23f
From: Kevin Wolf <kwolf@redhat.com>
77c23f
Date: Wed, 3 Jun 2020 16:03:19 +0100
77c23f
Subject: [PATCH 20/26] backup: Improve error for bdrv_getlength() failure
77c23f
77c23f
RH-Author: Kevin Wolf <kwolf@redhat.com>
77c23f
Message-id: <20200603160325.67506-6-kwolf@redhat.com>
77c23f
Patchwork-id: 97103
77c23f
O-Subject: [RHEL-AV-8.2.1 qemu-kvm PATCH v2 05/11] backup: Improve error for bdrv_getlength() failure
77c23f
Bugzilla: 1778593
77c23f
RH-Acked-by: Eric Blake <eblake@redhat.com>
77c23f
RH-Acked-by: Max Reitz <mreitz@redhat.com>
77c23f
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
77c23f
77c23f
bdrv_get_device_name() will be an empty string with modern management
77c23f
tools that don't use -drive. Use bdrv_get_device_or_node_name() instead
77c23f
so that the node name is used if the BlockBackend is anonymous.
77c23f
77c23f
While at it, start with upper case to make the message consistent with
77c23f
the rest of the function.
77c23f
77c23f
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
77c23f
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
77c23f
Reviewed-by: Alberto Garcia <berto@igalia.com>
77c23f
Message-Id: <20200430142755.315494-3-kwolf@redhat.com>
77c23f
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
77c23f
(cherry picked from commit 58226634c4b02af7b10862f7fbd3610a344bfb7f)
77c23f
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
77c23f
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
77c23f
---
77c23f
 block/backup.c | 4 ++--
77c23f
 1 file changed, 2 insertions(+), 2 deletions(-)
77c23f
77c23f
diff --git a/block/backup.c b/block/backup.c
77c23f
index ec50946..7c6ddd2 100644
77c23f
--- a/block/backup.c
77c23f
+++ b/block/backup.c
77c23f
@@ -408,8 +408,8 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
77c23f
 
77c23f
     len = bdrv_getlength(bs);
77c23f
     if (len < 0) {
77c23f
-        error_setg_errno(errp, -len, "unable to get length for '%s'",
77c23f
-                         bdrv_get_device_name(bs));
77c23f
+        error_setg_errno(errp, -len, "Unable to get length for '%s'",
77c23f
+                         bdrv_get_device_or_node_name(bs));
77c23f
         goto error;
77c23f
     }
77c23f
 
77c23f
-- 
77c23f
1.8.3.1
77c23f