1 From c6b074069e25ec722879f09672df89a446ef4f0a Mon Sep 17 00:00:00 2001
2 From: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 Date: Wed, 9 Dec 2015 15:39:36 +0100
4 Subject: [PATCH 19/55] backup: vma: correctly propagate error
8 vma-writer.c | 7 +++++++
10 3 files changed, 9 insertions(+), 1 deletion(-)
12 diff --git a/blockdev.c b/blockdev.c
13 index 157cc44..0ea8189 100644
16 @@ -3050,7 +3050,7 @@ static int pvebackup_dump_cb(void *opaque, BlockDriverState *target,
19 if (!backup_state.error) {
20 - error_setg(&backup_state.error, "vma_writer_write error %d", ret);
21 + vma_writer_error_propagate(backup_state.vmaw, &backup_state.error);
23 if (di->bs && di->bs->job) {
24 block_job_cancel(di->bs->job);
25 diff --git a/vma-writer.c b/vma-writer.c
26 index 8a3fa1c..425c4b9 100644
29 @@ -798,6 +798,13 @@ vma_writer_write(VmaWriter *vmaw, uint8_t dev_id, int64_t cluster_num,
33 +void vma_writer_error_propagate(VmaWriter *vmaw, Error **errp)
35 + if (vmaw->status < 0 && *errp == NULL) {
36 + error_setg(errp, "%s", vmaw->errmsg);
40 int vma_writer_close(VmaWriter *vmaw, Error **errp)
42 g_assert(vmaw != NULL);
43 diff --git a/vma.h b/vma.h
44 index 9bb6ea4..98377e4 100644
47 @@ -116,6 +116,7 @@ typedef struct VmaDeviceInfo {
49 VmaWriter *vma_writer_create(const char *filename, uuid_t uuid, Error **errp);
50 int vma_writer_close(VmaWriter *vmaw, Error **errp);
51 +void vma_writer_error_propagate(VmaWriter *vmaw, Error **errp);
52 void vma_writer_destroy(VmaWriter *vmaw);
53 int vma_writer_add_config(VmaWriter *vmaw, const char *name, gpointer data,