Commit ec68944
committed
Dynamically configure VirtIO node of Device Tree
PR #584 initializes the vblk only when the vblk CLI option is provided.
This leads to a segmentation fault when vblk is not specified, as the
capacity of the vblk device is left uninitialized (not set to 0).
Previously, the code would always initialize vblk but set its capacity
to 0, preventing the VirtIO block driver from interacting with it and
avoiding the segmentation fault. However, this original approach was
functionally redundant.
A better solution is to dynamically load or unload the VirtIO node in
the SoC node of the Device Tree based on configuration. To support
future others VirtIO devices, the interface of load_dtb() has been
refined, it now can parse all options stored in the attribute.1 parent 885c378 commit ec68944
1 file changed
+14
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
288 | | - | |
| 288 | + | |
289 | 289 | | |
290 | 290 | | |
| 291 | + | |
| 292 | + | |
291 | 293 | | |
292 | 294 | | |
293 | 295 | | |
| |||
314 | 316 | | |
315 | 317 | | |
316 | 318 | | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
317 | 329 | | |
318 | 330 | | |
319 | 331 | | |
| |||
499 | 511 | | |
500 | 512 | | |
501 | 513 | | |
502 | | - | |
| 514 | + | |
503 | 515 | | |
504 | 516 | | |
505 | 517 | | |
| |||
0 commit comments