[PATCH 3/8] Add max migration bandwidth to domain_conf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 src/conf/domain_conf.c |   11 +++++++++++
 src/conf/domain_conf.h |    2 ++
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 44212cf..4bf32e9 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -6263,6 +6263,10 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
                                    virDomainLifecycleCrashTypeFromString) < 0)
         goto error;
 
+    if (virXPathULong("number(./on_migrate/bandwidth/@peak)", ctxt,
+                         &def->migration_max_bandwidth) < 0)
+        def->migration_max_bandwidth = 0;
+
     tmp = virXPathString("string(./clock/@offset)", ctxt);
     if (tmp) {
         if ((def->clock.offset = virDomainClockOffsetTypeFromString(tmp)) < 0) {
@@ -10205,6 +10209,13 @@ virDomainDefFormatInternal(virDomainDefPtr def,
                                     virDomainLifecycleCrashTypeToString) < 0)
         goto cleanup;
 
+    if (def->migration_max_bandwidth > 0 ) {
+        virBufferAddLit(&buf, "  <on_migrate>\n");
+        virBufferAsprintf(&buf, "    <bandwidth peak='%ld'/>\n",
+                          def->migration_max_bandwidth);
+        virBufferAddLit(&buf, "  </on_migrate>\n");
+    }
+
     virBufferAddLit(&buf, "  <devices>\n");
 
     if (def->emulator)
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 8382d28..99e5bec 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1222,6 +1222,8 @@ struct _virDomainDef {
     int onPoweroff;
     int onCrash;
 
+    unsigned long migration_max_bandwidth;
+
     virDomainOSDef os;
     char *emulator;
     int features;
-- 
1.7.5.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]