(1 << VIR_DOMAIN_VIRT_XEN))
# define QEMU_DOMAIN_DEFAULT_MIG_BANDWIDTH_MAX 32
+# if ULONG_MAX == 4294967295
+/* Qemu has a 64-bit limit, but we are limited by our historical choice of
+ * representing bandwidth in a long instead of a 64-bit int. */
+# define QEMU_DOMAIN_FILE_MIG_BANDWIDTH_MAX ULONG_MAX
+# else
+# define QEMU_DOMAIN_FILE_MIG_BANDWIDTH_MAX (INT64_MAX / (1024 * 1024))
+# endif
# define JOB_MASK(job) (1 << (job - 1))
# define DEFAULT_JOB_MASK \
bool restoreLabel = false;
virCommandPtr cmd = NULL;
int pipeFD[2] = { -1, -1 };
+ unsigned long saveMigBandwidth = priv->migMaxBandwidth;
+
+ /* Increase migration bandwidth to unlimited since target is a file.
+ * Failure to change migration speed is not fatal. */
+ if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) == 0) {
+ qemuMonitorSetMigrationSpeed(priv->mon,
+ QEMU_DOMAIN_FILE_MIG_BANDWIDTH_MAX);
+ priv->migMaxBandwidth = QEMU_DOMAIN_FILE_MIG_BANDWIDTH_MAX;
+ qemuDomainObjExitMonitorWithDriver(driver, vm);
+ }
if (qemuCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATE_QEMU_FD) &&
(!compressor || pipe(pipeFD) == 0)) {
ret = 0;
cleanup:
+ /* Restore max migration bandwidth */
+ if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) == 0) {
+ qemuMonitorSetMigrationSpeed(priv->mon, saveMigBandwidth);
+ priv->migMaxBandwidth = saveMigBandwidth;
+ qemuDomainObjExitMonitorWithDriver(driver, vm);
+ }
+
VIR_FORCE_CLOSE(pipeFD[0]);
VIR_FORCE_CLOSE(pipeFD[1]);
virCommandFree(cmd);