|
|
9ae3a8 |
From 4aeb6d14385793a46b11d4d129bbad6c9fe9132b Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Laszlo Ersek <lersek@redhat.com>
|
|
|
9ae3a8 |
Date: Thu, 31 Oct 2013 16:29:26 +0100
|
|
|
9ae3a8 |
Subject: [PATCH 07/29] blockdev: use error_setg_file_open()
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Laszlo Ersek <lersek@redhat.com>
|
|
|
9ae3a8 |
Message-id: <1383236971-6067-4-git-send-email-lersek@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 55193
|
|
|
9ae3a8 |
O-Subject: [RHEL-7 qemu-kvm PATCH 3/8] blockdev: use error_setg_file_open()
|
|
|
9ae3a8 |
Bugzilla: 907743
|
|
|
9ae3a8 |
RH-Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
From: Luiz Capitulino <lcapitulino@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
|
|
|
9ae3a8 |
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
9ae3a8 |
Acked-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from commit 0eef407c7b4130d13138c1f75d9975165433f654)
|
|
|
9ae3a8 |
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
blockdev.c | 11 +++++++----
|
|
|
9ae3a8 |
1 file changed, 7 insertions(+), 4 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
blockdev.c | 11 +++++++----
|
|
|
9ae3a8 |
1 files changed, 7 insertions(+), 4 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/blockdev.c b/blockdev.c
|
|
|
9ae3a8 |
index 073f553..f65aff4 100644
|
|
|
9ae3a8 |
--- a/blockdev.c
|
|
|
9ae3a8 |
+++ b/blockdev.c
|
|
|
9ae3a8 |
@@ -950,7 +950,7 @@ static void external_snapshot_prepare(BlkTransactionStates *common,
|
|
|
9ae3a8 |
ret = bdrv_open(states->new_bs, new_image_file, NULL,
|
|
|
9ae3a8 |
flags | BDRV_O_NO_BACKING, drv);
|
|
|
9ae3a8 |
if (ret != 0) {
|
|
|
9ae3a8 |
- error_set(errp, QERR_OPEN_FILE_FAILED, new_image_file);
|
|
|
9ae3a8 |
+ error_setg_file_open(errp, -ret, new_image_file);
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -1113,8 +1113,11 @@ static void qmp_bdrv_open_encrypted(BlockDriverState *bs, const char *filename,
|
|
|
9ae3a8 |
int bdrv_flags, BlockDriver *drv,
|
|
|
9ae3a8 |
const char *password, Error **errp)
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
- if (bdrv_open(bs, filename, NULL, bdrv_flags, drv) < 0) {
|
|
|
9ae3a8 |
- error_set(errp, QERR_OPEN_FILE_FAILED, filename);
|
|
|
9ae3a8 |
+ int ret;
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+ ret = bdrv_open(bs, filename, NULL, bdrv_flags, drv);
|
|
|
9ae3a8 |
+ if (ret < 0) {
|
|
|
9ae3a8 |
+ error_setg_file_open(errp, -ret, filename);
|
|
|
9ae3a8 |
return;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -1526,7 +1529,7 @@ void qmp_drive_mirror(const char *device, const char *target,
|
|
|
9ae3a8 |
ret = bdrv_open(target_bs, target, NULL, flags | BDRV_O_NO_BACKING, drv);
|
|
|
9ae3a8 |
if (ret < 0) {
|
|
|
9ae3a8 |
bdrv_delete(target_bs);
|
|
|
9ae3a8 |
- error_set(errp, QERR_OPEN_FILE_FAILED, target);
|
|
|
9ae3a8 |
+ error_setg_file_open(errp, -ret, target);
|
|
|
9ae3a8 |
return;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.7.1
|
|
|
9ae3a8 |
|