public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH-SERIES qemu/storage/qemu-server v2 00/49] let's switch to blockdev, blockdev, blockdev, part four (final)
Date: Tue,  1 Jul 2025 17:40:20 +0200	[thread overview]
Message-ID: <20250701154117.434512-1-f.ebner@proxmox.com> (raw)

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


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


             reply	other threads:[~2025-07-01 15:41 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-01 15:40 Fiona Ebner [this message]
2025-07-01 15:40 ` [pve-devel] [PATCH qemu v2 01/49] PVE backup: prepare for the switch to using blockdev rather than drive Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH qemu v2 02/49] block/zeroinit: support using as blockdev driver Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH qemu v2 03/49] block/alloc-track: " Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH qemu v2 04/49] block: include child references in block device info Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH storage v4 05/49] plugin: add method to get qemu blockdevice options for volume Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH storage v4 06/49] iscsi direct plugin: implement method to get qemu blockdevice options Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH storage v4 07/49] zfs iscsi plugin: implement new " Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH storage v4 08/49] zfs pool plugin: implement " Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH storage v4 09/49] ceph/rbd: set 'keyring' in ceph configuration for externally managed RBD storages Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH storage v4 10/49] rbd plugin: implement new method to get qemu blockdevice options Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH storage v4 11/49] plugin: qemu block device: add hints option and EFI disk hint Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH storage v4 12/49] plugin: qemu block device: add support for snapshot option Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH storage v4 13/49] plugin: add machine version to qemu_blockdev_options() interface Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH storage v4 14/49] plugin api: bump api version and age Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH qemu-server v2 15/49] mirror: code style: avoid masking earlier declaration of $op Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH qemu-server v2 16/49] test: collect mocked functions for QemuServer module Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH qemu-server v2 17/49] drive: add helper to parse drive interface Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH qemu-server v2 18/49] drive: drop invalid export of get_scsi_devicetype Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH qemu-server v2 19/49] blockdev: add and use throttle_group_id() helper Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH qemu-server v2 20/49] blockdev: introduce top_node_name() and parse_top_node_name() helpers Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH qemu-server v2 21/49] blockdev: add helpers for attaching and detaching block devices Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH qemu-server v2 22/49] blockdev: add missing include for JSON module Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH qemu-server v2 23/49] backup: use blockdev for fleecing images Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH qemu-server v2 24/49] backup: use blockdev for TPM state file Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH qemu-server v2 25/49] blockdev: introduce qdev_id_to_drive_id() helper Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH qemu-server v2 26/49] blockdev: introduce and use get_block_info() helper Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH qemu-server v2 27/49] blockdev: move helper for resize into module Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH qemu-server v2 28/49] blockdev: add helper to get node below throttle node Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH qemu-server v2 29/49] blockdev: resize: query and use node name for resize operation Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH qemu-server v2 30/49] blockdev: support using zeroinit filter Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH qemu-server v2 31/49] blockdev: make some functions private Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH qemu-server v2 32/49] blockdev: add 'no-throttle' option to skip generationg throttle top node Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH qemu-server v2 33/49] block job: allow specifying a block node that should be detached upon completion Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH qemu-server v2 34/49] block job: add blockdev mirror Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH qemu-server v2 35/49] blockdev: add change_medium() helper Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH qemu-server v2 36/49] blockdev: add blockdev_change_medium() helper Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH qemu-server v2 37/49] blockdev: move helper for configuring throttle limits to module Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH qemu-server v2 38/49] clone disk: skip check for aio=default (io_uring) compatibility starting with machine version 10.0 Fiona Ebner
2025-07-01 15:40 ` [pve-devel] [PATCH qemu-server v2 39/49] print drive device: don't reference any drive for 'none' " Fiona Ebner
2025-07-01 15:41 ` [pve-devel] [PATCH qemu-server v2 40/49] blockdev: add support for NBD paths Fiona Ebner
2025-07-01 15:41 ` [pve-devel] [PATCH qemu-server v2 41/49] blockdev: add helper to generate PBS block device for live restore Fiona Ebner
2025-07-01 15:41 ` [pve-devel] [PATCH qemu-server v2 42/49] blockdev: support alloc-track driver for live-{import, restore} Fiona Ebner
2025-07-01 15:41 ` [pve-devel] [PATCH qemu-server v2 43/49] live import: also record volid information Fiona Ebner
2025-07-01 15:41 ` [pve-devel] [PATCH qemu-server v2 44/49] live import/restore: query which node to use for operation Fiona Ebner
2025-07-01 15:41 ` [pve-devel] [PATCH qemu-server v2 45/49] live import/restore: use Blockdev::detach helper Fiona Ebner
2025-07-01 15:41 ` [pve-devel] [PATCH qemu-server v2 46/49] command line: switch to blockdev starting with machine version 10.0 Fiona Ebner
2025-07-01 15:41 ` [pve-devel] [PATCH qemu-server v2 47/49] test: migration: update running machine to 10.0 Fiona Ebner
2025-07-01 15:41 ` [pve-devel] [PATCH qemu-server v2 48/49] partially fix #3227: ensure that target image for mirror has the same size for EFI disks Fiona Ebner
2025-07-01 15:41 ` [pve-devel] [PATCH qemu-server v2 49/49] blockdev: pass along machine version to storage layer Fiona Ebner
2025-07-02  8:20 ` [pve-devel] [PATCH-SERIES qemu/storage/qemu-server v2 00/49] let's switch to blockdev, blockdev, blockdev, part four (final) DERUMIER, Alexandre via pve-devel
2025-07-02  8:36   ` Fiona Ebner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250701154117.434512-1-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal