mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-20 20:02:38 +09:00
Merge branch 'feature-3028'
This commit is contained in:
commit
2fff41d8d0
27 files changed
+1172
-177
No files matched your search
@@ -413,11 +413,22 @@ class OneHostHelper < OpenNebulaHelper::OneHelper
|
||||
|
||||
wilds = host.wilds
|
||||
|
||||
begin
|
||||
pcis = [host.to_hash['HOST']['HOST_SHARE']['PCI_DEVICES']['PCI']]
|
||||
pcis = pcis.flatten.compact
|
||||
rescue
|
||||
pcis = nil
|
||||
end
|
||||
|
||||
host.delete_element("TEMPLATE/VM")
|
||||
host.delete_element("TEMPLATE_WILDS")
|
||||
|
||||
puts host.template_str
|
||||
|
||||
if pcis && !pcis.empty?
|
||||
print_pcis(pcis)
|
||||
end
|
||||
|
||||
puts
|
||||
CLIHelper.print_header("WILD VIRTUAL MACHINES", false)
|
||||
puts
|
||||
@@ -457,4 +468,43 @@ class OneHostHelper < OpenNebulaHelper::OneHelper
|
||||
onevm_helper.client=@client
|
||||
onevm_helper.list_pool({:filter=>["HOST=#{host.name}"]}, false)
|
||||
end
|
||||
|
||||
def print_pcis(pcis)
|
||||
puts
|
||||
CLIHelper.print_header("PCI DEVICES", false)
|
||||
puts
|
||||
|
||||
table=CLIHelper::ShowTable.new(nil, self) do
|
||||
column :VM, "Used by VM", :size => 4, :left => false do |d|
|
||||
if d["VMID"] == "-1"
|
||||
""
|
||||
else
|
||||
d["VMID"]
|
||||
end
|
||||
end
|
||||
|
||||
column :ADDR, "PCI Address", :size => 7, :left => true do |d|
|
||||
d["SHORT_ADDRESS"]
|
||||
end
|
||||
|
||||
column :TYPE, "Type", :size => 14, :left => true do |d|
|
||||
d["TYPE"]
|
||||
end
|
||||
|
||||
column :CLASS, "Class", :size => 12, :left => true do |d|
|
||||
d["CLASS_NAME"]
|
||||
end
|
||||
|
||||
column :NAME, "Name", :size => 30, :left => true do |d|
|
||||
d["DEVICE_NAME"]
|
||||
end
|
||||
|
||||
column :VENDOR, "Vendor", :size => 8, :left => true do |d|
|
||||
d["VENDOR_NAME"]
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
table.show(pcis)
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user