[libvirt] [PATCH 4/6 v3] virsh: Adding blkiotune command to virsh tool
Eric Blake
eblake at redhat.com
Fri Mar 11 00:21:40 UTC 2011
On 02/21/2011 10:33 PM, Gui Jianfeng wrote:
> Adding blkiotune command to virsh tool
>
> Signed-off-by: Gui Jianfeng <guijianfeng at cn.fujitsu.com>
> ---
> tools/virsh.c | 127 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 127 insertions(+), 0 deletions(-)
>
> +static int
> +cmdBlkiotune(vshControl * ctl, const vshCmd * cmd)
> +{
> + virDomainPtr dom;
> + int weight;
> + int nparams = 0;
> + unsigned int i = 0;
> + virBlkioParameterPtr params = NULL, temp = NULL;
> + int ret = FALSE;
> + int found;
> +
> + if (!vshConnectionUsability(ctl, ctl->conn))
> + return FALSE;
> +
> + if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
> + return FALSE;
> +
> + weight = vshCommandOptInt(cmd, "weight", &found);
Oh my - more merge resolution (and the compiler didn't catch that we'd
reworked vshCommandOptInt in d03f199).
> + if (found) {
> + nparams++;
> + if (weight < 0) {
> + virDomainFree(dom);
> + vshError(ctl, _("Invalid value of %d for I/O weight"), weight);
> + return FALSE;
Mem leak of dom.
> + if (weight) {
> + temp->value.ui = (unsigned int)weight;
Unnecessary cast.
> @@ -10324,6 +10450,7 @@ static const vshCmdDef domManagementCmds[] = {
> {"managedsave", cmdManagedSave, opts_managedsave, info_managedsave},
> {"managedsave-remove", cmdManagedSaveRemove, opts_managedsaveremove, info_managedsaveremove},
> {"maxvcpus", cmdMaxvcpus, opts_maxvcpus, info_maxvcpus},
> + {"blkiotune", cmdBlkiotune, opts_blkiotune, info_blkiotune},
Sorted order.
I like documentation closer to the changes, so I squashed 6/6 into this one.
--
Eric Blake eblake at redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110310/a61d7740/attachment-0001.sig>
More information about the libvir-list
mailing list