[libvirt RFC v3 02/19] iohelper: refactor copy operation as a separate function