Bug 726304
Summary: | Error output for blkiotune command when set invalid weight number | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Min Zhan <mzhan> |
Component: | libvirt | Assignee: | Alex Jia <ajia> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 6.2 | CC: | ajia, dallan, dyuan, mzhan, rwu, veillard |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-0.9.4-1.el6 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2011-12-06 11:18:03 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Min Zhan
2011-07-28 07:32:40 UTC
cmdBlkiotune function is missing 0 value judgement, I will commit a patch to fix this issue. Alex https://www.redhat.com/archives/libvir-list/2011-July/msg01973.html The above patch is used for resolving 0 value issue, and wait for developers review. For 0 < weight <100 and weight > 1000, cmdBlkiotune hasn't raised any error for a inactive guest, so whether we should only allow change weight value for active guest? Alex (In reply to comment #2) > https://www.redhat.com/archives/libvir-list/2011-July/msg01973.html here is latest patch: https://www.redhat.com/archives/libvir-list/2011-July/msg01980.html For 0 < weight <100 and weight > 1000, cmdBlkiotune hasn't raised any error for a inactive guest, so whether we should only allow change weight value for active guest? Alex commit 3f39a0bf2750e63472b4d6d93cd6413013f90902 Author: Alex Jia <ajia> Date: Thu Jul 28 19:13:41 2011 +0800 virsh: avoid missing zero value judgement in cmdBlkiotune * tools/virsh.c: fix missing zero value judgement in cmdBlkiotune and correct vshError information. when weight is equal to 0, the cmdBlkiotune will not raise any error information when judge weight value first time, and execute else branch to judge weight value again, strncpy(temp->field, VIR_DOMAIN_BLKIO_WEIGHT, sizeof(temp->field)) will be not executed for ever. However, if and only if param->field is equal to VIR_DOMAIN_BLKIO_WEIGHT, underlying qemuDomainSetBlkioParameters function will check whether weight value is in range [100, 1000]. * how to reproduce? % virsh blkiotune ${guestname} --weight 0 Signed-off-by: Alex Jia <ajia> Thanks for the patch! Hi Dave, This bug has 2 issues, one is missing zero value judgement, the above patch has resolved this issue, the other is when we set weight value out of range [100, 1000] for a inactive guest, the operation is successful and without any error information, it's not we expected result, I add comments for this issue in Comment 2 and Comment3, I want to know whether libvirt only allow to change weight value for a active guest not inactive like 'schedinfo', only allow to change cpu_shares for a active guest, if so, I will commit second patch to fix this issue, but I don't know if this will have effect on '--live', '--config' and '--current'. BTW, so current bug status shouldn't be 'POST', we need to fix the second issue. Alex Fix issue 2: https://www.redhat.com/archives/libvir-list/2011-August/msg00006.html Alex (In reply to comment #7) > Fix issue 2: > https://www.redhat.com/archives/libvir-list/2011-August/msg00006.html > > Alex here is latest patch: http://www.redhat.com/archives/libvir-list/2011-August/msg00039.html commit c03f7f1358a47e3bcc1575972c984233ca5da77c Author: Alex Jia <ajia> Date: Mon Aug 1 23:45:27 2011 +0800 qemu: fix return value issue whether or not previous return value is -1, the following codes will be executed for a inactive guest in src/qemu/qemu_driver.c: ret = virDomainSaveConfig(driver->configDir, persistentDef); and if everything is okay, 'ret' is assigned to 0, the previous 'ret' will be overwritten, this patch will fix this issue. * src/qemu/qemu_driver.c: avoid return value is overwritten when give a argument in out of blkio weight range for a inactive guest. * how to reproduce? % virsh blkiotune ${guestname} --weight 10 % echo $? Note: guest must be inactive, argument 10 in out of blkio weight range, and can get a error information by checking libvirtd.log, however, virsh hasn't raised any error information, and return value is 0. https://bugzilla.redhat.com/show_bug.cgi?id=726304 Signed-off-by: Alex Jia <ajia> Reproduced this bug with libvirt-0.9.4-0rc2.el6. Verified PASS with libvirt-0.9.4-1.el6. pkgs: qemu-kvm-0.12.1.2-2.176.el6 kernel-2.6.32-172.el6 # virsh start dom Domain dom started # virsh blkiotune dom --weight 0 error: Invalid value of 0 for I/O weight # virsh blkiotune dom --weight 99 error: Unable to change blkio parameters error: invalid argument in out of blkio weight range. # virsh destroy dom Domain dom destroyed # virsh blkiotune dom --weight 99 error: Unable to change blkio parameters error: invalid argument in out of blkio weight range. # virsh blkiotune dom weight : 1000 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2011-1513.html |