Re: [pve-devel] [PATCH 2/2] proxmox-boot-tool: check if correct grub metapackage is installed

2023-10-09 Thread Friedrich Weber
On 04/10/2023 14:05, Stoiko Ivanov wrote:
> diff --git a/src/proxmox-boot/zz-proxmox-boot 
> b/src/proxmox-boot/zz-proxmox-boot
> index 1adc1b1..0d08dbf 100755
> --- a/src/proxmox-boot/zz-proxmox-boot
> +++ b/src/proxmox-boot/zz-proxmox-boot
> @@ -215,6 +215,23 @@ disable_systemd_boot_hook() {
>  
>  }
>  
> +check_grub_efi_package() {
> +
> + if [ -f "${ESP_LIST}" ]; then
> + return
> + fi
> +
> + if [ ! -d /sys/firmware/efi ]; then
> + return
> + fi
> +
> + if [ ! -f /usr/share/doc/grub-efi-amd64/changelog.Debian.gz ]; then
> + return
> + fi

If I understand correctly, this check needs to be inverted, since we do
want to warn if grub-efi-amd64 is *not* installed? (only noticed because
my UEFI-based test machine did not print the warning below on upgrade)

> + warn "uefi-booted system, without grub-efi-amd64 package - /boot/efi 
> will not be updated"
> +
> +}
> +
>  set -- $DEB_MAINT_PARAMS
>  mode="${1#\'}"
>  mode="${mode%\'}"
> @@ -228,6 +245,7 @@ case $0:$mode in
>   BOOT_KVERS="$(boot_kernel_list "$@")"
>   update_esps
>   disable_systemd_boot_hook
> + check_grub_efi_package
>   ;;
>*/postrm.d/*:|*/postrm.d/*:remove)
>   reexec_in_mountns "$@"
> @@ -235,6 +253,7 @@ case $0:$mode in
>   BOOT_KVERS="$(boot_kernel_list)"
>   update_esps
>   disable_systemd_boot_hook
> + check_grub_efi_package
>   ;;
>  esac
>  


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



Re: [pve-devel] [PATCH 1/1] pve7to8: check for proper grub meta-package for bootmode

2023-10-09 Thread Friedrich Weber
On 04/10/2023 14:05, Stoiko Ivanov wrote:
> +} elsif ( ! -f "/usr/share/doc/grub-efi-amd64/changelog.Debian.gz" ) {
> + log_warn(
> + "System booted in uefi mode but grub-efi-amd64 meta-package not 
> installed"
> + . " new grub versions will not be installed to /boot/efi -"
> + . " install grub-efi-amd64"
>   );

Nit: The message is printed in one line, might be a bit more readable
with a newline (or full stop/exclamation mark) after "not installed".

> + return;
> +} else {
> + log_pass("bootloader packages installed correctly");
>  }
>  }
>  


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



[pve-devel] [PATCH manager] api2tools: check if file changed before reusing its hash

2023-10-09 Thread Maximiliano Sandoval
We cache the hash of this file, it makes sense to first check if the
file changed via `stat` and recompute the hash if needed.

This is to be in sync with the changes made in
https://git.proxmox.com/?p=pmg-api.git;a=commit;h=16d2ff9f8e90db64114a66d78672f5a03f5ee990.

Signed-off-by: Maximiliano Sandoval 
---
 PVE/API2Tools.pm | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/PVE/API2Tools.pm b/PVE/API2Tools.pm
index a3d7ca84..618c13b3 100644
--- a/PVE/API2Tools.pm
+++ b/PVE/API2Tools.pm
@@ -17,14 +17,22 @@ use PVE::SafeSyslog;
 use PVE::Storage::Plugin;
 
 my $hwaddress;
+my $hwaddress_st = {};
 
 sub get_hwaddress {
+my $fn = '/etc/ssh/ssh_host_rsa_key.pub';
+my $st = stat($fn);
 
-return $hwaddress if defined ($hwaddress);
+if (defined($hwaddress)
+   && $hwaddress_st->{mtime} == $st->mtime
+   && $hwaddress_st->{ino} == $st->ino
+   && $hwaddress_st->{dev} == $st->dev) {
+   return $hwaddress;
+}
 
-my $fn = '/etc/ssh/ssh_host_rsa_key.pub';
 my $sshkey = PVE::Tools::file_get_contents($fn);
 $hwaddress = uc(md5_hex($sshkey));
+$hwaddress_st->@{'mtime', 'ino', 'dev'} = ($st->mtime, $st->ino, $st->dev);
 
 return $hwaddress;
 }
-- 
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-i18n 0/1] update German translation

2023-10-09 Thread hd
I suggest an update of the german translation

hd (1):
  update German translation

 de.po | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

-- 
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-i18n 1/1] update German translation

2023-10-09 Thread hd
---
 de.po | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/de.po b/de.po
index fea74f1..c647f31 100644
--- a/de.po
+++ b/de.po
@@ -747,9 +747,8 @@ msgid "Authentication mode"
 msgstr "Authentifikationsmodus"
 
 #: proxmox-widget-toolkit/src/panel/SendmailEditPanel.js:111
-#, fuzzy
 msgid "Author"
-msgstr "Auth-ID"
+msgstr "Autor"
 
 #: pmg-gui/js/TFAView.js:60 pve-manager/www/manager6/dc/OptionView.js:241
 #: proxmox-backup/www/config/WebauthnView.js:109
-- 
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 proxmox-i18n 1/1] update German translation

2023-10-09 Thread Lukas Wagner

Hello Hannes,

please configure your git client so that the commit author is your full 
name [1]:


  git config --global user.name "Firstname Lastname"

Also, this patch is missing the 'Signed-off-by' line. That line is 
auto-generated by git if you provide the right flags to `git commit` or 
`git format-patch` (e.g. `git commit -s`, maybe create a git alias for that)


Also, for single patches there is no need to send a cover-letter.
If there is anything to be said about the patch that should *not* be
part of the commit message, you can write it under the the '---' marker.

Hope this helps :)

[1] https://pve.proxmox.com/wiki/Developer_Documentation#Using_git

On 10/9/23 11:38, hd wrote:

---

^ I mean this marker here.


  de.po | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/de.po b/de.po
index fea74f1..c647f31 100644
--- a/de.po
+++ b/de.po
@@ -747,9 +747,8 @@ msgid "Authentication mode"
  msgstr "Authentifikationsmodus"
  
  #: proxmox-widget-toolkit/src/panel/SendmailEditPanel.js:111

-#, fuzzy
  msgid "Author"
-msgstr "Auth-ID"
+msgstr "Autor"
  
  #: pmg-gui/js/TFAView.js:60 pve-manager/www/manager6/dc/OptionView.js:241

  #: proxmox-backup/www/config/WebauthnView.js:109


--
- Lukas


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



Re: [pve-devel] [PATCH v2 qemu-server 2/2] Rename vm_is_paused to vm_is_frozen

2023-10-09 Thread Fiona Ebner
Am 25.08.23 um 14:18 schrieb Filip Schauer:
> Rename vm_is_paused to vm_is_frozen to avoid confusion with the "paused"
> runstate.
> 

I know I suggested renaming the function, but with 'frozen' there is
potential for new confusion with fsfreeze, especially with the
user-facing warnings/errors. It's also that 'paused' sounds nicer to
users here IMHO.

Maybe we can call it vcpus_(are_)paused and keep the user-facing
messages the same? Or we can just keep the current name. Right now,
there is no case where we need to distinguish between having runstate
'paused' and the return value of vm_is_paused().


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



Re: [pve-devel] [PATCH v2 qemu-server 1/2] Add missing checks for paused runstates

2023-10-09 Thread Fiona Ebner
Am 25.08.23 um 14:18 schrieb Filip Schauer:
> Add checks for "suspended" and "prelaunch" runstates when checking
> whether a VM is paused.
> 
> This fixes the following issues:
> * ACPI-suspended VMs automatically resuming after migration
> * Shutdown and reboot commands timing out instead of failing
>   immediately on suspended VMs
> 
> Signed-off-by: Filip Schauer 
> ---
>  PVE/QemuServer.pm | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index bf1de17..954fed7 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -8596,7 +8596,11 @@ sub vm_is_paused {
>   mon_cmd($vmid, "query-status");
>  };
>  warn "$@\n" if $@;
> -return $qmpstatus && $qmpstatus->{status} eq "paused";
> +return $qmpstatus && (
> + $qmpstatus->{status} eq "paused" or
> + $qmpstatus->{status} eq "suspended" or

Style nit: mixing '&&' and 'or' is not too nice. For boolean expressions
like here, '&&' and '||' should always be used. For assertions like
$variable or die "error"
usually 'or' is used in our code base.

Once that's fixed:
Reviewed-by: Fiona Ebner 

> + $qmpstatus->{status} eq "prelaunch"
> +);
>  }
>  
>  sub check_volume_storage_type {


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



Re: [pve-devel] [PATCH proxmox-i18n 1/1] update German translation

2023-10-09 Thread Thomas Lamprecht
Am 09/10/2023 um 11:38 schrieb hd:
> ---
>  de.po | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 

On-top of what Lukas mentioned: there are dozens of fuzzy strings
in de.po, and applying/reviewing patches has a slight overhead
independent of the amount of changes, so I'd be great if you send
an update for a few more than just a single change in one patch,
so we get a better "return of (review/apply time) investment".


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



Re: [pve-devel] [PATCH v4 qemu-server 1/2] migration: move livemigration code in a dedicated sub

2023-10-09 Thread Fiona Ebner
Missing your Signed-off-by trailer.

Apart from that
Reviewed-by: Fiona Ebner 


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



Re: [pve-devel] [PATCH v4 qemu-server 2/2] remote-migration: add target-cpu && target-reboot params

2023-10-09 Thread Fiona Ebner
There can be other reasons to do a restart-migration, see also
https://bugzilla.proxmox.com/show_bug.cgi?id=4530, so I feel like this
should be split. One for introducing target-reboot and one for
introducing target-cpu.

For 'target-reboot', the question is if we should call it 'restart' like
for container migration for consistency? Could also be introduced for
normal migration while we're at it.

One could argue that a true 'restart' migration would migrate the
volumes also offline, but right now, I don't see a big downside to do it
via NBD like in this patch. Still, something we should think about. If
it turns out to be really needed, we'd need two different ways to do a
restart migration :/

Am 28.09.23 um 16:45 schrieb Alexandre Derumier:
> This patch add support for remote migration when target
> cpu model is different.
> 
> target-reboot param need to be defined to allow migration
> whens source vm is online.
> 
> When defined, only the live storage migration is done,
> and instead to transfert memory, we cleanly shutdown source vm
> and restart the target vm. (like a virtual reboot between source/dest)

Missing your Signed-off-by

> ---
>  PVE/API2/Qemu.pm   | 23 ++-
>  PVE/CLI/qm.pm  | 11 +++
>  PVE/QemuMigrate.pm | 31 +--
>  3 files changed, 62 insertions(+), 3 deletions(-)
> 
> diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
> index 774b0c7..38991e9 100644
> --- a/PVE/API2/Qemu.pm
> +++ b/PVE/API2/Qemu.pm
> @@ -4586,6 +4586,17 @@ __PACKAGE__->register_method({
>   optional => 1,
>   default => 0,
>   },
> + 'target-cpu' => {
> + optional => 1,
> + description => "Target Emulated CPU model. For online 
> migration, this require target-reboot option",

To enforce it, you can use:
requires => 'target-reboot',

> + type => 'string',
> + format => 'pve-vm-cpu-conf',> + },
> + 'target-reboot' => {
> + type => 'boolean',
> + description => "For online migration , don't migrate memory, 
> only storage. Then, the source vm is shutdown and the target vm is 
> restarted.",
> + optional => 1,
> + },
>   'target-storage' => get_standard_option('pve-targetstorage', {
>   completion => \&PVE::QemuServer::complete_migration_storage,
>   optional => 0,
> @@ -4666,7 +4677,7 @@ __PACKAGE__->register_method({
>  
>   if (PVE::QemuServer::check_running($source_vmid)) {
>   die "can't migrate running VM without --online\n" if 
> !$param->{online};
> -
> + die "can't migrate running VM without --target-reboot when target 
> cpu is different" if $param->{'target-cpu'} && !$param->{'target-reboot'};
>   } else {
>   warn "VM isn't running. Doing offline migration instead.\n" if 
> $param->{online};
>   $param->{online} = 0;
> @@ -4683,6 +4694,7 @@ __PACKAGE__->register_method({
>   raise_param_exc({ 'target-bridge' => "failed to parse bridge map: $@" })
>   if $@;
>  
> +
>   die "remote migration requires explicit storage mapping!\n"
>   if $storagemap->{identity};
>  

Nit: unrelated change

> @@ -5732,6 +5744,15 @@ __PACKAGE__->register_method({
>   PVE::QemuServer::nbd_stop($state->{vmid});
>   return;
>   },
> + 'restart' => sub {
> + PVE::QemuServer::vm_stop(undef, $state->{vmid}, 1, 1);

The first parameter is $storecfg and is not optional. To avoid
deactivating the volumes, use the $keepActive parameter.

> + my $info = PVE::QemuServer::vm_start_nolock(
> + $state->{storecfg},
> + $state->{vmid},
> + $state->{conf},
> + );
> + return;
> + },
>   'resume' => sub {
>   if 
> (PVE::QemuServer::Helpers::vm_running_locally($state->{vmid})) {
>   PVE::QemuServer::vm_resume($state->{vmid}, 1, 1);
> diff --git a/PVE/CLI/qm.pm b/PVE/CLI/qm.pm
> index b17b4fe..9d89cfe 100755
> --- a/PVE/CLI/qm.pm
> +++ b/PVE/CLI/qm.pm
> @@ -189,6 +189,17 @@ __PACKAGE__->register_method({
>   optional => 1,
>   default => 0,
>   },
> + 'target-cpu' => {
> + optional => 1,
> + description => "Target Emulated CPU model. For online 
> migration, this require target-reboot option",

Again, can be enforced
requires => 'target-reboot',

> + type => 'string',
> + format => 'pve-vm-cpu-conf',
> + },
> + 'target-reboot' => {
> + type => 'boolean',
> + description => "For online migration , don't migrate memory, 
> only storage. Then, the source vm is shutdown and the target vm is 
> restarted.",
> + optional => 1,
> + },
>   'target-storage' => get_standard_option(

[pve-devel] [PATCH manager v2 1/1] pve7to8: check for proper grub meta-package for bootmode

2023-10-09 Thread Stoiko Ivanov
This should catch installations from our ISO on non-ZFS in uefi mode,
which won't get the updated grub efi binary installed upon upgrade,
because grub-pc is installed instead of grub-efi-amd64.

Adding this to pve7to8 should make this even more visible, than the
corresponding patch for promxox-kernel-helper (warnings printed during
regular package upgrades might be overlooked more easily than
a yellow line in the major upgrade checkscript)

The if/else order was chosen to limit the nesting level of the long
messages.

Signed-off-by: Stoiko Ivanov 
---
 PVE/CLI/pve7to8.pm | 39 +++
 1 file changed, 23 insertions(+), 16 deletions(-)

diff --git a/PVE/CLI/pve7to8.pm b/PVE/CLI/pve7to8.pm
index d1a71eff..ff7825b3 100644
--- a/PVE/CLI/pve7to8.pm
+++ b/PVE/CLI/pve7to8.pm
@@ -1302,29 +1302,36 @@ sub check_time_sync {
 
 sub check_bootloader {
 log_info("Checking bootloader configuration...");
-if (!$upgraded) {
-   log_skip("not yet upgraded, no need to check the presence of 
systemd-boot");
-   return;
-}
 
-if (! -f "/etc/kernel/proxmox-boot-uuids") {
-   log_skip("proxmox-boot-tool not used for bootloader configuration");
+if (! -d '/sys/firmware/efi') {
+   log_skip("System booted in legacy-mode - no need for additional 
packages");
return;
 }
 
-if (! -d "/sys/firmware/efi") {
-   log_skip("System booted in legacy-mode - no need for systemd-boot");
-   return;
-}
-
-if ( -f "/usr/share/doc/systemd-boot/changelog.Debian.gz") {
-   log_pass("systemd-boot is installed");
-} else {
+if ( -f "/etc/kernel/proxmox-boot-uuids") {
+   if (!$upgraded) {
+   log_skip("not yet upgraded, no need to check the presence of 
systemd-boot");
+   return;
+   }
+   if ( -f "/usr/share/doc/systemd-boot/changelog.Debian.gz") {
+   log_pass("bootloader packages installed correctly");
+   return;
+   }
log_warn(
"proxmox-boot-tool is used for bootloader configuration in uefi 
mode"
-   . "but the separate systemd-boot package, existing in Debian 
Bookworm  is not installed"
-   . "initializing new ESPs will not work until the package is 
installed"
+   . " but the separate systemd-boot package, existing in Debian 
Bookworm is not installed"
+   . " initializing new ESPs will not work until the package is 
installed"
+   );
+   return;
+} elsif ( ! -f "/usr/share/doc/grub-efi-amd64/changelog.Debian.gz" ) {
+   log_warn(
+   "System booted in uefi mode but grub-efi-amd64 meta-package not 
installed"
+   . " new grub versions will not be installed to /boot/efi!"
+   . " Install grub-efi-amd64."
);
+   return;
+} else {
+   log_pass("bootloader packages installed correctly");
 }
 }
 
-- 
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 kernel-helper/manager v2] check for fitting grub-meta package on uefi systems

2023-10-09 Thread Stoiko Ivanov
v1->v2:
* adapted Friedrich's feedback (huge thanks!)
** fixed the wrongly negated check for installed grub-efi-amd64 in the
   boot-tool hook.
** Rephrased the error-message in pve7to8 to 2 sentences. I tried adding a
   newline as well, however this results in the message not being printed
   in the warning color anymore (most likely due to [0]) - and I felt this
   to be more important than having it on a separate line.

[0] https://perldoc.perl.org/Term::ANSIColor#RESTRICTIONS

original cover-letter for v1:
The following patchset is a followup to the one for the installer:
https://lists.proxmox.com/pipermail/pve-devel/2023-September/059270.html

As suggested by Thomas - adding the check to proxmox-kernel-helper seems
like a good idea. While adding it to d/postinst I thought that this might
not be the best place - and that getting the warning upon every
kernel-upgrade would be better vs. upon every upgrade of
proxmox-kernel-helper (which are far less often).
(Can gladly send the version with d/postinst as well)

If the pve-manager patch gets applied - I'd push the equivalent change to
pmg and provide one for pbs.

Tested on legacy and uefi VMs installed with pve-8.0 iso and
grub-efi-amd64 (and systemd-boot) removed vs. installed.

proxmox-kernel-helper:
Stoiko Ivanov (2):
  proxmox-boot-tool: do not exit early in kernel-hook
  proxmox-boot-tool: check if correct grub metapackage is installed

 src/proxmox-boot/zz-proxmox-boot | 21 -
 1 file changed, 20 insertions(+), 1 deletion(-)

pve-manager:
Stoiko Ivanov (1):
  pve7to8: check for proper grub meta-package for bootmode

 PVE/CLI/pve7to8.pm | 39 +++
 1 file changed, 23 insertions(+), 16 deletions(-)

-- 
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 kernel-helper v2 1/2] proxmox-boot-tool: do not exit early in kernel-hook

2023-10-09 Thread Stoiko Ivanov
update_esps is called first in the actual execution below - exiting
early does not work for systems that don't use proxmox-boot-tool if a
check added later needs to work there too.

Signed-off-by: Stoiko Ivanov 
---
 src/proxmox-boot/zz-proxmox-boot | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/proxmox-boot/zz-proxmox-boot b/src/proxmox-boot/zz-proxmox-boot
index 793882b..1adc1b1 100755
--- a/src/proxmox-boot/zz-proxmox-boot
+++ b/src/proxmox-boot/zz-proxmox-boot
@@ -44,7 +44,7 @@ fi
 update_esps() {
if [ ! -f "${ESP_LIST}" ]; then
warn "No ${ESP_LIST} found, skipping ESP sync."
-   exit 0
+   return
fi
if [ -f /etc/kernel/cmdline ]; then
# we can have cmdline files with multiple or no new line at 
all, handle both!
-- 
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 kernel-helper v2 2/2] proxmox-boot-tool: check if correct grub metapackage is installed

2023-10-09 Thread Stoiko Ivanov
this part of the hook applies only to systems not using pbt for
bootmangement.

Currently our ISO installs grub-pc unconditionally - and never the
conflicting grub-efi-amd64. Both packages are responsible for
running grub-install (for the appropriate disks) upon an upgrade of
grub.

This results in grub currently not getting updated on uefi-booted
systems (which do not use proxmox-boot-tool).

The patch causes a warning to be printed to notify the user.

Also considered putting the check+warning in d/postinst - but this way
it will get triggered more often (upon every
kernel-upgrade/update-initramfs, instead of only on
proxmox-kernel-helper updates, which are less often), increasing the
chances of being noticed.

checking for the changelog-presence was chosen, over `dpkg-query` for
the status, for consistency with the similar patch for pve7to8 (and
potentially a small speed-gain).

Suggested-by: Thomas Lamprecht 
Signed-off-by: Stoiko Ivanov 
---
 src/proxmox-boot/zz-proxmox-boot | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/src/proxmox-boot/zz-proxmox-boot b/src/proxmox-boot/zz-proxmox-boot
index 1adc1b1..4dfa765 100755
--- a/src/proxmox-boot/zz-proxmox-boot
+++ b/src/proxmox-boot/zz-proxmox-boot
@@ -215,6 +215,23 @@ disable_systemd_boot_hook() {
 
 }
 
+check_grub_efi_package() {
+
+   if [ -f "${ESP_LIST}" ]; then
+   return
+   fi
+
+   if [ ! -d /sys/firmware/efi ]; then
+   return
+   fi
+
+   if [ -f /usr/share/doc/grub-efi-amd64/changelog.Debian.gz ]; then
+   return
+   fi
+   warn "uefi-booted system, without grub-efi-amd64 package - /boot/efi 
will not be updated"
+
+}
+
 set -- $DEB_MAINT_PARAMS
 mode="${1#\'}"
 mode="${mode%\'}"
@@ -228,6 +245,7 @@ case $0:$mode in
BOOT_KVERS="$(boot_kernel_list "$@")"
update_esps
disable_systemd_boot_hook
+   check_grub_efi_package
;;
 */postrm.d/*:|*/postrm.d/*:remove)
reexec_in_mountns "$@"
@@ -235,6 +253,7 @@ case $0:$mode in
BOOT_KVERS="$(boot_kernel_list)"
update_esps
disable_systemd_boot_hook
+   check_grub_efi_package
;;
 esac
 
-- 
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/access-control/proxmox-widget-toolkit v1 0/4] fix #4546: Show warning hint/badge if user account is expiring in next few days

2023-10-09 Thread Philipp Hufnagl



On 10/6/23 15:16, Lukas Wagner wrote:
> 
> 
> On 9/22/23 16:36, Philipp Hufnagl wrote:
>> Currently, when an user account expires, it catches the users by
>> surprise. It would be helpful to notify the the user as well as the
>> administrator.
>>
>> This patch highlights such accounts in the user account pannel and also
>> shows for regular user an exclamation mark in the user info pannel. It
>> also adds in this case a new entry briefly saing that the account
>> expires. When this entry is clicked it states this in more detail
>> including the experation date.
>>
>> Sending this for PVE only now to get feedback before implementing this
>> for PMG and PBS
>>
> 
> Tested this on the latest master. Seems to work as adverised with the
> exception of a small rendering bug (decribed in one of the other
> messages).
> 
> 
> 

Thanks for all the valuable feedback! I am currently working on a v2.
Please don't merge!


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



[pve-devel] [PATCH v2 proxmox-i18n] update German translation

2023-10-09 Thread Hannes Duerr
Signed-off-by: Hannes Duerr 
---
 de.po | 111 --
 1 file changed, 37 insertions(+), 74 deletions(-)

diff --git a/de.po b/de.po
index fea74f1..4f6de7d 100644
--- a/de.po
+++ b/de.po
@@ -747,9 +747,8 @@ msgid "Authentication mode"
 msgstr "Authentifikationsmodus"
 
 #: proxmox-widget-toolkit/src/panel/SendmailEditPanel.js:111
-#, fuzzy
 msgid "Author"
-msgstr "Auth-ID"
+msgstr "Autor"
 
 #: pmg-gui/js/TFAView.js:60 pve-manager/www/manager6/dc/OptionView.js:241
 #: proxmox-backup/www/config/WebauthnView.js:109
@@ -1400,9 +1399,8 @@ msgstr "Testen"
 
 #: pve-manager/www/manager6/dc/AuthEditAD.js:93
 #: pve-manager/www/manager6/dc/AuthEditLDAP.js:93
-#, fuzzy
 msgid "Check connection"
-msgstr "Schutz ändern"
+msgstr "Teste Verbindung"
 
 #: pve-manager/www/manager6/window/DownloadUrlToStorage.js:188
 #: pve-manager/www/manager6/window/UploadToStorage.js:225
@@ -2100,9 +2098,8 @@ msgid "Current Auth ID"
 msgstr "Aktuelle Auth-ID"
 
 #: pve-manager/www/manager6/grid/PoolMembers.js:73
-#, fuzzy
 msgid "Current Pool"
-msgstr "Aktuelles Layout"
+msgstr "Aktueller Bestand"
 
 #: proxmox-backup/www/tape/window/TapeRestore.js:431
 msgid "Current User"
@@ -2674,11 +2671,10 @@ msgid "Disabled"
 msgstr "Deaktiviert"
 
 #: pve-manager/www/manager6/dc/NotificationEvents.js:32
-#, fuzzy
 msgid "Disabling notifications is not recommended for production systems!"
 msgstr ""
-"Das {0}no-subscription Repository ist nicht für die Verwendung in "
-"Produktivsystemen empfohlen!"
+"Das Deaktivieren von Benachrichtigungen in Produktivsystemen ist"
+"nicht empfohlen!"
 
 #: pve-manager/www/manager6/qemu/RNGEdit.js:90
 msgid ""
@@ -2789,9 +2785,8 @@ msgid "Do not use any media"
 msgstr "Kein Medium verwenden"
 
 #: proxmox-widget-toolkit/src/panel/NotificationConfigView.js:91
-#, fuzzy
 msgid "Do you want to send a test notification to '{0}'?"
-msgstr "Möchten Sie Replikation Job {0} wirklich entfernen?"
+msgstr "Möchten Sie eine Testbenachrichtigung an '{0}' senden?"
 
 #: pmg-gui/js/MainView.js:187 pve-manager/www/manager6/Workspace.js:352
 #: proxmox-backup/www/MainView.js:226
@@ -3287,9 +3282,8 @@ msgstr "Endzeit"
 #: proxmox-widget-toolkit/src/panel/GotifyEditPanel.js:16
 #: proxmox-widget-toolkit/src/panel/NotificationGroupEditPanel.js:67
 #: proxmox-widget-toolkit/src/panel/SendmailEditPanel.js:27
-#, fuzzy
 msgid "Endpoint Name"
-msgstr "Bind-Domänenname"
+msgstr "Endpointname"
 
 #: proxmox-widget-toolkit/src/Utils.js:70
 msgid "English"
@@ -3737,9 +3731,8 @@ msgstr "Filter"
 
 #: proxmox-widget-toolkit/src/panel/NotificationConfigView.js:265
 #: proxmox-widget-toolkit/src/window/NotificationFilterEdit.js:14
-#, fuzzy
 msgid "Filter Name"
-msgstr "Cluster-Name"
+msgstr "Filtername"
 
 #: proxmox-backup/www/form/GroupFilter.js:281
 msgid "Filter Type"
@@ -3747,7 +3740,7 @@ msgstr "Filtertyp"
 
 #: pve-manager/www/manager6/grid/BackupView.js:150
 msgid "Filter VMID"
-msgstr "Filtere VMID"
+msgstr "Filter-VMID"
 
 #: proxmox-backup/www/form/GroupFilter.js:291
 msgid "Filter Value"
@@ -3966,9 +3959,8 @@ msgid "From"
 msgstr "Von"
 
 #: proxmox-widget-toolkit/src/panel/SendmailEditPanel.js:121
-#, fuzzy
 msgid "From Address"
-msgstr "Front Adresse"
+msgstr "Von Adresse"
 
 #: pve-manager/www/manager6/window/Restore.js:260
 msgid "From Backup"
@@ -4137,9 +4129,8 @@ msgid "Group Guest Types"
 msgstr "Gruppiere Gast-Typ"
 
 #: proxmox-widget-toolkit/src/panel/NotificationGroupEditPanel.js:16
-#, fuzzy
 msgid "Group Name"
-msgstr "Gruppenmitglied"
+msgstr "Gruppenname"
 
 #: pve-manager/www/manager6/dc/ACLView.js:26
 #: pve-manager/www/manager6/dc/ACLView.js:199
@@ -4481,7 +4472,6 @@ msgid "IOMMU Group"
 msgstr "IOMMU-Gruppe"
 
 #: pve-manager/www/manager6/dc/PCIMapView.js:88
-#, fuzzy
 msgid "IOMMU-Group"
 msgstr "IOMMU-Gruppe"
 
@@ -5475,9 +5465,8 @@ msgid "Manufacturer"
 msgstr "Hersteller"
 
 #: pve-manager/www/manager6/qemu/PCIEdit.js:193
-#, fuzzy
 msgid "Mapped Device"
-msgstr "Gemapptes Devices"
+msgstr "Gemapptes Device"
 
 #: pve-manager/www/manager6/form/PCIMapSelector.js:52
 #: pve-manager/www/manager6/form/USBMapSelector.js:37
@@ -5646,9 +5635,8 @@ msgid "Memory usage"
 msgstr "Speicherverbrauch"
 
 #: pve-manager/www/manager6/ceph/OSDDetails.js:151
-#, fuzzy
 msgid "Memory usage (PSS)"
-msgstr "Speicherverbrauch"
+msgstr "Speicherverbrauch (PSS)"
 
 #: proxmox-widget-toolkit/src/window/ZFSDetail.js:151
 #: pve-manager/www/manager6/dc/Log.js:79
@@ -5730,9 +5718,8 @@ msgid "Min. Size"
 msgstr "Min. Größe"
 
 #: proxmox-widget-toolkit/src/window/NotificationFilterEdit.js:20
-#, fuzzy
 msgid "Minimum Severity"
-msgstr "Min. Speicher"
+msgstr "Min. Schweregrad"
 
 #: proxmox-widget-toolkit/src/Toolkit.js:100
 #: proxmox-widget-toolkit/src/Toolkit.js:108
@@ -6435,9 +6422,8 @@ msgid "No default available"
 msgstr "Kein Standardwert verfügbar"
 
 #: proxmox-widget-toolkit/src/panel/NotificationGroupEditPanel.js:170
-#, fuzzy
 msgid "No endpoint selected"
-msgstr "Keine Disk

[pve-devel] [PATCH v3 qemu-server] Fix ACPI-suspended VMs resuming after migration

2023-10-09 Thread Filip Schauer
Add checks for "suspended" and "prelaunch" runstates when checking
whether a VM is paused.

This fixes the following issues:
* ACPI-suspended VMs automatically resuming after migration
* Shutdown and reboot commands timing out instead of failing
  immediately on suspended VMs

Signed-off-by: Filip Schauer 
---
Changes since v2:
* Make && and || operators consistent
* Revert rename vm_is_paused to vm_is_frozen

We could have renamed vm_is_paused to vcpus_are_paused, but I do not
consider that necessary.

 PVE/QemuServer.pm | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 1b1ccf4..2895675 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -8503,7 +8503,11 @@ sub vm_is_paused {
mon_cmd($vmid, "query-status");
 };
 warn "$@\n" if $@;
-return $qmpstatus && $qmpstatus->{status} eq "paused";
+return $qmpstatus && (
+   $qmpstatus->{status} eq "paused" ||
+   $qmpstatus->{status} eq "suspended" ||
+   $qmpstatus->{status} eq "prelaunch"
+);
 }
 
 sub check_volume_storage_type {
-- 
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 v2 qemu-server 0/2] Fix ACPI-suspended VMs resuming after migration

2023-10-09 Thread Filip Schauer

v3 patch available:
https://lists.proxmox.com/pipermail/pve-devel/2023-October/059387.html

On 25/08/2023 14:18, Filip Schauer wrote:

Shutdown and reboot commands do infact time out instead of failing
immediately on suspended VMs. This is fixed by extending vm_is_paused
with the "suspended" runstate. It also make sense to check for the
"prelaunch" runstate, as the VM is not running in that state. To
accommodate the changes, the function is renamed to vm_is_frozen.

Filip Schauer (2):
   Add missing checks for paused runstates
   Rename vm_is_paused to vm_is_frozen

  PVE/API2/Qemu.pm |  8 
  PVE/QemuMigrate.pm   |  8 
  PVE/QemuServer.pm|  8 ++--
  PVE/VZDump/QemuServer.pm | 14 +++---
  4 files changed, 21 insertions(+), 17 deletions(-)




___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



Re: [pve-devel] [PATCH v4 qemu-server 2/2] remote-migration: add target-cpu && target-reboot params

2023-10-09 Thread DERUMIER, Alexandre
Hi Fiona, 

Thanks for the review.

>>There can be other reasons to do a restart-migration, see also
>>is so I feel like this
>>should be split. One for introducing target-reboot and one for
>>introducing target-cpu.

yes, sure it can be split in 2 patch, no problem. (v1 had only
targetcpu param, but I have splitted it in 2 differents param, I just
forgot to split in  2 patches



>>For 'target-reboot', the question is if we should call it 'restart'
>>like for container migration for consistency? Could also be
>>introduced for normal migration while we're at it.

Well, we have

pct reboot  
and
pct migrate   --restart  

^_^


We can use "restart", no problem, It make sense if we already using it
in pct migrate.





>>One could argue that a true 'restart' migration would migrate the
>>volumes also offline, but right now, I don't see a big downside to do
>>it
>>via NBD like in this patch. Still, something we should think about.
>>If
>>it turns out to be really needed, we'd need two different ways to do
>>a
>>restart migration :/

I think that a true offline migration (without starting any
source/target vm) can be done with qemu-storage-daemon running nbd
server on target &&  qemu-img on source.

This could be also used for online migration with unused/detached
disks.


I'll send a v5 next week, as I'm going to begin a 4 days proxmox
training tomorrow.


___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


[pve-devel] [PATCH proxmox-widget-toolkit] panel: sendmail edit: don't translate 'Proxmox VE' in author field

2023-10-09 Thread Lukas Wagner
The default value is determined by the backend and is never
translated (which does not make sense any way for a product name).
This was likely just a copy/paste mistake from other from fields.

Signed-off-by: Lukas Wagner 
---
 src/panel/SendmailEditPanel.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/panel/SendmailEditPanel.js b/src/panel/SendmailEditPanel.js
index ace6129..253ee3e 100644
--- a/src/panel/SendmailEditPanel.js
+++ b/src/panel/SendmailEditPanel.js
@@ -111,7 +111,7 @@ Ext.define('Proxmox.panel.SendmailEditPanel', {
fieldLabel: gettext('Author'),
name: 'author',
allowBlank: true,
-   emptyText: gettext('Proxmox VE'),
+   emptyText: 'Proxmox VE',
cbind: {
deleteEmpty: '{!isCreate}',
},
-- 
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 v2 proxmox-i18n] update German translation

2023-10-09 Thread Lukas Wagner

Some comments inline.

On 10/9/23 15:21, Hannes Duerr wrote:

Signed-off-by: Hannes Duerr 
---
  de.po | 111 --
  1 file changed, 37 insertions(+), 74 deletions(-)

diff --git a/de.po b/de.po
index fea74f1..4f6de7d 100644
--- a/de.po
+++ b/de.po
@@ -747,9 +747,8 @@ msgid "Authentication mode"
  msgstr "Authentifikationsmodus"
  
  #: proxmox-widget-toolkit/src/panel/SendmailEditPanel.js:111

-#, fuzzy
  msgid "Author"
-msgstr "Auth-ID"
+msgstr "Autor"
  
  #: pmg-gui/js/TFAView.js:60 pve-manager/www/manager6/dc/OptionView.js:241

  #: proxmox-backup/www/config/WebauthnView.js:109
@@ -1400,9 +1399,8 @@ msgstr "Testen"
  
  #: pve-manager/www/manager6/dc/AuthEditAD.js:93

  #: pve-manager/www/manager6/dc/AuthEditLDAP.js:93
-#, fuzzy
  msgid "Check connection"
-msgstr "Schutz ändern"
+msgstr "Teste Verbindung"
  
  #: pve-manager/www/manager6/window/DownloadUrlToStorage.js:188

  #: pve-manager/www/manager6/window/UploadToStorage.js:225
@@ -2100,9 +2098,8 @@ msgid "Current Auth ID"
  msgstr "Aktuelle Auth-ID"
  
  #: pve-manager/www/manager6/grid/PoolMembers.js:73

-#, fuzzy
  msgid "Current Pool"
-msgstr "Aktuelles Layout"
+msgstr "Aktueller Bestand"
  
  #: proxmox-backup/www/tape/window/TapeRestore.js:431

  msgid "Current User"
@@ -2674,11 +2671,10 @@ msgid "Disabled"
  msgstr "Deaktiviert"
  
  #: pve-manager/www/manager6/dc/NotificationEvents.js:32

-#, fuzzy
  msgid "Disabling notifications is not recommended for production systems!"
  msgstr ""
-"Das {0}no-subscription Repository ist nicht für die Verwendung in "
-"Produktivsystemen empfohlen!"
+"Das Deaktivieren von Benachrichtigungen in Produktivsystemen ist"
+"nicht empfohlen!"
  
  #: pve-manager/www/manager6/qemu/RNGEdit.js:90

  msgid ""
@@ -2789,9 +2785,8 @@ msgid "Do not use any media"
  msgstr "Kein Medium verwenden"
  
  #: proxmox-widget-toolkit/src/panel/NotificationConfigView.js:91

-#, fuzzy
  msgid "Do you want to send a test notification to '{0}'?"
-msgstr "Möchten Sie Replikation Job {0} wirklich entfernen?"
+msgstr "Möchten Sie eine Testbenachrichtigung an '{0}' senden?"
  
  #: pmg-gui/js/MainView.js:187 pve-manager/www/manager6/Workspace.js:352

  #: proxmox-backup/www/MainView.js:226
@@ -3287,9 +3282,8 @@ msgstr "Endzeit"
  #: proxmox-widget-toolkit/src/panel/GotifyEditPanel.js:16
  #: proxmox-widget-toolkit/src/panel/NotificationGroupEditPanel.js:67
  #: proxmox-widget-toolkit/src/panel/SendmailEditPanel.js:27
-#, fuzzy
  msgid "Endpoint Name"
-msgstr "Bind-Domänenname"
+msgstr "Endpointname"
  
  #: proxmox-widget-toolkit/src/Utils.js:70

  msgid "English"
@@ -3737,9 +3731,8 @@ msgstr "Filter"
  
  #: proxmox-widget-toolkit/src/panel/NotificationConfigView.js:265

  #: proxmox-widget-toolkit/src/window/NotificationFilterEdit.js:14
-#, fuzzy
  msgid "Filter Name"
-msgstr "Cluster-Name"
+msgstr "Filtername"
  
  #: proxmox-backup/www/form/GroupFilter.js:281

  msgid "Filter Type"
@@ -3747,7 +3740,7 @@ msgstr "Filtertyp"
  
  #: pve-manager/www/manager6/grid/BackupView.js:150

  msgid "Filter VMID"
-msgstr "Filtere VMID"
+msgstr "Filter-VMID"

The old translation was correct, 'filter' is supposed to be a verb here.
This text is shown as a description for a checkbox in the Backup tab
for a VM/CT.

  
  #: proxmox-backup/www/form/GroupFilter.js:291

  msgid "Filter Value"
@@ -3966,9 +3959,8 @@ msgid "From"
  msgstr "Von"
  
  #: proxmox-widget-toolkit/src/panel/SendmailEditPanel.js:121

-#, fuzzy
  msgid "From Address"
-msgstr "Front Adresse"
+msgstr "Von Adresse"
  
  #: pve-manager/www/manager6/window/Restore.js:260

  msgid "From Backup"
@@ -4137,9 +4129,8 @@ msgid "Group Guest Types"
  msgstr "Gruppiere Gast-Typ"
  
  #: proxmox-widget-toolkit/src/panel/NotificationGroupEditPanel.js:16

-#, fuzzy
  msgid "Group Name"
-msgstr "Gruppenmitglied"
+msgstr "Gruppenname"
  
  #: pve-manager/www/manager6/dc/ACLView.js:26

  #: pve-manager/www/manager6/dc/ACLView.js:199
@@ -4481,7 +4472,6 @@ msgid "IOMMU Group"
  msgstr "IOMMU-Gruppe"
  
  #: pve-manager/www/manager6/dc/PCIMapView.js:88

-#, fuzzy
  msgid "IOMMU-Group"
  msgstr "IOMMU-Gruppe"
  
@@ -5475,9 +5465,8 @@ msgid "Manufacturer"

  msgstr "Hersteller"
  
  #: pve-manager/www/manager6/qemu/PCIEdit.js:193

-#, fuzzy
  msgid "Mapped Device"
-msgstr "Gemapptes Devices"
+msgstr "Gemapptes Device"
  
  #: pve-manager/www/manager6/form/PCIMapSelector.js:52

  #: pve-manager/www/manager6/form/USBMapSelector.js:37
@@ -5646,9 +5635,8 @@ msgid "Memory usage"
  msgstr "Speicherverbrauch"
  
  #: pve-manager/www/manager6/ceph/OSDDetails.js:151

-#, fuzzy
  msgid "Memory usage (PSS)"
-msgstr "Speicherverbrauch"
+msgstr "Speicherverbrauch (PSS)"
  
  #: proxmox-widget-toolkit/src/window/ZFSDetail.js:151

  #: pve-manager/www/manager6/dc/Log.js:79
@@ -5730,9 +5718,8 @@ msgid "Min. Size"
  msgstr "Min. Größe"
  
  #: proxmox-widget-toolkit/src/window/NotificationFilterEdit.js:20

-#, fuzzy
  msgid "Minimum Severity"
-msgstr "Min. Speicher"

[pve-devel] [PATCH proxmox-widget-toolkit] schema: endpoint types: don't translate endpoint type names

2023-10-09 Thread Lukas Wagner
... that are not really translatable.

Signed-off-by: Lukas Wagner 
---
 src/Schema.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/Schema.js b/src/Schema.js
index a7ffdf8..e0f583a 100644
--- a/src/Schema.js
+++ b/src/Schema.js
@@ -39,12 +39,12 @@ Ext.define('Proxmox.Schema', { // a singleton
 
 notificationEndpointTypes: {
sendmail: {
-   name: gettext('Sendmail'),
+   name: 'Sendmail',
ipanel: 'pmxSendmailEditPanel',
iconCls: 'fa-envelope-o',
},
gotify: {
-   name: gettext('Gotify'),
+   name: 'Gotify',
ipanel: 'pmxGotifyEditPanel',
iconCls: 'fa-bell-o',
},
-- 
2.39.2



___
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel