[pve-devel] [PATCH storage 5/5] add default rotational value

Dominik Csapak d.csapak at proxmox.com
Mon Oct 17 11:26:37 CEST 2016


On 10/17/2016 10:29 AM, Dominik Csapak wrote:
> because if the file does not exist,
> we have an perl error for comparing an uninitialized
> value
>
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  PVE/Diskmanage.pm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/PVE/Diskmanage.pm b/PVE/Diskmanage.pm
> index c8706b7..0bd0556 100644
> --- a/PVE/Diskmanage.pm
> +++ b/PVE/Diskmanage.pm
> @@ -282,7 +282,7 @@ sub get_sysdir_info {
>      $data->{size} = $size * 512;
>
>      # dir/queue/rotational should be 1 for hdd, 0 for ssd
> -    $data->{rotational} = file_read_firstline("$sysdir/queue/rotational");
> +    $data->{rotational} = file_read_firstline("$sysdir/queue/rotational") || -1;

this should be

$data->{rotational} = file_read_firstline("$sysdir/queue/rotational") // -1;

or else all ssds show up as "unknown"






More information about the pve-devel mailing list