[pve-devel] vma extract force flag
Would the development team consider a patch like below to add a force flag to the vma extract command? diff --git a/debian/patches/pve/0027-PVE-Backup-add-vma-backup-format-code.patch b/debian/patches/pve/0027-PVE-Backup-add-vma-backup-format-code.patch index 1620a56..931bebc 100644 --- a/debian/patches/pve/0027-PVE-Backup-add-vma-backup-format-code.patch +++ b/debian/patches/pve/0027-PVE-Backup-add-vma-backup-format-code.patch @@ -1797,7 +1797,7 @@ index 00..347f6283ca +"vma list \n" +"vma config [-c config]\n" +"vma create [-c config] pathname ...\n" -+"vma extract [-d ] [-r ] \n" ++"vma extract [-d ] [-r ] [-f] \n" +"vma verify [-v]\n" +; + @@ -1939,6 +1939,7 @@ index 00..347f6283ca +{ +int c, ret = 0; +int verbose = 0; ++int force = 0; +const char *filename; +const char *dirname; +const char *readmap = NULL; @@ -1957,6 +1958,9 @@ index 00..347f6283ca +case 'd': +drive_list = g_strsplit(optarg, ",", 254); +break; ++case 'f': ++force = 1; ++break; +case 'r': +readmap = optarg; +break; @@ -1982,7 +1986,7 @@ index 00..347f6283ca +g_error("%s", error_get_pretty(errp)); +} + -+if (mkdir(dirname, 0777) < 0) { ++if (mkdir(dirname, 0777) < 0 && !force) { +g_error("unable to create target directory %s - %s", +dirname, g_strerror(errno)); +} @@ -2100,7 +2104,13 @@ index 00..347f6283ca +VmaDeviceInfo *di = vma_reader_get_device_info(vmar, i); +if (di && (strcmp(di->devname, "vmstate") == 0)) { +char *statefn = g_strdup_printf("%s/vmstate.bin", dirname); -+vmstate_fd = open(statefn, O_WRONLY|O_CREAT|O_EXCL, 0644); ++int open_flags =O_WRONLY|O_CREAT; ++if(force) { ++open_flags |= O_TRUNC; ++}else{ ++open_flags |= O_EXCL; ++} ++vmstate_fd = open(statefn, open_flags, 0644); +if (vmstate_fd < 0) { +g_error("create vmstate file '%s' failed - %s", statefn, +g_strerror(errno)); I would like to keep extracted backups on an NFS server backed with ZFS and retain the benefits of differential snapshots and it would be helpful to have the vma extract replace the previous backups directly. Thank you for your consideration. Praise the Lord! Ben Dailey Associate Technology Director Bluffton-Harrison MSD bdai...@bhmsd.org ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
Re: [pve-devel] [PATCH docs] network: override device names: include Type=ether in link file
Am 24/04/2024 um 18:55 schrieb Friedrich Weber: > Mention that the systemd link file should contain `Type=ether`, to > make sure it only applies to Ethernet devices and does not ever apply > to e.g. bridges or bonds which inherit the MAC address of the Ethernet > device. Reported in the forum [0]. > > [0] https://forum.proxmox.com/threads/144557/post-656188 > > Fixes: 96c0261 ("fix #4847: network: extend section on interface naming > scheme") > Signed-off-by: Friedrich Weber > --- > pve-network.adoc | 4 > 1 file changed, 4 insertions(+) > > diff --git a/pve-network.adoc b/pve-network.adoc > index ef586ec..8e5fa1c 100644 > --- a/pve-network.adoc > +++ b/pve-network.adoc > @@ -170,6 +170,9 @@ identifier. A link file has two sections: `[Match]` > determines which interfaces > the file will apply to; `[Link]` determines how these interfaces should be > configured, including their naming. > > +The `[Match]` section should contain `Type=ether`, to make sure it only > matches > +Ethernet devices. With have some users with different uplinks though, and while that is rather rare, I'd still mention this here in passing, so that users know about the existence of wlan or wwan, maybe even just in a footnote with a reference to: https://www.freedesktop.org/software/systemd/man/latest/systemd.link.html#Type= > + > To assign a name to a particular network device, you need a way to uniquely > and > permanently identify that device in the `[Match]` section. One possibility is > to match the device's MAC address using the `MACAddress` option, as it is > @@ -183,6 +186,7 @@ the following contents: > > [Match] > MACAddress=aa:bb:cc:dd:ee:ff > +Type=ether > > [Link] > Name=enwan0 ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] applied: [PATCH proxmox-firewall] fix #5410: config: fix naming scheme for names in firewall config
Am 24/04/2024 um 18:15 schrieb Stefan Hanreich: > This should bring the allowed names on par with the pve-firewall > naming scheme [1]. > > [1] > https://git.proxmox.com/?p=pve-firewall.git;a=blob;f=src/PVE/Firewall.pm;h=0abfeccffc94cec940760e69a894e392dc33f151;hb=29b48c381d14bf425232dc65c9c0d18f95c8f222#l51 > > Signed-off-by: Stefan Hanreich > --- > proxmox-ve-config/src/firewall/parse.rs | 8 +++- > proxmox-ve-config/src/firewall/types/alias.rs | 14 ++ > 2 files changed, 21 insertions(+), 1 deletion(-) > > applied, thanks! ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] [PATCH docs] network: override device names: include Type=ether in link file
Mention that the systemd link file should contain `Type=ether`, to make sure it only applies to Ethernet devices and does not ever apply to e.g. bridges or bonds which inherit the MAC address of the Ethernet device. Reported in the forum [0]. [0] https://forum.proxmox.com/threads/144557/post-656188 Fixes: 96c0261 ("fix #4847: network: extend section on interface naming scheme") Signed-off-by: Friedrich Weber --- pve-network.adoc | 4 1 file changed, 4 insertions(+) diff --git a/pve-network.adoc b/pve-network.adoc index ef586ec..8e5fa1c 100644 --- a/pve-network.adoc +++ b/pve-network.adoc @@ -170,6 +170,9 @@ identifier. A link file has two sections: `[Match]` determines which interfaces the file will apply to; `[Link]` determines how these interfaces should be configured, including their naming. +The `[Match]` section should contain `Type=ether`, to make sure it only matches +Ethernet devices. + To assign a name to a particular network device, you need a way to uniquely and permanently identify that device in the `[Match]` section. One possibility is to match the device's MAC address using the `MACAddress` option, as it is @@ -183,6 +186,7 @@ the following contents: [Match] MACAddress=aa:bb:cc:dd:ee:ff +Type=ether [Link] Name=enwan0 -- 2.39.2 ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] [PATCH proxmox-firewall] fix #5410: config: fix naming scheme for names in firewall config
This should bring the allowed names on par with the pve-firewall naming scheme [1]. [1] https://git.proxmox.com/?p=pve-firewall.git;a=blob;f=src/PVE/Firewall.pm;h=0abfeccffc94cec940760e69a894e392dc33f151;hb=29b48c381d14bf425232dc65c9c0d18f95c8f222#l51 Signed-off-by: Stefan Hanreich --- proxmox-ve-config/src/firewall/parse.rs | 8 +++- proxmox-ve-config/src/firewall/types/alias.rs | 14 ++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/proxmox-ve-config/src/firewall/parse.rs b/proxmox-ve-config/src/firewall/parse.rs index 93cf014..7bf00c0 100644 --- a/proxmox-ve-config/src/firewall/parse.rs +++ b/proxmox-ve-config/src/firewall/parse.rs @@ -2,6 +2,8 @@ use std::fmt; use anyhow::{bail, format_err, Error}; +const NAME_SPECIAL_CHARACTERS: [u8; 2] = [b'-', b'_']; + /// Parses out a "name" which can be alphanumeric and include dashes. /// /// Returns `None` if the name part would be empty. @@ -16,10 +18,14 @@ use anyhow::{bail, format_err, Error}; /// assert_eq!(match_name(" someremainder"), None); /// ``` pub fn match_name(line: ) -> Option<(, )> { +if !line.starts_with(|c: char| c.is_ascii_alphabetic()) { +return None; +} + let end = line .as_bytes() .iter() -.position(|| !(b.is_ascii_alphanumeric() || b == b'-')); +.position(|| !(b.is_ascii_alphanumeric() || NAME_SPECIAL_CHARACTERS.contains())); let (name, rest) = match end { Some(end) => line.split_at(end), diff --git a/proxmox-ve-config/src/firewall/types/alias.rs b/proxmox-ve-config/src/firewall/types/alias.rs index 43c6486..e6aa30d 100644 --- a/proxmox-ve-config/src/firewall/types/alias.rs +++ b/proxmox-ve-config/src/firewall/types/alias.rs @@ -147,6 +147,20 @@ impl FromStr for Alias { mod tests { use super::*; +#[test] +fn test_parse_alias() { +for alias in [ +"local_network 10.0.0.0/32", +"test-_123-___-a 10.0.0.1/32", +] { +alias.parse::().expect("valid alias"); +} + +for alias in ["-- 10.0.0.1/32", "0asd 10.0.0.1/32", "__test 10.0.0.0/32"] { +alias.parse::().expect_err("invalid alias"); +} +} + #[test] fn test_parse_alias_name() { for name in ["dc/proxmox_123", "guest/proxmox-123"] { -- 2.39.2 ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] Proxmox VE 8.2 released!
Hi All, We are excited to announce that our latest software version 8.2 for Proxmox Virtual Environment is now available for download. This release is based on Debian 12.5 "Bookworm" but uses a newer Linux kernel 6.8, QEMU 8.1, LXC 6.0, Ceph 18.2 and ZFS 2.2. We have an import wizard to migrate VMware ESXi guests to Proxmox VE. The integrated VM importer is presented as storage plugin for native integration into the API and web-based user interface. You can use this to import the VM as a whole, with most of the original configuration settings mapped to Proxmox VE's configuration model. With the new ‘proxmox-auto-install-assistant’ tool you can fully automate the setup process on bare-metal, rapidly deploying Proxmox VE hosts without the need for manual access to the systems. Proxmox VE 8.2 comes full of new features and highlights -Debian 12.5 (“Bookworm”), but uses a newer Linux kernel 6.8 as stable default - Latest versions of QEMU 8.1, LXC 6.0, Ceph 18.2 - Import wizard to migrate VMware ESXi guests to Proxmox VE - A new tool for automated installation from the ISO to bare-metal servers - Backup fleecing feature implementation: decouple slower backup storage from the VM performance - Firewall modernization with nftables (tech preview) - Countless GUI and API improvements. As always, we have included countless bugfixes and improvements on many places; see the release notes for all details. Release notes https://pve.proxmox.com/wiki/Roadmap Press release https://www.proxmox.com/en/news/press-releases/ Video tutorial https://www.proxmox.com/en/services/videos/proxmox-virtual-environment/whats-new-in-proxmox-ve-8-2 Download https://www.proxmox.com/en/downloads Alternate ISO download: https://enterprise.proxmox.com/iso Documentation https://pve.proxmox.com/pve-docs Community Forum https://forum.proxmox.com Bugtracker https://bugzilla.proxmox.com Source code https://git.proxmox.com We want to thank everyone who has contributed to this release, whether it's through code contributions, bug reports, or simply using and providing feedback on the software. As always, we welcome any feedback or bug reports you may have. Thanks again for your support, and happy virtualization! FAQ Q: Can I upgrade latest Proxmox VE 7 to 8 with apt? A: Yes, please follow the upgrade instructions on https://pve.proxmox.com/wiki/Upgrade_from_7_to_8 Q: Can I upgrade an 8.0 installation to the stable 8.2 via apt? A: Yes, upgrading from is possible via apt and GUI. Q: Can I install Proxmox VE 8.2 on top of Debian 12 "Bookworm"? A: Yes, see https://pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_12_Bookworm Q: Can I upgrade my Proxmox VE 7.4 cluster with Ceph Pacific to Proxmox VE 8.2 and to Ceph Reef? A: This is a three-step process. First, you have to upgrade Ceph from Pacific to Quincy, and afterwards you can then upgrade Proxmox VE from 7.4 to 8.2. As soon as you run Proxmox VE 8.2, you can upgrade Ceph to Reef. There are a lot of improvements and changes, so please follow exactly the upgrade documentation: https://pve.proxmox.com/wiki/Ceph_Pacific_to_Quincy https://pve.proxmox.com/wiki/Upgrade_from_7_to_8 https://pve.proxmox.com/wiki/Ceph_Quincy_to_Reef Q: Where can I get more information about feature updates? A: Check the https://pve.proxmox.com/wiki/Roadmap, https://forum.proxmox.com/, the https://lists.proxmox.com/, and/or subscribe to our https://www.proxmox.com/en/news. -- -- Best Regards, Martin Maurer Proxmox VE project leader ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] [PATCH pve-network] fix #5398: vxlan: only ipv4 is currently supported
--- Begin Message --- ifupdown2 only support ipv4 (could be fixed) frr/evpn: don't support ipv6 at all Signed-off-by: Alexandre Derumier --- src/PVE/Network/SDN/Controllers/EvpnPlugin.pm | 2 +- src/PVE/Network/SDN/Zones/VxlanPlugin.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm index c245ea2..21ff3f1 100644 --- a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm +++ b/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm @@ -28,7 +28,7 @@ sub properties { }, peers => { description => "peers address list.", - type => 'string', format => 'ip-list' + type => 'string', format => 'ipv4-list' }, }; } diff --git a/src/PVE/Network/SDN/Zones/VxlanPlugin.pm b/src/PVE/Network/SDN/Zones/VxlanPlugin.pm index b16f0c3..7e8b90b 100644 --- a/src/PVE/Network/SDN/Zones/VxlanPlugin.pm +++ b/src/PVE/Network/SDN/Zones/VxlanPlugin.pm @@ -27,7 +27,7 @@ sub properties { return { 'peers' => { description => "peers address list.", -type => 'string', format => 'ip-list' +type => 'string', format => 'ipv4-list' }, 'vxlan-port' => { description => "Vxlan tunnel udp port (default 4789).", -- 2.39.2 --- End Message --- ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] applied: [PATCH] auto install assistant: fix newline before ':'
Am 24/04/2024 um 11:02 schrieb Dominik Csapak: > this belongs after the ':' otherwise the output looks weird: > > [..] can be > : * integrated into [..] > * needs to be [..] > > Signed-off-by: Dominik Csapak > --- > proxmox-auto-install-assistant/src/main.rs | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > applied, thanks! ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] [PATCH manager] ui: fix align mode of two column container
'stretch' is most often the wrong value, as that will stretch everything, to the height of the whole container, including fields. That is not desirable, since fields look not good when stretched this way (e.g. the controls are not correctly aligned). To fix it, simply set it to 'begin'. Signed-off-by: Dominik Csapak --- noticed that the 'zstd thread' field was strechted in the backup advanced panel when using the german language... www/manager6/container/TwoColumnContainer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/manager6/container/TwoColumnContainer.js b/www/manager6/container/TwoColumnContainer.js index e8e5fca9..b7bf735a 100644 --- a/www/manager6/container/TwoColumnContainer.js +++ b/www/manager6/container/TwoColumnContainer.js @@ -10,7 +10,7 @@ Ext.define('PVE.container.TwoColumnContainer', { layout: { type: 'hbox', - align: 'stretch', + align: 'begin', }, // The default ratio of the start widget. It an be an integer or a floating point number -- 2.39.2 ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] [PATCH v2 manager] api: add proxmox-firewall to versions pkg list
Signed-off-by: Mira Limbeck --- v2: - add `api: ` prefix to commit msg PVE/API2/APT.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/PVE/API2/APT.pm b/PVE/API2/APT.pm index 19f0baca0..4095e790f 100644 --- a/PVE/API2/APT.pm +++ b/PVE/API2/APT.pm @@ -774,6 +774,7 @@ __PACKAGE__->register_method({ libpve-network-perl openvswitch-switch proxmox-backup-file-restore + proxmox-firewall proxmox-kernel-helper proxmox-offline-mirror-helper pve-esxi-import-tools -- 2.39.2 ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
Re: [pve-devel] [PATCH manager] add proxmox-firewall to versions list
On 4/24/24 13:20, Mira Limbeck wrote: > Signed-off-by: Mira Limbeck > --- > PVE/API2/APT.pm | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/PVE/API2/APT.pm b/PVE/API2/APT.pm > index 19f0baca0..4095e790f 100644 > --- a/PVE/API2/APT.pm > +++ b/PVE/API2/APT.pm > @@ -774,6 +774,7 @@ __PACKAGE__->register_method({ > libpve-network-perl > openvswitch-switch > proxmox-backup-file-restore > + proxmox-firewall > proxmox-kernel-helper > proxmox-offline-mirror-helper > pve-esxi-import-tools Sorry, this should have `api:` as prefix of the commit message, i'll send a v2 including that ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] [PATCH manager] add proxmox-firewall to versions list
Signed-off-by: Mira Limbeck --- PVE/API2/APT.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/PVE/API2/APT.pm b/PVE/API2/APT.pm index 19f0baca0..4095e790f 100644 --- a/PVE/API2/APT.pm +++ b/PVE/API2/APT.pm @@ -774,6 +774,7 @@ __PACKAGE__->register_method({ libpve-network-perl openvswitch-switch proxmox-backup-file-restore + proxmox-firewall proxmox-kernel-helper proxmox-offline-mirror-helper pve-esxi-import-tools -- 2.39.2 ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] [PATCH manager] ui: fix pbs storage edit reset behavior
two similar things to fix here: * the 'crypt-allow-edit' field was not submitted, but it's value was only ever set with a bind, so a reset always set it to it's default 'false' value (disabling the radio buttons, even when it was not visible) * the initial value of the 'keep' variant of the radiofield was decided only from 'isCreate' (via the 'checked' cbind), but should have been decided by whether there was an encryption key or not. both are fixed by setting the values in the 'setValue' method explicitly Signed-off-by: Dominik Csapak --- www/manager6/storage/PBSEdit.js | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/www/manager6/storage/PBSEdit.js b/www/manager6/storage/PBSEdit.js index 70dc42f5..95bf0a50 100644 --- a/www/manager6/storage/PBSEdit.js +++ b/www/manager6/storage/PBSEdit.js @@ -220,11 +220,14 @@ Ext.define('PVE.panel.PBSEncryptionKeyTab', { // old key without FP values['crypt-key-fp'] = icon + gettext('Active'); } + values.cryptMode = 'keep'; + values['crypt-allow-edit'] = false; } else { values['crypt-key-fp'] = gettext('None'); let cryptModeNone = me.down('radiofield[inputValue=none]'); cryptModeNone.setBoxLabel(gettext('Do not encrypt backups')); - cryptModeNone.setValue(true); + values.cryptMode = 'none'; + values['crypt-allow-edit'] = true; } vm.set('keepCryptVisible', !!cryptKeyInfo); vm.set('allowEdit', !cryptKeyInfo); @@ -272,7 +275,6 @@ Ext.define('PVE.panel.PBSEncryptionKeyTab', { padding: '0 0 0 25', cbind: { hidden: '{isCreate}', - checked: '{!isCreate}', }, bind: { hidden: '{!keepCryptVisible}', -- 2.39.2 ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] applied: [PATCH proxmox-i18n] update German translations
Am 24/04/2024 um 11:14 schrieb Max Carrara: > Signed-off-by: Max Carrara > --- > de.po | 220 -- > 1 file changed, 107 insertions(+), 113 deletions(-) > > applied, thanks! ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] applied: [PATCH qemu-server] fix get_cpu_bitness always reverting to default cpu type
Am 24.04.24 um 11:14 schrieb Filip Schauer: > This fixes the broken prevention of starting a VM with a 32-bit CPU > using a 64-bit OVMF (UEFI) BIOS. > > Signed-off-by: Filip Schauer applied, thanks! Added a "Fixes" trailer and a prefix to the commit title. ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] applied: [PATCH pve-installer] answer: perform basic input validation for keyboard
Am 24/04/2024 um 10:48 schrieb Christian Ebner: > Currently it is possible to validate and create an iso with an > invalid keyboad layout, only failing later during installation. > > Add a basic check for correct keyboard layout by defining an enum > with allowed variants. > > Signed-off-by: Christian Ebner > --- > proxmox-auto-installer/src/answer.rs | 39 +++- > proxmox-auto-installer/src/utils.rs | 8 -- > 2 files changed, 44 insertions(+), 3 deletions(-) > > applied, with a follow-up to use serde_plain::derive_display_from_serialize to derive the Display impl, thanks! btw. if we probably want to use the same perl code that generates the valid list for the installer environment to output that at build time in such a way that we can source it from rust on build. ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
Re: [pve-devel] [PATCH pve-installer] answer: perform basic input validation for keyboard
On 4/24/24 11:20, Stoiko Ivanov wrote: On Wed, 24 Apr 2024 10:48:50 +0200 Christian Ebner wrote: Currently it is possible to validate and create an iso with an invalid keyboad layout, only failing later during installation. Add a basic check for correct keyboard layout by defining an enum with allowed variants. Signed-off-by: Christian Ebner --- proxmox-auto-installer/src/answer.rs | 39 +++- proxmox-auto-installer/src/utils.rs | 8 -- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/proxmox-auto-installer/src/answer.rs b/proxmox-auto-installer/src/answer.rs index a6cf8b7..af7485a 100644 --- a/proxmox-auto-installer/src/answer.rs +++ b/proxmox-auto-installer/src/answer.rs @@ -23,7 +23,7 @@ pub struct Answer { pub struct Global { pub country: String, pub fqdn: Fqdn, -pub keyboard: String, +pub keyboard: KeyboardLayout, pub mailto: String, pub timezone: String, pub root_password: String, @@ -270,3 +270,40 @@ pub struct BtrfsOptions { pub hdsize: Option, pub raid: Option, } + +#[derive(Clone, Deserialize, Serialize, Debug, PartialEq)] +#[serde(rename_all = "kebab-case", deny_unknown_fields)] +pub enum KeyboardLayout { +De, +DeCh, +Dk, +EnGb, +EnUs, +Es, +Fi, +Fr, +FrBe, +FrCa, +FrCh, +Hu, +Is, +It, +Jp, +Lt, +Mk, +Nl, +No, +Pl, +Pt, +PtBr, +Se, +Si, +Tr, +} + quickly looked at that as well yesterday - and I also ran into the issue that we get the relevant data in the installer itself (where actual validation takes place). with the target to have the auto-install-assistant available as single static binary - I think your approach works well enough - the one thing that might be an improvment is to get the data from country.dat (a build-artefact output from country.pl based on /usr/share/iso-codes/json/iso_3166-1.json ) at build-time and embed it in the binary. (but I did not get around to checking how this is done sensibly in rust) Agreed, this would however still produce ISOs with possible inconsistent variants, if the `country.dat` in the ISO and the one used for compilation of the binary are out of sync (which probably will happen not that often). additionally we could verify the country selection as well with that. +impl std::fmt::Display for KeyboardLayout { +fn fmt(, f: std::fmt::Formatter<'_>) -> std::fmt::Result { +let keyboard_layout = serde_json::to_value(self).unwrap().to_string(); +write!(f, "{}", keyboard_layout.trim_matches('\"')) +} +} diff --git a/proxmox-auto-installer/src/utils.rs b/proxmox-auto-installer/src/utils.rs index 7e1366c..202ad41 100644 --- a/proxmox-auto-installer/src/utils.rs +++ b/proxmox-auto-installer/src/utils.rs @@ -281,7 +281,11 @@ pub fn verify_locale_settings(answer: , locales: ) -> Result<( { bail!("country code '{}' is not valid", ); } -if !locales.kmap.keys().any(|i| i == ) { +if !locales +.kmap +.keys() +.any(|i| i == _string()) +{ bail!("keyboard layout '{}' is not valid", ); } @@ -328,7 +332,7 @@ pub fn parse_answer( country: answer.global.country.clone(), timezone: answer.global.timezone.clone(), -keymap: answer.global.keyboard.clone(), +keymap: answer.global.keyboard.to_string(), password: answer.global.root_password.clone(), mailto: answer.global.mailto.clone(), ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
Re: [pve-devel] [PATCH pve-installer] answer: perform basic input validation for keyboard
On Wed, 24 Apr 2024 10:48:50 +0200 Christian Ebner wrote: > Currently it is possible to validate and create an iso with an > invalid keyboad layout, only failing later during installation. > > Add a basic check for correct keyboard layout by defining an enum > with allowed variants. > > Signed-off-by: Christian Ebner > --- > proxmox-auto-installer/src/answer.rs | 39 +++- > proxmox-auto-installer/src/utils.rs | 8 -- > 2 files changed, 44 insertions(+), 3 deletions(-) > > diff --git a/proxmox-auto-installer/src/answer.rs > b/proxmox-auto-installer/src/answer.rs > index a6cf8b7..af7485a 100644 > --- a/proxmox-auto-installer/src/answer.rs > +++ b/proxmox-auto-installer/src/answer.rs > @@ -23,7 +23,7 @@ pub struct Answer { > pub struct Global { > pub country: String, > pub fqdn: Fqdn, > -pub keyboard: String, > +pub keyboard: KeyboardLayout, > pub mailto: String, > pub timezone: String, > pub root_password: String, > @@ -270,3 +270,40 @@ pub struct BtrfsOptions { > pub hdsize: Option, > pub raid: Option, > } > + > +#[derive(Clone, Deserialize, Serialize, Debug, PartialEq)] > +#[serde(rename_all = "kebab-case", deny_unknown_fields)] > +pub enum KeyboardLayout { > +De, > +DeCh, > +Dk, > +EnGb, > +EnUs, > +Es, > +Fi, > +Fr, > +FrBe, > +FrCa, > +FrCh, > +Hu, > +Is, > +It, > +Jp, > +Lt, > +Mk, > +Nl, > +No, > +Pl, > +Pt, > +PtBr, > +Se, > +Si, > +Tr, > +} > + quickly looked at that as well yesterday - and I also ran into the issue that we get the relevant data in the installer itself (where actual validation takes place). with the target to have the auto-install-assistant available as single static binary - I think your approach works well enough - the one thing that might be an improvment is to get the data from country.dat (a build-artefact output from country.pl based on /usr/share/iso-codes/json/iso_3166-1.json ) at build-time and embed it in the binary. (but I did not get around to checking how this is done sensibly in rust) additionally we could verify the country selection as well with that. > +impl std::fmt::Display for KeyboardLayout { > +fn fmt(, f: std::fmt::Formatter<'_>) -> std::fmt::Result { > +let keyboard_layout = > serde_json::to_value(self).unwrap().to_string(); > +write!(f, "{}", keyboard_layout.trim_matches('\"')) > +} > +} > diff --git a/proxmox-auto-installer/src/utils.rs > b/proxmox-auto-installer/src/utils.rs > index 7e1366c..202ad41 100644 > --- a/proxmox-auto-installer/src/utils.rs > +++ b/proxmox-auto-installer/src/utils.rs > @@ -281,7 +281,11 @@ pub fn verify_locale_settings(answer: , locales: > ) -> Result<( > { > bail!("country code '{}' is not valid", ); > } > -if !locales.kmap.keys().any(|i| i == ) { > +if !locales > +.kmap > +.keys() > +.any(|i| i == _string()) > +{ > bail!("keyboard layout '{}' is not valid", ); > } > > @@ -328,7 +332,7 @@ pub fn parse_answer( > > country: answer.global.country.clone(), > timezone: answer.global.timezone.clone(), > -keymap: answer.global.keyboard.clone(), > +keymap: answer.global.keyboard.to_string(), > > password: answer.global.root_password.clone(), > mailto: answer.global.mailto.clone(), ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] [PATCH proxmox-i18n] update German translations
Signed-off-by: Max Carrara --- de.po | 220 -- 1 file changed, 107 insertions(+), 113 deletions(-) diff --git a/de.po b/de.po index cc60442..40bb8fa 100644 --- a/de.po +++ b/de.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: proxmox translations\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: Mon Apr 22 19:58:29 2024\n" -"PO-Revision-Date: 2023-11-22 16:10+0100\n" +"PO-Revision-Date: 2024-04-24 11:12+0200\n" "Last-Translator: Proxmox Support Team \n" "Language-Team: German\n" "Language: de\n" @@ -173,11 +173,11 @@ msgstr "Berechtigungen" #: pve-manager/www/manager6/lxc/DeviceEdit.js:88 msgid "Access Mode in CT" -msgstr "" +msgstr "Zugriffsrechte in CT" #: pve-manager/www/manager6/lxc/DeviceEdit.js:95 msgid "Access mode has to be an octal number" -msgstr "" +msgstr "Zugriffsrechte müssen als Oktalzahl angegeben werden" #: proxmox-widget-toolkit/src/window/ACMEAccount.js:154 #: pmg-gui/js/LDAPConfig.js:248 pmg-gui/js/LDAPUserEditor.js:43 @@ -398,11 +398,11 @@ msgstr "Als Storage hinzufügen" #: proxmox-backup/www/form/GroupFilter.js:388 msgid "Add exclude" -msgstr "" +msgstr "Ausschluss hinzufügen" #: proxmox-backup/www/form/GroupFilter.js:333 msgid "Add include" -msgstr "" +msgstr "Einschluss hinzufügen" #: pve-manager/www/manager6/tree/ResourceMapTree.js:337 msgid "Add new host mapping for '{0}'" @@ -717,9 +717,8 @@ msgid "Are you sure you want to remove tape '{0}' ?" msgstr "Möchten Sie das Band {0} wirklich entfernen?" #: proxmox-widget-toolkit/src/panel/Certificates.js:248 -#, fuzzy msgid "Are you sure you want to remove the certificate" -msgstr "Möchten Sie das {0} Zertifikat wirklich entfernen?" +msgstr "Möchten Sie das Zertifikat wirklich entfernen?" #: proxmox-widget-toolkit/src/panel/Certificates.js:244 msgid "Are you sure you want to remove the certificate used for {0}" @@ -1018,6 +1017,8 @@ msgstr "Backup-Snapshots auf '{0}'" msgid "" "Backup write cache that can reduce IO pressure inside guests (VMs only)." msgstr "" +"Backup-Schreibcache, welcher den IO-Druck innerhalb von Gästen reduzieren " +"kann (nur VMs)." #: pmg-gui/js/NavigationTree.js:90 msgid "Backup/Restore" @@ -1267,6 +1268,8 @@ msgid "" "CD-ROM images cannot get imported, if required you can reconfigure the '{0}' " "drive in the 'Advanced' tab." msgstr "" +"CD-ROM Abbilddateien können nicht importiert werden. Das '{0}' Laufwerk kann " +"im 'Erweitert' Tab neu konfiguriert werden, falls benötigt." #: pve-manager/www/manager6/qemu/HardwareView.js:227 #: pve-manager/www/manager6/qemu/HardwareView.js:676 @@ -1274,9 +1277,8 @@ msgid "CD/DVD Drive" msgstr "CD/DVD Laufwerk" #: pve-manager/www/manager6/window/GuestImport.js:715 -#, fuzzy msgid "CD/DVD Drives" -msgstr "CD/DVD Laufwerk" +msgstr "CD/DVD Laufwerke" #: proxmox-widget-toolkit/src/form/NetworkSelector.js:90 #: proxmox-widget-toolkit/src/node/NetworkView.js:352 @@ -1298,9 +1300,8 @@ msgid "CPU Affinity" msgstr "CPU-Affinität" #: pve-manager/www/manager6/window/GuestImport.js:508 -#, fuzzy msgid "CPU Type" -msgstr "OS-Typ" +msgstr "CPU-Typ" #: pve-manager/www/manager6/lxc/ResourceEdit.js:79 #: pve-manager/www/manager6/qemu/ProcessorEdit.js:191 @@ -1416,6 +1417,9 @@ msgid "" "Caution: 'What Objects' match each mail part separately, so be careful with " "any option besides 'Any matches'." msgstr "" +"Vorsicht: 'Was Objekte' treffen auf jeden Teil einer E-Mail separat zu. " +"Seien Sie deshalb vorsichtig, wenn Sie andere Optionen als 'beliebige " +"Übereinstimmungen' verwenden." #: pve-manager/www/manager6/ceph/Pool.js:260 msgid "Ceph Pool" @@ -1659,9 +1663,8 @@ msgid "Client Message Rate Limit" msgstr "Client Message Rate Limit" #: pve-manager/www/manager6/qemu/DisplayEdit.js:84 -#, fuzzy msgid "Clipboard" -msgstr "In Zwischenablage kopieren" +msgstr "Zwischenablage" #: pve-manager/www/manager6/Utils.js:2012 #: pve-manager/www/manager6/Utils.js:2041 @@ -1974,9 +1977,8 @@ msgid "Confirm" msgstr "Bestätigen" #: proxmox-widget-toolkit/src/window/PasswordEdit.js:47 -#, fuzzy msgid "Confirm New Password" -msgstr "Kennwort bestätigen" +msgstr "Neues Kennwort bestätigen" #: proxmox-backup/www/tape/window/EncryptionEdit.js:45 msgid "Confirm Password" @@ -2147,9 +2149,8 @@ msgstr "Daten kopieren" #: proxmox-backup/www/datastore/Content.js:1301 #: proxmox-backup/www/datastore/Content.js:1355 -#, fuzzy msgid "Copy name to clipboard" -msgstr "In Zwischenablage kopieren" +msgstr "Name in Zwischenablage kopieren" #: pmg-gui/js/Utils.js:660 msgid "Copy original mail to Attachment Quarantine" @@ -2181,6 +2182,8 @@ msgstr "Konnte keine Ceph-Installation im Cluster finden" #: pmg-gui/js/DKIMSettings.js:40 msgid "Could not read private key - please create a selector first!" msgstr "" +"Konnte privaten Schlüssel nicht lesen - bitte erstellen Sie zuerst einen " +"Selektor!" #: pmg-gui/js/ContactStatistics.js:158
[pve-devel] [PATCH qemu-server] fix get_cpu_bitness always reverting to default cpu type
This fixes the broken prevention of starting a VM with a 32-bit CPU using a 64-bit OVMF (UEFI) BIOS. Signed-off-by: Filip Schauer --- PVE/QemuServer/CPUConfig.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PVE/QemuServer/CPUConfig.pm b/PVE/QemuServer/CPUConfig.pm index 97a5e55..33f7524 100644 --- a/PVE/QemuServer/CPUConfig.pm +++ b/PVE/QemuServer/CPUConfig.pm @@ -757,7 +757,7 @@ sub get_cpu_bitness { my $cpu = PVE::JSONSchema::parse_property_string('pve-vm-cpu-conf', $cpu_prop_str) or die "Cannot parse cpu description: $cpu_prop_str\n"; - my $cputype = $cpu->{cputype}; + $cputype = $cpu->{cputype}; if (my $model = $builtin_models->{$cputype}) { $cputype = $model->{'reported-model'}; -- 2.39.2 ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] [PATCH] auto install assistant: fix newline before ':'
this belongs after the ':' otherwise the output looks weird: [..] can be : * integrated into [..] * needs to be [..] Signed-off-by: Dominik Csapak --- proxmox-auto-install-assistant/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxmox-auto-install-assistant/src/main.rs b/proxmox-auto-install-assistant/src/main.rs index 44dd12e..1aa6bfe 100644 --- a/proxmox-auto-install-assistant/src/main.rs +++ b/proxmox-auto-install-assistant/src/main.rs @@ -92,7 +92,7 @@ struct CommandValidateAnswer { /// Prepare an ISO for automated installation. /// /// The behavior of how to fetch an answer file must be set with the '--fetch-from', parameter. The -/// answer file can be{n}: +/// answer file can be:{n} /// * integrated into the ISO itself ('iso'){n} /// * needs to be present in a partition / file-system with the label 'PROXMOX-INST-SRC' /// ('partition'){n} -- 2.39.2 ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] [PATCH pve-installer] answer: perform basic input validation for keyboard
Currently it is possible to validate and create an iso with an invalid keyboad layout, only failing later during installation. Add a basic check for correct keyboard layout by defining an enum with allowed variants. Signed-off-by: Christian Ebner --- proxmox-auto-installer/src/answer.rs | 39 +++- proxmox-auto-installer/src/utils.rs | 8 -- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/proxmox-auto-installer/src/answer.rs b/proxmox-auto-installer/src/answer.rs index a6cf8b7..af7485a 100644 --- a/proxmox-auto-installer/src/answer.rs +++ b/proxmox-auto-installer/src/answer.rs @@ -23,7 +23,7 @@ pub struct Answer { pub struct Global { pub country: String, pub fqdn: Fqdn, -pub keyboard: String, +pub keyboard: KeyboardLayout, pub mailto: String, pub timezone: String, pub root_password: String, @@ -270,3 +270,40 @@ pub struct BtrfsOptions { pub hdsize: Option, pub raid: Option, } + +#[derive(Clone, Deserialize, Serialize, Debug, PartialEq)] +#[serde(rename_all = "kebab-case", deny_unknown_fields)] +pub enum KeyboardLayout { +De, +DeCh, +Dk, +EnGb, +EnUs, +Es, +Fi, +Fr, +FrBe, +FrCa, +FrCh, +Hu, +Is, +It, +Jp, +Lt, +Mk, +Nl, +No, +Pl, +Pt, +PtBr, +Se, +Si, +Tr, +} + +impl std::fmt::Display for KeyboardLayout { +fn fmt(, f: std::fmt::Formatter<'_>) -> std::fmt::Result { +let keyboard_layout = serde_json::to_value(self).unwrap().to_string(); +write!(f, "{}", keyboard_layout.trim_matches('\"')) +} +} diff --git a/proxmox-auto-installer/src/utils.rs b/proxmox-auto-installer/src/utils.rs index 7e1366c..202ad41 100644 --- a/proxmox-auto-installer/src/utils.rs +++ b/proxmox-auto-installer/src/utils.rs @@ -281,7 +281,11 @@ pub fn verify_locale_settings(answer: , locales: ) -> Result<( { bail!("country code '{}' is not valid", ); } -if !locales.kmap.keys().any(|i| i == ) { +if !locales +.kmap +.keys() +.any(|i| i == _string()) +{ bail!("keyboard layout '{}' is not valid", ); } @@ -328,7 +332,7 @@ pub fn parse_answer( country: answer.global.country.clone(), timezone: answer.global.timezone.clone(), -keymap: answer.global.keyboard.clone(), +keymap: answer.global.keyboard.to_string(), password: answer.global.root_password.clone(), mailto: answer.global.mailto.clone(), -- 2.39.2 ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel