'Get job info for the domain
Query the libvirt job info for the domain (ie progress
of migration, or snapshot operation)
:returns: a JobInfo of guest'

def get_job_info(self):

    if JobInfo._have_job_stats:
        try:
            stats = self._domain.jobStats()
            return JobInfo(**stats)
        except libvirt.libvirtError as ex:
            if (ex.get_error_code() == libvirt.VIR_ERR_NO_SUPPORT):
                LOG.debug('Missing    remote    virDomainGetJobStats:    %s', ex)
                JobInfo._have_job_stats = False
                return JobInfo._get_job_stats_compat(self._domain)
            elif (ex.get_error_code() in (libvirt.VIR_ERR_NO_DOMAIN, libvirt.VIR_ERR_OPERATION_INVALID)):
                LOG.debug('Domain    has    shutdown/gone    away:    %s', ex)
                return JobInfo(type=libvirt.VIR_DOMAIN_JOB_COMPLETED)
            else:
                LOG.debug('Failed    to    get    job    stats:    %s', ex)
                raise
        except AttributeError as ex:
            LOG.debug('Missing    local    virDomainGetJobStats:    %s', ex)
            JobInfo._have_job_stats = False
            return JobInfo._get_job_stats_compat(self._domain)
    else:
        return JobInfo._get_job_stats_compat(self._domain)
