[libvirt] [PATCH] qemu: fix not update weight in def after success

lhuang lhuang at redhat.com
Wed Aug 19 01:59:28 UTC 2015


On 08/19/2015 01:32 AM, John Ferlan wrote:
>
> On 08/12/2015 09:53 PM, Luyao Huang wrote:
>> https://bugzilla.redhat.com/show_bug.cgi?id=1253107
>>
>> Update the weight in vm def to fix this.
>>
>> Signed-off-by: Luyao Huang <lhuang at redhat.com>
>> ---
>>   src/qemu/qemu_driver.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
> Considering the series I recently ACK from Martin - shouldn't this to
> make a virCgroupGetBlkioWeight type call to ensure you get/save whatever
> the kernel saved?

Indeed, it will be better to check the value again (blkio.weigh and 
blkio.weight_device range is [10, 1000] right now, so seems these 2 
value won't hit the issue that was fixed by Martin), i will write a new 
version later.

Thanks a lot for your review.

> John

Luyao

> See:
>
> http://www.redhat.com/archives/libvir-list/2015-August/msg00065.html
>> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
>> index 7a984a8..0b984dc 100644
>> --- a/src/qemu/qemu_driver.c
>> +++ b/src/qemu/qemu_driver.c
>> @@ -9170,6 +9170,8 @@ qemuDomainSetBlkioParameters(virDomainPtr dom,
>>               if (STREQ(param->field, VIR_DOMAIN_BLKIO_WEIGHT)) {
>>                   if (virCgroupSetBlkioWeight(priv->cgroup, param->value.ui) < 0)
>>                       ret = -1;
>> +                else
>> +                    def->blkio.weight = param->value.ui;
>>               } else if (STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_WEIGHT) ||
>>                          STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_READ_IOPS) ||
>>                          STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_WRITE_IOPS) ||
>>




More information about the libvir-list mailing list