]> git.proxmox.com Git - qemu-server.git/commit
qemuserver: foreach_volid: include pending volumes
authorAaron Lauterer <a.lauterer@proxmox.com>
Mon, 19 Jun 2023 09:29:28 +0000 (11:29 +0200)
committerFiona Ebner <f.ebner@proxmox.com>
Wed, 21 Jun 2023 10:48:11 +0000 (12:48 +0200)
commit6328c554c1e9925df73c8891f8061271b7422511
treeb1f61903ebcfd1fae748ee4ed1400f4f48c79ce7
parentec11b92abb5e5610ce64934e0876f1b54d375cab
qemuserver: foreach_volid: include pending volumes

Make it possible to optionally iterate over disks in the pending section
of VMs, similar as to how snapshots are handled already.

This is for example useful in the migration if we don't want to rely on
the scanning of all storages.

All calling sites are adapted and enable it, except for
QemuConfig::get_replicatable_volumes as that would cause a change for
the replication if pending disks would be included.

The following lists the calling sites and if they should be fine with
the change (source [0]):

1. QemuMigrate: scan_local_volumes(): needed to include pending disk
   images
2. API2/Qemu.pm: check_vm_disks_local() for migration precondition:
   related to migration, so more consistent with pending
3. QemuConfig.pm: get_replicatable_volumes(): would change the behavior
   of the replication, will not use it for now.
4. QemuServer.pm: get_vm_volumes(): is used multiple times by:
4a. vm_stop_cleanup() to deactivate/unmap: should also be fine with
    including pending
4b. QemuMigrate.pm: in prepare(): part of migration, so more consistent
    with pending
4c. QemuMigrate.pm: in phase3_cleanup() for deactivation: part of
    migration, so more consistent with pending

[0] https://lists.proxmox.com/pipermail/pve-devel/2023-May/056868.html

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
PVE/API2/Qemu.pm
PVE/QemuConfig.pm
PVE/QemuMigrate.pm
PVE/QemuServer.pm