|
@@ -3546,8 +3546,7 @@ static BlockJob *do_drive_backup(DriveBackup *backup, JobTxn *txn,
|
|
if (set_backing_hd) {
|
|
if (set_backing_hd) {
|
|
bdrv_set_backing_hd(target_bs, source, &local_err);
|
|
bdrv_set_backing_hd(target_bs, source, &local_err);
|
|
if (local_err) {
|
|
if (local_err) {
|
|
- bdrv_unref(target_bs);
|
|
|
|
- goto out;
|
|
|
|
|
|
+ goto unref;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -3555,11 +3554,10 @@ static BlockJob *do_drive_backup(DriveBackup *backup, JobTxn *txn,
|
|
bmap = bdrv_find_dirty_bitmap(bs, backup->bitmap);
|
|
bmap = bdrv_find_dirty_bitmap(bs, backup->bitmap);
|
|
if (!bmap) {
|
|
if (!bmap) {
|
|
error_setg(errp, "Bitmap '%s' could not be found", backup->bitmap);
|
|
error_setg(errp, "Bitmap '%s' could not be found", backup->bitmap);
|
|
- bdrv_unref(target_bs);
|
|
|
|
- goto out;
|
|
|
|
|
|
+ goto unref;
|
|
}
|
|
}
|
|
if (bdrv_dirty_bitmap_check(bmap, BDRV_BITMAP_DEFAULT, errp)) {
|
|
if (bdrv_dirty_bitmap_check(bmap, BDRV_BITMAP_DEFAULT, errp)) {
|
|
- goto out;
|
|
|
|
|
|
+ goto unref;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (!backup->auto_finalize) {
|
|
if (!backup->auto_finalize) {
|
|
@@ -3573,12 +3571,13 @@ static BlockJob *do_drive_backup(DriveBackup *backup, JobTxn *txn,
|
|
backup->sync, bmap, backup->compress,
|
|
backup->sync, bmap, backup->compress,
|
|
backup->on_source_error, backup->on_target_error,
|
|
backup->on_source_error, backup->on_target_error,
|
|
job_flags, NULL, NULL, txn, &local_err);
|
|
job_flags, NULL, NULL, txn, &local_err);
|
|
- bdrv_unref(target_bs);
|
|
|
|
if (local_err != NULL) {
|
|
if (local_err != NULL) {
|
|
error_propagate(errp, local_err);
|
|
error_propagate(errp, local_err);
|
|
- goto out;
|
|
|
|
|
|
+ goto unref;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+unref:
|
|
|
|
+ bdrv_unref(target_bs);
|
|
out:
|
|
out:
|
|
aio_context_release(aio_context);
|
|
aio_context_release(aio_context);
|
|
return job;
|
|
return job;
|