From ce27473110750d2844444c4ec8fcc414d6bbf40b Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Sat, 28 Sep 2024 10:08:43 -0700 Subject: [PATCH] VirtIO disks aren't IDE --- fdisk/edit_disk.cgi | 7 +++---- fdisk/fdisk-lib.pl | 5 +++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fdisk/edit_disk.cgi b/fdisk/edit_disk.cgi index 6bb7024bf..79910b239 100755 --- a/fdisk/edit_disk.cgi +++ b/fdisk/edit_disk.cgi @@ -12,10 +12,9 @@ $d || &error($text{'disk_egone'}); @parts = @{$d->{'parts'}}; &ui_print_header($d->{'desc'}, $text{'disk_title'}, "", undef, @disks == 1 ? 1 : 0, @disks == 1 ? 1 : 0); -$caneditpart = - $d->{'table'} ne 'gpt' || - ($d->{'table'} eq 'gpt' && - &has_command('parted') && $config{'mode'} ne 'fdisk'); +$caneditpart = $d->{'table'} ne 'gpt' || + ($d->{'table'} eq 'gpt' && + &has_command('parted') && $config{'mode'} ne 'fdisk'); # Work out links to add partitions foreach $p (@parts) { diff --git a/fdisk/fdisk-lib.pl b/fdisk/fdisk-lib.pl index be66da2a8..1a7ffc8c2 100755 --- a/fdisk/fdisk-lib.pl +++ b/fdisk/fdisk-lib.pl @@ -324,7 +324,7 @@ while() { # KVM virtual disk $disk->{'desc'} = &text('select_device', 'VirtIO', uc($1)); - $disk->{'type'} = 'ide'; + $disk->{'type'} = 'virtio'; } elsif ($disk->{'device'} =~ /\/(scsi\/host(\d+)\/bus(\d+)\/target(\d+)\/lun(\d+)\/disc)/) { # New complete SCSI disk specification @@ -1764,7 +1764,8 @@ return $disk->{'table'} eq 'gpt'; sub supports_hdparm { local ($d) = @_; -return $d->{'type'} eq 'ide' || $d->{'type'} eq 'scsi' && $d->{'model'} =~ /ATA/; +return $d->{'type'} eq 'ide' || + $d->{'type'} eq 'scsi' && $d->{'model'} =~ /ATA/; } # supports_relabel(&disk)