Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Draft
wants to merge 3 commits into
base: release4.0
Choose a base branch
from

Conversation

v6ak
Copy link
Contributor

@v6ak v6ak commented May 18, 2021

Partial fix for QubesOS/qubes-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

@marmarek
Copy link
Member

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

@v6ak
Copy link
Contributor Author

v6ak commented May 18, 2021

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

@DemiMarie
Copy link
Contributor

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

@marmarek
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants