mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 14:35:25 +00:00
qemuDomainDiskBackingStoreGetName: Eliminate temp variable
We can return the formatted string directly. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
4a19b7b832
commit
48b7c33cc7
@ -11633,14 +11633,10 @@ char *
|
|||||||
qemuDomainDiskBackingStoreGetName(virDomainDiskDefPtr disk,
|
qemuDomainDiskBackingStoreGetName(virDomainDiskDefPtr disk,
|
||||||
unsigned int idx)
|
unsigned int idx)
|
||||||
{
|
{
|
||||||
char *ret = NULL;
|
|
||||||
|
|
||||||
if (idx)
|
if (idx)
|
||||||
ret = g_strdup_printf("%s[%d]", disk->dst, idx);
|
return g_strdup_printf("%s[%d]", disk->dst, idx);
|
||||||
else
|
|
||||||
ret = g_strdup(disk->dst);
|
|
||||||
|
|
||||||
return ret;
|
return g_strdup(disk->dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user