qubes-core-admin icon indicating copy to clipboard operation
qubes-core-admin copied to clipboard

Partial fix for PCI devices reordering. See https://github.com/QubesO…

Open v6ak opened this issue 4 years ago • 4 comments

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_list a bit. If the evolution is not clear, there is some intermediate step: https://gist.github.com/v6ak/23c6b5f84238e314a8a751c8ac6de48d

v6ak avatar May 18 '21 08:05 v6ak

* 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.

marmarek avatar May 18 '21 12:05 marmarek

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?)

v6ak avatar May 18 '21 14:05 v6ak

@marmarek can we get this going again? It would be a really nice fix for some problems I have had.

DemiMarie avatar Apr 21 '22 19:04 DemiMarie

@v6ak can you rebase this PR on master, and sign your commits?

marmarek avatar Jun 20 '22 00:06 marmarek