qubes-core-admin
qubes-core-admin copied to clipboard
Partial fix for PCI devices reordering. See https://github.com/QubesO…
Partial fix for https://github.com/QubesOS/qubes-issues/issues/6587
- Persistently assigned block devices no longer reorder. (This does not matter much on its own, as their order in qubes.xml is mostly irelevant, but it is much easier to test, as I can increase the reproduction rate to nearly 100 % by assigning plenty of block devices.)
- PCI devices seem to reorder less frequently. I'd like to investigate this deeper, but this is all I know ATM.
- They are rather conservative – I haven't touched the original method assignments, but rather copied and created a new one. It doesn't seem to be hard to change other occurrences, but I am not sure about testing.
- Tests: works on my machine. I see, it deserves to be better, but I am not sure how to do it properly.
- I believe I have simplified the for cycle of
DeviceCollection.assignments_lista bit. If the evolution is not clear, there is some intermediate step: https://gist.github.com/v6ak/23c6b5f84238e314a8a751c8ac6de48d
* They are rather conservative – I haven't touched the original method assignments, but rather copied and created a new one. It doesn't seem to be hard to change other occurrences, but I am not sure about testing.
I think it should be ok to replace original assignments method.
PCI devices seem to reorder less frequently. I'd like to investigate this deeper, but this is all I know ATM.
If you replace the original assignments method, it will be used in libvirt xml template too (templates/libvirt/xen.xml) - which I guess is another source of reordering.
Aha, good point. So, IIUC, create_config_file generates randomized XML and it is cached in /var/lib/xen/userdata-d.* files. So, it can survive some reboots, and thus it is reordered far less often than in 50 % cases. Can I somehow speed the testing up, e.g. by sudo rm /var/lib/xen/userdata-d.*? (Is it safe?)
@marmarek can we get this going again? It would be a really nice fix for some problems I have had.
@v6ak can you rebase this PR on master, and sign your commits?