Hide Forgot
+++ This bug was initially created as a clone of Bug #1369850 +++ The idea is simple: request the OS uptime via qemu-guest agent. Some patches were submitted to upstream QEMU back in 2015, but never merged (nor reviewed, apparently): https://lists.nongnu.org/archive/html/qemu-devel/2015-03/msg06125.html
IMHO this should really be out of scope for QEMU guest agent / libvirt. The guest agent scope is really aimed at providing functions necessary for managing the operation of virtual machine. This is things like CPU hotplug, disk quiesce for snapshotting, and similar things. Reporting guest OS uptime is getting into the area of managing the guest operating system. That area is absolutely enormous in scope and there are countless existing tools that fill that can role. As such IMHO it doesn't make sense to add uptime reporting into QEMU guest agent, nor libvirt.
I agree with Comment 1. This is really getting into OS management scope.