Re: [pve-devel] [PATCH network] sdn: factor out frr config generation and writing

2025-02-11 Thread Thomas Lamprecht
Am 05.02.25 um 17:13 schrieb Gabriel Goller: > Previously the frr config generation and writing was only done in the > evpn plugin. This means that it was not possible to create a standalone > bgp and isis plugin without an evpn plugin in place. (The config would > just never be written.) To fix th

[pve-devel] applied: [PATCH pve-network 1/1] sdn: fix comparison of pending configuration values

2025-02-11 Thread Thomas Lamprecht
Am 07.02.25 um 14:40 schrieb Stefan Hanreich: > The conditional assignment caused falsy values to be converted to > undef when comparing them. This led to the behavior that configuration > values that are interpreted by perl as falsy would get wrongly > compared and always show up as pending change

[pve-devel] [PATCH container v2 02/11] tests: add tests for expected behavior of alloc_disk wrapper

2025-02-11 Thread Daniel Kral
Adds test cases for the alloc_disk wrapper subroutine to ensure that: - zero-sized volumes are allocated as subvols on path-based storages - non-zero-sized volumes are allocated as raw on path-based storages - volumes are allocated as raw on btrfs storages without quotas - volumes are allocated as

[pve-devel] [PATCH qemu-server v2 14/15] api: migrate_vm: use volume content type assertion helpers

2025-02-11 Thread Daniel Kral
Make use of the newly introduced content type assertion helpers in the preconditions check paths and the call to `vdisk_alloc` in the API handler for migrating VMs (and its subcommands and `mtunnel` endpoint). Since the preconditions existed before, adding a content type safeguard at `vdisk_alloc`

[pve-devel] [PATCH container v2 04/11] alloc_disk: factor out common arguments for call to vdisk_alloc

