]> xenbits.xensource.com Git - libvirt.git/commit
storageDriverAutostartCallback: Refactor control flow
authorPeter Krempa <pkrempa@redhat.com>
Thu, 20 Jan 2022 10:36:29 +0000 (11:36 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 20 Jan 2022 13:23:56 +0000 (14:23 +0100)
commita09c5b3cc21486481d4a584936b318723670decd
treec4feb3e31ce29c0e8130c532c6efbf5898c2a691
parent8a80df95ac1cdd481bbabbd6fcda666bedc9b1ed
storageDriverAutostartCallback: Refactor control flow

Use early returns to decrease the indentation level and make it more
obvious that the 'cleanup' path is a noop in those cases.

'virStoragePoolObjSetStarting' was called only when the code wanted to
start the pool, so if that was skipped, cleanup is noop as it's
conditional on the return value of 'virStoragePoolObjIsStarting'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/storage/storage_driver.c