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