]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: monitor: Drop parsing of 'errs' from block info
authorPeter Krempa <pkrempa@redhat.com>
Mon, 9 Mar 2015 14:25:17 +0000 (15:25 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 11 Mar 2015 10:28:03 +0000 (11:28 +0100)
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.

src/qemu/qemu_driver.c
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor.h
src/qemu/qemu_monitor_json.c
src/qemu/qemu_monitor_json.h
src/qemu/qemu_monitor_text.c
src/qemu/qemu_monitor_text.h
tests/qemumonitorjsontest.c

index e904b7be8f351a715caa57563875a29fabe6f587..7ae5c29f885ba37ee5a20bc182328969739ec57b 100644 (file)
@@ -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;
index 94495cd7179b242e02434cd922bb6a7776ad381d..24e87b783c244e255892c2521b1a82a17a7bf32f 100644 (file)
@@ -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;
 }
 
index 133d42d4bb7589e9027d6ec440236ec6738f224e..72498b339ebb5c84760e09ec95ecc3b1d75c5ab6 100644 (file)
@@ -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;
index 832f5898b22c1d53967c37ac6c71c1929d09e47c..612553b00798e441ac0a5eb857e4ce3849e04324 100644 (file)
@@ -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;
index 1da1a007ffc0dd712a65f2cb7946f8c5ff060eef..23589cf4f1daad148d13d4470ecfb6a13186dae3 100644 (file)
@@ -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);
index 70aeaca3694fb5f508a8a0cbcbba5b0c5f189817..2de281ff355fbff119eb5ba154b35c5cf03e20c1 100644 (file)
@@ -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;
index f118a308e64fd91a48421d84e3e29b9b6f83e36d..695ac28a828b863c23688388ff7d8263e8d457ee 100644 (file)
@@ -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,
index bd92e631acd60d6cecb336779624972175751bf6..da9cd6cc6a1fbab811cae6870634182b49b3af70 100644 (file)
@@ -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)