Description of problem: Libvirt 5.7.0+ with the introduction of virhostuptime no longer works on void linux or slackware linux. Here is a good report of how it breaks on the void bug report: https://github.com/void-linux/void-packages/issues/14721 Here is the patch that causes the issue: https://www.mail-archive.com/libvir-list@redhat.com/msg187630.html Here is what it does on slackware: 2019-10-11 03:44:05.591+0000: 1286: error : virProcessRunInFork:1170 : internal error: child reported (status=125): Unable to get host boot time: No such process How reproducible: Always. Steps to Reproduce: 1. Install 5.7.0 or 5.8.0 on slackware 2. virsh start <domain> Actual results: 2019-10-11 03:44:05.591+0000: 1286: error : virProcessRunInFork:1170 : internal error: child reported (status=125): Unable to get host boot time: No such process Expected results: Start domain. Additional info: I suspect there is something missing with void and slackware, and if I knew what I can add/fix on my os, I would do that, within reason.... Can I configure without utmpx? What are the issues with doing that?
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