Since 18.04 was an LTS I have already added quite some patches on top of 4.0 before it was released to stabilize it.
Due to that the kernelversion detection already is in:
debian/patches/stable/0004-qemu-Refresh-caps-cache-after-booting-a-different-ke.patch
That leaves just nesting to be backported, but with a much better understanding of the overall situation \o/
Since 18.04 was an LTS I have already added quite some patches on top of 4.0 before it was released to stabilize it. patches/ stable/ 0004-qemu- Refresh- caps-cache- after-booting- a-different- ke.patch
Due to that the kernelversion detection already is in:
debian/
That leaves just nesting to be backported, but with a much better understanding of the overall situation \o/