]> xenbits.xensource.com Git - libvirt.git/commitdiff
cmdAttachInterface: Fully implement @floor support
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 12 Aug 2015 08:38:12 +0000 (10:38 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 12 Aug 2015 08:57:36 +0000 (10:57 +0200)
In my previous commit d7f5c88961b52 I tried to introduce support
for inbound.floor. But the code change was incomplete. This is
the change needed to fully enable the feature.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
tools/virsh-domain.c

index 9f54691df3e827eabda4b055678c4d69a50dc33d..c8b0e76b885052428c5b17609d6be8a5cb5b753a 100644 (file)
@@ -1023,12 +1023,16 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd)
     if (inboundStr || outboundStr) {
         virBufferAddLit(&buf, "<bandwidth>\n");
         virBufferAdjustIndent(&buf, 2);
-        if (inboundStr && inbound.average > 0) {
-            virBufferAsprintf(&buf, "<inbound average='%llu'", inbound.average);
+        if (inboundStr && (inbound.average || inbound.floor)) {
+            virBufferAddLit(&buf, "<inbound");
+            if (inbound.average > 0)
+                virBufferAsprintf(&buf, " average='%llu'", inbound.average);
             if (inbound.peak > 0)
                 virBufferAsprintf(&buf, " peak='%llu'", inbound.peak);
             if (inbound.burst > 0)
                 virBufferAsprintf(&buf, " burst='%llu'", inbound.burst);
+            if (inbound.floor > 0)
+                virBufferAsprintf(&buf, " floor='%llu'", inbound.floor);
             virBufferAddLit(&buf, "/>\n");
         }
         if (outboundStr && outbound.average > 0) {