[libvirt PATCH v2] iohelper: some refactoring