From 2fa64dbdddfb5eba4eec2323361fe98d656e9909 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Wed, 9 Nov 2022 08:55:55 +0100 Subject: [PATCH] pci: add/improve HW reservation comments Signed-off-by: Thomas Lamprecht --- PVE/QemuServer/PCI.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PVE/QemuServer/PCI.pm b/PVE/QemuServer/PCI.pm index 788ab2ad..1cb059e3 100644 --- a/PVE/QemuServer/PCI.pm +++ b/PVE/QemuServer/PCI.pm @@ -522,6 +522,9 @@ my $RUNDIR = '/run/qemu-server'; my $PCIID_RESERVATION_FILE = "${RUNDIR}/pci-id-reservations"; my $PCIID_RESERVATION_LOCK = "${PCIID_RESERVATION_FILE}.lock"; +# a list of PCI ID to VMID reservations, the validity is protected against leakage by either a PID, +# for succesfully started VM processes, or a expiration time for the initial time window between +# reservation and actual VM process start-up. my $parse_pci_reservation_unlocked = sub { my $pciids = {}; if (my $fh = IO::File->new($PCIID_RESERVATION_FILE, "r")) { @@ -552,7 +555,7 @@ my $write_pci_reservation_unlocked = sub { PVE::Tools::file_set_contents($PCIID_RESERVATION_FILE, $data); }; -# removes all pci reservations of the given vmid +# removes all PCI device reservations held by the `vmid` sub remove_pci_reservation { my ($vmid) = @_; -- 2.39.5