2025-02-11 Thread Daniel Kral
Signed-off-by: Daniel Kral --- changes since v1: - new! src/PVE/LXC.pm | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index 51457ec..1152131 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -2157,6 +2157,7 @@ sub alloc_disk {

[pve-devel] [PATCH container v2 08/11] api: create: use volume content type assertion helpers

2025-02-11 Thread Daniel Kral
Make use of newly introduced content type assertion helpers in the preconditions check path in the API handler for creating a container. Signed-off-by: Daniel Kral --- changes since v1: - new! src/PVE/API2/LXC.pm | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/PVE

[pve-devel] [PATCH container v2 06/11] alloc_disk: update vdisk_alloc optional arguments signature

2025-02-11 Thread Daniel Kral
Update the call to `PVE::Storage::vdisk_alloc` to the updated function signature, which moves the optional argument `$name` (as it may be passed as undefined), to the optional hash argument at the end of the argument list. Signed-off-by: Daniel Kral --- changes since v1: - new! src/PVE/LXC.pm |

[pve-devel] [PATCH container v2 07/11] alloc_disk: use volume content type assertion helpers

2025-02-11 Thread Daniel Kral
Make use of the newly introduced content type assertion helpers in the precondition check path and the call to `vdisk_alloc` in the wrapper for allocating container's disks. Signed-off-by: Daniel Kral --- changes since v1: - new! src/PVE/LXC.pm | 7 --- 1 file changed, 4 insertions(+), 3 de

[pve-devel] [PATCH qemu-server v2 08/15] tree-wide: update vdisk_alloc optional arguments signature

2025-02-11 Thread Daniel Kral
Update any callers of `PVE::Storage::vdisk_alloc` to the updated function signature, which moves the optional arguments `$fmt` and `$name` (as these may be passed as undefined), to the optional hash argument at the end of the argument list. Signed-off-by: Daniel Kral --- changes since v1: - updat

[pve-devel] [PATCH container v2 09/11] migration: prepare: use volume content type assertion helpers

2025-02-11 Thread Daniel Kral
Make use of newly introduced content type assertion helpers in the preconditions check and preparation path of the migration API handlers. Signed-off-by: Daniel Kral --- changes since v1: - new! src/PVE/API2/LXC.pm| 8 ++-- src/PVE/LXC/Migrate.pm | 13 ++--- 2 files changed, 8

[pve-devel] [PATCH container v2 10/11] api: update_vm: use volume content type assertion helpers

2025-02-11 Thread Daniel Kral
Make use of the newly introduced content type assertion helpers at verifying the added and/or changed container config values, which is called e.g. in the API handler for updating the container config. Signed-off-by: Daniel Kral --- changes since v1: - new! src/PVE/LXC/Config.pm | 4 +--- 1 fil

[pve-devel] [PATCH container v2 11/11] mount: raw/iso: use volume content type assertion helpers

2025-02-11 Thread Daniel Kral
Make use of the newly introduced content type assertion helpers at verifying the content type when mounting mountpoints, which have the format "raw" or "iso". Signed-off-by: Daniel Kral --- changes since v1: - new! src/PVE/LXC.pm | 18 +- 1 file changed, 9 insertions(+), 9 delet

[pve-devel] [PATCH qemu-server v2 11/15] api: {create, update}_vm: use volume content type assertion helpers

2025-02-11 Thread Daniel Kral
Make use of the newly introduced content type assertion helpers in the preconditions check paths and the call to `vdisk_alloc` in the API handlers for creating a VM or updating a VM with newly allocated VM, EFI, TPM and/or cloudinit images. Since the preconditions existed before, adding a content

[pve-devel] [PATCH qemu-server v2 13/15] api: qmrestore: use volume content type assertion helpers

2025-02-11 Thread Daniel Kral
Make use of the newly introduced content type assertion helpers in the preconditions check paths and the call to `vdisk_alloc` in the API and CLI handler for restoring VMs to a specified target storage. Since the preconditions existed before, adding a content type safeguard at `vdisk_alloc` does n

[pve-devel] [PATCH container v2 03/11] alloc_disk: fail fast if storage does not support content type rootdir

2025-02-11 Thread Daniel Kral
Signed-off-by: Daniel Kral --- changes since v1: - new! src/PVE/LXC.pm | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index 44e28fc..51457ec 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -2158,7 +2158,11 @@ sub alloc_disk {

[pve-devel] [PATCH qemu-server v2 10/15] api: {clone, move}_vm: use volume content type assertion helpers

2025-02-11 Thread Daniel Kral
Make use of the newly introduced content type assertion helpers in the preconditions check paths and the call to `vdisk_alloc` in the API handlers for cloning VMs to another storage and moving a VM disk to another storage with the newly introduced helper. Since the preconditions existed before, ad

[pve-devel] [PATCH qemu-server v2 05/15] api: remove unusable default storage parameter in check_storage_access

2025-02-11 Thread Daniel Kral
Since 0541eeb8 ("use property strings for drive options") the user input of a volume with allocation support must be a pair of a PVE-managed storage and an arbitrary string (i.e. the volume name or the size of a new disk in GB) [0]. Therefore, the `$volid` must always be the string "$storeid:$volna

[pve-devel] [PATCH qemu-server v2 09/15] cfg2cmd: improve error message for invalid volume content type

2025-02-11 Thread Daniel Kral
Improve the error message when a VM start fails due to a volume storage not supporting the volume's required content type by prefixing it with the disk handle (e.g. scsi0). Signed-off-by: Daniel Kral --- changes since v1: - none except relocation of helper PVE/QemuServer.pm

[pve-devel] [PATCH qemu-server v2 04/15] api: remove unused size variable in check_storage_access

2025-02-11 Thread Daniel Kral
Remove variable `$size`, which is not used here and likely a copy-paste redundancy from the `create_disks` subroutine. Signed-off-by: Daniel Kral --- changes since v1: - new! PVE/API2/Qemu.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm

[pve-devel] [PATCH pve-storage v2 2/5] introduce helpers for content type assertions of storages and volumes

2025-02-11 Thread Daniel Kral
Add subroutines for asserting the content types of storages and volumes to reduce code duplication, e.g. when implementing preconditions in an API handler before calling vdisk_alloc. Signed-off-by: Daniel Kral --- changes since v1: - moved from qemu-server to pve-storage - add missing $node param

[pve-devel] [PATCH qemu-server v2 02/15] fix #5284: api: move-disk: assert content type support for target storage

2025-02-11 Thread Daniel Kral
Asserts whether the target storage supports storing VM images before moving a VM volume to the target storage. Without the check in place, a VM volume can be moved to a storage, which does not support VM images, but won't be able to start since any attached volume must be stored on a supported sto

[pve-devel] [PATCH qemu-server v2 01/15] test: cfg2cmd: expect error for invalid volume's storage content type

2025-02-11 Thread Daniel Kral
Tests whether when running `config_to_command` it will correctly fail with an error message that a volume cannot be used if the underlying storage does not support its content type. Signed-off-by: Daniel Kral --- changes since v1: - no changes except removing unrelated diff test/cfg2cmd/unsuppo

[pve-devel] [PATCH container v2 05/11] alloc_disk: simplify storage-specific logic for vdisk_alloc arguments

2025-02-11 Thread Daniel Kral
Since there are only two distinct outcomes, i.e. raw format + do_format and subvol format + needs_chown, break down the conditions to reduce the branching depth. Signed-off-by: Daniel Kral --- changes since v1: - new! src/PVE/LXC.pm | 13 + 1 file changed, 5 insertions(+), 8 deletio

[pve-devel] [PATCH container v2 01/11] migration: prepare: factor out common read-only variables

2025-02-11 Thread Daniel Kral
Factor out the common read-only variables to allow the second call to `storage_check_enabled` to be below 100 characters. Signed-off-by: Daniel Kral --- changes since v1: - new! src/PVE/LXC/Migrate.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/PVE/LXC/Migrate.p

[pve-devel] [PATCH qemu-server v2 12/15] api: import{disk, ovf}: use volume content type assertion helpers

2025-02-11 Thread Daniel Kral
Make use of the newly introduced content type assertion helpers in the preconditions check paths and the call to `vdisk_alloc` in the API handlers for importing VM disks or importing OVF manifests as VMs. Since the preconditions existed before, adding a content type safeguard at `vdisk_alloc` does

[pve-devel] [PATCH qemu-server v2 15/15] tree-wide: add todos for breaking content type assertions

2025-02-11 Thread Daniel Kral
Add TODO comments to calls to `vdisk_alloc`, which should be done for consistency, but would be breaking in the current release since both snapshot state files and fleecing images are allowed on storages, which do not support VM images and work without errors currently. Signed-off-by: Daniel Kral

[pve-devel] [PATCH container/qemu-server/storage v2 00/31] consistent assertions for volume's content types

2025-02-11 Thread Daniel Kral
== Description == There were (at least) four missing assertions whether the underlying storage supports the content type that is about the be allocated, but will fail to start with a volume not being on a storage, which supports VM images (see `config_to_command` for the existing check): - when m

[pve-devel] [PATCH pve-storage v2 5/5] vdisk_alloc: add optional assertion for volume's content type

2025-02-11 Thread Daniel Kral
Allow a caller to specify the volume's intended content type and assert whether the specified content type may be stored on the specified storage before allocating any volume. Signed-off-by: Daniel Kral --- changes since v1: - add assertion at `vdisk_alloc` instead of wrapper `alloc_volume_disk`

[pve-devel] [PATCH qemu-server v2 06/15] fix #5284: api: update-vm: assert content type support for cloudinit images

2025-02-11 Thread Daniel Kral
Asserts whether the target storage supports storing cloudinit images, i.e. VM images, before creating a cloudinit image on the target storage. Without the check in place, a cloudinit image can be created on the storage, which does not support VM images, but won't be able to start since any attache

[pve-devel] [PATCH pve-storage v2 3/5] tree-wide: make use of content type assertion helper

2025-02-11 Thread Daniel Kral
Make any code path with an existent content type assertion use the newly introduced content type assertion helper. As those code paths must perform actions on the storage anyway, the `storage_check_enabled` in the helper subroutine adds an additional precondition check without breaking the existin

[pve-devel] [PATCH qemu-server v2 07/15] fix #5284: cli: importovf: assert content type support for target storage

2025-02-11 Thread Daniel Kral
Asserts whether the target storage supports storing VM images before importing a OVF manifest as a VM to the target storage. Without the check in place, a VM volume can be imported to a storage, which does not support VM images, but won't be able to start since any attached volume must be stored o

[pve-devel] [PATCH qemu-server v2 03/15] fix #5284: api: clone_vm: assert content type support for target storage

2025-02-11 Thread Daniel Kral
Asserts whether the target storage supports storing VM images before cloning a VM and its volumes to the target storage. Without the check in place, a VMs volumes can be cloned to a storage, which does not support VM images, but won't be able to start since any attached volume must be stored on a

[pve-devel] [PATCH pve-storage v2 1/5] api: {upload, download}_url: factor out common parameter hash accesses

2025-02-11 Thread Daniel Kral
Minor cleanup to reduce the amount of `$param->{...}` to variables in the upload and download url API handler. Signed-off-by: Daniel Kral --- changes since v1: - new! src/PVE/API2/Storage/Status.pm | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/PV

[pve-devel] [PATCH pve-storage v2 4/5] vdisk_alloc: factor out optional parameters in options hash argument

2025-02-11 Thread Daniel Kral
Moves the optional parameter `name` into an optional hash argument at the end of the function. This allows to add more optional arguments in the future and makes the function call easier to follow when a name is not required. Signed-off-by: Daniel Kral --- changes since v1: - new! src/PVE/API2

Re: [pve-devel] [PATCH proxmox-i18n v2 2/2] make: add proxmox-datacenter-manager translations

2025-02-11 Thread Maximiliano Sandoval
Maximiliano Sandoval writes: > Maximiliano Sandoval writes: > >> Maximiliano Sandoval writes: >> >>> The catalog-{lang}.mo files are generated only with strings that are >>> relevant to the proxmox-datacenter-manager instead of the whole >>> {lang}.po file. The msgmerge command will produce a

Re: [pve-devel] [PATCH guest-common/qemu-server/manager/docs v5 0/3] implement experimental vgpu live migration

2025-02-11 Thread Christoph Heiss
I'm not _that_ familiar (yet) really with the resource mapping and live-migration code. So I'd not consider this a full in-depth review. But looking over the patches, nothing odd stood out to me, at least. Small nit: personally I'd just squash the two pve-docs patches, since they touch the exact

Re: [pve-devel] [PATCH manager v5 2/5] bulk migrate: improve precondition checks

2025-02-11 Thread Christoph Heiss
On Mon Jan 20, 2025 at 3:51 PM CET, Dominik Csapak wrote: [..] > diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm > index 9cdf19db..6fe7a5fd 100644 > --- a/PVE/API2/Nodes.pm > +++ b/PVE/API2/Nodes.pm > @@ -2331,11 +2331,23 @@ my $create_migrate_worker = sub { > $invalidConditions .= joi

Re: [pve-devel] [PATCH v2 pve-manager] fix #5936: ui: backup: add CT PBS change detection mode selector

2025-02-11 Thread Christian Ebner
Ping! ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Re: [pve-devel] [PATCH qemu-server v5 02/11] pci: mapping: move implementation of find_on_current_node here

2025-02-11 Thread Christoph Heiss
On Mon Jan 20, 2025 at 3:51 PM CET, Dominik Csapak wrote: [..] > +my sub get_current_node_mapping { > +my ($mapping_config, $mapping_name) = @_; > + > +my $node = PVE::INotify::nodename(); > +my $devices = PVE::Mapping::PCI::get_node_mapping($mapping_config, > $mapping_name, $node); >

Re: [pve-devel] [PATCH cluster/guest-common/manager/qemu-server v3 00/11] fix #5657: allow configuring RNG device as non-root user

2025-02-11 Thread Fabian Grünbichler
On February 10, 2025 4:37 pm, Filip Schauer wrote: > Allow users with the VM.Config.HWType privilege to configure VirtIO RNG > devices on VMs with either /dev/urandom or /dev/random as the entropy > source. > > Further introduce hardware RNG device mapping to be able to selectively > allow non-roo

Re: [pve-devel] [PATCH qemu-server v3 10/11] allow non-root users to set /dev/u?random as an RNG source

2025-02-11 Thread Fabian Grünbichler
On February 10, 2025 4:37 pm, Filip Schauer wrote: > Allow non-root users with the VM.Config.HWType privilege to configure > /dev/urandom & /dev/random as an entropy source for a VirtIO RNG device. > /dev/hwrng remains restricted to the root user. > > Signed-off-by: Filip Schauer > --- > PVE/API

Re: [pve-devel] [PATCH qemu-server v3 11/11] let VirtIO RNG devices source entropy from mapped HWRNGs

2025-02-11 Thread Fabian Grünbichler
On February 10, 2025 4:37 pm, Filip Schauer wrote: > This allows a user with the Mapping.Modify privilege on /mapping/hwrng > to configure a hardware RNG mapping. A less privileged user with the > Mapping.Use privilege can then pass the mapped hardware RNG device as an > entropy source to a VirtIO

Re: [pve-devel] [PATCH container] fix #5907: ignore conflicting mount options for read-only mounts

2025-02-11 Thread Thomas Lamprecht
Am 11.02.25 um 11:17 schrieb Fiona Ebner: > @Filip, you are more than welcome to ping your fixes after a while, > especially if they already have T-B and R-B 🙂 Thanks for your reminder on this series. FWIW, in such a case I think one can also "ping" in the form of a new revision of the patch (seri

[pve-devel] applied: [PATCH container] fix #5907: ignore conflicting mount options for read-only mounts

2025-02-11 Thread Thomas Lamprecht
Am 25.11.24 um 14:09 schrieb Filip Schauer: > When mounting volumes as read-only, certain mount options like > "discard", "lazytime", and "noatime" are either ignored or can cause the > mount to fail. For example, attempting to mount with "-t zfs" and > "-o ro,discard" leads to an error: filesystem

[pve-devel] [PATCH manager v2] ui: restore: enable safeguarding of mount point volumes by default

2025-02-11 Thread Fiona Ebner
Same rationale as in pve-manager commit 5f855ccf ("ui: restore: improve warning for restoring container with same ID"): it's surprising to (new) users that all owned mount point volumes are erased upon container restore, even those that are not currently selected for backup. This is different from

[pve-devel] [PATCH container v2] api: restore: allow keeping not backed-up volumes

2025-02-11 Thread Fiona Ebner
Same rationale as in pve-manager commit 5f855ccf ("ui: restore: improve warning for restoring container with same ID"): it's surprising to (new) users that all owned mount point volumes are erased upon container restore, even those that are not currently selected for backup. This is different from

Re: [pve-devel] [PATCH container] fix #5907: ignore conflicting mount options for read-only mounts

2025-02-11 Thread Fiona Ebner
Ping @Filip, you are more than welcome to ping your fixes after a while, especially if they already have T-B and R-B :) Am 25.11.24 um 14:09 schrieb Filip Schauer: > When mounting volumes as read-only, certain mount options like > "discard", "lazytime", and "noatime" are either ignored or can cau

Re: [pve-devel] applied: [PATCH container 2/2] migration: add reminder to evaluate dropping seemingly useless check for PVE 9

2025-02-11 Thread Thomas Lamprecht
Am 11.02.25 um 10:45 schrieb Fiona Ebner: > Am 10.02.25 um 17:12 schrieb Thomas Lamprecht: >> Am 18.12.24 um 11:32 schrieb Fiona Ebner: >>> Signed-off-by: Fiona Ebner >>> --- >>> src/PVE/LXC/Migrate.pm | 2 ++ >>> 1 file changed, 2 insertions(+) >>> >>> >> >> applied, thanks! >> >> The first patc

Re: [pve-devel] applied: [PATCH container 2/2] migration: add reminder to evaluate dropping seemingly useless check for PVE 9

2025-02-11 Thread Fiona Ebner
Am 10.02.25 um 17:12 schrieb Thomas Lamprecht: > Am 18.12.24 um 11:32 schrieb Fiona Ebner: >> Signed-off-by: Fiona Ebner >> --- >> src/PVE/LXC/Migrate.pm | 2 ++ >> 1 file changed, 2 insertions(+) >> >> > > applied, thanks! > > The first patch was already applied by Fabian on 2024-12-19: > > h