From: Peter Krempa Date: Mon, 24 Jun 2019 13:48:59 +0000 (+0200) Subject: qemu: command: get rid of 'cleanup' in qemuBuildDiskSourceCommandLine X-Git-Tag: v5.5.0-rc1~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c64010d3e84fba13c4ee7f8e211831a27fb7ce45;p=thirdparty%2Flibvirt.git qemu: command: get rid of 'cleanup' in qemuBuildDiskSourceCommandLine Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 0baae43339..85d1e3b7b0 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2563,43 +2563,37 @@ qemuBuildDiskSourceCommandLine(virCommandPtr cmd, VIR_AUTOPTR(virJSONValue) copyOnReadProps = NULL; VIR_AUTOFREE(char *) copyOnReadPropsStr = NULL; size_t i; - int ret = -1; if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) { - if (virStorageSourceIsEmpty(disk->src)) { - ret = 0; - goto cleanup; - } + if (virStorageSourceIsEmpty(disk->src)) + return 0; if (!(data = qemuBuildStorageSourceChainAttachPrepareBlockdev(disk->src, qemuCaps))) - goto cleanup; + return -1; if (disk->copy_on_read == VIR_TRISTATE_SWITCH_ON && !(copyOnReadProps = qemuBlockStorageGetCopyOnReadProps(disk))) - goto cleanup; + return -1; } else { if (!(data = qemuBuildStorageSourceChainAttachPrepareDrive(disk, qemuCaps))) - goto cleanup; + return -1; } for (i = data->nsrcdata; i > 0; i--) { if (qemuBuildBlockStorageSourceAttachDataCommandline(cmd, data->srcdata[i - 1]) < 0) - goto cleanup; + return -1; } if (copyOnReadProps) { if (!(copyOnReadPropsStr = virJSONValueToString(copyOnReadProps, false))) - goto cleanup; + return -1; virCommandAddArgList(cmd, "-blockdev", copyOnReadPropsStr, NULL); } - ret = 0; - - cleanup: - return ret; + return 0; }