From 08e0ffe8f58dc0ca45d1b77da4f6d2d8fc32e26a Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Tue, 8 Oct 2019 15:14:22 +0200 Subject: [PATCH] qemu: domain: Remove pointless return value in qemuDomainPrepareDiskSourceData The function does not do anything that could fail. Remove the return value. Signed-off-by: Peter Krempa Reviewed-by: Daniel Henrique Barboza --- src/qemu/qemu_domain.c | 16 ++++------------ src/qemu/qemu_domain.h | 5 ++--- tests/qemublocktest.c | 3 +-- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 8ef2947061..e101f2f07e 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -10379,9 +10379,7 @@ qemuDomainDetermineDiskChain(virQEMUDriverPtr driver, return -1; qemuDomainPrepareStorageSourceConfig(n, cfg, priv->qemuCaps); - - if (qemuDomainPrepareDiskSourceData(disk, n) < 0) - return -1; + qemuDomainPrepareDiskSourceData(disk, n); if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV) && qemuDomainPrepareStorageSourceBlockdev(disk, n, priv, cfg) < 0) @@ -15080,7 +15078,7 @@ qemuDomainCheckCCWS390AddressSupport(const virDomainDef *def, * chain. This function should be also called for detected backing chain * members. */ -int +void qemuDomainPrepareDiskSourceData(virDomainDiskDefPtr disk, virStorageSourcePtr src) { @@ -15095,8 +15093,6 @@ qemuDomainPrepareDiskSourceData(virDomainDiskDefPtr disk, if (disk->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY) src->floppyimg = true; - - return 0; } @@ -15148,9 +15144,7 @@ qemuDomainPrepareDiskSourceLegacy(virDomainDiskDefPtr disk, return -1; qemuDomainPrepareStorageSourceConfig(disk->src, cfg, priv->qemuCaps); - - if (qemuDomainPrepareDiskSourceData(disk, disk->src) < 0) - return -1; + qemuDomainPrepareDiskSourceData(disk, disk->src); if (qemuDomainSecretStorageSourcePrepare(priv, disk->src, disk->info.alias, @@ -15184,9 +15178,7 @@ qemuDomainPrepareStorageSourceBlockdev(virDomainDiskDefPtr disk, return -1; qemuDomainPrepareStorageSourceConfig(src, cfg, priv->qemuCaps); - - if (qemuDomainPrepareDiskSourceData(disk, src) < 0) - return -1; + qemuDomainPrepareDiskSourceData(disk, src); if (qemuDomainSecretStorageSourcePrepare(priv, src, src->nodestorage, diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 796911c197..b23912ee98 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -1169,10 +1169,9 @@ qemuDomainCheckCCWS390AddressSupport(const virDomainDef *def, virQEMUCapsPtr qemuCaps, const char *devicename); -int +void qemuDomainPrepareDiskSourceData(virDomainDiskDefPtr disk, - virStorageSourcePtr src) - G_GNUC_WARN_UNUSED_RESULT; + virStorageSourcePtr src); int diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index e277744b06..5f89d73c72 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -222,8 +222,7 @@ testQemuDiskXMLToProps(const void *opaque) if (qemuDomainValidateStorageSource(n, data->qemuCaps) < 0) goto cleanup; - if (qemuDomainPrepareDiskSourceData(disk, n) < 0) - goto cleanup; + qemuDomainPrepareDiskSourceData(disk, n); if (!(formatProps = qemuBlockStorageSourceGetBlockdevProps(n, n->backingStore)) || !(storageSrcOnlyProps = qemuBlockStorageSourceGetBackendProps(n, false, true, true)) || -- GitLab