* [pve-devel] [PATCH qemu-server v2 1/2] fix #5363: cloudinit: make creation of scsi cloudinit discs possible again
@ 2024-04-10 11:17 Hannes Duerr
2024-04-10 11:17 ` [pve-devel] [PATCH qemu-server v2 2/2] drive: improve readability to get_scsi_device_type Hannes Duerr
2024-04-10 13:42 ` [pve-devel] applied: [PATCH qemu-server v2 1/2] fix #5363: cloudinit: make creation of scsi cloudinit discs possible again Thomas Lamprecht
0 siblings, 2 replies; 3+ messages in thread
From: Hannes Duerr @ 2024-04-10 11:17 UTC (permalink / raw)
To: pve-devel
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.
The mentioned error was introduced by this patch:
https://lists.proxmox.com/pipermail/pve-devel/2024-January/061311.html
Signed-off-by: Hannes Duerr <h.duerr@proxmox.com>
---
Changes since v1:
- fixed rephrased commit message
- added reference to the commit which introduced the bug
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
* [pve-devel] [PATCH qemu-server v2 2/2] drive: improve readability to get_scsi_device_type
2024-04-10 11:17 [pve-devel] [PATCH qemu-server v2 1/2] fix #5363: cloudinit: make creation of scsi cloudinit discs possible again Hannes Duerr
@ 2024-04-10 11:17 ` Hannes Duerr
2024-04-10 13:42 ` [pve-devel] applied: [PATCH qemu-server v2 1/2] fix #5363: cloudinit: make creation of scsi cloudinit discs possible again Thomas Lamprecht
1 sibling, 0 replies; 3+ messages in thread
From: Hannes Duerr @ 2024-04-10 11:17 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Hannes Duerr <h.duerr@proxmox.com>
---
PVE/API2/Qemu.pm | 2 +-
PVE/QemuServer.pm | 2 +-
PVE/QemuServer/Drive.pm | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index 497987f..dc44dee 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -751,7 +751,7 @@ sub assert_scsi_feature_compatibility {
my $machine_type = PVE::QemuServer::get_vm_machine($conf, undef, $conf->{arch});
my $machine_version = PVE::QemuServer::Machine::extract_version(
$machine_type, PVE::QemuServer::kvm_user_version());
- my $drivetype = PVE::QemuServer::Drive::get_scsi_devicetype(
+ my $drivetype = PVE::QemuServer::Drive::get_scsi_device_type(
$drive, $storecfg, $machine_version);
if ($drivetype ne 'hd' && $drivetype ne 'cd') {
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 6e2c805..bd375a2 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -1413,7 +1413,7 @@ sub print_drivedevice_full {
my $unit = $drive->{index} % $maxdev;
my $machine_version = extract_version($machine_type, kvm_user_version());
- my $devicetype = PVE::QemuServer::Drive::get_scsi_devicetype(
+ my $devicetype = PVE::QemuServer::Drive::get_scsi_device_type(
$drive, $storecfg, $machine_version);
if (!$conf->{scsihw} || $conf->{scsihw} =~ m/^lsi/ || $conf->{scsihw} eq 'pvscsi') {
diff --git a/PVE/QemuServer/Drive.pm b/PVE/QemuServer/Drive.pm
index c829bde..6a4fafd 100644
--- a/PVE/QemuServer/Drive.pm
+++ b/PVE/QemuServer/Drive.pm
@@ -848,7 +848,7 @@ sub path_is_scsi {
return $res;
}
-sub get_scsi_devicetype {
+sub get_scsi_device_type {
my ($drive, $storecfg, $machine_version) = @_;
my $devicetype = 'hd';
--
2.39.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* [pve-devel] applied: [PATCH qemu-server v2 1/2] fix #5363: cloudinit: make creation of scsi cloudinit discs possible again
2024-04-10 11:17 [pve-devel] [PATCH qemu-server v2 1/2] fix #5363: cloudinit: make creation of scsi cloudinit discs possible again Hannes Duerr
2024-04-10 11:17 ` [pve-devel] [PATCH qemu-server v2 2/2] drive: improve readability to get_scsi_device_type Hannes Duerr
@ 2024-04-10 13:42 ` Thomas Lamprecht
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2024-04-10 13:42 UTC (permalink / raw)
To: Proxmox VE development discussion, Hannes Duerr
Am 10/04/2024 um 13:17 schrieb Hannes Duerr:
> 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.
>
> The mentioned error was introduced by this patch:
> https://lists.proxmox.com/pipermail/pve-devel/2024-January/061311.html
>
> Signed-off-by: Hannes Duerr <h.duerr@proxmox.com>
> ---
> Changes since v1:
> - fixed rephrased commit message
> - added reference to the commit which introduced the bug
>
> PVE/QemuServer/Drive.pm | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>
applied both patches, thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-04-10 13:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-10 11:17 [pve-devel] [PATCH qemu-server v2 1/2] fix #5363: cloudinit: make creation of scsi cloudinit discs possible again Hannes Duerr
2024-04-10 11:17 ` [pve-devel] [PATCH qemu-server v2 2/2] drive: improve readability to get_scsi_device_type Hannes Duerr
2024-04-10 13:42 ` [pve-devel] applied: [PATCH qemu-server v2 1/2] fix #5363: cloudinit: make creation of scsi cloudinit discs possible again Thomas Lamprecht
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal