2011-09-15 01:35:28 +02:00
|
|
|
commit 829bce174c8a958dee4eb5b1fea63e0f5f914af8
|
|
|
|
Author: Jim Fehlig <jfehlig@novell.com>
|
|
|
|
Date: Fri Aug 26 12:10:23 2011 -0600
|
|
|
|
|
|
|
|
Impl virDomainMigrateGetMaxSpeed in qemu driver
|
|
|
|
|
|
|
|
Index: libvirt-0.9.4/src/qemu/qemu_driver.c
|
|
|
|
===================================================================
|
|
|
|
--- libvirt-0.9.4.orig/src/qemu/qemu_driver.c
|
|
|
|
+++ libvirt-0.9.4/src/qemu/qemu_driver.c
|
2011-09-15 06:10:37 +02:00
|
|
|
@@ -8329,6 +8329,40 @@ static int qemuDomainSnapshotSetCurrentI
|
2011-09-15 01:35:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+static int
|
|
|
|
+qemuDomainMigrateGetMaxSpeed(virDomainPtr dom,
|
|
|
|
+ unsigned long *bandwidth,
|
|
|
|
+ unsigned int flags)
|
|
|
|
+{
|
|
|
|
+ struct qemud_driver *driver = dom->conn->privateData;
|
|
|
|
+ virDomainObjPtr vm;
|
2011-09-15 06:10:37 +02:00
|
|
|
+ qemuDomainObjPrivatePtr priv;
|
2011-09-15 01:35:28 +02:00
|
|
|
+ int ret = -1;
|
|
|
|
+
|
|
|
|
+ virCheckFlags(0, -1);
|
|
|
|
+
|
|
|
|
+ qemuDriverLock(driver);
|
|
|
|
+ vm = virDomainFindByUUID(&driver->domains, dom->uuid);
|
|
|
|
+ qemuDriverUnlock(driver);
|
|
|
|
+
|
|
|
|
+ if (!vm) {
|
|
|
|
+ char uuidstr[VIR_UUID_STRING_BUFLEN];
|
|
|
|
+ virUUIDFormat(dom->uuid, uuidstr);
|
|
|
|
+ qemuReportError(VIR_ERR_NO_DOMAIN,
|
|
|
|
+ _("no domain with matching uuid '%s'"), uuidstr);
|
|
|
|
+ goto cleanup;
|
|
|
|
+ }
|
|
|
|
+
|
2011-09-15 06:10:37 +02:00
|
|
|
+ priv = vm->privateData;
|
|
|
|
+ *bandwidth = priv->migMaxBandwidth;
|
2011-09-15 01:35:28 +02:00
|
|
|
+ ret = 0;
|
|
|
|
+
|
|
|
|
+cleanup:
|
|
|
|
+ if (vm)
|
|
|
|
+ virDomainObjUnlock(vm);
|
|
|
|
+ return ret;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
static int qemuDomainSnapshotIsAllowed(virDomainObjPtr vm)
|
|
|
|
{
|
|
|
|
int i;
|
2011-09-15 06:10:37 +02:00
|
|
|
@@ -9494,6 +9528,7 @@ static virDriver qemuDriver = {
|
2011-09-15 01:35:28 +02:00
|
|
|
.domainAbortJob = qemuDomainAbortJob, /* 0.7.7 */
|
|
|
|
.domainMigrateSetMaxDowntime = qemuDomainMigrateSetMaxDowntime, /* 0.8.0 */
|
|
|
|
.domainMigrateSetMaxSpeed = qemuDomainMigrateSetMaxSpeed, /* 0.9.0 */
|
|
|
|
+ .domainMigrateGetMaxSpeed = qemuDomainMigrateGetMaxSpeed, /* 0.9.5 */
|
|
|
|
.domainEventRegisterAny = qemuDomainEventRegisterAny, /* 0.8.0 */
|
|
|
|
.domainEventDeregisterAny = qemuDomainEventDeregisterAny, /* 0.8.0 */
|
|
|
|
.domainManagedSave = qemuDomainManagedSave, /* 0.8.0 */
|