mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu: driver: Don't copy disk alias in qemuDomainBlocksStatsGather
The string is not modified so it does not make sense to have a copy. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
da7123a686
commit
93fad53d3e
@ -11069,7 +11069,7 @@ qemuDomainBlocksStatsGather(virQEMUDriverPtr driver,
|
|||||||
virHashTablePtr blockstats = NULL;
|
virHashTablePtr blockstats = NULL;
|
||||||
qemuBlockStatsPtr stats;
|
qemuBlockStatsPtr stats;
|
||||||
int nstats;
|
int nstats;
|
||||||
char *diskAlias = NULL;
|
const char *entryname = NULL;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
if (*path) {
|
if (*path) {
|
||||||
@ -11084,8 +11084,7 @@ qemuDomainBlocksStatsGather(virQEMUDriverPtr driver,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VIR_STRDUP(diskAlias, disk->info.alias) < 0)
|
entryname = disk->info.alias;
|
||||||
goto cleanup;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
qemuDomainObjEnterMonitor(driver, vm);
|
qemuDomainObjEnterMonitor(driver, vm);
|
||||||
@ -11101,10 +11100,10 @@ qemuDomainBlocksStatsGather(virQEMUDriverPtr driver,
|
|||||||
if (VIR_ALLOC(*retstats) < 0)
|
if (VIR_ALLOC(*retstats) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (diskAlias) {
|
if (entryname) {
|
||||||
if (!(stats = virHashLookup(blockstats, diskAlias))) {
|
if (!(stats = virHashLookup(blockstats, entryname))) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot find statistics for device '%s'"), diskAlias);
|
_("cannot find statistics for device '%s'"), entryname);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -11116,7 +11115,6 @@ qemuDomainBlocksStatsGather(virQEMUDriverPtr driver,
|
|||||||
ret = nstats;
|
ret = nstats;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(diskAlias);
|
|
||||||
virHashFree(blockstats);
|
virHashFree(blockstats);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user