mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
block/backup: deal with zero detection
We have detect_zeroes option, so at least for blockdev-backup user should define it if zero-detection is needed. For drive-backup leave detection enabled by default but do it through existing option instead of open-coding. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190730163251.755248-2-vsementsov@virtuozzo.com Signed-off-by: John Snow <jsnow@redhat.com>
This commit is contained in:
parent
590a63d598
commit
319bd5edb9
2 changed files with 10 additions and 13 deletions
|
@ -3615,7 +3615,7 @@ static BlockJob *do_drive_backup(DriveBackup *backup, JobTxn *txn,
|
|||
BlockDriverState *source = NULL;
|
||||
BlockJob *job = NULL;
|
||||
AioContext *aio_context;
|
||||
QDict *options = NULL;
|
||||
QDict *options;
|
||||
Error *local_err = NULL;
|
||||
int flags;
|
||||
int64_t size;
|
||||
|
@ -3688,10 +3688,10 @@ static BlockJob *do_drive_backup(DriveBackup *backup, JobTxn *txn,
|
|||
goto out;
|
||||
}
|
||||
|
||||
options = qdict_new();
|
||||
qdict_put_str(options, "discard", "unmap");
|
||||
qdict_put_str(options, "detect-zeroes", "unmap");
|
||||
if (backup->format) {
|
||||
if (!options) {
|
||||
options = qdict_new();
|
||||
}
|
||||
qdict_put_str(options, "driver", backup->format);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue