[PATCH] qemu: Rewrite code to the pattern