mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-21 10:50:24 +03:00
We were wasting time to malloc a copy of a constant string, then copy it into static storage, for every call to nodeGetInfo. At least we were lucky that it was a constant source, and thus not subject to even worse issues with one thread clobbering the static storage while another was using it. This gets rid of the waste, by passing the string through the stack instead, as well as renaming internal functions to better match our conventions. * src/nodeinfo.c (sysfs_path): Delete. (get_cpu_value, count_thread_siblings, parse_socket): Add parameter, and rename... (virNodeGetCpuValue, virNodeCountThreadSiblings) (virNodeParseSocket): ... into a common namespace. (cpu_online, parse_core): Inline into callers. (linuxNodeInfoCPUPopulate): Update caller. (nodeGetInfo): Drop a useless malloc.
LibVirt : simple API for virtualization Libvirt is a C toolkit to interact with the virtualization capabilities of recent versions of Linux (and other OSes). It is free software available under the GNU Lesser General Public License. Virtualization of the Linux Operating System means the ability to run multiple instances of Operating Systems concurrently on a single hardware system where the basic resources are driven by a Linux instance. The library aim at providing long term stable C API initially for the Xen paravirtualization but should be able to integrate other virtualization mechanisms if needed. Daniel Veillard <veillard@redhat.com>
Description
Languages
C
95.1%
Python
2%
Meson
0.9%
Shell
0.6%
Perl
0.5%
Other
0.8%