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 <[email protected]> Cc: Kevin Wolf <[email protected]> Cc: Hanna Reitz <[email protected]> Cc: [email protected] Message-Id: <[email protected]> Reviewed-by: Eric Blake <[email protected]>
- Loading branch information