Please configure your mail client to send plain-text version to mailing lists ... On Tue, Jul 25, 2017 at 16:08:58 +0100, Dirty Dan wrote: > <div dir='auto'>How can I automatically revert to a snapshot after the guest is stopped?<div dir="auto"><br></div><div dir="auto">/etc/libvirt/hooks/qemu </div><div dir="auto">#!/bin/sh </div><div dir="auto">name="<span class="money">$1</span>" </div><div dir="auto">action="<span class="money">$2</span>" </div><div dir="auto">if [ "$name" = "name" ]; then </div><div dir="auto"> virsh snapshot-revert "$name" --snapshotname "snapshot1" </div><div dir="auto">fi</div><div dir="auto"><br></div><div dir="auto">I tried this which resulted in a deadlock, then I saw the warning further down the page.</div></div> The hook documentation explicitly states that no calls to libvirt shoudl be executed from the hook. You can start a process in background, which will terminate the hook and that process should be able to do libvirt calls.
Attachment:
signature.asc
Description: Digital signature
_______________________________________________ libvirt-users mailing list libvirt-users@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvirt-users