diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 7b1e392f73b9699c7679c43fd230a825cf5a06f7..832f98346d136fa576171018c0061620a7b25d09 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -793,10 +793,6 @@ qemuMigrationSrcNBDStorageCopyBlockdev(virQEMUDriverPtr driver, int mon_ret = 0; int ret = -1; VIR_AUTOUNREF(virStorageSourcePtr) copysrc = NULL; - unsigned int mirror_flags = 0; - - if (mirror_shallow) - mirror_flags |= VIR_DOMAIN_BLOCK_REBASE_SHALLOW; VIR_DEBUG("starting blockdev mirror for disk=%s to host=%s", diskAlias, host); @@ -841,7 +837,7 @@ qemuMigrationSrcNBDStorageCopyBlockdev(virQEMUDriverPtr driver, if (mon_ret == 0) mon_ret = qemuMonitorBlockdevMirror(qemuDomainGetMonitor(vm), NULL, diskAlias, copysrc->nodeformat, - mirror_speed, 0, 0, mirror_flags); + mirror_speed, 0, 0, mirror_shallow); if (mon_ret != 0) qemuBlockStorageSourceAttachRollback(qemuDomainGetMonitor(vm), data); diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index e1fcbac13fe77997e68ab9e836219919aeb73cd7..9a796db3cb6b9e9baf9fc459965be1a77bcf9142 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3266,17 +3266,17 @@ qemuMonitorBlockdevMirror(qemuMonitorPtr mon, unsigned long long bandwidth, unsigned int granularity, unsigned long long buf_size, - unsigned int flags) + bool shallow) { VIR_DEBUG("jobname=%s, device=%s, target=%s, bandwidth=%lld, " - "granularity=%#x, buf_size=%lld, flags=0x%x", + "granularity=%#x, buf_size=%lld, shallow=%d", NULLSTR(jobname), device, target, bandwidth, granularity, - buf_size, flags); + buf_size, shallow); QEMU_CHECK_MONITOR(mon); return qemuMonitorJSONBlockdevMirror(mon, jobname, device, target, bandwidth, - granularity, buf_size, flags); + granularity, buf_size, shallow); } diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 9242d3740785487e93cadb038cfe73cf0d19a9a1..438c3c38ed96fcb5539a3e83c46aaf38a897e41c 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -893,7 +893,7 @@ int qemuMonitorBlockdevMirror(qemuMonitorPtr mon, unsigned long long bandwidth, unsigned int granularity, unsigned long long buf_size, - unsigned int flags) + bool shallow) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); int qemuMonitorDrivePivot(qemuMonitorPtr mon, const char *jobname) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 5e3df5e75992a8c4d55976e661bd981181fc1eb9..a75e660d07314b316dc0a189eb8efa0ae95e492c 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -4320,12 +4320,11 @@ qemuMonitorJSONBlockdevMirror(qemuMonitorPtr mon, unsigned long long speed, unsigned int granularity, unsigned long long buf_size, - unsigned int flags) + bool shallow) { int ret = -1; virJSONValuePtr cmd; virJSONValuePtr reply = NULL; - bool shallow = (flags & VIR_DOMAIN_BLOCK_REBASE_SHALLOW) != 0; cmd = qemuMonitorJSONMakeCommand("blockdev-mirror", "S:job-id", jobname, diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 746b7072ca87c96e40360d26d63d5e8ddd5fb1a2..174db7a2e9cf69135d1d37041fa08aa9e9e869ef 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -259,7 +259,7 @@ int qemuMonitorJSONBlockdevMirror(qemuMonitorPtr mon, unsigned long long speed, unsigned int granularity, unsigned long long buf_size, - unsigned int flags) + bool shallow) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); int qemuMonitorJSONDrivePivot(qemuMonitorPtr mon, const char *jobname) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 923f6d7d9ce4c0e43022e8a28b862ad6a1cd4ab8..c2bb3a6c4fa7f28d5a7440d8fcc7b6b18e3db667 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1343,8 +1343,7 @@ GEN_TEST_FUNC(qemuMonitorJSONDelDevice, "ide0") GEN_TEST_FUNC(qemuMonitorJSONAddDevice, "some_dummy_devicestr") GEN_TEST_FUNC(qemuMonitorJSONDriveMirror, "vdb", "/foo/bar", "formatstr", 1024, 1234, 31234, VIR_DOMAIN_BLOCK_REBASE_SHALLOW | VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT) -GEN_TEST_FUNC(qemuMonitorJSONBlockdevMirror, "jobname", "vdb", "targetnode", 1024, 1234, 31234, - VIR_DOMAIN_BLOCK_REBASE_SHALLOW | VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT) +GEN_TEST_FUNC(qemuMonitorJSONBlockdevMirror, "jobname", "vdb", "targetnode", 1024, 1234, 31234, true) GEN_TEST_FUNC(qemuMonitorJSONBlockStream, "vdb", "/foo/bar1", "backingfilename", 1024) GEN_TEST_FUNC(qemuMonitorJSONBlockCommit, "vdb", "/foo/bar1", "/foo/bar2", "backingfilename", 1024) GEN_TEST_FUNC(qemuMonitorJSONDrivePivot, "vdb")