Commit 38c6693
committed
Fix panic in HasConfidentialPolicy for LCOW.
`HasConfidentialPolicy` assumed that
the UVM creation options saved in the UtilityVM struct will always be of type
`OptionsWCOW` & `OptionsLCOW`. However, for LCOW we store the options as a pointer (i.e
type `*OptionsLCOW`) whereas for WCOW we store the options as a value (i.e type
`OptionsWCOW`). This caused the `HasConfidentialPolicy` method to panic when testing the
policy for LCOW UtilityVM types.
Easy fix would be to just update the switch case to `*OptionsLCOW` instead of
`OptionsLCOW`, but it seems better to use the same type (create options pointer) for both
LCOW & WCOW to avoid such issues in future. In the long run we also want to refactor this
and have a common set of methods/types for handling confidential options for LCOW & WCOW.
Signed-off-by: Amit Barve <[email protected]>1 parent 6efa5fd commit 38c6693
3 files changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
505 | 505 | | |
506 | 506 | | |
507 | 507 | | |
508 | | - | |
| 508 | + | |
509 | 509 | | |
510 | 510 | | |
511 | 511 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
| 170 | + | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
342 | | - | |
343 | | - | |
| 342 | + | |
| 343 | + | |
344 | 344 | | |
345 | 345 | | |
346 | 346 | | |
| |||
0 commit comments