qemuDomainBlocksStatsGather: Remove pre-blockdev code paths
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
69e3a31729
commit
837b637f40
@ -10022,7 +10022,6 @@ qemuDomainBlocksStatsGather(virDomainObj *vm,
|
|||||||
qemuBlockStats **retstats)
|
qemuBlockStats **retstats)
|
||||||
{
|
{
|
||||||
qemuDomainObjPrivate *priv = vm->privateData;
|
qemuDomainObjPrivate *priv = vm->privateData;
|
||||||
bool blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV);
|
|
||||||
virDomainDiskDef *disk = NULL;
|
virDomainDiskDef *disk = NULL;
|
||||||
g_autoptr(GHashTable) blockstats = NULL;
|
g_autoptr(GHashTable) blockstats = NULL;
|
||||||
qemuBlockStats *stats;
|
qemuBlockStats *stats;
|
||||||
@ -10058,12 +10057,8 @@ qemuDomainBlocksStatsGather(virDomainObj *vm,
|
|||||||
qemuDomainObjEnterMonitor(vm);
|
qemuDomainObjEnterMonitor(vm);
|
||||||
nstats = qemuMonitorGetAllBlockStatsInfo(priv->mon, &blockstats);
|
nstats = qemuMonitorGetAllBlockStatsInfo(priv->mon, &blockstats);
|
||||||
|
|
||||||
if (capacity && nstats >= 0) {
|
if (capacity && nstats >= 0)
|
||||||
if (blockdev)
|
rc = qemuMonitorBlockStatsUpdateCapacityBlockdev(priv->mon, blockstats);
|
||||||
rc = qemuMonitorBlockStatsUpdateCapacityBlockdev(priv->mon, blockstats);
|
|
||||||
else
|
|
||||||
rc = qemuMonitorBlockStatsUpdateCapacity(priv->mon, blockstats);
|
|
||||||
}
|
|
||||||
|
|
||||||
qemuDomainObjExitMonitor(vm);
|
qemuDomainObjExitMonitor(vm);
|
||||||
|
|
||||||
@ -10073,6 +10068,8 @@ qemuDomainBlocksStatsGather(virDomainObj *vm,
|
|||||||
*retstats = g_new0(qemuBlockStats, 1);
|
*retstats = g_new0(qemuBlockStats, 1);
|
||||||
|
|
||||||
if (entryname) {
|
if (entryname) {
|
||||||
|
qemuBlockStats *capstats;
|
||||||
|
|
||||||
if (!(stats = virHashLookup(blockstats, entryname))) {
|
if (!(stats = virHashLookup(blockstats, entryname))) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot find statistics for device '%s'"), entryname);
|
_("cannot find statistics for device '%s'"), entryname);
|
||||||
@ -10081,18 +10078,14 @@ qemuDomainBlocksStatsGather(virDomainObj *vm,
|
|||||||
|
|
||||||
**retstats = *stats;
|
**retstats = *stats;
|
||||||
|
|
||||||
if (blockdev) {
|
/* capacity are reported only per node-name so we need to transfer them */
|
||||||
/* capacity are reported only per node-name so we need to transfer them */
|
if (disk && disk->src &&
|
||||||
qemuBlockStats *capstats;
|
(capstats = virHashLookup(blockstats, disk->src->nodeformat))) {
|
||||||
|
(*retstats)->capacity = capstats->capacity;
|
||||||
if (disk && disk->src &&
|
(*retstats)->physical = capstats->physical;
|
||||||
(capstats = virHashLookup(blockstats, disk->src->nodeformat))) {
|
(*retstats)->wr_highest_offset = capstats->wr_highest_offset;
|
||||||
(*retstats)->capacity = capstats->capacity;
|
(*retstats)->wr_highest_offset_valid = capstats->wr_highest_offset_valid;
|
||||||
(*retstats)->physical = capstats->physical;
|
(*retstats)->write_threshold = capstats->write_threshold;
|
||||||
(*retstats)->wr_highest_offset = capstats->wr_highest_offset;
|
|
||||||
(*retstats)->wr_highest_offset_valid = capstats->wr_highest_offset_valid;
|
|
||||||
(*retstats)->write_threshold = capstats->write_threshold;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (i = 0; i < vm->def->ndisks; i++) {
|
for (i = 0; i < vm->def->ndisks; i++) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user