public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server 1/1] fix #5365: drive: add drive_is_cloudinit check to get_scsi_devicetype
@ 2024-04-09 14:47 Hannes Duerr
  2024-04-10  9:34 ` Thomas Lamprecht
  0 siblings, 1 reply; 3+ messages in thread
From: Hannes Duerr @ 2024-04-09 14:47 UTC (permalink / raw)
  To: pve-devel

When we obtain the devicetype, we check whether it is a CD drive.
Cloudinit drives are always allocated CD drives, but if the drive has
not yet been allocated, the test fails because the cd attribute has not
yet been set.
We therefore now explicitly check whether it is a cloudinit
drive that has not yet been allocated.

Signed-off-by: Hannes Duerr <h.duerr@proxmox.com>
---
 PVE/QemuServer/Drive.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/QemuServer/Drive.pm b/PVE/QemuServer/Drive.pm
index 34c6e87..c829bde 100644
--- a/PVE/QemuServer/Drive.pm
+++ b/PVE/QemuServer/Drive.pm
@@ -853,7 +853,7 @@ sub get_scsi_devicetype {
 
     my $devicetype = 'hd';
     my $path = '';
-    if (drive_is_cdrom($drive)) {
+    if (drive_is_cdrom($drive) || drive_is_cloudinit($drive)) {
 	$devicetype = 'cd';
     } else {
 	if ($drive->{file} =~ m|^/|) {
-- 
2.39.2





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

end of thread, other threads:[~2024-04-10 11:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-09 14:47 [pve-devel] [PATCH qemu-server 1/1] fix #5365: drive: add drive_is_cloudinit check to get_scsi_devicetype Hannes Duerr
2024-04-10  9:34 ` Thomas Lamprecht
2024-04-10 11:19   ` Hannes Dürr

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