From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: [pve-devel] applied: [PATCH qemu-server] api2: only add ide drives for non-legacy bootorders
Date: Thu, 05 Aug 2021 14:08:56 +0200 [thread overview]
Message-ID: <1628165326.xa3ecf8qsn.astroid@nora.none> (raw)
In-Reply-To: <20210805115301.3415307-1-d.csapak@proxmox.com>
thanks!
On August 5, 2021 1:53 pm, Dominik Csapak wrote:
> @bootorder only contains entries for non-legacy bootorder entries,
> but the default one contains all cdroms anyway, and if the user
> explicitely disabled cdroms, it is ok to not add them back
> for the new cdrom drive.
>
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> view with -w to see the actual change
> PVE/API2/Qemu.pm | 15 +++++++++------
> 1 file changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
> index 94cc0d2..ef0d877 100644
> --- a/PVE/API2/Qemu.pm
> +++ b/PVE/API2/Qemu.pm
> @@ -1358,12 +1358,15 @@ my $update_vm_api = sub {
>
> &$create_disks($rpcenv, $authuser, $conf->{pending}, $arch, $storecfg, $vmid, undef, {$opt => $param->{$opt}});
>
> - # 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) && !grep(/^$opt$/, @bootorder)) {
> - push @bootorder, $opt;
> - $conf->{pending}->{boot} = PVE::QemuServer::print_bootorder(\@bootorder);
> - $modified->{boot} = 1;
> + # default legacy boot order implies all cdroms anyway
> + if (@bootorder) {
> + # 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) && !grep(/^$opt$/, @bootorder)) {
> + push @bootorder, $opt;
> + $conf->{pending}->{boot} = PVE::QemuServer::print_bootorder(\@bootorder);
> + $modified->{boot} = 1;
> + }
> }
> } elsif ($opt =~ m/^serial\d+/) {
> if ((!defined($conf->{$opt}) || $conf->{$opt} eq 'socket') && $param->{$opt} eq 'socket') {
> --
> 2.30.2
>
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>
>
>
prev parent reply other threads:[~2021-08-05 12:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-05 11:53 [pve-devel] " Dominik Csapak
2021-08-05 12:08 ` Fabian Grünbichler [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1628165326.xa3ecf8qsn.astroid@nora.none \
--to=f.gruenbichler@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox