This value needs to be set to actual static max for qmemman to work
properly. If it's set higher than real static-max, qmemman will try to
assign more memory to dom0, which dom0 could not use - will be wasted.
Since this script is executed before any VM is started, simply
take the current dom0 memory usage, instead of parsing dom0_mem Xen
argument. There doesn't seem to be nice API to get this value from Xen
directly.
FixesQubesOS/qubes-issues#4891
Not only refresh the info about mounted devices, but also check for
others - detected before xenstored was running. Because of recent change
in udev rules (adding flock) it shouldn't deadlock now.