]> git.proxmox.com Git - mirror_qemu.git/commit - block.c
block: Simplify bdrv_append_temp_snapshot() logic
authorEric Blake <eblake@redhat.com>
Thu, 27 Apr 2017 21:58:18 +0000 (16:58 -0500)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 9 May 2017 07:14:39 +0000 (09:14 +0200)
commitff6ed7141d87d26eafa2b8e4df969623e40fac49
treeeedb7135d64638688c41dbd54ae577ff3727bbfe
parent46f5ac205a9dc5e2c24274c7df371509a286281f
block: Simplify bdrv_append_temp_snapshot() logic

Noticed while checking Coccinelle results. Naming a label 'out:'
when it is only used on error paths is weird.  Also, we had some
dead stores to 'ret'.  Meanwhile we know that snapshot_options
is NULL on success and that QDECREF(NULL) is safe.  So merge the
two exit paths into one by careful control over bs_snapshot.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20170427215821.19397-8-eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
block.c