On 02/28/2018 01:25 PM, Kevin Wolf wrote: > Am 24.02.2018 um 00:51 hat John Snow geschrieben: >> Expose the "manual" property via QAPI for the backup-related jobs. >> As of this commit, this allows the management API to request the >> "concluded" and "dismiss" semantics for backup jobs. >> >> Signed-off-by: John Snow <js...@redhat.com> >> --- >> blockdev.c | 19 ++++++++++++++++--- >> qapi/block-core.json | 32 ++++++++++++++++++++++++++------ >> 2 files changed, 42 insertions(+), 9 deletions(-) >> >> diff --git a/blockdev.c b/blockdev.c >> index 05fd421cdc..2eddb0e726 100644 >> --- a/blockdev.c >> +++ b/blockdev.c >> @@ -3260,7 +3260,7 @@ static BlockJob *do_drive_backup(DriveBackup *backup, >> BlockJobTxn *txn, >> AioContext *aio_context; >> QDict *options = NULL; >> Error *local_err = NULL; >> - int flags; >> + int flags, job_flags = BLOCK_JOB_DEFAULT; >> int64_t size; >> bool set_backing_hd = false; >> >> @@ -3279,6 +3279,9 @@ static BlockJob *do_drive_backup(DriveBackup *backup, >> BlockJobTxn *txn, >> if (!backup->has_job_id) { >> backup->job_id = NULL; >> } >> + if (!backup->has_manual) { >> + backup->manual = false; >> + } > > I think this is unnecessary these days, NULL/0/false is the default > value for QMP/QAPI. >
That's what I get for cargo cult. Eric, confirm/deny? Should I remove the other auto-false defaults too? Either we have them all or none of them for consistency. --js >> if (!backup->has_compress) { >> backup->compress = false; >> } >> @@ -3422,6 +3429,9 @@ BlockJob *do_blockdev_backup(BlockdevBackup *backup, >> BlockJobTxn *txn, >> if (!backup->has_job_id) { >> backup->job_id = NULL; >> } >> + if (!backup->has_manual) { >> + backup->manual = false; >> + } > > Same here. > >> if (!backup->has_compress) { >> backup->compress = false; >> } > > Kevin >