ret = qemuMonitorBlockdevMirror(priv->mon, job->name, true,
qemuDomainDiskGetTopNodename(disk),
mirror->nodeformat, bandwidth,
- granularity, buf_size, mirror_shallow);
+ granularity, buf_size, mirror_shallow,
+ false);
} else {
/* qemuMonitorDriveMirror needs to honor the REUSE_EXT flag as specified
* by the user */
if (mon_ret == 0)
mon_ret = qemuMonitorBlockdevMirror(qemuDomainGetMonitor(vm), jobname, persistjob,
sourcename, copysrc->nodeformat,
- mirror_speed, 0, 0, mirror_shallow);
+ mirror_speed, 0, 0, mirror_shallow,
+ false);
if (mon_ret != 0)
qemuBlockStorageSourceAttachRollback(qemuDomainGetMonitor(vm), data);
unsigned long long bandwidth,
unsigned int granularity,
unsigned long long buf_size,
- bool shallow)
+ bool shallow,
+ bool syncWrite)
{
VIR_DEBUG("jobname=%s, persistjob=%d, device=%s, target=%s, bandwidth=%lld, "
- "granularity=%#x, buf_size=%lld, shallow=%d",
+ "granularity=%#x, buf_size=%lld, shallow=%d syncWrite=%d",
NULLSTR(jobname), persistjob, device, target, bandwidth, granularity,
- buf_size, shallow);
+ buf_size, shallow, syncWrite);
QEMU_CHECK_MONITOR(mon);
return qemuMonitorJSONBlockdevMirror(mon, jobname, persistjob, device, target,
- bandwidth, granularity, buf_size, shallow);
+ bandwidth, granularity, buf_size, shallow,
+ syncWrite);
}
unsigned long long bandwidth,
unsigned int granularity,
unsigned long long buf_size,
- bool shallow)
+ bool shallow,
+ bool syncWrite)
ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5);
int qemuMonitorDrivePivot(qemuMonitor *mon,
const char *jobname)
unsigned long long speed,
unsigned int granularity,
unsigned long long buf_size,
- bool shallow)
+ bool shallow,
+ bool syncWrite)
{
g_autoptr(virJSONValue) cmd = NULL;
g_autoptr(virJSONValue) reply = NULL;
virTristateBool autofinalize = VIR_TRISTATE_BOOL_ABSENT;
virTristateBool autodismiss = VIR_TRISTATE_BOOL_ABSENT;
const char *syncmode = "full";
+ const char *copymode = NULL;
if (shallow)
syncmode = "top";
+ if (syncWrite)
+ copymode = "write-blocking";
+
if (persistjob) {
autofinalize = VIR_TRISTATE_BOOL_YES;
autodismiss = VIR_TRISTATE_BOOL_NO;
"z:granularity", granularity,
"P:buf-size", buf_size,
"s:sync", syncmode,
+ "S:copy-mode", copymode,
"T:auto-finalize", autofinalize,
"T:auto-dismiss", autodismiss,
NULL);
unsigned long long speed,
unsigned int granularity,
unsigned long long buf_size,
- bool shallow)
+ bool shallow,
+ bool syncWrite)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5);
int qemuMonitorJSONDrivePivot(qemuMonitor *mon,
const char *jobname)
GEN_TEST_FUNC(qemuMonitorJSONRemoveNetdev, "net0")
GEN_TEST_FUNC(qemuMonitorJSONDelDevice, "ide0")
GEN_TEST_FUNC(qemuMonitorJSONDriveMirror, "vdb", "/foo/bar", "formatstr", 1024, 1234, 31234, true, true)
-GEN_TEST_FUNC(qemuMonitorJSONBlockdevMirror, "jobname", true, "vdb", "targetnode", 1024, 1234, 31234, true)
+GEN_TEST_FUNC(qemuMonitorJSONBlockdevMirror, "jobname", true, "vdb", "targetnode", 1024, 1234, 31234, true, true)
GEN_TEST_FUNC(qemuMonitorJSONBlockStream, "vdb", "jobname", true, "/foo/bar1", "backingnode", "backingfilename", 1024)
GEN_TEST_FUNC(qemuMonitorJSONBlockCommit, "vdb", "jobname", true, "/foo/bar1", "topnode", "/foo/bar2", "basenode", "backingfilename", 1024)
GEN_TEST_FUNC(qemuMonitorJSONDrivePivot, "vdb")