diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 2c19e60c946188214ea37d99f69eb1c08278e71e..2d46f5cfa7cf0813722488531b20acd9288e5f21 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -4539,3 +4539,24 @@ qemuMonitorTransactionBitmapMerge(virJSONValuePtr actions, { return qemuMonitorJSONTransactionBitmapMerge(actions, node, target, sources); } + + +int +qemuMonitorTransactionSnapshotLegacy(virJSONValuePtr actions, + const char *device, + const char *path, + const char *format, + bool existing) +{ + return qemuMonitorJSONTransactionSnapshotLegacy(actions, device, path, + format, existing); +} + + +int +qemuMonitorTransactionSnapshotBlockdev(virJSONValuePtr actions, + const char *node, + const char *overlay) +{ + return qemuMonitorJSONTransactionSnapshotBlockdev(actions, node, overlay); +} diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 44ce139a9b63db8ace8fcadf3a1a22f5e048de1f..b42bdfbea8d09a02fe8e203966a1c76669a5b587 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1361,3 +1361,14 @@ qemuMonitorTransactionBitmapMerge(virJSONValuePtr actions, const char *node, const char *target, virJSONValuePtr *sources); + +int +qemuMonitorTransactionSnapshotLegacy(virJSONValuePtr actions, + const char *device, + const char *path, + const char *format, + bool existing); +int +qemuMonitorTransactionSnapshotBlockdev(virJSONValuePtr actions, + const char *node, + const char *overlay); diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index bfb6245082f930231de01254e8ea14bbaee53ad2..450b5828c5fb2a87022cd8f4a3e62f18fa9f9e93 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -9100,6 +9100,41 @@ qemuMonitorJSONTransactionBitmapMerge(virJSONValuePtr actions, } +int +qemuMonitorJSONTransactionSnapshotLegacy(virJSONValuePtr actions, + const char *device, + const char *path, + const char *format, + bool existing) +{ + const char *mode = NULL; + + if (existing) + mode = "existing"; + + return qemuMonitorJSONTransactionAdd(actions, + "blockdev-snapshot-sync", + "s:device", device, + "s:snapshot-file", path, + "s:format", format, + "S:mode", mode, + NULL); +} + + +int +qemuMonitorJSONTransactionSnapshotBlockdev(virJSONValuePtr actions, + const char *node, + const char *overlay) +{ + return qemuMonitorJSONTransactionAdd(actions, + "blockdev-snapshot", + "s:node", node, + "s:overlay", overlay, + NULL); +} + + static qemuMonitorJobInfoPtr qemuMonitorJSONGetJobInfoOne(virJSONValuePtr data) { diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 3915fb45b5d34098b4ee46b5d474f923f11bd42d..85f07676fa4ac181058406950092047aceaf9831 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -656,3 +656,14 @@ qemuMonitorJSONTransactionBitmapMerge(virJSONValuePtr actions, const char *node, const char *target, virJSONValuePtr *sources); + +int +qemuMonitorJSONTransactionSnapshotLegacy(virJSONValuePtr actions, + const char *device, + const char *path, + const char *format, + bool existing); +int +qemuMonitorJSONTransactionSnapshotBlockdev(virJSONValuePtr actions, + const char *node, + const char *overlay);