Changes in v2:
* new approach, attach as ide-cd rather than using older machine
  version, which would break qcow2 snapshot-as-volume-chain
* get rid of now outdated drive_is_read_only() helper

With ide-hd, the inserted block node needs to be marked as writable
too, but -blockdev will complain if it's marked as writable but the
actual backing device is read-only (e.g. read-only base LV).

IDE/SATA do not support being configured as read-only, the most
similar is using ide-cd instead of ide-hd, with most of the code and
configuration shared in QEMU.

Since a template is never actually started, the front-end device is
never accessed. The backup only accesses the inserted block node, so
it does not matter for the backup if the type is 'ide-cd' instead.

The same issue did not manifest for '-drive', because the '-snapshot'
option is used for template backups. The '-snapshot' option does not
affect '-blockdev', from 'man kvm':

> snapshot is incompatible with -blockdev

Fiona Ebner (5):
  ovmf: pass along whether the VM is a template
  code cleanup: cfg2cmd: check if configuration is for template
    centrally
  fix #6675: template backup: fix regression with IDE/SATA and blockdev
  code cleanup: drive: get rid of outdated drive_is_read_only() helper
  cfg2cmd: add reminder comments to remove template handling for -drive

 src/PVE/QemuServer.pm                      | 37 ++++++++++++++++------
 src/PVE/QemuServer/Drive.pm                | 10 ------
 src/PVE/QemuServer/OVMF.pm                 | 20 ++++++------
 src/test/cfg2cmd/simple1-template.conf.cmd |  4 +--
 4 files changed, 39 insertions(+), 32 deletions(-)

-- 
2.47.2



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to