1 The backup dump_cb should always return success. Else the original write
2 does not succeed and the VM gets notified.
4 We simply report success and cancel the backup job instead.
8 ===================================================================
9 --- new.orig/blockdev.c 2014-11-20 07:49:05.000000000 +0100
10 +++ new/blockdev.c 2014-11-20 07:49:14.000000000 +0100
11 @@ -1991,6 +1991,11 @@
13 PVEBackupDevInfo *di = opaque;
15 + int size = n_sectors * BDRV_SECTOR_SIZE;
16 + if (backup_state.cancel) {
17 + return size; // return success
20 if (sector_num & 0x7f) {
21 if (!backup_state.error) {
22 error_setg(&backup_state.error,
26 int64_t cluster_num = sector_num >> 7;
27 - int size = n_sectors * BDRV_SECTOR_SIZE;
31 @@ -2009,17 +2013,27 @@
32 size_t zero_bytes = 0;
33 ret = vma_writer_write(backup_state.vmaw, di->dev_id, cluster_num,
35 - backup_state.zero_bytes += zero_bytes;
37 + if (!backup_state.error) {
38 + error_setg(&backup_state.error, "vma_writer_write error %d", ret);
40 + if (di->bs && di->bs->job) {
41 + block_job_cancel(di->bs->job);
44 + backup_state.zero_bytes += zero_bytes;
45 + backup_state.transferred += size;
50 backup_state.zero_bytes += size;
52 + backup_state.transferred += size;
55 - backup_state.transferred += size;
56 + // Note: always return success, because we want that writes succeed anyways.
62 static void pvebackup_cleanup(void)
64 BlockJob *job = di->bs->job;
67 - block_job_cancel_sync(job);
68 + block_job_cancel_sync(job);