[pve-devel] [PATCH qemu-server v3 0/3] fix #3258: check for in-use pci devices on vm start

Dominik Csapak d.csapak at proxmox.com
Thu Oct 7 15:45:28 CEST 2021


by having a vmid <-> pciid mapping in /var/run
i did not check if the vm has the pci device really in the config,
but we should not need that, since we remove the reservation again
in the cleanup step and check the running pid anyway.

notes:
1/3 is more or less independent, but made the code less crowded
3/3 is best viewed with -w since much of it is indentation change

changes from v2:
* add refactor of pci device preparation (could be independently applied)
* always expect a list of ids in (un)reserve
* really collect the whole list of ids before preparing

changes from v1:
* use time-based reservation before starting (current + start timeout +5s)
  and reserve again after we have the pid

Dominik Csapak (3):
  pci: refactor pci device preparation
  pci: add helpers to (un)reserve pciids for a vm
  fix #3258: block vm start when pci device is already in use

 PVE/QemuServer.pm     |  62 ++++++++++++++-------
 PVE/QemuServer/PCI.pm | 123 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 165 insertions(+), 20 deletions(-)

-- 
2.30.2






More information about the pve-devel mailing list