mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu: block: Replace snapshot transaction action generator
Use the new generator residing in the monitor code rather than directly using qemuMonitorJSONTransactionAdd. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
bacbd0f2ee
commit
043c09b4f8
@ -22,7 +22,6 @@
|
|||||||
#include "qemu_command.h"
|
#include "qemu_command.h"
|
||||||
#include "qemu_domain.h"
|
#include "qemu_domain.h"
|
||||||
#include "qemu_alias.h"
|
#include "qemu_alias.h"
|
||||||
#include "qemu_monitor_json.h"
|
|
||||||
|
|
||||||
#include "viralloc.h"
|
#include "viralloc.h"
|
||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
@ -1880,15 +1879,7 @@ qemuBlockSnapshotAddLegacy(virJSONValuePtr actions,
|
|||||||
if (qemuGetDriveSourceString(newsrc, NULL, &source) < 0)
|
if (qemuGetDriveSourceString(newsrc, NULL, &source) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (qemuMonitorJSONTransactionAdd(actions, "blockdev-snapshot-sync",
|
return qemuMonitorTransactionSnapshotLegacy(actions, device, source, format, reuse);
|
||||||
"s:device", device,
|
|
||||||
"s:snapshot-file", source,
|
|
||||||
"s:format", format,
|
|
||||||
"S:mode", reuse ? "existing" : NULL,
|
|
||||||
NULL) < 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1897,13 +1888,9 @@ qemuBlockSnapshotAddBlockdev(virJSONValuePtr actions,
|
|||||||
virDomainDiskDefPtr disk,
|
virDomainDiskDefPtr disk,
|
||||||
virStorageSourcePtr newsrc)
|
virStorageSourcePtr newsrc)
|
||||||
{
|
{
|
||||||
if (qemuMonitorJSONTransactionAdd(actions, "blockdev-snapshot",
|
return qemuMonitorTransactionSnapshotBlockdev(actions,
|
||||||
"s:node", disk->src->nodeformat,
|
disk->src->nodeformat,
|
||||||
"s:overlay", newsrc->nodeformat,
|
newsrc->nodeformat);
|
||||||
NULL) < 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user