mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 19:11:16 +00:00
qemu: monitor: Add transaction generators for snapshot APIs
Unify with other code that generates parameters for the 'transaction' command. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
2adae485ae
commit
5cf0a3752f
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user