[PATCH v2 07/21] qemu: hostdev: Move the hostdev preparation to a separate function