提交 32288fc9 编写于 作者: P Peter Krempa

qemu: monitor: Drop parsing of 'errs' from block info

The error count statistic is not supported by qemu, so there's no need
to pass the variables around if the result is ignored anyways.
上级 7e9fb151
......@@ -10536,6 +10536,9 @@ qemuDomainBlockStats(virDomainPtr dom,
priv = vm->privateData;
/* qemu doesn't report the error count */
stats->errs = -1;
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorGetBlockStatsInfo(priv->mon,
diskAlias,
......@@ -10546,8 +10549,7 @@ qemuDomainBlockStats(virDomainPtr dom,
&stats->wr_bytes,
NULL,
NULL,
NULL,
&stats->errs);
NULL);
if (qemuDomainObjExitMonitor(driver, vm) < 0)
ret = -1;
......@@ -10574,7 +10576,7 @@ qemuDomainBlockStatsFlags(virDomainPtr dom,
virDomainObjPtr vm;
qemuDomainObjPrivatePtr priv;
long long rd_req, rd_bytes, wr_req, wr_bytes, rd_total_times;
long long wr_total_times, flush_req, flush_total_times, errs;
long long wr_total_times, flush_req, flush_total_times;
char *diskAlias = NULL;
virCheckFlags(VIR_TYPED_PARAM_STRING_OKAY, -1);
......@@ -10643,8 +10645,7 @@ qemuDomainBlockStatsFlags(virDomainPtr dom,
&wr_bytes,
&wr_total_times,
&flush_req,
&flush_total_times,
&errs);
&flush_total_times);
if (qemuDomainObjExitMonitor(driver, vm) < 0)
ret = -1;
......
......@@ -1817,8 +1817,7 @@ int qemuMonitorGetBlockStatsInfo(qemuMonitorPtr mon,
long long *wr_bytes,
long long *wr_total_times,
long long *flush_req,
long long *flush_total_times,
long long *errs)
long long *flush_total_times)
{
int ret;
VIR_DEBUG("mon=%p dev=%s", mon, dev_name);
......@@ -1836,8 +1835,7 @@ int qemuMonitorGetBlockStatsInfo(qemuMonitorPtr mon,
wr_req, wr_bytes,
wr_total_times,
flush_req,
flush_total_times,
errs);
flush_total_times);
else
ret = qemuMonitorTextGetBlockStatsInfo(mon, dev_name,
rd_req, rd_bytes,
......@@ -1845,8 +1843,7 @@ int qemuMonitorGetBlockStatsInfo(qemuMonitorPtr mon,
wr_req, wr_bytes,
wr_total_times,
flush_req,
flush_total_times,
errs);
flush_total_times);
return ret;
}
......
......@@ -366,8 +366,7 @@ int qemuMonitorGetBlockStatsInfo(qemuMonitorPtr mon,
long long *wr_bytes,
long long *wr_total_times,
long long *flush_req,
long long *flush_total_times,
long long *errs);
long long *flush_total_times);
typedef struct _qemuBlockStats qemuBlockStats;
typedef qemuBlockStats *qemuBlockStatsPtr;
......
......@@ -1677,15 +1677,14 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon,
long long *wr_bytes,
long long *wr_total_times,
long long *flush_req,
long long *flush_total_times,
long long *errs)
long long *flush_total_times)
{
qemuBlockStats *stats;
virHashTablePtr blockstats = NULL;
int ret = -1;
*rd_req = *rd_bytes = -1;
*wr_req = *wr_bytes = *errs = -1;
*wr_req = *wr_bytes = -1;
if (rd_total_times)
*rd_total_times = -1;
......@@ -1709,7 +1708,6 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon,
*rd_bytes = stats->rd_bytes;
*wr_req = stats->wr_req;
*wr_bytes = stats->wr_bytes;
*errs = -1; /* QEMU does not have this */
if (rd_total_times)
*rd_total_times = stats->rd_total_times;
......
......@@ -80,8 +80,7 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon,
long long *wr_bytes,
long long *wr_total_times,
long long *flush_req,
long long *flush_total_times,
long long *errs);
long long *flush_total_times);
int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon,
virHashTablePtr *ret_stats,
bool backingChain);
......
......@@ -847,8 +847,7 @@ int qemuMonitorTextGetBlockStatsInfo(qemuMonitorPtr mon,
long long *wr_bytes,
long long *wr_total_times,
long long *flush_req,
long long *flush_total_times,
long long *errs)
long long *flush_total_times)
{
char *info = NULL;
int ret = -1;
......@@ -872,7 +871,7 @@ int qemuMonitorTextGetBlockStatsInfo(qemuMonitorPtr mon,
}
*rd_req = *rd_bytes = -1;
*wr_req = *wr_bytes = *errs = -1;
*wr_req = *wr_bytes = -1;
if (rd_total_times)
*rd_total_times = -1;
......
......@@ -69,8 +69,7 @@ int qemuMonitorTextGetBlockStatsInfo(qemuMonitorPtr mon,
long long *wr_bytes,
long long *wr_total_times,
long long *flush_req,
long long *flush_total_times,
long long *errs);
long long *flush_total_times);
int qemuMonitorTextGetBlockStatsParamsNumber(qemuMonitorPtr mon,
int *nparams);
int qemuMonitorTextGetBlockExtent(qemuMonitorPtr mon,
......
......@@ -1438,7 +1438,7 @@ testQemuMonitorJSONqemuMonitorJSONGetBlockStatsInfo(const void *data)
int ret = -1;
long long rd_req, rd_bytes, rd_total_times;
long long wr_req, wr_bytes, wr_total_times;
long long flush_req, flush_total_times, errs;
long long flush_req, flush_total_times;
int nparams;
unsigned long long extent;
......@@ -1552,7 +1552,7 @@ testQemuMonitorJSONqemuMonitorJSONGetBlockStatsInfo(const void *data)
}
#define CHECK(RD_REQ, RD_BYTES, RD_TOTAL_TIMES, WR_REQ, WR_BYTES, WR_TOTAL_TIMES, \
FLUSH_REQ, FLUSH_TOTAL_TIMES, ERRS) \
FLUSH_REQ, FLUSH_TOTAL_TIMES) \
CHECK0(rd_req, RD_REQ) \
CHECK0(rd_bytes, RD_BYTES) \
CHECK0(rd_total_times, RD_TOTAL_TIMES) \
......@@ -1560,32 +1560,31 @@ testQemuMonitorJSONqemuMonitorJSONGetBlockStatsInfo(const void *data)
CHECK0(wr_bytes, WR_BYTES) \
CHECK0(wr_total_times, WR_TOTAL_TIMES) \
CHECK0(flush_req, FLUSH_REQ) \
CHECK0(flush_total_times, FLUSH_TOTAL_TIMES) \
CHECK0(errs, ERRS)
CHECK0(flush_total_times, FLUSH_TOTAL_TIMES)
if (qemuMonitorJSONGetBlockStatsInfo(qemuMonitorTestGetMonitor(test), "virtio-disk0",
&rd_req, &rd_bytes, &rd_total_times,
&wr_req, &wr_bytes, &wr_total_times,
&flush_req, &flush_total_times, &errs) < 0)
&flush_req, &flush_total_times) < 0)
goto cleanup;
CHECK(1279, 28505088, 640616474, 174, 2845696, 530699221, 0, 0, -1)
CHECK(1279, 28505088, 640616474, 174, 2845696, 530699221, 0, 0)
if (qemuMonitorJSONGetBlockStatsInfo(qemuMonitorTestGetMonitor(test), "virtio-disk1",
&rd_req, &rd_bytes, &rd_total_times,
&wr_req, &wr_bytes, &wr_total_times,
&flush_req, &flush_total_times, &errs) < 0)
&flush_req, &flush_total_times) < 0)
goto cleanup;
CHECK(85, 348160, 8232156, 0, 0, 0, 0, 0, -1)
CHECK(85, 348160, 8232156, 0, 0, 0, 0, 0)
if (qemuMonitorJSONGetBlockStatsInfo(qemuMonitorTestGetMonitor(test), "ide0-1-0",
&rd_req, &rd_bytes, &rd_total_times,
&wr_req, &wr_bytes, &wr_total_times,
&flush_req, &flush_total_times, &errs) < 0)
&flush_req, &flush_total_times) < 0)
goto cleanup;
CHECK(16, 49250, 1004952, 0, 0, 0, 0, 0, -1)
CHECK(16, 49250, 1004952, 0, 0, 0, 0, 0)
if (qemuMonitorJSONGetBlockStatsParamsNumber(qemuMonitorTestGetMonitor(test),
&nparams) < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册