It would be great to have a <transient> tag in libvirt's xml format so that we could specify that a disk isn't modified. That is to say, we could boot into a snapshot of a VM, use it for the duration of a session, and then discard it when done. This would be great for untrusted VMs, as well as demos.
Actually, we already _do_ have a <transient> tag supported in the XML, since 0.9.5, it's just that it never got wired up to being supported in qemu.
Revisiting this issue - still something we want, but it may first be useful to have the notion of a storage pool associated with a domain, where libvirt allocates from that storage pool instead of from /tmp when creating wrapper files (since /tmp may be small, especially on tmp-on-tmpfs systems)
maybe do that:
1. <transient pool=xxxx>
2. Fail if pool type is not a directory
3. Fail if multiple disks defined with <transient> that points to different pools
4. pass TMP environment variable for qemu to a directory where that pool points to?
Also, I can try to make patch to QEMU project in order to allow specify directory as:
qemu-system-xxx ... -drive snapshot=on,snapshot_dir=...
does not work now with error:
internal error: process exited while connecting to monitor: qemu-system-x86_64: -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1: Device needs media, but drive is empty
qemu-system-x86_64: -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1: Device initialization failed.
qemu-system-x86_64: -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1: Device 'ide-hd' could not be initialized
So, after my patch for QEMU, it seems, that <transient> will not work anyway.
Forgot to add, if my patch will go to upstream in QEMU, constraints 3 and 4 should be removed
marking as duplicate of an older bug for this feature
*** This bug has been marked as a duplicate of bug 508662 ***