[pve-devel] [PATCH qemu/storage/qemu-server v3 00/51] let's switch to blockdev, blockdev, blockdev, part four (final)
Fiona Ebner
f.ebner at proxmox.com
Wed Jul 2 18:27:33 CEST 2025
v2 https://lore.proxmox.com/pve-devel/20250701154117.434512-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 patch "partially fix #3227:
ensure that target image for mirror has the same size for EFI disks".
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 version:
* Use latest iteration of QEMU patch for child node name info.
* Restrict allowed drivers and options returned by storage plugins
(Thanks Thomas, restricting drivers makes a ton of sense, as there
is way more than just protocol paths).
* Implement protocol path parsing for common protocols in default
storage implementation.
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/qapi: include child references in block device info
block/qapi.c | 10 ++++++++
block/zeroinit.c | 12 ++++++---
pve-backup.c | 51 +++++++++++++++++++++++++++++---------
qapi/block-core.json | 40 +++++++++++++++++++++++++++---
tests/qemu-iotests/184.out | 8 ++++++
5 files changed, 103 insertions(+), 18 deletions(-)
storage:
Fiona Ebner (12):
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
qemu blockdev options: restrict allowed drivers and options
plugin: qemu blockdev options: parse protocol paths in default
implementation
plugin api: bump api version and age
ApiChangeLog | 15 +++
src/PVE/CephConfig.pm | 50 ++++++++
src/PVE/Storage.pm | 135 ++++++++++++++++++-
src/PVE/Storage/ISCSIDirectPlugin.pm | 17 +++
src/PVE/Storage/Plugin.pm | 185 +++++++++++++++++++++++++++
src/PVE/Storage/RBDPlugin.pm | 60 +++++++++
src/PVE/Storage/ZFSPlugin.pm | 19 +++
src/PVE/Storage/ZFSPoolPlugin.pm | 16 +++
8 files changed, 495 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 | 551 +++++++++++++++++-
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, 1211 insertions(+), 418 deletions(-)
Summary over all repositories:
56 files changed, 1809 insertions(+), 438 deletions(-)
--
Generated by git-murpp 0.5.0
More information about the pve-devel
mailing list