* [pve-devel] [PATCH qemu-server] api: clone: sort vm disks to keep numbers consistent
@ 2021-05-26 14:19 Lorenz Stechauner
2021-05-26 15:36 ` [pve-devel] applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Lorenz Stechauner @ 2021-05-26 14:19 UTC (permalink / raw)
To: pve-devel
reported by user in forum:
https://forum.proxmox.com/threads/problem-when-copying-template-with-2-discs.89851/
Signed-off-by: Lorenz Stechauner <l.stechauner@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 c56b609..24dba86 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -3157,7 +3157,7 @@ __PACKAGE__->register_method({
my $total_jobs = scalar(keys %{$drives});
my $i = 1;
- foreach my $opt (keys %$drives) {
+ foreach my $opt (sort keys %$drives) {
my $drive = $drives->{$opt};
my $skipcomplete = ($total_jobs != $i); # finish after last drive
my $completion = $skipcomplete ? 'skip' : 'complete';
--
2.20.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* [pve-devel] applied: [PATCH qemu-server] api: clone: sort vm disks to keep numbers consistent
2021-05-26 14:19 [pve-devel] [PATCH qemu-server] api: clone: sort vm disks to keep numbers consistent Lorenz Stechauner
@ 2021-05-26 15:36 ` Thomas Lamprecht
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2021-05-26 15:36 UTC (permalink / raw)
To: Proxmox VE development discussion, Lorenz Stechauner
On 26.05.21 16:19, Lorenz Stechauner wrote:
> reported by user in forum:
> https://forum.proxmox.com/threads/problem-when-copying-template-with-2-discs.89851/
>
> Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
> ---
> PVE/API2/Qemu.pm | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>
applied, thanks!
But note that this sorts drives with different digit-size of the decimal part
also wrong, depnding on POV, e.g., drive1, drive2 and drive10 would sort:
drive1
drive10
drive2
But IMO still lots better that before, especially as they're grouped by bus
type too.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-05-26 15:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-26 14:19 [pve-devel] [PATCH qemu-server] api: clone: sort vm disks to keep numbers consistent Lorenz Stechauner
2021-05-26 15:36 ` [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