mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-16 22:50:10 +03:00
F 5885: Select vGPU profile (#2169)
This commit is contained in:
parent
e72a9b0ea7
commit
c096e95bf4
@ -147,6 +147,15 @@ devices.each do |dev|
|
||||
# name, in this way Sunstone shows a better name
|
||||
values << pval('DEVICE_NAME',
|
||||
"#{dev[:vendor_name]} #{dev[:device_name]}")
|
||||
|
||||
|
||||
# Get profiles
|
||||
addr = "0000:#{dev[:bus]}:#{dev[:slot]}.#{dev[:function]}"
|
||||
profiles = `ls /sys/class/mdev_bus/#{addr}/mdev_supported_types`
|
||||
profiles = profiles.split("\n")
|
||||
|
||||
# Comma separated value with different profiles
|
||||
values << pval('PROFILES', profiles.join(','))
|
||||
else
|
||||
values << pval('DEVICE_NAME', dev[:device_name])
|
||||
end
|
||||
|
@ -40,6 +40,7 @@ function get_mdev_path() {
|
||||
bus=$(get_xpath_val "$pci" "/PCI/BUS")
|
||||
slot=$(get_xpath_val "$pci" "/PCI/SLOT")
|
||||
func=$(get_xpath_val "$pci" "/PCI/FUNCTION")
|
||||
profile=$(get_xpath_val "$pci" "/PCI/PROFILE")
|
||||
|
||||
# Generate mdev path
|
||||
mdev="/sys/class/mdev_bus/$domain:$bus:$slot.$func"
|
||||
@ -50,10 +51,12 @@ function get_mdev_path() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# TODO: give the user the ability to choose this
|
||||
device="$(ls "$mdev/mdev_supported_types" | head -n1)"
|
||||
if [ -z "$profile" ]
|
||||
then
|
||||
profile="$(ls "$mdev/mdev_supported_types" | head -n1)"
|
||||
fi
|
||||
|
||||
echo "$mdev/mdev_supported_types/$device/"
|
||||
echo "$mdev/mdev_supported_types/$profile/"
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user