From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 0A4181FF15C for ; Wed, 8 Jan 2025 15:31:53 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id BC9481C26A; Wed, 8 Jan 2025 15:31:40 +0100 (CET) Date: Wed, 8 Jan 2025 15:31:36 +0100 (CET) From: =?UTF-8?Q?Fabian_Gr=C3=BCnbichler?= To: Proxmox VE development discussion Message-ID: <547723417.3.1736346696779@webmail.proxmox.com> In-Reply-To: References: <20241216091229.3142660-1-alexandre.derumier@groupe-cyllene.com> MIME-Version: 1.0 X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer v7.10.6-Rev72 X-Originating-Client: open-xchange-appsuite X-SPAM-LEVEL: Spam detection results: 0 AWL 0.047 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH v3 qemu-server 04/11] blockdev: vm_devices_list : fix block-query 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: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" > Alexandre Derumier via pve-devel hat am 16.12.2024 10:12 CET geschrieben: > Look at qdev value, as cdrom drives can be empty > without any inserted media is this needed if we don't drive_del the cdrom drive when ejecting the medium? > > Signed-off-by: Alexandre Derumier > --- > PVE/QemuServer.pm | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm > index baf78ec0..3b33fd7d 100644 > --- a/PVE/QemuServer.pm > +++ b/PVE/QemuServer.pm > @@ -4425,10 +4425,9 @@ sub vm_devices_list { > } > > my $resblock = mon_cmd($vmid, 'query-block'); > - foreach my $block (@$resblock) { > - if($block->{device} =~ m/^drive-(\S+)/){ > - $devices->{$1} = 1; > - } > + $resblock = { map { $_->{qdev} => $_ } $resblock->@* }; > + foreach my $blockid (keys %$resblock) { > + $devices->{$blockid} = 1; > } > > my $resmice = mon_cmd($vmid, 'query-mice'); > -- > 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel