On Fri, Mar 04, 2016 at 07:30:01 -0500, John Ferlan wrote:
On 02/24/2016 09:22 AM, Peter Krempa wrote:
> The implementation of the inner guts of the function is similar for all
> drivers, so we can add a helper and not have to reimplement it three
> times.
> ---
> src/conf/domain_conf.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++
> src/conf/domain_conf.h | 8 ++++++
> src/libvirt_private.syms | 1 +
> src/libxl/libxl_driver.c | 38 +++-------------------------
> src/qemu/qemu_driver.c | 43 +++-----------------------------
> src/test/test_driver.c | 38 ++++------------------------
> 6 files changed, 84 insertions(+), 108 deletions(-)
>
ACK with one nit...
One difference I noted, the 'libxl' code would:
memset(cpumaps, 0x00, maplen * ncpumaps);
just before filling. Should that be replicated in the common code? If
not then for the libxl code should the lines be kept?
The array members set in our code are cleared by virBitmapToDataBuf. If
the array is larger than filled by this code (which it shouldn't be
really) the rest of the array will be now kept untouched, but the caller
should not use that data either, so this should be safe.
Peter