Commit ea7179f
committed
KVM: selftests: Get VM's binary stats FD when opening VM
Get and cache a VM's binary stats FD when the VM is opened, as opposed to
waiting until the stats are first used. Opening the stats FD outside of
__vm_get_stat() will allow converting it to a scope-agnostic helper.
Note, this doesn't interfere with kvm_binary_stats_test's testcase that
verifies a stats FD can be used after its own VM's FD is closed, as the
cached FD is also closed during kvm_vm_free().
Link: https://lore.kernel.org/r/20250111005049.1247555-7-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>1 parent e65faf7 commit ea7179f
1 file changed
Lines changed: 11 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
199 | 204 | | |
200 | 205 | | |
201 | 206 | | |
| |||
661 | 666 | | |
662 | 667 | | |
663 | 668 | | |
664 | | - | |
| 669 | + | |
665 | 670 | | |
666 | 671 | | |
667 | | - | |
668 | | - | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
669 | 676 | | |
670 | 677 | | |
671 | 678 | | |
| 679 | + | |
672 | 680 | | |
673 | 681 | | |
674 | 682 | | |
| |||
2231 | 2239 | | |
2232 | 2240 | | |
2233 | 2241 | | |
2234 | | - | |
2235 | 2242 | | |
2236 | 2243 | | |
2237 | 2244 | | |
| |||
0 commit comments