From: Jim Fehlig <jfehlig(a)novell.com>
The maximum bandwidth that can be consumed when migrating a domain
is better classified as an operational vs configuration parameter of
the dommain. As such, store this parameter in qemuDomainObjPrivate
structure.
---
src/qemu/qemu_domain.c | 2 ++
src/qemu/qemu_domain.h | 5 +++++
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 982bad6..d2cc2f0 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -215,6 +215,8 @@ static void *qemuDomainObjPrivateAlloc(void)
if (qemuDomainObjInitJob(priv) < 0)
VIR_FREE(priv);
+ priv->migMaxBandwidth = QEMU_DOMAIN_DEFAULT_MIG_BANDWIDTH_MAX;
+
return priv;
}
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 55875fe..e44ff8a 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -36,6 +36,9 @@
(1 << VIR_DOMAIN_VIRT_KVM) | \
(1 << VIR_DOMAIN_VIRT_XEN))
+# define QEMU_DOMAIN_DEFAULT_MIG_BANDWIDTH_MAX (32 << 20)
+# define QEMU_DOMAIN_FILE_MIG_BANDWIDTH_MAX (INT64_MAX / (1024 * 1024))
+
# define JOB_MASK(job) (1 << (job - 1))
# define DEFAULT_JOB_MASK \
(JOB_MASK(QEMU_JOB_QUERY) | \
@@ -115,6 +118,8 @@ struct _qemuDomainObjPrivate {
bool fakeReboot;
int jobs_queued;
+
+ unsigned long migMaxBandwidth;
};
struct qemuDomainWatchdogEvent
--
1.7.5.4