Greetings Digimer,
 
regarding the latter, I'd assume that saying vm running you mean that the os is up and running too.
I have similar need, I was able to get something as such to work using virsh console when the guest was a linux with serial console support enabled.
I wasn't able to get this to work in a script as I was never able to terminate the console seesion as virsh console wasn't able to send the termination combination properly.
I'm using expect for automation.
 
hope this helps somhow.
 
Dagg.
Sent: Thursday, October 01, 2020 at 4:42 AM
From: "Digimer" <lists@alteeve.ca>
To: libvirt-users@redhat.com
Subject: Determining when a guest booted / how long it's been running

Hi all,

  Is there a way to tell when a tool made a change to guest (ie: used virt-manager to make a change)? Following, is there a way to check to see if there are changes queued to take effect when the guest next reboots?

  If either of the above are not possible, is there a way to see when a guest last booted or how long a guest has been running?

Thanks!