mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
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: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
dfc980ab97
commit
08f23b8ffa
@ -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:
|
||||
* @disk: disk with copy-on-read enabled
|
||||
|
@ -163,6 +163,11 @@ qemuBlockSnapshotAddLegacy(virJSONValuePtr actions,
|
||||
virStorageSourcePtr newsrc,
|
||||
bool reuse);
|
||||
|
||||
int
|
||||
qemuBlockSnapshotAddBlockdev(virJSONValuePtr actions,
|
||||
virDomainDiskDefPtr disk,
|
||||
virStorageSourcePtr newsrc);
|
||||
|
||||
int
|
||||
qemuBlockStorageSourceCreateGetFormatProps(virStorageSourcePtr src,
|
||||
virStorageSourcePtr backing,
|
||||
|
Loading…
Reference in New Issue
Block a user