- 23 9月, 2014 2 次提交
-
-
由 Michal Privoznik 提交于
It's better to use a macro instead of if-else construct. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Jincheng Miao 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1145050Signed-off-by: NJincheng Miao <jmiao@redhat.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 11 9月, 2014 1 次提交
-
-
由 John Ferlan 提交于
If the virNumaGetNodeCPUs() call fails with -1, then jumping to cleanup with 'cpus == NULL' and calling virCapabilitiesClearHostNUMACellCPUTopology will cause issues. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 20 8月, 2014 1 次提交
-
-
由 Michal Privoznik 提交于
In case the host has 2 or more NUMA nodes, we fetch CPU map for each node. However, we need to free the CPU map in between loops: ==29513== 96 (72 direct, 24 indirect) bytes in 3 blocks are definitely lost in loss record 951 of 1,264 ==29513== at 0x4C2A700: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==29513== by 0x52AD24B: virAlloc (viralloc.c:144) ==29513== by 0x52AF0E6: virBitmapNew (virbitmap.c:78) ==29513== by 0x52FB720: virNumaGetNodeCPUs (virnuma.c:294) ==29513== by 0x53C700B: nodeCapsInitNUMA (nodeinfo.c:1886) ==29513== by 0x11759708: vboxCapsInit (vbox_common.c:398) ==29513== by 0x11759CC4: vboxConnectOpen (vbox_common.c:514) ==29513== by 0x53C965F: do_open (libvirt.c:1147) ==29513== by 0x53C9EBC: virConnectOpen (libvirt.c:1317) ==29513== by 0x142905: remoteDispatchConnectOpen (remote.c:1215) ==29513== by 0x126ADF: remoteDispatchConnectOpenHelper (remote_dispatch.h:2346) ==29513== by 0x5453D21: virNetServerProgramDispatchCall (virnetserverprogram.c:437) Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 24 6月, 2014 1 次提交
-
-
由 Michal Privoznik 提交于
On the Linux kernel, if huge pages are allocated the size they cut off from memory is accounted under the 'MemUsed' in the meminfo file. However, we want the sum to be subtracted from 'MemTotal'. This patch implements this feature. After this change, we can enable reporting of the ordinary system pages in the capability XML: <capabilities> <host> <uuid>01281cda-f352-cb11-a9db-e905fe22010c</uuid> <cpu> <arch>x86_64</arch> <model>Haswell</model> <vendor>Intel</vendor> <topology sockets='1' cores='1' threads='1'/> <feature/> <pages unit='KiB' size='4'/> <pages unit='KiB' size='2048'/> <pages unit='KiB' size='1048576'/> </cpu> <power_management/> <migration_features/> <topology> <cells num='4'> <cell id='0'> <memory unit='KiB'>4048248</memory> <pages unit='KiB' size='4'>748382</pages> <pages unit='KiB' size='2048'>3</pages> <pages unit='KiB' size='1048576'>1</pages> <distances/> <cpus num='1'> <cpu id='0' socket_id='0' core_id='0' siblings='0'/> </cpus> </cell> ... </cells> </topology> </host> </capabilities> You can see the beautiful thing about this: if you sum up all the <pages/> you'll get <memory/>. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 20 6月, 2014 3 次提交
-
-
由 Michal Privoznik 提交于
The virNodeParseSocket() function tries to get socked ID from 'topology/physical_package_id' file. However, on some architectures the file contains the -1 constant which makes in turn libvirt think the info extraction was unsuccessful. If that's the case, we need to overwrite the obtained integer with zero like we are doing for other architectures. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
As in previous commit, there are again some places where we can do runtime decision instead of compile time. This time it's whether the 'topology/physical_package_id' is allowed to have '-1' within or not. Then, core ID is pared differently on s390(x) than on the rest of architectures. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
So far, we are doing compile time decisions on which architecture is used. However, for testing purposes it's much easier if we pass host architecture as parameter and then let the function decide which code snippet for extracting host CPU info will be used. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 19 6月, 2014 3 次提交
-
-
由 Michal Privoznik 提交于
And add stubs to other drivers like: lxc, qemu, uml and vbox. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
There are two places where you'll find info on page sizes. The first one is under <cpu/> element, where all supported pages sizes are listed. Then the second one is under each <cell/> element which refers to concrete NUMA node. At this place, the size of page's pool is reported. So the capabilities XML looks something like this: <capabilities> <host> <uuid>01281cda-f352-cb11-a9db-e905fe22010c</uuid> <cpu> <arch>x86_64</arch> <model>Westmere</model> <vendor>Intel</vendor> <topology sockets='1' cores='1' threads='1'/> ... <pages unit='KiB' size='4'/> <pages unit='KiB' size='2048'/> <pages unit='KiB' size='1048576'/> </cpu> ... <topology> <cells num='4'> <cell id='0'> <memory unit='KiB'>4054408</memory> <pages unit='KiB' size='4'>1013602</pages> <pages unit='KiB' size='2048'>3</pages> <pages unit='KiB' size='1048576'>1</pages> <distances/> <cpus num='1'> <cpu id='0' socket_id='0' core_id='0' siblings='0'/> </cpus> </cell> <cell id='1'> <memory unit='KiB'>4071072</memory> <pages unit='KiB' size='4'>1017768</pages> <pages unit='KiB' size='2048'>3</pages> <pages unit='KiB' size='1048576'>1</pages> <distances/> <cpus num='1'> <cpu id='1' socket_id='0' core_id='0' siblings='1'/> </cpus> </cell> ... </cells> </topology> ... </host> <guest/> </capabilities> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
For future work we want to get info for not only the free memory but overall memory size too. That's why the function must have new signature too. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 11 6月, 2014 1 次提交
-
-
由 Eric Blake 提交于
Commit 8ba0a58f introduced a compiler warning that I hit during a run of ./autobuild.sh: ../../src/nodeinfo.c: In function 'nodeCapsInitNUMA': ../../src/nodeinfo.c:1853:43: error: 'nsiblings' may be used uninitialized in this function [-Werror=maybe-uninitialized] if (virCapabilitiesAddHostNUMACell(caps, n, memory, ^ Sure enough, nsiblings starts uninitialized, and is set by a call to virNodeCapsGetSiblingInfo, but that function fails to assign through the pointer if virNumaGetDistances fails. * src/nodeinfo.c (nodeCapsInitNUMA): Initialize nsiblings. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 04 6月, 2014 1 次提交
-
-
由 Michal Privoznik 提交于
If user or management application wants to create a guest, it may be useful to know the cost of internode latencies before the guest resources are pinned. For example: <capabilities> <host> ... <topology> <cells num='2'> <cell id='0'> <memory unit='KiB'>4004132</memory> <distances> <sibling id='0' value='10'/> <sibling id='1' value='20'/> </distances> <cpus num='2'> <cpu id='0' socket_id='0' core_id='0' siblings='0'/> <cpu id='2' socket_id='0' core_id='2' siblings='2'/> </cpus> </cell> <cell id='1'> <memory unit='KiB'>4030064</memory> <distances> <sibling id='0' value='20'/> <sibling id='1' value='10'/> </distances> <cpus num='2'> <cpu id='1' socket_id='0' core_id='0' siblings='1'/> <cpu id='3' socket_id='0' core_id='2' siblings='3'/> </cpus> </cell> </cells> </topology> ... </host> ... </capabilities> We can see the distance from node1 to node0 is 20 and within nodes 10. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 29 4月, 2014 1 次提交
-
-
由 Natanael Copa 提交于
This makes sure that errno is reset before readdir is called, even if the loop does a 'continue'. This fixes issue with musl libc which sets errno on sscanf. The following 'continue' makes the errno be set before calling readdir. Signed-off-by: NNatanael Copa <ncopa@alpinelinux.org> Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 25 3月, 2014 1 次提交
-
-
由 Ján Tomko 提交于
-
- 20 3月, 2014 1 次提交
-
-
由 Wojciech Macek 提交于
New functionalities: - connectGetMaxVcpus - on bhyve hardcode this value to 16 - nodeGetFreeMemory - do not use physmem_get on FreeBSD, since it might get wrong value on systems with more than 100GB of RAM - nodeGetCPUMap - wrapper only for mapping function, currently not supported by FreeBSD - nodeSet/GetMemoryParameters - wrapper only for future improvements, currently not supported by FreeBSD
-
- 18 3月, 2014 1 次提交
-
-
由 Daniel P. Berrange 提交于
Any source file which calls the logging APIs now needs to have a VIR_LOG_INIT("source.name") declaration at the start of the file. This provides a static variable of the virLogSource type. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 06 2月, 2014 1 次提交
-
-
由 Roman Bogorodskiy 提交于
Implementation obtains CPU usage information using kern.cp_time and kern.cp_times sysctl(8)s and reports CPU utilization.
-
- 01 2月, 2014 1 次提交
-
-
由 John Ferlan 提交于
Coverity complains about default: label in libxl_driver.c not be able to be reached. It's by design for the code and since it's not necessary in the code nor does it elicit any compiler/make check warnings - just remove it rather than adding a coverity[dead_error_begin] tag. While I'm at it, lxc_driver.c and nodeinfo.c have the same design, so I removed the default labels and the existing coverity tags.
-
- 28 1月, 2014 2 次提交
- 27 1月, 2014 2 次提交
- 23 1月, 2014 1 次提交
-
-
由 Bing Bu Cao 提交于
94f82053 added a space to the string but didn't change the buffer size. Signed-off-by: NBing Bu Cao <mars@linux.vnet.ibm.com> Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
- 22 1月, 2014 1 次提交
-
-
由 Bing Bu Cao 提交于
To retrieve node cpu statistics on Linux system, the linuxNodeGetCPUstats function simply uses STRPREFIX() to match the cpuid with the one read from /proc/stat. However, as the file is read line by line it may happen, that some CPUs share the same prefix. So if user requested stats for the first CPU, which is offline, then there's no cpu1 in the stats file so the one that we match is cpu10. Which is obviously wrong. Fortunately, the IDs are terminated by a space, so we can utilize that. Signed-off-by: NBing Bu Cao <mars@linux.vnet.ibm.com>
-
- 07 1月, 2014 1 次提交
-
-
由 Roman Bogorodskiy 提交于
Add a BSD implementation of nodeGetMemoryStats based on sysctl(3).
-
- 07 11月, 2013 1 次提交
-
-
由 Eric Blake 提交于
Commit b0f85462 broke the build on mingw, by exposing code that had Linux-specific dependencies but which was previously protected by libnuma ifdef guards: make[3]: Entering directory `/home/eblake/libvirt-tmp/build/src' CC libvirt_driver_la-nodeinfo.lo ../../src/nodeinfo.c: In function 'virNodeGetSiblingsList': ../../src/nodeinfo.c:1543:30: error: 'SYSFS_THREAD_SIBLINGS_LIST_LENGTH_MAX' undeclared (first use in this function) if (virFileReadAll(path, SYSFS_THREAD_SIBLINGS_LIST_LENGTH_MAX, &buf) < 0) ^ ../../src/nodeinfo.c:1543:30: note: each undeclared identifier is reported only once for each function it appears in ../../src/nodeinfo.c: In function 'virNodeCapsFillCPUInfo': ../../src/nodeinfo.c:1562:5: error: implicit declaration of function 'virNodeGetCpuValue' [-Werror=implicit-function-declaration] if ((tmp = virNodeGetCpuValue(SYSFS_CPU_PATH, cpu_id, ^ ../../src/nodeinfo.c:1562:5: error: nested extern declaration of 'virNodeGetCpuValue' [-Werror=nested-externs] ../../src/nodeinfo.c:1562:35: error: 'SYSFS_CPU_PATH' undeclared (first use in this function) if ((tmp = virNodeGetCpuValue(SYSFS_CPU_PATH, cpu_id, ^ cc1: all warnings being treated as errors * src/nodeinfo.c (virNodeCapsFillCPUInfo): Make conditional. (virNodeGetSiblingsList): Move into #ifdef linux block. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 04 11月, 2013 8 次提交
-
-
由 Peter Krempa 提交于
Now that all libnuma functions used by libvirt are wrapped in virNuma we can remove the dependancy from nodeinfo.
-
由 Peter Krempa 提交于
-
由 Peter Krempa 提交于
-
由 Peter Krempa 提交于
The function was called in a single place only and was reporting errors that were later ignored. Use the virNumaGetNodeMemory helper to get the size of the memory in the NUMA node and remove the helper
-
由 Peter Krempa 提交于
-
由 Peter Krempa 提交于
Avoid necessary checks for the numa library with this helper.
-
由 Peter Krempa 提交于
linuxNodeGetCPUStats() and linuxNodeGetMemoryStats() are static and don't need a forward declaration.
-
由 Peter Krempa 提交于
All functions from libnuma must be protected with ifdefs. Avoid this by using our own wrapper.
-
- 22 10月, 2013 1 次提交
-
-
由 Ryota Ozaki 提交于
HW_PHYSMEM is available on Mac OS X as well as FreeBSD, however, its resulting value for Mac OS X is 32 bits. Mac OS X provides HW_MEMSIZE that is 64 bits version of HW_PHYSMEM. We have to use it. I tested the patch on Mac OS X 10.6.8, 10.7.4, 10.8.5 and FreeBSD 9.2. Signed-off-by: NRyota Ozaki <ozaki.ryota@gmail.com>
-
- 16 10月, 2013 1 次提交
-
-
由 Pranavkumar Sawargaonkar 提交于
CPU "parser" for AArch64. Showing cputopology in arm64 linux is work-in-progress so for now all AArch64 cpus belong to same socket (like PPC). Also we parse BogoMIPS same like arm 32bit. Signed-off-by: NAnup Patel <anup.patel@linaro.org> Signed-off-by: NPranavkumar Sawargaonkar <pranavkumar@linaro.org>
-
- 09 10月, 2013 1 次提交
-
-
由 Giuseppe Scrivano 提交于
Commit 2d74822a renamed "freebsdNodeGetCPUCount" to "appleFreebsdNodeGetCPUCount", leaving one call to "freebsdNodeGetCPUCount". Fix this other case. Signed-off-by: NGiuseppe Scrivano <gscrivan@redhat.com> Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 07 10月, 2013 1 次提交
-
-
由 Ryota Ozaki 提交于
This fixes the following error: error : nodeGetInfo:933 : this function is not supported by the connection driver: node info not implemented on this platform The freebsdNodeGetCPUCount was renamed to appleFreebsdNodeGetCPUCount in order to make more visible the fact, that it works on Mac OS X too. Mac OS X can use sysctlbyname as same as FreeBSD to get the CPU frequency. However, the MIB style name is different from FreeBSD's. And the unit of the return frequency is also different. Signed-off-by: NRyota Ozaki <ozaki.ryota@gmail.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 22 8月, 2013 1 次提交
-
-
由 Peter Krempa 提交于
Re-arrange the code so that the returned bitmap is always initialized to NULL even on early failures and return an error message as some callers are already expecting it. Fix up the rest not to shadow the error.
-