[libvirt-users] automatically reverting to a snapshot

Peter Krempa pkrempa at redhat.com
Wed Jul 26 16:27:45 UTC 2017


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20170726/144aa41b/attachment.sig>


More information about the libvirt-users mailing list