Commit 6820ada
block: Improve block device request error handling
The current implementation of `VirtioBlockDevice::request()` panics if
`data` is `None` or `data` size is not equal to sector size. This commit
removes the panics and adds error handlings.
Signed-off-by: Akira Moroo <retrage01@gmail.com>1 parent 5bc8086 commit 6820ada
3 files changed
+19
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
| |||
236 | 238 | | |
237 | 239 | | |
238 | 240 | | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | 241 | | |
244 | 242 | | |
245 | 243 | | |
| |||
268 | 266 | | |
269 | 267 | | |
270 | 268 | | |
271 | | - | |
272 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
273 | 281 | | |
274 | 282 | | |
275 | 283 | | |
| |||
306 | 314 | | |
307 | 315 | | |
308 | 316 | | |
309 | | - | |
| 317 | + | |
310 | 318 | | |
311 | 319 | | |
312 | 320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
557 | | - | |
| 557 | + | |
558 | 558 | | |
559 | 559 | | |
560 | 560 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
| 185 | + | |
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
| 189 | + | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| |||
0 commit comments