aboutsummaryrefslogtreecommitdiff
path: root/blockdev.c
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>2024-03-13 18:28:21 +0300
committerVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>2024-05-28 15:52:15 +0300
commit0fd05c8d807dc7cd25b2f9bf32dd4135c94acb7a (patch)
tree3a77f8f16cedb241024faafc1819f1b0a1784110 /blockdev.c
parent006e845b5a4cbb1f93a2e8ed22fa648b9d7e4182 (diff)
downloadqemu-0fd05c8d807dc7cd25b2f9bf32dd4135c94acb7a.zip
qemu-0fd05c8d807dc7cd25b2f9bf32dd4135c94acb7a.tar.gz
qemu-0fd05c8d807dc7cd25b2f9bf32dd4135c94acb7a.tar.bz2
qapi: blockdev-backup: add discard-source parameter
Add a parameter that enables discard-after-copy. That is mostly useful in "push backup with fleecing" scheme, when source is snapshot-access format driver node, based on copy-before-write filter snapshot-access API: [guest] [snapshot-access] ~~ blockdev-backup ~~> [backup target] | | | root | file v v [copy-before-write] | | | file | target v v [active disk] [temp.img] In this case discard-after-copy does two things: - discard data in temp.img to save disk space - avoid further copy-before-write operation in discarded area Note that we have to declare WRITE permission on source in copy-before-write filter, for discard to work. Still we can't take it unconditionally, as it will break normal backup from RO source. So, we have to add a parameter and pass it thorough bdrv_open flags. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Reviewed-by: Fiona Ebner <f.ebner@proxmox.com> Tested-by: Fiona Ebner <f.ebner@proxmox.com> Acked-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20240313152822.626493-5-vsementsov@yandex-team.ru> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Diffstat (limited to 'blockdev.c')
-rw-r--r--blockdev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/blockdev.c b/blockdev.c
index 528db34..835064e 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2728,7 +2728,7 @@ static BlockJob *do_backup_common(BackupCommon *backup,
job = backup_job_create(backup->job_id, bs, target_bs, backup->speed,
backup->sync, bmap, backup->bitmap_mode,
- backup->compress,
+ backup->compress, backup->discard_source,
backup->filter_node_name,
&perf,
backup->on_source_error,