]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: allow getting < max typed parameters
authorEric Blake <eblake@redhat.com>
Mon, 31 Oct 2011 23:17:12 +0000 (17:17 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 1 Nov 2011 19:20:48 +0000 (13:20 -0600)
commit97656536e786300d8762b5d087f0b9de91f53b91
tree19f3fe555245a329db4501ab1d37ef6877d69e32
parent5465bc0c8704b58e7984b8e56174bbc82356b1a5
qemu: allow getting < max typed parameters

Since all virTypedParameter APIs allow us to return the number
of slots we actually populated, we should allow the user to
call with nparams too small (without overrunning their array)
or too large (ignoring the tail of the array that we can't fill),
rather than requiring that they get things exactly right.

Making this change will make it easier for a future patch to
introduce VIR_TYPED_PARAM_STRING, with filtering in libvirt.c
rather than in every single driver, since users already have
to be prepared for *nparams to be smaller on exit than on entry.

* src/qemu/qemu_driver.c (qemuDomainGetBlkioParameters)
(qemuDomainGetMemoryParameters): Allow variable nparams on entry.
(qemuGetSchedulerParametersFlags): Drop redundant check.
(qemudDomainBlockStats, qemudDomainBlockStatsFlags): Rename...
(qemuDomainBlockStats, qemuDomainBlockStatsFlags): ...to this.
Don't return unavailable stats.
src/qemu/qemu_driver.c