def _pv_device_reported(self, instance, vm_ref):
        vm_rec = self._session.VM.get_record(vm_ref)
        vif_list = [self._session.call_xenapi("VIF.get_record", vrec)
                    for vrec in vm_rec['VIFs']]
        net_devices = [vif['device'] for vif in vif_list]
        # NOTE(sulo): We infer the presence of pv driver
        # by the presence of a pv network device. If xenstore reports
        # device status as connected (status=4) we take that as the presence
        # of pv driver. Any other status will likely cause migration to fail.
        for device in net_devices:
            xs_path = "device/vif/%s/state" % device
            ret = self._read_from_xenstore(instance, xs_path, vm_ref=vm_ref)
            LOG.debug("PV Device vif.%(vif_ref)s reporting state %(ret)s",
                      {'vif_ref': device, 'ret': ret}, instance=instance)
            if strutils.is_int_like(ret) and int(ret) == 4:
                return True

        return False
dataset/ETHPy150Open openstack/nova/nova/virt/xenapi/vmops.py/VMOps._pv_device_reported/original