summaryrefslogtreecommitdiff
path: root/src/qemu/qemu_block.c
diff options
context:
space:
mode:
authorPeter Krempa <pkrempa@redhat.com>2023-01-09 14:01:59 +0100
committerPeter Krempa <pkrempa@redhat.com>2023-01-09 14:13:25 +0100
commit64366c005693a2fc389e3f61dbc68259ead2c260 (patch)
tree034faa92d7c835a5fb085d9b24ad239bd4d0f9df /src/qemu/qemu_block.c
parentbb80344fd00263b88890712152084502ac516cc8 (diff)
downloadlibvirt-64366c005693a2fc389e3f61dbc68259ead2c260.tar.gz
qemu: snapshot: Restructure control flow to detect errors sooner and work around compiler
Some compilers aren't happy when an automatically freed variable is used just to free something (thus it's only assigned in the code): When compiling qemuSnapshotDelete after recent commits they complain: ../src/qemu/qemu_snapshot.c:3153:61: error: variable 'delData' set but not used [-Werror,-Wunused-but-set-variable] g_autoslist(qemuSnapshotDeleteExternalData) delData = NULL; ^ To work around the issue we can restructure the code which also has the following semantic implications: - since qemuSnapshotDeleteExternalPrepare does validation we error out sooner than attempting to start the VM - we read the temporary variable at least in one code path Fixes: 4a4d89a9252 Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Diffstat (limited to 'src/qemu/qemu_block.c')
0 files changed, 0 insertions, 0 deletions