public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server] bootorder: fix double entry on cdrom edit
@ 2021-07-30 11:28 Dominik Csapak
  2021-07-30 13:08 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2021-07-30 11:28 UTC (permalink / raw)
  To: pve-devel

We unconditionally added an entry into the bootorder whenever we
edited the drive, even if it was already in there. Instead we only want to do
that if the bootorder list does not contain it already.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 PVE/API2/Qemu.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index 6038b28..94cc0d2 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -1360,7 +1360,7 @@ my $update_vm_api  = sub {
 
 		    # append new CD drives to bootorder to mark them bootable
 		    my $drive = PVE::QemuServer::parse_drive($opt, $param->{$opt});
-		    if (PVE::QemuServer::drive_is_cdrom($drive, 1)) {
+		    if (PVE::QemuServer::drive_is_cdrom($drive, 1) && !grep(/^$opt$/, @bootorder)) {
 			push @bootorder, $opt;
 			$conf->{pending}->{boot} = PVE::QemuServer::print_bootorder(\@bootorder);
 			$modified->{boot} = 1;
-- 
2.30.2





^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] applied: Re: [PATCH qemu-server] bootorder: fix double entry on cdrom edit
  2021-07-30 11:28 [pve-devel] [PATCH qemu-server] bootorder: fix double entry on cdrom edit Dominik Csapak
@ 2021-07-30 13:08 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2021-07-30 13:08 UTC (permalink / raw)
  To: Proxmox VE development discussion, Dominik Csapak

On 30/07/2021 13:28, Dominik Csapak wrote:
> We unconditionally added an entry into the bootorder whenever we
> edited the drive, even if it was already in there.

argh.

> Instead we only want to do
> that if the bootorder list does not contain it already.
> 
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
>  PVE/API2/Qemu.pm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
>

applied, thanks!




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-30 13:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-30 11:28 [pve-devel] [PATCH qemu-server] bootorder: fix double entry on cdrom edit Dominik Csapak
2021-07-30 13:08 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal