File tree Expand file tree Collapse file tree 1 file changed +7
-24
lines changed
src/im_mad/remotes/kvm-probes.d/host/system Expand file tree Collapse file tree 1 file changed +7
-24
lines changed Original file line number Diff line number Diff line change 40
40
ENV [ 'LANG' ] = 'C'
41
41
ENV [ 'LC_ALL' ] = 'C'
42
42
43
- GUEST_ARCHS = [ 'i686' , 'x86_64' ]
43
+ GUEST_ARCHS = [ 'i686' , 'x86_64' , 'aarch64' ]
44
44
45
45
begin
46
46
machines = [ ]
105
105
end
106
106
end
107
107
108
- cmd = "virsh -r -c qemu:///system cpu-models #{ a } "
109
- cpu_models , _e , s = Open3 . capture3 ( cmd )
108
+ cmd = "virsh -c qemu:///system domcapabilities --arch #{ a } "
109
+ domcapabilities , _e , s = Open3 . capture3 ( cmd )
110
+ next unless s . success?
110
111
111
- break unless s . success?
112
-
113
- cpu_models . each_line do |l |
114
- l . chomp!
115
- next if l . empty? || l =~ /all CPU models are accepted/i
116
-
117
- models << l
118
- end
119
- end
120
-
121
- # Filter out the unsupported CPU models
122
- cmd = 'virsh -c qemu:///system domcapabilities kvm'
123
- domcapabilities , _e , s = Open3 . capture3 ( cmd )
124
-
125
- if s . success?
126
112
domcap_xml = REXML ::Document . new ( domcapabilities )
127
113
domcap_xml = domcap_xml . root
128
114
129
- cpu_mode_xpath = "cpu/mode[@name='custom',@supported='yes']"
130
- cpu_mode_custom_elem = domcap_xml . elements [ cpu_mode_xpath ]
131
-
132
- cpu_mode_custom_elem . elements . each ( "model[@usable='no']" ) do |m |
133
- models . delete ( m . text )
134
- end if cpu_mode_custom_elem
115
+ models = domcap_xml . elements . to_a (
116
+ "cpu/mode[@name='custom' and @supported='yes']/model[@usable!='no']"
117
+ ) . map ( &:text )
135
118
end
136
119
137
120
machines . uniq!
You can’t perform that action at this time.
0 commit comments