[libvirt] [PATCH] qemu: Remove code duplication