libvirt/src/util
Michal Privoznik 45aa4c1d2a virhostmem: Introduce virHostMemGetTHPSize()
New virHostMemGetTHPSize() is introduced which allows caller to
obtain THP PMD (Page Middle Directory) size, which is equal to
the minimal size that THP can use, taken from kernel doc
(Documentation/admin-guide/mm/transhuge.rst):

  Some userspace (such as a test program, or an optimized memory allocation
  library) may want to know the size (in bytes) of a transparent hugepage::

    cat /sys/kernel/mm/transparent_hugepage/hpage_pmd_size

Since this size depends on the host architecture and the kernel
it won't change whilst libvirtd is running. Therefore, we can use
virOnce() and cache the value. Of course, we can be running under
kernel that has THP disabled or has no notion of THP at all. In
that case a negative value is returned to signal error.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-10-01 10:58:27 +02:00
..
glibcompat.c src: ensure GSource background unref happens in correct event loop 2021-03-17 09:16:05 +00:00
glibcompat.h src: ensure GSource background unref happens in correct event loop 2021-03-17 09:16:05 +00:00
iohelper.c iohelper: skip lseek() and ftruncate() on block devices 2021-08-24 16:02:38 +02:00
meson.build meson: tools: depend on keycode generated sources 2021-03-05 20:05:54 +04:00
viralloc.c util: alloc: Introduce virAppendElement helper 2021-08-06 08:53:25 +02:00
viralloc.h util: alloc: Completely replace VIR_APPEND_ELEMENT_QUIET by VIR_APPEND_ELEMENT 2021-08-06 08:53:25 +02:00
virarch.c
virarch.h util: add ARCH_IS_MIPS64 helper macro 2020-11-20 12:09:51 +00:00
virarptable.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virarptable.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
viraudit.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
viraudit.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virauth.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virauth.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virauthconfig.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virauthconfig.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virbitmap.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virbitmap.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virbpf.c lib: Prefer WITH_* prefix for #if conditionals 2020-09-02 10:28:10 +02:00
virbpf.h lib: Prefer WITH_* prefix for #if conditionals 2020-09-02 10:28:10 +02:00
virbuffer.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virbuffer.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
vircgroup.c vircgroup: fix build on non-linux systems 2021-08-17 15:29:38 +02:00
vircgroup.h vircgroup: introduce virCgroupGetInode function 2021-08-17 12:35:45 +02:00
vircgroupbackend.c vircgroupbackend: Extend error messages in VIR_CGROUP_BACKEND_CALL() 2021-04-19 11:21:40 +02:00
vircgroupbackend.h vircgroupbackend: Extend error messages in VIR_CGROUP_BACKEND_CALL() 2021-04-19 11:21:40 +02:00
vircgrouppriv.h vircgroup: Fix virCgroupKillRecursive() wrt nested controllers 2021-04-19 11:21:40 +02:00
vircgroupv1.c vircgroup: Fix virCgroupKillRecursive() wrt nested controllers 2021-04-19 11:21:40 +02:00
vircgroupv1.h
vircgroupv2.c vircgroup: Fix virCgroupKillRecursive() wrt nested controllers 2021-04-19 11:21:40 +02:00
vircgroupv2.h
vircgroupv2devices.c vircgroupv2devices: refactor virCgroupV2DevicesRemoveProg 2021-04-14 12:06:16 +02:00
vircgroupv2devices.h vircgroupv2devices: refactor virCgroupV2DevicesRemoveProg 2021-04-14 12:06:16 +02:00
vircommand.c util: command: Introduce virCommandToStringBuf 2021-06-15 16:27:35 +02:00
vircommand.h util: command: Introduce virCommandToStringBuf 2021-06-15 16:27:35 +02:00
vircommandpriv.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virconf.c Remove static analysis assertions 2021-05-24 20:26:20 +02:00
virconf.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
vircrypto.c util: Remove use of virCryptoHaveCipher(VIR_CRYPTO_CIPHER_AES256CBC) 2021-09-22 14:53:55 +02:00
vircrypto.h util: Remove use of virCryptoHaveCipher(VIR_CRYPTO_CIPHER_AES256CBC) 2021-09-22 14:53:55 +02:00
virdaemon.c lib: Replace virFileMakePath() with g_mkdir_with_parents() 2021-03-04 20:52:23 +01:00
virdaemon.h util: introduce shared daemon startup code 2020-03-27 16:22:49 +01:00
virdevmapper.c virDevMapperGetTargets: Fix non-linux implementation 2021-09-21 14:30:19 +02:00
virdevmapper.h virDevMapperGetTargets: Use a linked list as return type 2021-09-21 12:25:42 +02:00
virdnsmasq.c virdnsmasq: remove binaryPath argument from dnsmasqCapsNewFromBinary 2021-04-21 14:18:31 +02:00
virdnsmasq.h virdnsmasq: remove binaryPath argument from dnsmasqCapsNewFromBinary 2021-04-21 14:18:31 +02:00
virebtables.c util: replace VIR_FREE with g_free in all vir*Free() functions 2021-02-05 00:20:43 -05:00
virebtables.h
virendian.h
virenum.c
virenum.h
virerror.c Add basic driver for the Cloud-Hypervisor 2021-06-04 10:56:06 +01:00
virerror.h util: virerror: Remove VIR_ERROR_MAX_LENGTH macro 2021-03-05 15:01:29 +01:00
virerrorpriv.h
virevent.c util: event: check return value of virInitialize 2020-09-23 13:26:34 +02:00
virevent.h
vireventglib.c src: ensure GSource background unref happens in correct event loop 2021-03-17 09:16:05 +00:00
vireventglib.h
vireventglibwatch.c util: keep track of full GSource object not source ID number 2020-08-07 12:43:56 +01:00
vireventglibwatch.h util: keep track of full GSource object not source ID number 2020-08-07 12:43:56 +01:00
vireventthread.c util: do not unref event thread after joining it 2020-09-23 17:06:36 +02:00
vireventthread.h src: introduce an abstraction for running event loops 2020-03-11 14:44:04 +00:00
virfcp.c virBuildPath: Remove return value 2021-03-02 09:50:19 +01:00
virfcp.h
virfdstream.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virfdstream.h
virfile.c util: Add virFileReadValueUllongQuiet 2021-07-27 10:29:20 +02:00
virfile.h util: Add virFileReadValueUllongQuiet 2021-07-27 10:29:20 +02:00
virfilecache.c virFileCacheNew: virHashNew cannot return NULL 2021-07-23 11:31:09 +02:00
virfilecache.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virfirewall.c lib: Use $PROG instead of $PROG_PATH 2021-09-21 14:09:44 +02:00
virfirewall.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virfirewalld.c util: firewall: use g_new0 2020-10-06 12:31:34 +02:00
virfirewalld.h
virfirewalldpriv.h
virfirewallpriv.h
virfirmware.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virfirmware.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virgdbus.c virgdbus: fix getting non-shared DBus connection 2020-11-09 23:42:33 +01:00
virgdbus.h virgdbus: add DBus reply format check 2020-09-23 12:53:31 +02:00
virgettext.c lib: Prefer WITH_* prefix for #if conditionals 2020-09-02 10:28:10 +02:00
virgettext.h
virgic.c Remove virutil.h where possible 2020-02-24 23:15:49 +01:00
virgic.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virglibutil.c util: Add helpers for auto-freeing GSList filled with strings 2021-02-11 17:05:32 +01:00
virglibutil.h util: Add helpers for auto-freeing GSList filled with strings 2021-02-11 17:05:32 +01:00
virhash.c virHashAtomicNew: virHashNew cannot return NULL 2021-07-23 11:31:12 +02:00
virhash.h virHashNew: Ensure return value is used 2021-07-26 13:27:30 +02:00
virhashcode.c Prefer https: everywhere where possible 2020-09-01 21:58:46 +02:00
virhashcode.h Prefer https: everywhere where possible 2020-09-01 21:58:46 +02:00
virhook.c virBuildPath: Remove return value 2021-03-02 09:50:19 +01:00
virhook.h bhyve: add hooks 2020-02-24 17:25:07 +00:00
virhostcpu.c util: directly query KVM for TSC scaling support 2021-08-06 12:00:53 +01:00
virhostcpu.h util: Add virHostCPUGetHaltPollTime 2021-07-27 10:29:23 +02:00
virhostcpupriv.h hostcpu: Introduce virHostCPUGetSignature 2020-05-25 16:09:41 +02:00
virhostmem.c virhostmem: Introduce virHostMemGetTHPSize() 2021-10-01 10:58:27 +02:00
virhostmem.h virhostmem: Introduce virHostMemGetTHPSize() 2021-10-01 10:58:27 +02:00
virhostuptime.c virhostuptime: Fix rounding in uptime calculation 2021-02-02 15:00:55 +01:00
virhostuptime.h
viridentity.c util: virIdentitySetCurrent: only unref the old identity on success 2021-09-08 16:19:55 +02:00
viridentity.h src: add API to determine if current identity is a system identity 2021-05-13 11:07:40 +01:00
viridentitypriv.h util: generate a persistent system token 2021-05-13 11:07:16 +01:00
virinitctl.c
virinitctl.h
viriptables.c iptablesPrivateChainCreate: Remove superfluous gotos 2021-07-14 15:36:27 +02:00
viriptables.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
viriscsi.c util: alloc: Reimplement VIR_APPEND_ELEMENT using virAppendElement 2021-08-06 08:53:25 +02:00
viriscsi.h
virjson.c util: alloc: Reimplement VIR_APPEND_ELEMENT using virAppendElement 2021-08-06 08:53:25 +02:00
virjson.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virkeycode.c Split declarations from initializations 2020-08-25 19:03:11 +02:00
virkeycode.h Remove virutil.h from all header files 2020-02-24 23:15:50 +01:00
virkmod.c util: rename method to virKModIsProhibited 2020-06-26 15:39:33 +01:00
virkmod.h util: rename method to virKModIsProhibited 2020-06-26 15:39:33 +01:00
virlease.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virlease.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virlockspace.c virLockSpaceNewPostExecRestart: virHashNew cannot return NULL 2021-07-26 13:25:11 +02:00
virlockspace.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virlog.c util: alloc: Reimplement VIR_APPEND_ELEMENT using virAppendElement 2021-08-06 08:53:25 +02:00
virlog.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virmacaddr.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virmacaddr.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virmacmap.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virmacmap.h conf: add cleanup func for virMacMap 2021-09-09 18:06:13 +02:00
virmdev.c util: alloc: Reimplement VIR_APPEND_ELEMENT using virAppendElement 2021-08-06 08:53:25 +02:00
virmdev.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virmodule.c lib: Prefer WITH_* prefix for #if conditionals 2020-09-02 10:28:10 +02:00
virmodule.h
virnetdev.c virNetDevGetVirtualFunctions: Directly return virPCIVirtualFunctionList 2021-08-09 10:09:00 +02:00
virnetdev.h virNetDevGetVirtualFunctions: Directly return virPCIVirtualFunctionList 2021-08-09 10:09:00 +02:00
virnetdevbandwidth.c virnetdev: move virNetDevSetRootQDisc to virnetdevbandwidth 2021-04-21 14:19:34 +02:00
virnetdevbandwidth.h virnetdev: move virNetDevSetRootQDisc to virnetdevbandwidth 2021-04-21 14:19:34 +02:00
virnetdevbridge.c meson: Drop netinet workaround 2021-06-01 14:30:39 +02:00
virnetdevbridge.h
virnetdevip.c lib: Use $PROG instead of $PROG_PATH 2021-09-21 14:09:44 +02:00
virnetdevip.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virnetdevmacvlan.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virnetdevmacvlan.h netdevmacvlan: Use helper function to create unique macvlan/macvtap name 2020-12-15 13:35:33 -05:00
virnetdevmidonet.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virnetdevmidonet.h
virnetdevopenvswitch.c virnetdevopenvswitch: Fix qos cleaning residual on multi interfaces 2021-08-19 16:47:40 +02:00
virnetdevopenvswitch.h virnetdevopenvswitch: Introduce virNetDevOpenvswitchInterfaceClearTxQos and virNetDevOpenvswitchInterfaceClearRxQos 2021-08-19 16:47:38 +02:00
virnetdevtap.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virnetdevtap.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virnetdevveth.c util:veth: Create veth device pair by netlink 2020-12-16 14:43:18 -05:00
virnetdevveth.h
virnetdevvlan.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virnetdevvlan.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virnetdevvportprofile.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virnetdevvportprofile.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virnetlink.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virnetlink.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virnodesuspend.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virnodesuspend.h
virnuma.c conf, docs, schema: Add support for 'restrictive' mode in numatune 2021-04-19 11:39:13 +02:00
virnuma.h virnuma: Export virNumaGetMaxCPUs properly 2021-05-17 15:54:13 +02:00
virnvme.c util: alloc: Reimplement VIR_APPEND_ELEMENT using virAppendElement 2021-08-06 08:53:25 +02:00
virnvme.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virobject.c Remove static analysis assertions 2021-05-24 20:26:20 +02:00
virobject.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virpci.c virpci: Clarify lifetime of temporary object 2021-08-26 09:16:44 +02:00
virpci.h virPCIGetVirtualFunctions: Fetch also network interface name if needed 2021-08-09 10:09:00 +02:00
virperf.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virperf.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virpidfile.c util: virPidFileForceCleanupPath: add group argument 2021-08-05 11:18:09 +02:00
virpidfile.h util: virPidFileForceCleanupPath: add group argument 2021-08-05 11:18:09 +02:00
virpolkit.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virpolkit.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virportallocator.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virportallocator.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virprobe.h
virprocess.c util: alloc: Reimplement VIR_APPEND_ELEMENT using virAppendElement 2021-08-06 08:53:25 +02:00
virprocess.h util: virPidFileForceCleanupPath: add group argument 2021-08-05 11:18:09 +02:00
virqemu.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virqemu.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virrandom.c util: add virRandomToken API 2021-05-13 11:07:13 +01:00
virrandom.h util: add virRandomToken API 2021-05-13 11:07:13 +01:00
virresctrl.c util: alloc: Reimplement VIR_APPEND_ELEMENT using virAppendElement 2021-08-06 08:53:25 +02:00
virresctrl.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virresctrlpriv.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virrotatingfile.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virrotatingfile.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virscsi.c virscsi: Drop @tmp from virSCSIDeviceListDel 2021-08-26 09:16:44 +02:00
virscsi.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virscsihost.c util: quieten virSCSIHostGetUniqueId 2020-11-06 15:03:39 +01:00
virscsihost.h
virscsivhost.c util: alloc: Reimplement VIR_APPEND_ELEMENT using virAppendElement 2021-08-06 08:53:25 +02:00
virscsivhost.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virseclabel.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virseclabel.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virsecret.c secret: rework handling of private secrets 2021-05-13 11:07:47 +01:00
virsecret.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virsecureerase.c util: virsecureerase: Introduce virSecureEraseString 2021-02-03 13:07:13 +01:00
virsecureerase.h util: virsecureerase: Introduce virSecureEraseString 2021-02-03 13:07:13 +01:00
virsocket.c virsocket: Don't preserve errno in virSocketRecvFD() 2021-08-20 15:00:53 +02:00
virsocket.h
virsocketaddr.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virsocketaddr.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virstoragefile.c virStorageFileParseBackingStoreStr: use g_strsplit instead of virStringSplitCount 2021-04-12 15:55:09 +02:00
virstoragefile.h Remove virStorageFileCanonicalizePath 2021-04-12 15:55:09 +02:00
virstring.c util: virstring: Remove unused 'virStringListMerge' 2021-09-21 12:25:42 +02:00
virstring.h util: virstring: Remove unused 'virStringListMerge' 2021-09-21 12:25:42 +02:00
virsysinfo.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virsysinfo.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virsysinfopriv.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virsystemd.c virSystemdActivationNew: Remove superfluous gotos 2021-07-23 11:30:11 +02:00
virsystemd.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virsystemdpriv.h
virthread.c virthread: Make sure virOnce() returns -1 on error 2021-05-07 12:33:58 +02:00
virthread.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virthreadjob.c
virthreadjob.h
virthreadpool.c virThreadPoolNewFull: Prevent expanding worker pool by zero 2021-07-19 13:27:22 +02:00
virthreadpool.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virtime.c util: o-z: use g_new0 2020-10-06 12:31:34 +02:00
virtime.h
virtpm.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virtpm.h
virtypedparam-public.c Do not check return value of VIR_RESIZE_N 2021-03-22 12:44:18 +01:00
virtypedparam.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virtypedparam.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
viruri.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
viruri.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virusb.c util: alloc: Reimplement VIR_APPEND_ELEMENT using virAppendElement 2021-08-06 08:53:25 +02:00
virusb.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virutil.c util: alloc: Reimplement VIR_APPEND_ELEMENT using virAppendElement 2021-08-06 08:53:25 +02:00
virutil.h virIndexToDiskName: Make 'idx' unsigned and remove check 2021-03-05 15:33:34 +01:00
viruuid.c viruuid: Rework virUUIDIsValid() 2020-12-04 16:24:19 +01:00
viruuid.h viruuid: Rework virUUIDIsValid() 2020-12-04 16:24:19 +01:00
virvhba.c remove unnecessary cleanup labels and unused return variables 2020-11-02 22:01:36 -05:00
virvhba.h
virvsock.c lib: Prefer WITH_* prefix for #if conditionals 2020-09-02 10:28:10 +02:00
virvsock.h
virxdrdefs.h
virxml.c Use g_auto for xmlFreeDoc everywhere 2021-08-17 18:27:13 +02:00
virxml.h util: define cleanup func for xmlXPathObject 2021-08-12 15:47:36 +02:00