Commit 0efae50
committed
refactor: move KVM related logic into a separate struct
`Vm` constructor was the only place where the `/dev/kvm` was open
and only there we could do any KVM (not VM) specific checks.
By moving this KVM logic into a separate struct we can can do
KVM specific actions (like checking optional KVM capabilities)
without needing to reopen the `/dev/kvm` again.
Signed-off-by: Egor Lazarchuk <[email protected]>1 parent 3fb06e9 commit 0efae50
File tree
12 files changed
+372
-273
lines changed- src/vmm/src
- arch/aarch64
- device_manager
- vstate
- vcpu
12 files changed
+372
-273
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
218 | 217 | | |
219 | 218 | | |
220 | 219 | | |
221 | 220 | | |
| 221 | + | |
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
226 | | - | |
| 225 | + | |
| 226 | + | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
246 | | - | |
| 245 | + | |
| 246 | + | |
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
265 | | - | |
| 264 | + | |
| 265 | + | |
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
286 | | - | |
287 | | - | |
| 286 | + | |
| 287 | + | |
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
160 | 161 | | |
161 | 162 | | |
162 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
163 | 167 | | |
164 | 168 | | |
165 | | - | |
| 169 | + | |
166 | 170 | | |
167 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
168 | 175 | | |
169 | 176 | | |
170 | 177 | | |
| |||
186 | 193 | | |
187 | 194 | | |
188 | 195 | | |
189 | | - | |
| 196 | + | |
190 | 197 | | |
191 | 198 | | |
192 | 199 | | |
| |||
218 | 225 | | |
219 | 226 | | |
220 | 227 | | |
221 | | - | |
| 228 | + | |
222 | 229 | | |
223 | 230 | | |
224 | 231 | | |
| |||
227 | 234 | | |
228 | 235 | | |
229 | 236 | | |
| 237 | + | |
230 | 238 | | |
231 | 239 | | |
232 | 240 | | |
| |||
476 | 484 | | |
477 | 485 | | |
478 | 486 | | |
479 | | - | |
| 487 | + | |
480 | 488 | | |
481 | 489 | | |
482 | 490 | | |
| |||
738 | 746 | | |
739 | 747 | | |
740 | 748 | | |
741 | | - | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
742 | 755 | | |
743 | 756 | | |
744 | 757 | | |
745 | | - | |
| 758 | + | |
746 | 759 | | |
747 | 760 | | |
748 | 761 | | |
| |||
765 | 778 | | |
766 | 779 | | |
767 | 780 | | |
768 | | - | |
| 781 | + | |
769 | 782 | | |
770 | 783 | | |
771 | 784 | | |
| |||
1111 | 1124 | | |
1112 | 1125 | | |
1113 | 1126 | | |
1114 | | - | |
| 1127 | + | |
| 1128 | + | |
1115 | 1129 | | |
1116 | 1130 | | |
1117 | 1131 | | |
| |||
1137 | 1151 | | |
1138 | 1152 | | |
1139 | 1153 | | |
1140 | | - | |
| 1154 | + | |
1141 | 1155 | | |
1142 | 1156 | | |
1143 | 1157 | | |
1144 | 1158 | | |
1145 | 1159 | | |
1146 | 1160 | | |
1147 | 1161 | | |
| 1162 | + | |
1148 | 1163 | | |
1149 | 1164 | | |
1150 | 1165 | | |
| |||
1362 | 1377 | | |
1363 | 1378 | | |
1364 | 1379 | | |
| 1380 | + | |
1365 | 1381 | | |
1366 | | - | |
| 1382 | + | |
1367 | 1383 | | |
1368 | 1384 | | |
1369 | 1385 | | |
1370 | 1386 | | |
1371 | 1387 | | |
1372 | 1388 | | |
1373 | | - | |
| 1389 | + | |
1374 | 1390 | | |
1375 | 1391 | | |
1376 | 1392 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | | - | |
248 | | - | |
| 247 | + | |
249 | 248 | | |
250 | 249 | | |
251 | 250 | | |
252 | | - | |
253 | | - | |
254 | | - | |
| 251 | + | |
255 | 252 | | |
256 | 253 | | |
257 | 254 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
544 | 544 | | |
545 | 545 | | |
546 | 546 | | |
| 547 | + | |
547 | 548 | | |
548 | 549 | | |
549 | 550 | | |
| |||
661 | 662 | | |
662 | 663 | | |
663 | 664 | | |
664 | | - | |
| 665 | + | |
| 666 | + | |
665 | 667 | | |
666 | 668 | | |
667 | 669 | | |
| |||
690 | 692 | | |
691 | 693 | | |
692 | 694 | | |
693 | | - | |
| 695 | + | |
| 696 | + | |
694 | 697 | | |
695 | 698 | | |
696 | 699 | | |
| |||
744 | 747 | | |
745 | 748 | | |
746 | 749 | | |
747 | | - | |
| 750 | + | |
| 751 | + | |
748 | 752 | | |
749 | 753 | | |
750 | 754 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
| |||
255 | 256 | | |
256 | 257 | | |
257 | 258 | | |
| 259 | + | |
| 260 | + | |
258 | 261 | | |
259 | 262 | | |
260 | 263 | | |
| |||
307 | 310 | | |
308 | 311 | | |
309 | 312 | | |
| 313 | + | |
310 | 314 | | |
311 | 315 | | |
312 | 316 | | |
| |||
511 | 515 | | |
512 | 516 | | |
513 | 517 | | |
| 518 | + | |
514 | 519 | | |
515 | 520 | | |
516 | 521 | | |
| |||
531 | 536 | | |
532 | 537 | | |
533 | 538 | | |
| 539 | + | |
534 | 540 | | |
535 | 541 | | |
536 | 542 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| 81 | + | |
| 82 | + | |
80 | 83 | | |
81 | 84 | | |
82 | 85 | | |
| |||
736 | 739 | | |
737 | 740 | | |
738 | 741 | | |
| 742 | + | |
739 | 743 | | |
740 | 744 | | |
741 | 745 | | |
| |||
0 commit comments