[pve-devel] [PATCH qemu-server 20/22] blockdev: add helpers to generate blockdev commandline
Fiona Ebner
f.ebner at proxmox.com
Tue Jun 17 12:02:11 CEST 2025
Am 16.06.25 um 13:07 schrieb DERUMIER, Alexandre via pve-devel:
>>> The 'snapshot' option, for QEMU's snapshot mode, i.e. writes are only
>>> temporary, is not yet supported.
>
> from qemu manpage:
>
> "
> -snapshot
> Write to temporary files instead of disk image files. In
> this case, the raw disk image you use is not written back. You can
> however force the write back by pressing C-a s (see the Disk Images
> chapter in the System Emulation Users Guide).
>
> WARNING:
> snapshot is incompatible with -blockdev (instead use
> qemu-img to manually create snapshot images to attach to your
> blockdev). If you have mixed -blockdev and -drive declarations you can
> use the 'snapshot' property on your drive declarations instead of this
> global
> option.
> "
>
> So, if we want to keep this option. (I never used it to be honest),
I've briefly talked with Fabian about this a while ago. Yes, we do want
to keep it and it will be useful for
https://bugzilla.proxmox.com/show_bug.cgi?id=5187#c3
> I think we should create a temporary qcow2 file at vm start and delete
> it at vm stop.
Yes, we need an overlay. Note that there already is a FIXME comment too ;)
>> + # FIXME use overlay and new config option to define storage for temp write device
>> + die "'snapshot' option is not yet supported for '-blockdev'\n" if $drive->{snapshot};
> I'm not sure of current behaviour when you use a block device ?
Note that what you linked above is for the global '-snapshot' option,
not the drive one. It just doesn't apply to blockdevs AFAIU.
> how qemu known where to write a temp snapshot file ?
It just uses /var/tmp which of course is not ideal.
> maybe we could reuse state storage ? only with a temp qcow2 file ? or
> do we want to reuse snapshot feature of storage ?
We want to add a dedicated option to select a snapshot storage. There
could be a sensible default selection (depending on restrictions for the
overlay image).
> Also, I think that some features should be disable when it's used.
> (vm snapshots for example, maybe move disk,...)
Haven't looked into that, but would be pre-existing issues, so nothing
urgent. We just shouldn't break the feature if not necessary. If we
really don't get around to support it in time for PVE 9 we could also
initially note it as a breaking change or fallback to -drive.
More information about the pve-devel
mailing list