summary refs log tree commit diff stats
path: root/scripts/qapi/visit.py
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2022-11-04 17:06:50 +0100
committerMarkus Armbruster <armbru@redhat.com>2022-12-13 18:31:37 +0100
commit04658a5b90f48b269722631b4e51b21935a6be8d (patch)
treee38f32552e989e84183afbce0697b0ce2bd12bf5 /scripts/qapi/visit.py
parentceb19c8f684c7541ee878255ed686d92cfb90175 (diff)
downloadfocaccia-qemu-04658a5b90f48b269722631b4e51b21935a6be8d.tar.gz
focaccia-qemu-04658a5b90f48b269722631b4e51b21935a6be8d.zip
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>
Diffstat (limited to 'scripts/qapi/visit.py')
0 files changed, 0 insertions, 0 deletions