[pve-devel] [PATCH-SERIES qemu/storage/qemu-server v2 00/49] let's switch to blockdev, blockdev, blockdev, part four (final)
Fiona Ebner
f.ebner at proxmox.com
Tue Jul 1 17:40:20 CEST 2025
v3 storage: https://lore.proxmox.com/pve-devel/20250626144644.279679-1-f.ebner@proxmox.com/
v1 qemu-server: https://lore.proxmox.com/pve-devel/20250627155737.162083-1-f.ebner@proxmox.com/
v1 qemu: https://lore.proxmox.com/pve-devel/20250626160504.330350-1-f.ebner@proxmox.com/
The preliminary final part in the series. I'm sure there will be some
follow-ups, and the decisions about edge cases like cache mode for EFI
disk and querying file child are not yet set in stone. But this should
essentially be it.
The switch from '-drive' to '-blockdev' is in preparation for future
features like external snapshots, FUSE exports via qemu-storage-daemon
and also generally the more modern interface in QEMU. It also allows
to address some limitations drive-mirror had, in particular this
series makes it possible to mirror between storages having a different
aio default as well as mirror when the size of the allocated image
doesn't exactly match for EFI disks, see [2] and patch 31/31.
The switch is guarded by machine version 10.0 to avoid any potential
incompatibilities between -drive and -blockdev options/defaults.
What is still missing is support for the rather obscure 'snapshot'
drive option where writes will go to a temporary image (currently in
'/var/tmp', which is far from ideal to begin with). That requires
inserting an overlay node.
When using -drive, storage plugins currently give us a path that QEMU
understands, some using special protocols such as 'iscsi://'. We'd
like to switch to using the more modern -blockdev for PVE 9. The
plan is to have the storage plugins return the very basic information
required to access the image, and qemu-server can then add other
settings like cache, aio, etc. on top. In fact, pretty similar to what
we have now for -drive, just with a structured hash rather than a
string.
This is also a prerequisite for qemu-storage-daemon, that would be
useful for TPM-as-qcow2 exported via NBD or FUSE or external backup
provider restore providing an NBD export for the provider to write to.
Changes from the previous versions:
* Return child node references as part of block device info in QEMU,
based on latest feedback upstream [0].
* Try to delete potentially left-over throttle group before attaching.
* Recursively detach children.
* Use Blockdev::{attach,detach} helpers for hot{,un}plug.
* More compact POD.
* Pass machine version to storage layer, so plugins can version guard.
* Do not create throttle group if there is no associated blockdev in
the first place.
* Assert that blockdev_mirror() is called only when there is a top
throttle node.
* Assert in ZFS plugin's qemu-blockdev-options() that volume is not a
subvol.
* Drop anticipating vector notation for mon host in storage config in
RBD storage plugin.
* Introduce helpers for throttle and node names.
[0]: https://lore.kernel.org/qemu-devel/74a66925-12a5-42af-8f93-4031d663a90d@proxmox.com/T/
qemu:
Fiona Ebner (4):
PVE backup: prepare for the switch to using blockdev rather than drive
block/zeroinit: support using as blockdev driver
block/alloc-track: support using as blockdev driver
block: include child references in block device info
block/qapi.c | 12 +++++++++
block/zeroinit.c | 12 ++++++---
pve-backup.c | 51 +++++++++++++++++++++++++++++---------
qapi/block-core.json | 40 +++++++++++++++++++++++++++---
tests/qemu-iotests/184.out | 1 +
tests/qemu-iotests/191.out | 8 ++++++
tests/qemu-iotests/273.out | 2 ++
7 files changed, 108 insertions(+), 18 deletions(-)
storage:
Fiona Ebner (10):
plugin: add method to get qemu blockdevice options for volume
iscsi direct plugin: implement method to get qemu blockdevice options
zfs iscsi plugin: implement new method to get qemu blockdevice options
zfs pool plugin: implement method to get qemu blockdevice options
ceph/rbd: set 'keyring' in ceph configuration for externally managed
RBD storages
rbd plugin: implement new method to get qemu blockdevice options
plugin: qemu block device: add hints option and EFI disk hint
plugin: qemu block device: add support for snapshot option
plugin: add machine version to qemu_blockdev_options() interface
plugin api: bump api version and age
ApiChangeLog | 13 ++++
src/PVE/CephConfig.pm | 50 +++++++++++++++
src/PVE/Storage.pm | 21 ++++++-
src/PVE/Storage/ISCSIDirectPlugin.pm | 17 +++++
src/PVE/Storage/Plugin.pm | 92 ++++++++++++++++++++++++++++
src/PVE/Storage/RBDPlugin.pm | 60 ++++++++++++++++++
src/PVE/Storage/ZFSPlugin.pm | 19 ++++++
src/PVE/Storage/ZFSPoolPlugin.pm | 16 +++++
8 files changed, 286 insertions(+), 2 deletions(-)
qemu-server:
Fiona Ebner (35):
mirror: code style: avoid masking earlier declaration of $op
test: collect mocked functions for QemuServer module
drive: add helper to parse drive interface
drive: drop invalid export of get_scsi_devicetype
blockdev: add and use throttle_group_id() helper
blockdev: introduce top_node_name() and parse_top_node_name() helpers
blockdev: add helpers for attaching and detaching block devices
blockdev: add missing include for JSON module
backup: use blockdev for fleecing images
backup: use blockdev for TPM state file
blockdev: introduce qdev_id_to_drive_id() helper
blockdev: introduce and use get_block_info() helper
blockdev: move helper for resize into module
blockdev: add helper to get node below throttle node
blockdev: resize: query and use node name for resize operation
blockdev: support using zeroinit filter
blockdev: make some functions private
blockdev: add 'no-throttle' option to skip generationg throttle top
node
block job: allow specifying a block node that should be detached upon
completion
block job: add blockdev mirror
blockdev: add change_medium() helper
blockdev: add blockdev_change_medium() helper
blockdev: move helper for configuring throttle limits to module
clone disk: skip check for aio=default (io_uring) compatibility
starting with machine version 10.0
print drive device: don't reference any drive for 'none' starting with
machine version 10.0
blockdev: add support for NBD paths
blockdev: add helper to generate PBS block device for live restore
blockdev: support alloc-track driver for live-{import,restore}
live import: also record volid information
live import/restore: query which node to use for operation
live import/restore: use Blockdev::detach helper
command line: switch to blockdev starting with machine version 10.0
test: migration: update running machine to 10.0
partially fix #3227: ensure that target image for mirror has the same
size for EFI disks
blockdev: pass along machine version to storage layer
src/PVE/API2/Qemu.pm | 5 +-
src/PVE/QemuConfig.pm | 12 +-
src/PVE/QemuServer.pm | 304 +++++-----
src/PVE/QemuServer/BlockJob.pm | 216 ++++++-
src/PVE/QemuServer/Blockdev.pm | 552 +++++++++++++++++-
src/PVE/QemuServer/Drive.pm | 21 +-
src/PVE/QemuServer/OVMF.pm | 26 +-
src/PVE/VZDump/QemuServer.pm | 50 +-
src/test/MigrationTest/QemuMigrateMock.pm | 13 +
src/test/MigrationTest/QmMock.pm | 56 +-
src/test/cfg2cmd/aio.conf.cmd | 42 +-
src/test/cfg2cmd/bootorder-empty.conf.cmd | 12 +-
src/test/cfg2cmd/bootorder-legacy.conf.cmd | 12 +-
src/test/cfg2cmd/bootorder.conf.cmd | 12 +-
...putype-icelake-client-deprecation.conf.cmd | 6 +-
src/test/cfg2cmd/efi-raw-template.conf.cmd | 7 +-
src/test/cfg2cmd/efi-raw.conf.cmd | 7 +-
.../cfg2cmd/efi-secboot-and-tpm-q35.conf.cmd | 7 +-
src/test/cfg2cmd/efi-secboot-and-tpm.conf.cmd | 7 +-
src/test/cfg2cmd/efidisk-on-rbd.conf.cmd | 7 +-
src/test/cfg2cmd/ide.conf.cmd | 15 +-
src/test/cfg2cmd/q35-ide.conf.cmd | 15 +-
.../q35-linux-hostpci-mapping.conf.cmd | 7 +-
.../q35-linux-hostpci-multifunction.conf.cmd | 7 +-
.../q35-linux-hostpci-template.conf.cmd | 10 +-
...q35-linux-hostpci-x-pci-overrides.conf.cmd | 7 +-
src/test/cfg2cmd/q35-linux-hostpci.conf.cmd | 7 +-
src/test/cfg2cmd/q35-simple.conf.cmd | 7 +-
src/test/cfg2cmd/seabios_serial.conf.cmd | 6 +-
src/test/cfg2cmd/sev-es.conf.cmd | 7 +-
src/test/cfg2cmd/sev-std.conf.cmd | 7 +-
src/test/cfg2cmd/simple-btrfs.conf.cmd | 15 +-
src/test/cfg2cmd/simple-cifs.conf.cmd | 15 +-
.../cfg2cmd/simple-disk-passthrough.conf.cmd | 9 +-
src/test/cfg2cmd/simple-lvm.conf.cmd | 12 +-
src/test/cfg2cmd/simple-lvmthin.conf.cmd | 12 +-
src/test/cfg2cmd/simple-rbd.conf.cmd | 27 +-
src/test/cfg2cmd/simple-virtio-blk.conf.cmd | 6 +-
.../cfg2cmd/simple-zfs-over-iscsi.conf.cmd | 15 +-
src/test/cfg2cmd/simple1-template.conf.cmd | 9 +-
src/test/cfg2cmd/simple1.conf.cmd | 6 +-
src/test/run_config2command_tests.pl | 19 +
src/test/run_qemu_migrate_tests.pl | 16 +-
43 files changed, 1212 insertions(+), 418 deletions(-)
Summary over all repositories:
58 files changed, 1606 insertions(+), 438 deletions(-)
--
Generated by git-murpp 0.5.0
More information about the pve-devel
mailing list