Refactored the code to use GLib automatic memory management capabilities. Added macros to enable the g_autoptr capability for some structures. Removed prevosly defined cleanup stages, as now it is not required. Moved some variables to closer scope, to enbale auto memory management capability for it.
Changes: v2: Split the commits to individual functions Kirill Shchetiniuk (22): virQEMUCapsKVMSupportsNesting: Use automatic memory management qemuDomainSetVcpusAgent: Use automatic memory management qemuDomainGetHostnameLease: Use automatic memory management qemuProcessRefreshChannelVirtioState: Use automatic memory management qemuMigrationSrcPerformPeer2Peer2: Use automatic memory management qemuDomainMasterKeyReadFile: Use automatic memory management qemuDomainObjPrivateXMLParse: Use automatic memory management qemuDomainGetGuestVcpus: Use automatic memory management qemuDomainSetGuestVcpus: Use automatic memory management qemuMonitorInitBalloonObjectPath: Use automatic memory management qemuMonitorMigrateToHost: Use automatic memory management qemuMigrationAnyParseURI: Use automatic memory management qemuMigrationAnyPrepareDef: Use automatic memory management qemuMigrationSrcIOFunc: Use automatic memory management qemuMigrationSrcStartTunnel: Use automatic memory management qemuMigrationSrcToLegacyFile: Use automatic memory management virDomainGraphicsDefNew: Use automatic memory management virDomainTPMDefNew: Use automatic memory management virDomainVideoDefNew: Use automatic memory management virDomainIdmapDefParseXML: Use automatic memory management virDomainNetAppendIPAddress: Use automatic memory management virDomainChrDefNew: Use automatic memory management src/conf/domain_conf.c | 35 ++++++++++++------------------ src/conf/domain_conf.h | 2 ++ src/datatypes.h | 1 + src/qemu/qemu_capabilities.c | 6 +++--- src/qemu/qemu_domain.c | 15 ++++++------- src/qemu/qemu_driver.c | 33 +++++++++++------------------ src/qemu/qemu_migration.c | 41 +++++++++++++----------------------- src/qemu/qemu_monitor.c | 6 ++---- src/qemu/qemu_process.c | 7 +++--- 9 files changed, 58 insertions(+), 88 deletions(-) -- 2.49.0
