1 From 7f74494cc36b70074bbdf8aaaca7eb7d0ad6c5e5 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 18/41] 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 fb71cdc..2e51913 100644
16 @@ -3037,7 +3037,7 @@ static int pvebackup_dump_cb(void *opaque, BlockBackend *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 b0cf529..689e988 100644
29 @@ -792,6 +792,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,