[pve-devel] [PATCH-SERIES qemu-server 00/31] let's switch to blockdev, blockdev, blockdev, part four (final)

Fiona Ebner f.ebner at proxmox.com
Fri Jun 27 17:56:56 CEST 2025


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.

This series depends on [0] and [1].

Changes to the patches carried from part three:
* Mirror 17/31: Query QEMU for file child.
* Mirror 17/31: Remove appropriate node after mirror.
* Mirror 17/31: Delete format property from cloned drive hash for
  destination.
* Switch 29/31: Support for live restore and live import.
* Switch 29/31: Use Blockdev::{attach,detach} helpers for hot{,un}plug.
* Switch 29/31: Adapt to changes from previous patches.
* Switch 29/31: Also switch for medium change.


[0]: https://lore.proxmox.com/pve-devel/20250626160504.330350-1-f.ebner@proxmox.com/T/
[1]: https://lore.proxmox.com/pve-devel/20250626144644.279679-1-f.ebner@proxmox.com/T/
[2]: https://bugzilla.proxmox.com/show_bug.cgi?id=3227


Fiona Ebner (31):
  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 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
  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

 src/PVE/API2/Qemu.pm                          |   5 +-
 src/PVE/QemuConfig.pm                         |  12 +-
 src/PVE/QemuServer.pm                         | 319 ++++++------
 src/PVE/QemuServer/BlockJob.pm                | 251 ++++++++-
 src/PVE/QemuServer/Blockdev.pm                | 482 +++++++++++++++++-
 src/PVE/QemuServer/Drive.pm                   |  21 +-
 src/PVE/QemuServer/OVMF.pm                    |  21 +-
 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     |  13 +-
 src/test/cfg2cmd/bootorder-legacy.conf.cmd    |  13 +-
 src/test/cfg2cmd/bootorder.conf.cmd           |  13 +-
 ...putype-icelake-client-deprecation.conf.cmd |   7 +-
 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      |   7 +-
 src/test/cfg2cmd/sev-es.conf.cmd              |   7 +-
 src/test/cfg2cmd/sev-std.conf.cmd             |   7 +-
 src/test/cfg2cmd/simple-btrfs.conf.cmd        |  16 +-
 src/test/cfg2cmd/simple-cifs.conf.cmd         |  16 +-
 .../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          |  28 +-
 src/test/cfg2cmd/simple-virtio-blk.conf.cmd   |   7 +-
 .../cfg2cmd/simple-zfs-over-iscsi.conf.cmd    |  16 +-
 src/test/cfg2cmd/simple1-template.conf.cmd    |  10 +-
 src/test/cfg2cmd/simple1.conf.cmd             |   7 +-
 src/test/run_config2command_tests.pl          |  19 +
 src/test/run_qemu_migrate_tests.pl            |  16 +-
 43 files changed, 1208 insertions(+), 409 deletions(-)

-- 
2.47.2





More information about the pve-devel mailing list