[libvirt] [PATCH] qemu: eliminate nested switch, simplify code