[PATCH] Fix bug on setting both weight and device-weights at the same time

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

 



When setting both blkio weight and device-weights at the same time, the weight
is lost. Fix it.
---
 tools/virsh.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/virsh.c b/tools/virsh.c
index 01da8e5..af9f538 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -4788,14 +4788,14 @@ cmdBlkiotune(vshControl * ctl, const vshCmd * cmd)
                 if (!virStrcpy(temp->field, VIR_DOMAIN_BLKIO_WEIGHT,
                                sizeof(temp->field)))
                     goto cleanup;
-            }
-
-            if (device_weight) {
+                weight = 0;
+            } else if (device_weight) {
                 temp->value.s = vshStrdup(ctl, device_weight);
                 temp->type = VIR_TYPED_PARAM_STRING;
                 if (!virStrcpy(temp->field, VIR_DOMAIN_BLKIO_DEVICE_WEIGHT,
                                sizeof(temp->field)))
                     goto cleanup;
+                device_weight = NULL;
             }
         }
 
-- 
1.7.3.1

--
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]