[pve-devel] [PATCH proxmox-firewall 1/2] fix: firewall: apply `nt_conntrack_allow_invalid` to all chains

2025-02-20 Thread Hannes Laimer
... on the guest table. There is no reason to not repect that option on those two chains. These two were missed in the referenced commit. Fixes: 64dc344b ("firewall: apply `nt_conntrack_allow_invalid` option to guest table") Signed-off-by: Hannes Laimer --- proxmox-firewall/resources/proxmox-fi

[pve-devel] [PATCH pve_flutter_frontend] Updated Gradle version and some build dependencies.

2025-02-20 Thread Alexander Abraham
The Flutter frontend of PVE was not compilable for Android with the versions of different tools set in the project files. The versions of the tools causing this problem was updated and the app compiles for Android. Signed-off-by: Alexander Abraham --- android/app/build.gradle

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

2025-02-20 Thread Daniel Kral
On 2/20/25 13:15, Fiona Ebner wrote: I'd change the title to "alloc disk: fix content type check for ZFS storages" because the check was missing for that branch ;) The commit message should mention that there are already earlier checks for the create operations. Moving a volume to a ZFS storage

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

2025-02-20 Thread Daniel Kral
On 2/20/25 15:46, Fiona Ebner wrote: Am 11.02.25 um 17:08 schrieb Daniel Kral: diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm index ed5ede30..827e54b7 100644 --- a/PVE/QemuMigrate.pm +++ b/PVE/QemuMigrate.pm @@ -158,15 +158,13 @@ sub target_storage_check_available { my ($self, $store

[pve-devel] [PATCH proxmox-firewall 2/2] firewall: apply `nt_conntrack_allow_invalid` option to host table

2025-02-20 Thread Hannes Laimer
... on all chains that check for ct state. Since we support this option, we should also use it in our firewall rule generation. This is a follow-up to 64dc344b ("firewall: apply `nt_conntrack_allow_invalid` option to guest table") Signed-off-by: Hannes Laimer --- .../resources/proxmox-firewa

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

2025-02-20 Thread Fiona Ebner
Rest of the qemu-server patches also LGTM from a glance, but I know they'll change in v3. ___ 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 v2 14/15] api: migrate_vm: use volume content type assertion helpers

2025-02-20 Thread Fiona Ebner
Am 11.02.25 um 17:08 schrieb Daniel Kral: > diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm > index ed5ede30..827e54b7 100644 > --- a/PVE/QemuMigrate.pm > +++ b/PVE/QemuMigrate.pm > @@ -158,15 +158,13 @@ sub target_storage_check_available { > my ($self, $storecfg, $targetsid, $volid) = @_

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

2025-02-20 Thread Fiona Ebner
Am 11.02.25 um 17:08 schrieb Daniel Kral: > @@ -552,9 +554,9 @@ my sub create_disks : prototype($$$) { > } elsif ($ds eq 'tpmstate0') { > # swtpm can only use raw volumes, and uses a fixed size > $size = > PVE::Tools::convert_size(PVE::Qemu

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

2025-02-20 Thread Fiona Ebner
Am 11.02.25 um 17:08 schrieb 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

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

2025-02-20 Thread Fiona Ebner
Am 11.02.25 um 17:08 schrieb Daniel Kral: > @@ -1106,8 +1104,7 @@ __PACKAGE__->register_method({ > if (scalar(keys $param->%*) > 0) { > &$resolve_cdrom_alias($param); > > - &$check_storage_access( > - $rpcenv, $authuser, $storecfg, $vmid, $param, $storage, > $

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

2025-02-20 Thread Fiona Ebner
Am 11.02.25 um 17:08 schrieb 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

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

2025-02-20 Thread Fiona Ebner
Am 11.02.25 um 17:08 schrieb 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 Reviewed-by: Fiona Ebner > --- > changes since v1: > - new! > > PVE/API2/Qemu.pm | 2 +- > 1 fil

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

2025-02-20 Thread Fiona Ebner
Am 11.02.25 um 17:08 schrieb 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 `

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

2025-02-20 Thread Fiona Ebner
Am 11.02.25 um 17:08 schrieb 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 a

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

2025-02-20 Thread Fiona Ebner
Am 11.02.25 um 17:08 schrieb 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

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

2025-02-20 Thread Fiona Ebner
Am 20.02.25 um 13:33 schrieb Daniel Kral: > On 2/20/25 11:48, Fiona Ebner wrote: >> Am 20.02.25 um 11:40 schrieb Fabian Grünbichler: >>> Quoting Fiona Ebner (2025-02-20 10:03:09) Hmm, vdisk_alloc() is only for allocating guest and import images. So I think the other content types should b

Re: [pve-devel] SPAM: [PATCH pve-network v2 2/7] ipam: nautobot: implement plain prefix allocation

2025-02-20 Thread Hannes Dürr
On 1/8/25 13:15, Lou Lecrivain wrote: add support for subnet allocation without ranges, where it was previously not supported. Signed-off-by: lou lecrivain --- src/PVE/Network/SDN/Ipams/NautobotPlugin.pm | 68 + 1 file changed, 68 insertions(+) diff --git a/src/PVE/Net

Re: [pve-devel] SPAM: [PATCH pve-network v2 5/7] ipam: nautobot: add checks for prefix deletion

2025-02-20 Thread Hannes Dürr
On 1/8/25 13:15, Lou Lecrivain wrote: check that prefix/subnet is empty (only gateway IPs should remain) before deletion. Signed-off-by: lou lecrivain --- src/PVE/Network/SDN/Ipams/NautobotPlugin.pm | 60 - 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/

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

2025-02-20 Thread Fiona Ebner
Rest of the container patches also LGTM from a glance, but I know they'll change in v3. ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Re: [pve-devel] SPAM: [PATCH pve-network v2 4/7] ipam: nautobot: base plugin + enhance errors

2025-02-20 Thread Hannes Dürr
On 1/8/25 13:15, Lou Lecrivain wrote: added error handling in helpers Signed-off-by: lou lecrivain --- src/PVE/Network/SDN/Ipams/NautobotPlugin.pm | 126 ++-- 1 file changed, 113 insertions(+), 13 deletions(-) diff --git a/src/PVE/Network/SDN/Ipams/NautobotPlugin.pm b/src

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

2025-02-20 Thread Fiona Ebner
Am 11.02.25 um 17:08 schrieb 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

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

2025-02-20 Thread Fiona Ebner
Am 11.02.25 um 17:08 schrieb 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 Reviewed-by: Fiona Ebner > --- > changes since v1: >

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

2025-02-20 Thread Fiona Ebner
Am 11.02.25 um 17:08 schrieb Daniel Kral: > Signed-off-by: Daniel Kral Reviewed-by: Fiona Ebner > --- > 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 1

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

2025-02-20 Thread Fiona Ebner
Am 20.02.25 um 13:53 schrieb Daniel Kral: > On 2/20/25 10:36, Fiona Ebner wrote: >> Not necessarily? What about qm showcmd ? Question is, do we want to >> do storage-related checks there or not? If we already check for the >> content type, I don't see much reason not to check for storage being >> e

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

2025-02-20 Thread Daniel Kral
On 2/20/25 10:36, Fiona Ebner wrote: Not necessarily? What about qm showcmd ? Question is, do we want to do storage-related checks there or not? If we already check for the content type, I don't see much reason not to check for storage being enabled either. It could be seen as surprising, becaus

[pve-devel] [PATCH 1/3] pmxcfs: Use g_string_append when appropriate

2025-02-20 Thread Maximiliano Sandoval
g_string_append_printf should only be used when there is something to format. Signed-off-by: Maximiliano Sandoval --- Some micro optimizations for GStrings usage. The following script can be used to verify the claim that the replacements are drop-in: ```c /* test.c */ #include int main () {

[pve-devel] [PATCH 3/3] pmxcfg: use g_string_append_c when appropiate

2025-02-20 Thread Maximiliano Sandoval
Signed-off-by: Maximiliano Sandoval --- src/pmxcfs/logger.c | 2 +- src/pmxcfs/status.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pmxcfs/logger.c b/src/pmxcfs/logger.c index 0be4be6..d6e281f 100644 --- a/src/pmxcfs/logger.c +++ b/src/pmxcfs/logger.c @@ -201,7 +2

[pve-devel] [PATCH 2/3] pmxcfs: use g_string_assign when appropiate

2025-02-20 Thread Maximiliano Sandoval
Signed-off-by: Maximiliano Sandoval --- src/pmxcfs/status.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pmxcfs/status.c b/src/pmxcfs/status.c index e76c150..7533057 100644 --- a/src/pmxcfs/status.c +++ b/src/pmxcfs/status.c @@ -973,7 +973,7 @@ cfs_create_guest_conf_pro

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

2025-02-20 Thread Daniel Kral
On 2/20/25 11:48, Fiona Ebner wrote: Am 20.02.25 um 11:40 schrieb Fabian Grünbichler: Quoting Fiona Ebner (2025-02-20 10:03:09) Hmm, vdisk_alloc() is only for allocating guest and import images. So I think the other content types should be prohibited here (can still be extended later if it ever

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

2025-02-20 Thread Fiona Ebner
I'd change the title to "alloc disk: fix content type check for ZFS storages" because the check was missing for that branch ;) The commit message should mention that there are already earlier checks for the create operations. Moving a volume to a ZFS storage without 'rootdir' content type was stil

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

2025-02-20 Thread Fiona Ebner
Am 20.02.25 um 11:40 schrieb Fabian Grünbichler: > Quoting Fiona Ebner (2025-02-20 10:03:09) >> Am 11.02.25 um 17:07 schrieb 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 bef

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

2025-02-20 Thread Fabian Grünbichler
Quoting Fiona Ebner (2025-02-20 10:03:09) > Am 11.02.25 um 17:07 schrieb 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: D

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

2025-02-20 Thread Fiona Ebner
Am 11.02.25 um 17:08 schrieb 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 btrf

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

2025-02-20 Thread Fiona Ebner
Am 20.02.25 um 10:14 schrieb Daniel Kral: > On 2/19/25 15:54, Fiona Ebner wrote: >> Am 11.02.25 um 17:07 schrieb Daniel Kral: >>> +sub assert_content_type_supported : prototype($$$;$) { >>> +    my ($cfg, $storeid, $content_type, $node) = @_; >>> + >>> +    my $scfg = storage_config($cfg, $storeid,

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

2025-02-20 Thread Daniel Kral
On 2/20/25 09:49, Fiona Ebner wrote: Am 11.02.25 um 17:07 schrieb 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

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

2025-02-20 Thread Daniel Kral
On 2/19/25 16:16, Fiona Ebner wrote: Am 11.02.25 um 17:07 schrieb 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 he

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

2025-02-20 Thread Fiona Ebner
Am 11.02.25 um 17:08 schrieb Daniel Kral: > Factor out the common read-only variables to allow the second call to > `storage_check_enabled` to be below 100 characters. > Just wanted to say in general, there is nothing wrong with using $self->{node} either, especially if it's only used a single ti

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

2025-02-20 Thread Daniel Kral
On 2/19/25 15:54, Fiona Ebner wrote: Am 11.02.25 um 17:07 schrieb 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 --- c

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

2025-02-20 Thread Fiona Ebner
Am 11.02.25 um 17:07 schrieb 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 assertio

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

2025-02-20 Thread Fiona Ebner
Am 11.02.25 um 17:07 schrieb 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: