]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virsh: avoid missing zero value judgement in cmdBlkiotune
authorAlex Jia <ajia@redhat.com>
Thu, 28 Jul 2011 11:13:41 +0000 (19:13 +0800)
committerEric Blake <eblake@redhat.com>
Thu, 28 Jul 2011 14:30:50 +0000 (08:30 -0600)
commit3f39a0bf2750e63472b4d6d93cd6413013f90902
tree23e1eac02074b50de4d3769735a8c6cc7007a4c9
parentb240f966d9a7f7670cc2107dc06eba630646fb44
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@redhat.com>
tools/virsh.c