libvirt/src/util
Sukrit Bhatnagar 30783d36b2 util: scsi: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC
Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in
src/util/viralloc.h, define a new wrapper around an existing
cleanup function which will be called when a variable declared
with VIR_AUTOPTR macro goes out of scope. Also, drop the redundant
viralloc.h include, since that has moved from the source module into
the header.

When variables of type virSCSIDevicePtr and virUsedByInfoPtr
are declared using VIR_AUTOPTR, the functions virSCSIDeviceFree
and virSCSIDeviceUsedByInfoFree, respectively, will be run
automatically on them when they go out of scope.

This commit also adds an intermediate typedef for virUsedByInfo
type for use with the cleanup macros.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-07-27 17:21:19 +02:00
..
iohelper.c util: iohelper: use VIR_AUTOFREE instead of VIR_FREE for scalar types 2018-07-14 17:01:30 +02:00
Makefile.inc.am Switch from yajl to Jansson 2018-07-18 17:54:18 +02:00
viralloc.c Use explicit boolean comparison in OOM check 2017-02-23 10:11:16 +00:00
viralloc.h util: alloc: add macros for implementing automatic cleanup functionality 2018-07-14 17:01:30 +02:00
virarch.c
virarch.h
virarptable.c util: arptable: use VIR_AUTOFREE instead of VIR_FREE for scalar types 2018-07-14 17:01:30 +02:00
virarptable.h virarptable: Include rtnetlink.h only on Linux 2018-03-15 14:59:12 +01:00
viratomic.c
viratomic.h Remove backslash alignment attempts 2017-11-03 13:24:12 +01:00
viraudit.c util: audit: use VIR_AUTOFREE instead of VIR_FREE for scalar types 2018-07-14 17:01:30 +02:00
viraudit.h audit: Log only an info message if audit_level < 2 and audit is not supported 2017-12-13 13:42:16 +01:00
virauth.c util: auth: use VIR_AUTOPTR for aggregate types 2018-07-14 17:01:30 +02:00
virauth.h
virauthconfig.c util: authconfig: use VIR_AUTOFREE instead of VIR_FREE for scalar types 2018-07-14 17:01:30 +02:00
virauthconfig.h util: authconfig: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC 2018-07-14 17:01:30 +02:00
virbitmap.c util: bitmap: use VIR_AUTOPTR for aggregate types 2018-07-14 17:01:30 +02:00
virbitmap.h util: bitmap: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC 2018-07-14 17:01:30 +02:00
virbuffer.c util: buffer: use VIR_AUTOPTR for aggregate types 2018-07-27 17:19:15 +02:00
virbuffer.h util: buffer: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC 2018-07-27 17:19:13 +02:00
vircgroup.c util: cgroup: use VIR_AUTOPTR for aggregate types 2018-07-27 17:19:22 +02:00
vircgroup.h util: cgroup: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC 2018-07-27 17:19:18 +02:00
vircgrouppriv.h util: cgroup: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC 2018-07-27 17:19:18 +02:00
virclosecallbacks.c conf: Rework/rename virDomainObjListFindByUUIDRef 2018-04-23 06:41:45 -04:00
virclosecallbacks.h util: Alter virCloseCallback typedef to return void 2018-04-09 18:26:03 -04:00
vircommand.c virCommandWait: Propagate dryRunCallback return value properly 2018-07-25 07:11:13 +02:00
vircommand.h util: command: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC 2018-07-14 17:01:30 +02:00
vircommandpriv.h
virconf.c util: handle missing switch enum cases 2018-02-21 16:53:44 +00:00
virconf.h maint: Replace tabs with spaces in all source files in repo 2017-10-18 13:25:10 +02:00
vircrypto.c src: Drop most of #ifdef WITH_GNUTLS 2018-06-05 14:32:36 +02:00
vircrypto.h vircrypto: Drop virCryptoGenerateRandom 2018-06-05 10:31:19 +02:00
virdbus.c Remove backslash alignment attempts 2017-11-03 13:24:12 +01:00
virdbus.h
virdbuspriv.h
virdevmapper.c virDevMapperGetTargetsImpl: Be tolerant to kernels without DM support 2018-07-13 16:01:05 +02:00
virdevmapper.h util: Introduce virDevMapperGetTargets 2018-04-05 09:58:44 +02:00
virdnsmasq.c virobject: Introduce VIR_CLASS_NEW() macro 2018-04-18 10:04:55 +02:00
virdnsmasq.h Remove backslash alignment attempts 2017-11-03 13:24:12 +01:00
virebtables.c
virebtables.h
virendian.h Remove backslash alignment attempts 2017-11-03 13:24:12 +01:00
virerror.c util: error: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC 2018-07-27 17:19:06 +02:00
virerror.h util: error: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC 2018-07-27 17:19:06 +02:00
virevent.c util: Missing 'removeTimeoutImpl' check variable inside virEventRegisterImpl() function. 2017-10-20 15:15:35 +02:00
virevent.h
vireventpoll.c util: eventpoll: use VIR_AUTOFREE instead of VIR_FREE for scalar types 2018-07-14 17:01:30 +02:00
vireventpoll.h THREADS.txt: fix typos 2017-01-25 09:18:49 +01:00
virfcp.c util: fcp: use VIR_AUTOFREE instead of VIR_FREE for scalar types 2018-07-14 17:01:30 +02:00
virfcp.h util: helper functions for fibre channel devices 2017-05-26 10:44:05 -04:00
virfdstream.c src: Make virStr*cpy*() functions return an int 2018-07-23 14:27:30 +02:00
virfdstream.h fdstream: Implement sparse stream 2017-05-18 07:42:13 +02:00
virfile.c util: remove unused variable inside virFileReadValueString(). 2018-07-14 20:38:56 +04:00
virfile.h util: file: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC 2018-07-14 17:01:30 +02:00
virfilecache.c util: filecache: use VIR_AUTOFREE instead of VIR_FREE for scalar types 2018-07-14 17:01:30 +02:00
virfilecache.h util: introduce virFileCache 2017-07-26 15:31:25 +02:00
virfirewall.c util: firewall: use VIR_AUTOPTR for aggregate types 2018-07-27 17:21:08 +02:00
virfirewall.h util: firewall: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC 2018-07-27 17:21:04 +02:00
virfirewallpriv.h
virfirmware.c
virfirmware.h
virgettext.c po: provide custom make rules for po file management 2018-04-19 10:35:58 +01:00
virgettext.h
virgic.c
virgic.h gic: Remove VIR_GIC_VERSION_DEFAULT 2017-05-16 16:48:30 +02:00
virhash.c util: hash: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC 2018-07-27 17:19:16 +02:00
virhash.h util: hash: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC 2018-07-27 17:19:16 +02:00
virhashcode.c Use ATTRIBUTE_FALLTHROUGH 2017-06-12 19:11:30 -04:00
virhashcode.h util: hash: Make virHashCodeGen mockable 2017-08-03 09:49:15 +02:00
virhook.c util: hook: use VIR_AUTOPTR for aggregate types 2018-07-27 17:21:11 +02:00
virhook.h Replace QEmu with QEMU 2018-04-01 17:42:29 +02:00
virhostcpu.c src: Make virStr*cpy*() functions return an int 2018-07-23 14:27:30 +02:00
virhostcpu.h util: introduce virHostCPUGetMicrocodeVersion 2018-01-04 16:52:03 +01:00
virhostcpupriv.h util: Adapt virhostcpu to the new virsysfs 2017-03-27 13:13:29 +02:00
virhostdev.c util: usb: modify virUSBDeviceListAdd to take double pointer 2018-07-27 17:21:14 +02:00
virhostdev.h util: virhostdev: add virHostdevIsMdevDevice() 2018-05-14 12:12:06 -04:00
virhostmem.c src: Make virStr*cpy*() functions return an int 2018-07-23 14:27:30 +02:00
virhostmem.h
viridentity.c util: identity: use VIR_AUTOFREE instead of VIR_FREE for scalar types 2018-07-14 17:01:30 +02:00
viridentity.h
virinitctl.c
virinitctl.h
viriptables.c
viriptables.h
viriscsi.c util: Fix virStorageBackendIQNFound() to work on FreeBSD 2018-07-25 13:23:10 +02:00
viriscsi.h virISCSIScanTargets: Allow making targets persistent 2018-07-25 07:11:13 +02:00
virjson.c Remove virJSONValueNewStringLen 2018-07-18 17:54:18 +02:00
virjson.h Remove virJSONValueNewStringLen 2018-07-18 17:54:18 +02:00
virkeycode.c keycodemapdb: Update submodule 2018-03-12 16:30:49 +01:00
virkeycode.h
virkeyfile.c
virkeyfile.h
virkmod.c
virkmod.h
virlease.c
virlease.h
virlockspace.c util: Clean up consumers of virJSONValueArraySize 2018-05-10 14:59:15 -04:00
virlockspace.h
virlog.c src: Make virStr*cpy*() functions return an int 2018-07-23 14:27:30 +02:00
virlog.h log: rename virLogFlags to virLogFilterFlags to match docs 2018-05-11 17:06:55 +01:00
virmacaddr.c conf: move 'generated' member from virMacAddr to virDomainNetDef 2018-02-19 13:15:00 -05:00
virmacaddr.h conf: move 'generated' member from virMacAddr to virDomainNetDef 2018-02-19 13:15:00 -05:00
virmacmap.c util: Rework virStringListAdd 2018-07-27 15:47:45 +02:00
virmacmap.h network: Move and rename networkMacMgrFileName 2017-08-16 14:17:57 -04:00
virmdev.c util: mdev: use VIR_AUTOPTR for aggregate types 2018-07-27 17:19:25 +02:00
virmdev.h util: mdev: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC 2018-07-27 17:19:23 +02:00
virmodule.c virmodule: Fix virModuleLoad stub 2018-07-15 12:09:09 +02:00
virmodule.h util: create new virmodule.{c,h} files for dlopen support code 2018-05-03 12:47:43 +01:00
virnetdev.c src: Make virStr*cpy*() functions return an int 2018-07-23 14:27:30 +02:00
virnetdev.h nodedev: add switchdev to NIC capabilities 2017-09-18 08:32:24 -04:00
virnetdevbandwidth.c QoS: Set classes and filters in proper direction 2017-10-05 09:16:05 +02:00
virnetdevbandwidth.h QoS: Set classes and filters in proper direction 2017-10-05 09:16:05 +02:00
virnetdevbridge.c src: Make virStr*cpy*() functions return an int 2018-07-23 14:27:30 +02:00
virnetdevbridge.h
virnetdevip.c IPv6 route check: list devices only once 2017-04-26 18:59:24 +02:00
virnetdevip.h Revert "Prevent more compiler optimization of mockable functions" 2017-07-13 13:07:06 +01:00
virnetdevmacvlan.c util: restructure virNetDevReadNetConfig() to eliminate false error logs 2017-08-11 19:09:49 -04:00
virnetdevmacvlan.h util: make macvtap/macvlan generated name #defines available to other files 2017-04-28 09:43:52 -04:00
virnetdevmidonet.c
virnetdevmidonet.h
virnetdevopenvswitch.c util: new function virNetDevOpenvswitchInterfaceGetMaster() 2018-07-02 18:06:53 -04:00
virnetdevopenvswitch.h util: new function virNetDevOpenvswitchInterfaceGetMaster() 2018-07-02 18:06:53 -04:00
virnetdevtap.c src: Make virStr*cpy*() functions return an int 2018-07-23 14:27:30 +02:00
virnetdevtap.h util: Remove ATTRIBUTE_NONNULL from virNetDevTapInterfaceStats 2018-07-16 06:57:25 -04:00
virnetdevveth.c
virnetdevveth.h
virnetdevvlan.c
virnetdevvlan.h
virnetdevvportprofile.c src: Make virStr*cpy*() functions return an int 2018-07-23 14:27:30 +02:00
virnetdevvportprofile.h util: handle missing switch enum cases 2018-02-21 16:53:44 +00:00
virnetlink.c virNetlinkDumpCommand: Don't leak response buffer 2018-03-19 10:47:08 +01:00
virnetlink.h util: introduce virNetlinkGetNeighbor to get neighbor table entry 2018-03-15 11:22:42 +01:00
virnodesuspend.c util: Fix naming in util/virnodesuspend 2017-03-27 13:13:29 +02:00
virnodesuspend.h util: Fix naming in util/virnodesuspend 2017-03-27 13:13:29 +02:00
virnuma.c virNumaGetHugePageInfo: Return page_avail and page_free as ULL 2018-04-24 11:02:28 +02:00
virnuma.h virNumaGetHugePageInfo: Return page_avail and page_free as ULL 2018-04-24 11:02:28 +02:00
virobject.c util: fix misleading comment for virObjectLock 2018-05-15 18:43:01 +01:00
virobject.h virobject: Check if @parent is the first member in class 2018-04-18 10:04:55 +02:00
virpci.c util: pci: use VIR_AUTOPTR for aggregate types 2018-07-27 17:21:13 +02:00
virpci.h util: pci: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC 2018-07-27 17:21:11 +02:00
virperf.c virPerfEventIsEnabled: Accept NULL @perf 2017-05-04 16:42:25 +02:00
virperf.h perf: add emulation_faults software perf event support 2017-03-07 13:51:05 -05:00
virpidfile.c util:Fix with process number and pid file do not match 2018-07-04 08:10:53 +02:00
virpidfile.h
virpolkit.c Merge WITH_POLKIT1 and WITH_POLKIT 2018-03-14 12:46:26 +01:00
virpolkit.h
virportallocator.c virtportallocator: Change number of ports to 65536 2018-06-14 09:52:21 +02:00
virportallocator.h port allocator: make port range constant object 2018-02-22 13:52:45 +01:00
virprobe.h util: probe: Add quiet versions of the "PROBE" macro 2018-01-03 15:21:06 +01:00
virprocess.c util: fix mount issue by moving NULL value to "none" in syscall. 2018-06-26 08:05:57 +02:00
virprocess.h lxc: Move lxcContainerAvailable to virprocess 2017-01-11 18:02:35 +01:00
virqemu.c storage: Rename encryption info variable for clarity 2018-06-26 14:02:43 -04:00
virqemu.h qemu: Delete old unused code for adding objects to qemu 2018-06-05 08:13:59 +02:00
virrandom.c virrandom: Make virRandomBits better 2018-06-05 10:31:19 +02:00
virrandom.h Revert "Prevent more compiler optimization of mockable functions" 2017-07-13 13:07:06 +01:00
virresctrl.c util: Remove cbm_mask from virResctrlInfoPerType 2018-06-08 10:28:46 +02:00
virresctrl.h Move virCacheKernel enum implemetation from conf/ to util/ 2018-06-08 10:28:46 +02:00
virresctrlpriv.h resctrl: Add functions to work with resctrl allocations 2018-01-25 17:16:08 +01:00
virrotatingfile.c Print hex values with '0x' prefix and octal with '0' in debug messages 2017-09-25 13:34:53 +01:00
virrotatingfile.h
virscsi.c util: scsi: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC 2018-07-27 17:21:19 +02:00
virscsi.h util: scsi: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC 2018-07-27 17:21:19 +02:00
virscsihost.c util: Move scsi_host specific functions from virutil 2017-02-19 06:45:09 -05:00
virscsihost.h util: Move scsi_host specific functions from virutil 2017-02-19 06:45:09 -05:00
virscsivhost.c virobject: Introduce VIR_CLASS_NEW() macro 2018-04-18 10:04:55 +02:00
virscsivhost.h Revert "Prevent more compiler optimization of mockable functions" 2017-07-13 13:07:06 +01:00
virseclabel.c
virseclabel.h
virsecret.c util: Move virSecretUsageType to virsecret.h 2017-09-21 15:46:48 -04:00
virsecret.h util: Move virSecretUsageType to virsecret.h 2017-09-21 15:46:48 -04:00
virsexpr.c
virsexpr.h
virsocketaddr.c util: fix spelling in virSocketAddrParseAny docs 2018-04-05 14:57:16 -06:00
virsocketaddr.h util: introduce virSocketAddrParseAny 2018-04-05 14:50:15 -06:00
virstorageencryption.c util: storage: Sanitize parsing of disk encryption XMLs 2018-03-08 14:29:50 +01:00
virstorageencryption.h util: storage: Sanitize parsing of disk encryption XMLs 2018-03-08 14:29:50 +01:00
virstoragefile.c utils: storage: Add helper for checking if storage source is the same 2018-07-20 15:41:38 +02:00
virstoragefile.h utils: storage: Add helper for checking if storage source is the same 2018-07-20 15:41:38 +02:00
virstoragefilebackend.c storagefile: conditional build of virStorageFileLoadBackendModule 2018-05-03 15:42:59 +01:00
virstoragefilebackend.h storage: create separate loadable modules for storage file drivers 2018-05-03 13:17:59 +01:00
virstring.c util: Rework virStringListAdd 2018-07-27 15:47:45 +02:00
virstring.h util: Rework virStringListAdd 2018-07-27 15:47:45 +02:00
virsysinfo.c virsysinfo: Use more virSkipSpacesBackwards() 2018-03-14 17:43:40 +01:00
virsysinfo.h conf: Add support for setting Chassis SMBIOS data fields 2018-02-17 07:36:46 -05:00
virsysinfopriv.h tests: sysinfo: Export virSysinfoSetup via the private header 2017-03-07 10:44:26 +01:00
virsystemd.c Remove backslash alignment attempts 2017-11-03 13:24:12 +01:00
virsystemd.h Move machineName generation from virsystemd into domain_conf 2017-07-25 17:02:27 +02:00
virsystemdpriv.h Cache the presence of machine1 service 2017-03-06 15:44:33 +01:00
virthread.c util: gettid() is Linux-specific 2017-12-05 11:28:19 +01:00
virthread.h Remove backslash alignment attempts 2017-11-03 13:24:12 +01:00
virthreadjob.c
virthreadjob.h
virthreadpool.c virThreadPool: Prevent switching between zero and non-zero maxWorkers 2018-07-21 07:46:45 -04:00
virthreadpool.h
virtime.c virTimeBackOffWait: Avoid long periods of sleep 2017-03-16 09:21:39 +01:00
virtime.h
virtpm.c tpm: Use /dev/null for cancel path if none was found 2017-09-07 14:00:46 +02:00
virtpm.h Revert "Prevent more compiler optimization of mockable functions" 2017-07-13 13:07:06 +01:00
virtypedparam.c virTypedParamsDeserialize: set nparams to 0 in case of an error 2018-07-23 14:28:58 -04:00
virtypedparam.h Remove backslash alignment attempts 2017-11-03 13:24:12 +01:00
viruri.c virstring: Unify string list function names 2016-11-25 13:54:05 +01:00
viruri.h util: uri: Convert port number to unsigned integer 2017-07-24 10:55:43 +02:00
virusb.c util: usb: use VIR_AUTOPTR for aggregate types 2018-07-27 17:21:17 +02:00
virusb.h util: usb: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC 2018-07-27 17:21:15 +02:00
virutil.c qemu: hostdev: Move parts of qemuHostdevHostSupportsPassthroughVFIO() into separate function 2018-06-05 08:33:13 +02:00
virutil.h qemu: hostdev: Move parts of qemuHostdevHostSupportsPassthroughVFIO() into separate function 2018-06-05 08:33:13 +02:00
viruuid.c virUUIDGenerate don't fall back to virRandomBits 2018-06-05 10:31:19 +02:00
viruuid.h Remove backslash alignment attempts 2017-11-03 13:24:12 +01:00
virvhba.c util: virvhba: fix typo that breaks build on non-linux systems 2017-02-19 15:47:27 +01:00
virvhba.h util: Create a new virvhba module and move/rename API's 2017-02-19 06:45:09 -05:00
virvsock.c util: create virvsock.c 2018-05-29 15:42:03 +02:00
virvsock.h util: create virvsock.c 2018-05-29 15:42:03 +02:00
virxdrdefs.h
virxml.c all: Replace virGetLastError with virGetLastErrorCode where we can 2018-06-05 18:44:05 +02:00
virxml.h Remove backslash alignment attempts 2017-11-03 13:24:12 +01:00