提交 5cf0a375 编写于 作者: P Peter Krempa

qemu: monitor: Add transaction generators for snapshot APIs

Unify with other code that generates parameters for the 'transaction'
command.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
上级 2adae485
......@@ -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);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册