提交 08f23b8f 编写于 作者: P Peter Krempa

qemu: block: Add helper for generating snapshot transaction for -blockdev

For the modern use cases we are going to use 'blockdev-snapshot' instead
of 'blockdev-snapshot-sync'.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 dfc980ab
...@@ -1886,6 +1886,21 @@ qemuBlockSnapshotAddLegacy(virJSONValuePtr actions, ...@@ -1886,6 +1886,21 @@ qemuBlockSnapshotAddLegacy(virJSONValuePtr actions,
} }
int
qemuBlockSnapshotAddBlockdev(virJSONValuePtr actions,
virDomainDiskDefPtr disk,
virStorageSourcePtr newsrc)
{
if (qemuMonitorJSONTransactionAdd(actions, "blockdev-snapshot",
"s:node", disk->src->nodeformat,
"s:overlay", newsrc->nodeformat,
NULL) < 0)
return -1;
return 0;
}
/** /**
* qemuBlockStorageGetCopyOnReadProps: * qemuBlockStorageGetCopyOnReadProps:
* @disk: disk with copy-on-read enabled * @disk: disk with copy-on-read enabled
......
...@@ -163,6 +163,11 @@ qemuBlockSnapshotAddLegacy(virJSONValuePtr actions, ...@@ -163,6 +163,11 @@ qemuBlockSnapshotAddLegacy(virJSONValuePtr actions,
virStorageSourcePtr newsrc, virStorageSourcePtr newsrc,
bool reuse); bool reuse);
int
qemuBlockSnapshotAddBlockdev(virJSONValuePtr actions,
virDomainDiskDefPtr disk,
virStorageSourcePtr newsrc);
int int
qemuBlockStorageSourceCreateGetFormatProps(virStorageSourcePtr src, qemuBlockStorageSourceCreateGetFormatProps(virStorageSourcePtr src,
virStorageSourcePtr backing, virStorageSourcePtr backing,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册