Commit 87d5358
KVM: selftests: Clean up stats fd in common stats_test() helper
Move the stats fd cleanup code into stats_test() and drop the
superfluous vm_stats_test() and vcpu_stats_test() helpers in order to
decouple creation of the stats file from consuming/testing the file
(deduping code is a bonus). This will make it easier to test various
edge cases related to stats, e.g. that userspace can dup() a stats fd,
that userspace can have multiple stats files for a singleVM/vCPU, etc.
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20230711230131.648752-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>1 parent 625646a commit 87d5358
1 file changed
Lines changed: 4 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | 170 | | |
186 | | - | |
187 | 171 | | |
188 | 172 | | |
189 | 173 | | |
| |||
241 | 225 | | |
242 | 226 | | |
243 | 227 | | |
244 | | - | |
| 228 | + | |
| 229 | + | |
245 | 230 | | |
246 | | - | |
| 231 | + | |
| 232 | + | |
247 | 233 | | |
248 | 234 | | |
249 | 235 | | |
| |||
0 commit comments