Bug 508662 - RFE: qemu: support qemu snapshot=on with <transient/> disk XML
Summary: RFE: qemu: support qemu snapshot=on with <transient/> disk XML
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
: 832194 (view as bug list)
Depends On:
Blocks: libvirtTodoHV 1040068
TreeView+ depends on / blocked
 
Reported: 2009-06-29 11:47 UTC by Jan ONDREJ
Modified: 2020-11-03 15:01 UTC (History)
14 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-11-03 15:01:34 UTC
Embargoed:


Attachments (Terms of Use)

Description Jan ONDREJ 2009-06-29 11:47:05 UTC
Description of problem:
Please add ability to set snapshot mode for virtual harddisks. There is an excellent parameter of qemu, which can run virtual machine in mode, where all changes are stored in separate file and original image is not touched.

This parameter can be well used by developers or testers, which need to test any software without reinstallation of his machine. User can install anything and then simply poweroff this virtual machine, after next boot everything will be back in original state.

This can be done in qemu 2 ways:
  1. add -snapshot parameter, which set snapshot mode for all harddisks (not best way)
  2. add ",snapshot=on" for "-drive" parameter. By this way each partition can be set separately.

Comment 1 Jan ONDREJ 2009-06-30 06:39:24 UTC
There are other options, which can be useful too, for example these:

           "snapshot=snapshot"
               snapshot is "on" or "off" and allows to enable snapshot for
               given drive (see -snapshot).

           "cache=cache"
               cache is "none", "writeback", or "writethrough" and controls
               how the host cache is used to access block data.

           "boot=boot"
               boot if "on" enables extboot for a given drive so it can be
               used as a boot drive.

Comment 2 Mark McLoughlin 2009-07-03 14:23:18 UTC
Moving this to libvirt's upstream bug tracker - it's a common request, but there are no immediate plans to implement it

(Not, cache= and boot= are already available through libvirt)

Comment 3 Eric Blake 2012-04-18 16:03:50 UTC
The XML is in place as of 0.9.5 (the <transient/> attribute of a <disk> in domain xml), but has not yet been wired up to qemu.

Comment 4 Cole Robinson 2016-03-21 22:59:53 UTC
*** Bug 832194 has been marked as a duplicate of this bug. ***

Comment 5 ildar.mulyukov 2020-01-24 04:46:03 UTC
the way #1 worked well until recently. The config part for it:
> <qemu:commandline>
>    <qemu:arg value='-snapshot'/>
> </qemu:commandline>

But last upgrade of libvirt&qemu brought `-snapshot` option ignored by qemu. Hence would someone please
re-triage?

Comment 6 ildar.mulyukov 2020-01-24 08:17:50 UTC
qemu bug reported: https://bugs.launchpad.net/qemu/+bug/1860759

Comment 7 Eric Blake 2020-01-24 16:04:41 UTC
(In reply to ildar.mulyukov from comment #6)
> qemu bug reported: https://bugs.launchpad.net/qemu/+bug/1860759

Per the qemu team, it is intentional (albeit poorly documented) that -snapshot only works with -drive, not -snapshot. Libvirt should be implementing support for the <transient/> tag per <disk> element; absent that, you may still be able to get your command-line passthrough hack of passing -snapshot by telling libvirt to use -drive instead of -blockdev.  I'm not sure of the trick, but know that Peter made the choice between old or new configurable in case we encountered problems with -blockdev; this would be one such case to use the trick.

Comment 8 ildar.mulyukov 2020-01-31 07:04:56 UTC
Eric, thanks for the hint. Excuse me, but Peter - who?

How can we know more about the trick
as we (users) are screwed in the situation when `<transient/>` isn't yet implemented and the old trick with `<qemu:arg/>` have no effect anymore?

Thanks in advance!

Comment 9 Ján Tomko 2020-01-31 23:50:57 UTC
See:
https://libvirt.org/drvqemu.html#xmlnsfeatures

<qemu:del capability='blockdev'/>

should do the trick

Comment 10 ildar.mulyukov 2020-02-03 07:07:19 UTC
Perfectly right, thanks a lot, Ján!

Comment 11 Eric Blake 2020-02-03 14:59:27 UTC
(In reply to ildar.mulyukov from comment #8)
> Eric, thanks for the hint. Excuse me, but Peter - who?

Sorry, Peter Krempa. But I see Jan answered in the meantime.

Comment 12 Daniel Berrangé 2020-11-03 15:01:34 UTC
Support for <transient/> in QEMU was introduced in release 6.9.0 per https://www.redhat.com/archives/libvir-list/2020-October/msg00006.html


Note You need to log in before you can comment on or make changes to this bug.