]> git.proxmox.com Git - qemu-server.git/commitdiff
fix #5363: cloudinit: make creation of scsi cloudinit discs possible again
authorHannes Duerr <h.duerr@proxmox.com>
Wed, 10 Apr 2024 11:17:29 +0000 (13:17 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 10 Apr 2024 11:56:41 +0000 (13:56 +0200)
Upon obtaining the device type, a check is performed to determine if it
is a CD drive. It is important to note that Cloudinit drives are always
assigned as CD drives. If the drive has not yet been allocated, the test
will fail due to the unset cd attribute.
To avoid this, an explicit check is now performed to determine if it is
a Cloudinit drive that has not yet been assigned.

Fixes: d1feab4 ("fix #4957: add vendor and product information passthrough for SCSI-Disks")
Signed-off-by: Hannes Duerr <h.duerr@proxmox.com>
PVE/QemuServer/Drive.pm

index 34c6e878193f9781af14bb39d136b3317d0fd423..c829bdeb88eaa4ec5c699bbd9d4d2d271013df31 100644 (file)
@@ -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|^/|) {