We replaced them by use of transaction to simplify possible failure
scenarios.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_monitor.c | 51 ---------------
src/qemu/qemu_monitor.h | 19 ------
src/qemu/qemu_monitor_json.c | 119 -----------------------------------
src/qemu/qemu_monitor_json.h | 17 -----
tests/qemumonitorjsontest.c | 41 ------------
5 files changed, 247 deletions(-)
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index b6c890f9ce..8de386817b 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -4480,57 +4480,6 @@ qemuMonitorGetCurrentMachineInfo(qemuMonitorPtr mon,
}
-int
-qemuMonitorAddBitmap(qemuMonitorPtr mon,
- const char *node,
- const char *bitmap,
- bool persistent)
-{
- VIR_DEBUG("node=%s bitmap=%s persistent=%d", node, bitmap, persistent);
-
- QEMU_CHECK_MONITOR(mon);
-
- return qemuMonitorJSONAddBitmap(mon, node, bitmap, persistent);
-}
-
-int
-qemuMonitorEnableBitmap(qemuMonitorPtr mon,
- const char *node,
- const char *bitmap)
-{
- VIR_DEBUG("node=%s bitmap=%s", node, bitmap);
-
- QEMU_CHECK_MONITOR(mon);
-
- return qemuMonitorJSONEnableBitmap(mon, node, bitmap);
-}
-
-int
-qemuMonitorMergeBitmaps(qemuMonitorPtr mon,
- const char *node,
- const char *dst,
- virJSONValuePtr *src)
-{
- VIR_DEBUG("node=%s dst=%s", node, dst);
-
- QEMU_CHECK_MONITOR(mon);
-
- return qemuMonitorJSONMergeBitmaps(mon, node, dst, src);
-}
-
-int
-qemuMonitorDeleteBitmap(qemuMonitorPtr mon,
- const char *node,
- const char *bitmap)
-{
- VIR_DEBUG("node=%s bitmap=%s", node, bitmap);
-
- QEMU_CHECK_MONITOR(mon);
-
- return qemuMonitorJSONDeleteBitmap(mon, node, bitmap);
-}
-
-
void
qemuMonitorJobInfoFree(qemuMonitorJobInfoPtr job)
{
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 36eb5f342d..45f2a5a7d2 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -702,25 +702,6 @@ int qemuMonitorSetBalloon(qemuMonitorPtr mon,
unsigned long long newmem);
int qemuMonitorSetCPU(qemuMonitorPtr mon, int cpu, bool online);
-int qemuMonitorAddBitmap(qemuMonitorPtr mon,
- const char *node,
- const char *bitmap,
- bool persistent)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
-int qemuMonitorEnableBitmap(qemuMonitorPtr mon,
- const char *node,
- const char *bitmap)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
-int qemuMonitorMergeBitmaps(qemuMonitorPtr mon,
- const char *node,
- const char *dst,
- virJSONValuePtr *src)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
-int qemuMonitorDeleteBitmap(qemuMonitorPtr mon,
- const char *node,
- const char *bitmap)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
-
/* XXX should we pass the virDomainDiskDefPtr instead
* and hide dev_name details inside monitor. Reconsider
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index c474ac0203..0062816e3e 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -9128,125 +9128,6 @@ qemuMonitorJSONGetCurrentMachineInfo(qemuMonitorPtr mon,
}
-int
-qemuMonitorJSONAddBitmap(qemuMonitorPtr mon,
- const char *node,
- const char *bitmap,
- bool persistent)
-{
- int ret = -1;
- virJSONValuePtr cmd;
- virJSONValuePtr reply = NULL;
-
- if (!(cmd = qemuMonitorJSONMakeCommand("block-dirty-bitmap-add",
- "s:node", node,
- "s:name", bitmap,
- "b:persistent", persistent,
- NULL)))
- return -1;
-
- if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
- goto cleanup;
-
- if (qemuMonitorJSONCheckError(cmd, reply) < 0)
- goto cleanup;
-
- ret = 0;
- cleanup:
- virJSONValueFree(cmd);
- virJSONValueFree(reply);
- return ret;
-}
-
-int
-qemuMonitorJSONEnableBitmap(qemuMonitorPtr mon,
- const char *node,
- const char *bitmap)
-{
- int ret = -1;
- virJSONValuePtr cmd;
- virJSONValuePtr reply = NULL;
-
- if (!(cmd = qemuMonitorJSONMakeCommand("block-dirty-bitmap-enable",
- "s:node", node,
- "s:name", bitmap,
- NULL)))
- return -1;
-
- if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
- goto cleanup;
-
- if (qemuMonitorJSONCheckError(cmd, reply) < 0)
- goto cleanup;
-
- ret = 0;
- cleanup:
- virJSONValueFree(cmd);
- virJSONValueFree(reply);
- return ret;
-}
-
-int
-qemuMonitorJSONMergeBitmaps(qemuMonitorPtr mon,
- const char *node,
- const char *dst,
- virJSONValuePtr *src)
-{
- int ret = -1;
- virJSONValuePtr cmd;
- virJSONValuePtr reply = NULL;
-
- if (!(cmd = qemuMonitorJSONMakeCommand("block-dirty-bitmap-merge",
- "s:node", node,
- "s:target", dst,
- "a:bitmaps", src,
- NULL)))
- goto cleanup;
-
- if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
- goto cleanup;
-
- if (qemuMonitorJSONCheckError(cmd, reply) < 0)
- goto cleanup;
-
- ret = 0;
- cleanup:
- virJSONValueFree(*src);
- *src = NULL;
- virJSONValueFree(cmd);
- virJSONValueFree(reply);
- return ret;
-}
-
-int
-qemuMonitorJSONDeleteBitmap(qemuMonitorPtr mon,
- const char *node,
- const char *bitmap)
-{
- int ret = -1;
- virJSONValuePtr cmd;
- virJSONValuePtr reply = NULL;
-
- if (!(cmd = qemuMonitorJSONMakeCommand("block-dirty-bitmap-remove",
- "s:node", node,
- "s:name", bitmap,
- NULL)))
- return -1;
-
- if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
- goto cleanup;
-
- if (qemuMonitorJSONCheckError(cmd, reply) < 0)
- goto cleanup;
-
- ret = 0;
- cleanup:
- virJSONValueFree(cmd);
- virJSONValueFree(reply);
- return ret;
-}
-
-
int
qemuMonitorJSONTransactionBitmapAdd(virJSONValuePtr actions,
const char *node,
diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h
index 6ee3e912f9..d74ef91b83 100644
--- a/src/qemu/qemu_monitor_json.h
+++ b/src/qemu/qemu_monitor_json.h
@@ -627,23 +627,6 @@ int
qemuMonitorJSONGetCurrentMachineInfo(qemuMonitorPtr mon,
qemuMonitorCurrentMachineInfoPtr info)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
-int qemuMonitorJSONAddBitmap(qemuMonitorPtr mon,
- const char *node,
- const char *bitmap,
- bool persistent);
-
-int qemuMonitorJSONEnableBitmap(qemuMonitorPtr mon,
- const char *node,
- const char *bitmap);
-
-int qemuMonitorJSONMergeBitmaps(qemuMonitorPtr mon,
- const char *node,
- const char *dst,
- virJSONValuePtr *src);
-
-int qemuMonitorJSONDeleteBitmap(qemuMonitorPtr mon,
- const char *node,
- const char *bitmap);
int
qemuMonitorJSONTransactionBitmapAdd(virJSONValuePtr actions,
diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index f754e4d94b..4f15d231f9 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -1337,9 +1337,6 @@ GEN_TEST_FUNC(qemuMonitorJSONBlockdevTrayOpen, "foodev",
true)
GEN_TEST_FUNC(qemuMonitorJSONBlockdevTrayClose, "foodev")
GEN_TEST_FUNC(qemuMonitorJSONBlockdevMediumRemove, "foodev")
GEN_TEST_FUNC(qemuMonitorJSONBlockdevMediumInsert, "foodev",
"newnode")
-GEN_TEST_FUNC(qemuMonitorJSONAddBitmap, "node", "bitmap", true)
-GEN_TEST_FUNC(qemuMonitorJSONEnableBitmap, "node", "bitmap")
-GEN_TEST_FUNC(qemuMonitorJSONDeleteBitmap, "node", "bitmap")
GEN_TEST_FUNC(qemuMonitorJSONJobDismiss, "jobname")
GEN_TEST_FUNC(qemuMonitorJSONJobCancel, "jobname", false)
GEN_TEST_FUNC(qemuMonitorJSONJobComplete, "jobname")
@@ -1382,40 +1379,6 @@ testQemuMonitorJSONqemuMonitorJSONNBDServerStart(const void
*opaque)
return 0;
}
-static int
-testQemuMonitorJSONqemuMonitorJSONMergeBitmaps(const void *opaque)
-{
- const testGenericData *data = opaque;
- virDomainXMLOptionPtr xmlopt = data->xmlopt;
- g_autoptr(qemuMonitorTest) test = NULL;
- g_autoptr(virJSONValue) arr = NULL;
-
- if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
- return -1;
-
- if (!(arr = virJSONValueNewArray()))
- return -1;
-
- if (virJSONValueArrayAppendString(arr, "b1") < 0 ||
- virJSONValueArrayAppendString(arr, "b2") < 0)
- return -1;
-
- if (qemuMonitorTestAddItem(test, "block-dirty-bitmap-merge",
- "{\"return\":{}}") < 0)
- return -1;
-
- if (qemuMonitorJSONMergeBitmaps(qemuMonitorTestGetMonitor(test),
- "node", "dst", &arr) < 0)
- return -1;
-
- if (arr) {
- VIR_TEST_VERBOSE("arr should have been cleared");
- return -1;
- }
-
- return 0;
-}
-
static bool
testQemuMonitorJSONqemuMonitorJSONQueryCPUsEqual(struct qemuMonitorQueryCpusEntry *a,
struct qemuMonitorQueryCpusEntry *b)
@@ -3174,9 +3137,6 @@ mymain(void)
DO_TEST_GEN(qemuMonitorJSONBlockdevTrayClose);
DO_TEST_GEN(qemuMonitorJSONBlockdevMediumRemove);
DO_TEST_GEN(qemuMonitorJSONBlockdevMediumInsert);
- DO_TEST_GEN(qemuMonitorJSONAddBitmap);
- DO_TEST_GEN(qemuMonitorJSONEnableBitmap);
- DO_TEST_GEN(qemuMonitorJSONDeleteBitmap);
DO_TEST_GEN(qemuMonitorJSONJobDismiss);
DO_TEST_GEN(qemuMonitorJSONJobCancel);
DO_TEST_GEN(qemuMonitorJSONJobComplete);
@@ -3196,7 +3156,6 @@ mymain(void)
DO_TEST(qemuMonitorJSONSendKeyHoldtime);
DO_TEST(qemuMonitorSupportsActiveCommit);
DO_TEST(qemuMonitorJSONNBDServerStart);
- DO_TEST(qemuMonitorJSONMergeBitmaps);
DO_TEST_CPU_DATA("host");
DO_TEST_CPU_DATA("full");
--
2.21.0