Report swapinfo - #140
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #140 +/- ##
=======================================
Coverage 71.24% 71.24%
=======================================
Files 6 6
Lines 991 991
=======================================
Hits 706 706
Misses 285 285 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| sprintf(used_mem_buf, "%lld", used_mem); | ||
| sprintf(used_swap_buf, "%lld", used_swap); |
| syslog(LOG_DAEMON | LOG_ERR, "error writing meminfo to xenstore ?"); | ||
| exit(1); | ||
| } | ||
| if (!xs_write(xs, XBT_NULL, "memory/swapinfo", swap, strlen(swap))) { |
There was a problem hiding this comment.
Note to self: this can be merged only after core-admin part, which sets necessary xenstore access.
| char *swap; | ||
| } UsedMem; | ||
|
|
||
| UsedMem parse(const char *meminfo_buf, const char* dom_current_buf) |
There was a problem hiding this comment.
FWIW the usual method in C for returning more results is to either return a pointer to a structure (usually dynamically allocated via malloc), or add output parameters (pointers to where function should write result). In case of a simple structure like this, compiler will do the latter for you here, so it can stay this way, but keep in mind it wont be efficient code in more complex cases.
| return (UsedMem){ .mem = used_mem_buf, .swap = used_swap_buf }; | ||
| } | ||
| return NULL; | ||
| return (UsedMem){ .mem = NULL, .swap = NULL }; |
There was a problem hiding this comment.
Report swap change if above threshold despite memory being below its threshold.
| if (meminfo_data) | ||
| send_to_qmemman(xs, meminfo_data); | ||
| UsedMem meminfo_data = parse(meminfo_buf, dom_current_buf); | ||
| if (meminfo_data.mem && meminfo_data.mem[0]) |
There was a problem hiding this comment.
Allows distinguishing how much memory the qube is using from what is assigned by using "meminfo - swapinfo". For: QubesOS/qubes-core-admin#827
Although both values can be lied by the qube, we can distinguish the "memory types" being used in client tools. For: QubesOS/qubes-linux-utils#140
Although both values can be lied by the qube, we can distinguish the "memory types" being used in client tools. For: QubesOS/qubes-linux-utils#140
Although both values can be lied by the qube, we can distinguish the "memory types" being used in client tools. For: QubesOS/qubes-linux-utils#140
Although both values can be lied by the qube, we can distinguish the "memory types" in client tools. For: QubesOS/qubes-linux-utils#140
Although both values can be lied by the qube, we can distinguish the "memory types" in client tools. For: QubesOS/qubes-linux-utils#140
Although both values can be lied by the qube, we can distinguish the "memory types" in client tools. For: QubesOS/qubes-linux-utils#140
Although both values can be lied by the qube, we can distinguish the "memory types" in client tools. For: QubesOS/qubes-linux-utils#140
Although both values can be lied by the qube, we can distinguish the "memory types" in client tools. For: QubesOS/qubes-linux-utils#140
Although both values can be lied by the qube, we can distinguish the "memory types" in client tools. For: QubesOS/qubes-linux-utils#140
Although both values can be lied by the qube, we can distinguish the "memory types" in client tools. For: QubesOS/qubes-linux-utils#140
Although both values can be lied by the qube, we can distinguish the "memory types" in client tools. For: QubesOS/qubes-linux-utils#140
Although both values can be lied by the qube, we can distinguish the "memory types" in client tools. For: QubesOS/qubes-linux-utils#140
Although both values can be lied by the qube, we can distinguish the "memory types" in client tools. For: QubesOS/qubes-linux-utils#140
Although both values can be lied by the qube, we can distinguish the "memory types" in client tools. For: QubesOS/qubes-linux-utils#140
Although both values can be lied by the qube, we can distinguish the "memory types" in client tools. For: QubesOS/qubes-linux-utils#140
Although both values can be lied by the qube, we can distinguish the "memory types" in client tools. For: QubesOS/qubes-linux-utils#140
Although both values can be lied by the qube, we can distinguish the "memory types" in client tools. For: QubesOS/qubes-linux-utils#140
Although both values can be lied by the qube, we can distinguish the "memory types" in client tools. For: QubesOS/qubes-linux-utils#140
Although both values can be lied by the qube, we can distinguish the "memory types" in client tools. For: QubesOS/qubes-linux-utils#140
Although both values can be lied by the qube, we can distinguish the "memory types" in client tools. For: QubesOS/qubes-linux-utils#140
Although both values can be lied by the qube, we can distinguish the "memory types" in client tools. For: QubesOS/qubes-linux-utils#140
* origin/pr/827: Avoid reads to xenstore keys that are not written Deprecate cpu_usage_raw from Stats event Report more CPU information to QubesHost Report maxmem and fix get_mem variants Hotplug memory for real Skip stubdom_xid query if qube is not HVM Do not require Xen to get VM stats Report amount of swap used Broadcast memory correctly Report vcpu in stats API Pull request description: - online vcpus - time of each vcpu - share all vm_info captured with clients (I presume there is no intent to capture private information internally and not broadcast to clients, as the only place where `get_vm_stats()` is called is from `admin.vm.Stats`. --- Requires: - QubesOS/qubes-linux-utils#140
OpenQA test summaryComplete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2026080820-devel&flavor=pull-requests Test run included the following:
New failures, excluding unstableCompared to: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2026050504-devel&flavor=update
Failed tests8 failures
Fixed failuresCompared to: https://openqa.qubes-os.org/tests/176874#dependencies 32 fixed
Unstable testsDetails
Performance TestsPerformance degradation:18 performance degradations
Remaining performance tests:93 tests
|
| data->mem = ret_mem; | ||
| data->swap = ret_swap; |
There was a problem hiding this comment.
Those two may be uninitialized at this point. Maybe simply set to NULL at the start?
Allows distinguishing how much memory the qube is using from what is assigned by using "meminfo - swapinfo".
For: QubesOS/qubes-core-admin#827
Tested briefly.