'qemuDomainStorageAlias' always returns non-NULL pointer if it gets a
non-NULL string on input. Remove unneeded checks from callers.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_driver.c | 5 ++---
src/qemu/qemu_monitor_json.c | 5 ++---
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index aee66b2bc7..877fefaa38 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -17415,9 +17415,8 @@ qemuDomainGetStatsBlockExportDisk(virDomainDiskDef *disk,
backendstoragealias = qemuBlockStorageSourceGetStorageNodename(n);
} else {
/* alias may be NULL if the VM is not running */
- if (disk->info.alias &&
- !(alias = qemuDomainStorageAlias(disk->info.alias, n->id)))
- return -1;
+ if (disk->info.alias)
+ alias = qemuDomainStorageAlias(disk->info.alias, n->id);
/* for 'sd' disks we won't be displaying stats for the backing
chain
* as we don't update the stats correctly */
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 554572b13d..74420b2ee7 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -2332,9 +2332,8 @@ qemuMonitorJSONGetOneBlockStatsInfo(virJSONValue *dev,
g_autofree char *devicename = NULL;
virJSONValue *backing;
- if (dev_name &&
- !(devicename = qemuDomainStorageAlias(dev_name, depth)))
- return -1;
+ if (dev_name)
+ devicename = qemuDomainStorageAlias(dev_name, depth);
qdevname = virJSONValueObjectGetString(dev, "qdev");
nodename = virJSONValueObjectGetString(dev, "node-name");
--
2.48.1