This is a followup to a previous patch series: v0: https://www.redhat.com/archives/libvir-list/2019-August/msg01374.html v1: https://www.redhat.com/archives/libvir-list/2019-September/msg01331.html v2: https://www.redhat.com/archives/libvir-list/2019-October/msg00271.html The focus in this glib series is - Wire up pieces to facilitate interoperability around memory allocation/cleanup. - Deprecate & document existing libvirt APIs that are targetted for removal/conversion. - Illustrate some conversions and/or usage of new APIs. - Convert code that allows us to eliminate more gnulib modules There's obviously alot of conversion work that could be done, especially around memory allocation, auto cleanup and virObject stuff. I'm not intending to do that myself in the short term, as my immediate focus is on eliminating gnulib modules. Once this series is merged though, anyone is able to take on conversion jobs, so this allows the work to be spread out across the contributors. changed in v2: - First patch gets an addition to .travis.yml to add glib2 on macOS - First patch blacklists -Wbad-function-cast warning flag - Second patch updates many makefiles to refer to $(GLIB_LIBS) to fix build on platforms with stricter linkers (Ubuntu) - virIdentity conversion uses _ consistently in methods - GOptionContext conversions are dropped Daniel P. Berrangé (19): build: probe for glib-2 library in configure build: link to glib library util: use glib memory allocation functions util: use glib string allocation/formatting functions util: convert virSystemdActivation to use VIR_DEFINE_AUTOPTR_FUNC util: rewrite auto cleanup macros to use glib's equivalent src: add support for g_autoptr with virObject instances conf: convert virSecretObj APIs to use autofree util: use glib base64 encoding/decoding APIs util: convert virIdentity implementation and test suite to g_autoptr access: convert polkit driver to auto free memory admin: convert admin server code to use auto free macros rpc: convert methods using virIdentityPtr to auto free macros remote: convert methods using virIdentityPtr to auto free macros util: convert virIdentity class to use GObject libxl: convert over to use GRegex for regular expressions conf: convert over to use GRegex for regular expressions util: replace strerror/strerror_r with g_strerror build: remove use of usleep gnulib module in favour of g_usleep .travis.yml | 1 + bootstrap.conf | 8 -- build-aux/syntax-check.mk | 2 +- configure.ac | 7 +- docs/hacking.html.in | 144 ++++++++------------ libvirt.spec.in | 1 + m4/virt-compile-warnings.m4 | 23 ++++ m4/virt-glib.m4 | 36 +++++ mingw-libvirt.spec.in | 2 + src/Makefile.am | 3 + src/access/Makefile.inc.am | 4 +- src/access/viraccessdriverpolkit.c | 38 ++---- src/admin/admin_server.c | 204 ++++++++++++---------------- src/bhyve/Makefile.inc.am | 1 + src/conf/capabilities.h | 3 + src/conf/domain_capabilities.h | 3 + src/conf/domain_conf.h | 3 + src/conf/domain_event.c | 25 ++-- src/conf/snapshot_conf.h | 3 + src/conf/storage_capabilities.h | 3 + src/conf/virsecretobj.c | 68 +++------- src/datatypes.h | 15 ++ src/hyperv/hyperv_driver.c | 2 +- src/hyperv/hyperv_wmi.c | 4 +- src/interface/Makefile.inc.am | 1 + src/internal.h | 1 + src/libvirt_private.syms | 1 - src/libxl/Makefile.inc.am | 1 + src/libxl/libxl_capabilities.c | 42 +++--- src/libxl/libxl_conf.c | 3 +- src/libxl/libxl_conf.h | 2 + src/locking/Makefile.inc.am | 9 +- src/locking/lock_daemon.c | 2 +- src/locking/lock_driver_sanlock.c | 2 +- src/logging/Makefile.inc.am | 1 + src/lxc/Makefile.inc.am | 4 + src/lxc/lxc_controller.c | 2 +- src/lxc/lxc_driver.c | 2 +- src/lxc/lxc_process.c | 2 +- src/network/Makefile.inc.am | 2 + src/network/bridge_driver.c | 2 +- src/node_device/Makefile.inc.am | 5 +- src/nwfilter/Makefile.inc.am | 1 + src/nwfilter/nwfilter_dhcpsnoop.c | 4 +- src/nwfilter/nwfilter_learnipaddr.c | 2 +- src/qemu/Makefile.inc.am | 1 + src/qemu/qemu_agent.c | 6 +- src/qemu/qemu_blockjob.h | 1 + src/qemu/qemu_capabilities.h | 2 + src/qemu/qemu_command.c | 5 +- src/qemu/qemu_conf.h | 3 + src/qemu/qemu_domain.c | 8 +- src/qemu/qemu_monitor_json.c | 2 +- src/qemu/qemu_process.c | 6 +- src/qemu/qemu_tpm.c | 2 +- src/remote/Makefile.inc.am | 2 + src/remote/remote_daemon.c | 3 +- src/remote/remote_daemon_dispatch.c | 35 ++--- src/rpc/virnetserverclient.c | 57 ++++---- src/rpc/virnetserverprogram.c | 13 +- src/rpc/virnetsocket.c | 2 +- src/secret/Makefile.inc.am | 1 + src/secret/secret_driver.c | 1 - src/security/Makefile.inc.am | 1 + src/security/security_manager.c | 2 +- src/storage/Makefile.inc.am | 16 +++ src/storage/storage_backend_rbd.c | 4 +- src/storage/storage_util.c | 4 +- src/util/viralloc.c | 29 +--- src/util/viralloc.h | 14 +- src/util/virautoclean.h | 38 +++--- src/util/vircgroup.c | 2 +- src/util/virerror.c | 9 +- src/util/virerror.h | 1 + src/util/virfile.c | 2 +- src/util/virhostdev.h | 3 + src/util/viridentity.c | 92 +++++++------ src/util/viridentity.h | 7 +- src/util/virmdev.h | 3 + src/util/virnetdev.c | 2 +- src/util/virnetdevip.c | 2 +- src/util/virnetdevmacvlan.c | 2 +- src/util/virnetdevvportprofile.c | 2 +- src/util/virobject.h | 4 + src/util/virpci.c | 8 +- src/util/virpci.h | 3 + src/util/virprocess.c | 4 +- src/util/virresctrl.h | 4 + src/util/virscsi.h | 3 + src/util/virscsivhost.h | 3 + src/util/virstoragefile.h | 2 + src/util/virstring.c | 49 +++---- src/util/virstring.h | 10 +- src/util/virsystemd.c | 10 +- src/util/virsystemd.h | 5 +- src/util/virtime.c | 2 +- src/util/virusb.h | 3 + src/vbox/Makefile.inc.am | 1 + src/vbox/vbox_common.c | 2 +- src/vz/Makefile.inc.am | 1 + tests/Makefile.am | 7 +- tests/commandtest.c | 16 +-- tests/eventtest.c | 4 +- tests/fdstreamtest.c | 4 +- tests/qemumonitortestutils.c | 2 +- tests/seclabeltest.c | 4 +- tests/testutils.c | 6 +- tests/virhostcputest.c | 4 +- tests/viridentitytest.c | 45 +++--- tests/virnetserverclienttest.c | 3 +- tests/virsystemdtest.c | 2 +- tests/virtestmock.c | 4 +- tools/Makefile.am | 4 + tools/virsh-domain.c | 2 +- tools/virsh-secret.c | 17 +-- 115 files changed, 667 insertions(+), 650 deletions(-) create mode 100644 m4/virt-glib.m4 -- 2.21.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list