Commit a986bcb
fix(virtio): avoid panic on device activation failure
According to the VirtIO spec section 2.1.2, when we enter a failed state
we need to to set `DEVICE_NEEDS_RESET` status field and if `DRIVER_OK`
is set we need to must send a device configuration change interrupt to
the driver.
In MMIO code we were trying to follow this logic, but we were trying to
get the interrupt object from the device, which fails (and panics)
because interrupts are only set in the device upon successful
activation. In the PCI transport, instead, we were not doing this at
all.
The transport layers hold a reference to the interrupts at all times.
So, add the missing logic to the PCI transport and use the transport
layer reference in both transports to avoid panics.
Signed-off-by: Babis Chalios <[email protected]>1 parent c9b0e64 commit a986bcb
2 files changed
+15
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
| 193 | + | |
197 | 194 | | |
198 | 195 | | |
199 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1029 | 1029 | | |
1030 | 1030 | | |
1031 | 1031 | | |
1032 | | - | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
1033 | 1035 | | |
1034 | 1036 | | |
1035 | | - | |
1036 | | - | |
1037 | | - | |
1038 | | - | |
1039 | | - | |
1040 | | - | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
1041 | 1048 | | |
1042 | 1049 | | |
1043 | 1050 | | |
| |||
0 commit comments