[libvirt-users] How to trigger a script in a guest after resume? (aka guest system clock incorrect after host reboot with suspended guest)

Eric Blake eblake at redhat.com
Wed Jul 24 21:16:05 UTC 2013


On 07/24/2013 08:07 AM, Nils Toedtmann wrote:
> Hi
> 
> Is there a way i can trigger a script within a libvirt guest immediately
> after resume? E.g. i don't see any log message that indicates to a guest
> that it had been paused and was just woken up.

Upstream qemu has added the guest-set-time command to qemu-ga as of qemu
1.5; if you have the qemu-ga daemon running in your guest (available at
least for Linux and Windows guests), then triggering this guest-agent
command would do what you want.

It might be nice to expose an API in libvirt for poking the guest-agent
command on demand, and/or adding some XML configuration to a guest that
requests that libvirt will automatically send the guest-agent command
every time the guest is resumed.  But for now, you're stuck using the
unsupported 'virsh qemu-agent-command' option for triggering the command
manually.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20130724/5751f186/attachment.sig>


More information about the libvirt-users mailing list