Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
blockdev: Clean up abuse of DriveBackup member format
drive-backup argument @Format defaults to the format of the source unless @mode is "existing". drive_backup_prepare() implements this by copying the source's @format_name to DriveBackup member @Format. It leaves @has_format false, violating the "has_format == !!format" invariant. Unclean. Falls apart when we elide @has_format (commit after next): then QAPI passes @Format, which is a string constant, to g_free(). iotest 056 duly explodes. Clean it up. Since the value stored in member @Format is not actually used outside this function, use a local variable instead of modifying the QAPI object. Signed-off-by: Markus Armbruster <armbru@redhat.com> Cc: Kevin Wolf <kwolf@redhat.com> Cc: Hanna Reitz <hreitz@redhat.com> Cc: qemu-block@nongnu.org Message-Id: <20221104160712.3005652-9-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
- Loading branch information