[libvirt] [PATCH 2/4] qemu: refactor device modification functions