On Thu, Jun 29, 2017 at 20:04:02 +0200, Andrea Bolognani wrote:
Same as virDomainDeviceInfo itself, any struct that
embeds it needs to be initialized properly before use;
however, none of the structs in question even had a
proper allocation function defined.
Implement an allocation function for all structs
embedding a virDomainDeviceInfo and use them instead
of plain VIR_ALLOC() everywhere.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
src/bhyve/bhyve_parse_command.c | 4 +-
src/conf/domain_conf.c | 280 +++++++++++++++++++++++++++++++---------
src/conf/domain_conf.h | 15 +++
src/libvirt_private.syms | 11 ++
src/openvz/openvz_conf.c | 2 +-
src/qemu/qemu_command.c | 12 +-
src/qemu/qemu_domain.c | 11 +-
src/qemu/qemu_domain_address.c | 2 +-
src/qemu/qemu_hotplug.c | 5 +-
src/qemu/qemu_parse_command.c | 27 ++--
src/vbox/vbox_common.c | 12 +-
src/vmx/vmx.c | 2 +-
src/vz/vz_sdk.c | 6 +-
src/xen/xen_driver.c | 2 +-
src/xenapi/xenapi_driver.c | 2 +-
src/xenconfig/xen_common.c | 2 +-
src/xenconfig/xen_sxpr.c | 8 +-
src/xenconfig/xen_xl.c | 2 +-
src/xenconfig/xen_xm.c | 2 +-
19 files changed, 303 insertions(+), 104 deletions(-)
While I agree that having allocation functions which initialize the
internals are necessary in some cases, this patch is a mess as you
squashed everything into one place.