},
);
+my %wwn_fmt = (
+ wwn => {
+ type => 'string',
+ pattern => qr/^(0x)[0-9a-fA-F]{16}/,
+ format_description => 'wwn',
+ description => "The drive's worldwide name, encoded as 16 bytes hex string, prefixed by '0x'.",
+ optional => 1,
+ },
+);
+
my $add_throttle_desc = sub {
my ($key, $type, $what, $unit, $longunit, $minimum) = @_;
my $d = {
%drivedesc_base,
%model_fmt,
%ssd_fmt,
+ %wwn_fmt,
};
PVE::JSONSchema::register_format("pve-qm-ide", $ide_fmt);
%queues_fmt,
%scsiblock_fmt,
%ssd_fmt,
+ %wwn_fmt,
};
my $scsidesc = {
optional => 1,
my $sata_fmt = {
%drivedesc_base,
%ssd_fmt,
+ %wwn_fmt,
};
my $satadesc = {
optional => 1,
%queues_fmt,
%scsiblock_fmt,
%ssd_fmt,
+ %wwn_fmt,
};
my $efidisk_fmt = {
if ($drive->{ssd} && ($devicetype eq 'block' || $devicetype eq 'hd')) {
$device .= ",rotation_rate=1";
}
+ $device .= ",wwn=$drive->{wwn}" if $drive->{wwn};
} elsif ($drive->{interface} eq 'ide' || $drive->{interface} eq 'sata') {
my $maxdev = ($drive->{interface} eq 'sata') ? $MAX_SATA_DISKS : 2;
$device .= ",rotation_rate=1";
}
}
+ $device .= ",wwn=$drive->{wwn}" if $drive->{wwn};
} elsif ($drive->{interface} eq 'usb') {
die "implement me";
# -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0