Bug 1760885
Summary: | virhostuptime doesn't work on void or slackware linux. | ||
---|---|---|---|
Product: | [Community] Virtualization Tools | Reporter: | Matthew Schumacher <matt.s> |
Component: | libvirt | Assignee: | Michal Privoznik <mprivozn> |
Status: | CLOSED NEXTRELEASE | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | unspecified | CC: | crobinso, libvirt-maint, mprivozn, tburke |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-5.10.0 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2019-11-14 14:23:43 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Matthew Schumacher
2019-10-11 15:35:13 UTC
CCing mprivozn. musl libc doesn't provide utmpx.h, so virHostGetBootTimeOnceInit returns a stub definition. Matthew, does disabling remember_owner in /etc/libvirt/qemu.conf and restarting libvirtd fix things? Cole, That does indeed fix things. Thanks! Matt It's discussed in github. However, what we can do is to provide an alternative implementation for cases where getutxid() returns ENODATA and we're running on Linux where /proc/uptime is available. Patch proposed here: https://www.redhat.com/archives/libvir-list/2019-October/msg00765.html I tried to compile with that patch to see if it worked on slackware, but it doesn't compile: CC util/libvirt_util_la-virgic.lo CC util/libvirt_util_la-virhash.lo CC util/libvirt_util_la-virhashcode.lo CC util/libvirt_util_la-virhook.lo CC util/libvirt_util_la-virhostcpu.lo CC util/libvirt_util_la-virhostdev.lo CC util/libvirt_util_la-virhostmem.lo CC util/libvirt_util_la-virhostuptime.lo util/virhostuptime.c: In function 'virHostGetBootTimeProcfs': util/virhostuptime.c:50:5: error: 'g_autofree' undeclared (first use in this function) g_autofree char *buf = NULL; ^ util/virhostuptime.c:50:5: note: each undeclared identifier is reported only once for each function it appears in util/virhostuptime.c:50:16: error: expected ';' before 'char' g_autofree char *buf = NULL; ^ util/virhostuptime.c:57:44: error: 'buf' undeclared (first use in this function) if (virFileReadAll(UPTIME_FILE, 1024, &buf) < 0) ^ Makefile:11686: recipe for target 'util/libvirt_util_la-virhostuptime.lo' failed make[3]: *** [util/libvirt_util_la-virhostuptime.lo] Error 1 make[3]: Leaving directory '/tmp/SBo/libvirt-5.8.0/src' Makefile:7537: recipe for target 'all' failed make[2]: *** [all] Error 2 make[2]: Leaving directory '/tmp/SBo/libvirt-5.8.0/src' Makefile:2263: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/tmp/SBo/libvirt-5.8.0' Makefile:2156: recipe for target 'all' failed make: *** [all] Error 2 Once it compiles, I'll do some testing. Thanks! (In reply to Matthew Schumacher from comment #5) > When sending a patch one has to make sure they are rebased onto the master. Please update your repo and retry. Alternatively, if you want to backport the patch you can s/g_autofree/VIR_AUTOFREE/ and put 'char *' into braces. I downloaded master, applied the patch, and tested on my Slackware system. I still get: error : virProcessRunInFork:1170 : internal error: child reported (status=125): Unable to get host boot time: No such process It might make sense to have the code try /proc/uptime on any error, not just null (I think I read the patch right)... Please note: Slackware doesn't use systemd, it's BSD init. (In reply to Matthew Schumacher from comment #7) > I downloaded master, applied the patch, and tested on my Slackware system. > I still get: > > error : virProcessRunInFork:1170 : internal error: child reported > (status=125): Unable to get host boot time: No such process > > It might make sense to have the code try /proc/uptime on any error, not just > null (I think I read the patch right)... And if you do that change, does it help? The condition in virHostGetBootTimeOnceInit() then looks like this: if (bootTimeErrno != 0 || bootTime == 0) bootTimeErrno = -virHostGetBootTimeProcfs(&bootTime); That works fine, so I think that's a good solution. Thanks for the patch! I've just pushed the patch upstream: 070d6969fe virhostuptime: Add linux stub for musl v5.9.0-190-g070d6969fe |