From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id C69CB60E87 for ; Tue, 1 Dec 2020 10:41:15 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id BB5BBF16A for ; Tue, 1 Dec 2020 10:41:15 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 50138F15C for ; Tue, 1 Dec 2020 10:41:15 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 219A844166 for ; Tue, 1 Dec 2020 10:41:15 +0100 (CET) To: Proxmox VE development discussion , Moayad Almalat References: <20201201093450.101063-1-m.almalat@proxmox.com> From: Aaron Lauterer Message-ID: Date: Tue, 1 Dec 2020 10:41:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <20201201093450.101063-1-m.almalat@proxmox.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.004 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.001 Looks like a legit reply (A) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [cluster.pm] Subject: Re: [pve-devel] [PATCH pve-manager]: api2:/cluster return intiger format for VMID X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2020 09:41:15 -0000 After taking a quick look, isn't there another instance just above in the code on line 720 which would benefit from the same change? --------- if (my $vmid = $param->{vmid}) { return $vmid if !defined($idlist->{$vmid}); ^^^^^ raise_param_exc({ vmid => "VM $vmid already exists" }); } --------- Cheers! On 12/1/20 10:34 AM, Moayad Almalat wrote: > > When call /cluster/nextid over API, it returns ID as a string format > like {"data":"100"}. in the API pve-viewer, the result type is an integer > format. > > Signed-off-by: Moayad Almalat > --- > PVE/API2/Cluster.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/PVE/API2/Cluster.pm b/PVE/API2/Cluster.pm > index bf0e3b4d..ab07b491 100644 > --- a/PVE/API2/Cluster.pm > +++ b/PVE/API2/Cluster.pm > @@ -727,7 +727,7 @@ __PACKAGE__->register_method({ > } > > for (my $i = 100; $i < 10000; $i++) { > - return $i if !defined($idlist->{$i}); > + return int($i) if !defined($idlist->{$i}); > } > > die "unable to get any free VMID\n"; >