def qemuAgentCommand(domain, cmd, timeout, flags): """Send a Guest Agent command to domain """ ret = libvirtmod_qemu.virDomainQemuAgentCommand(domain._o, cmd, timeout, flags) if ret is None: raise libvirt.libvirtError('virDomainQemuAgentCommand() failed') return ret
def _qemuAgentGuestPing(self, domain, timeout, flags=0): def _no_heartbeat(domain_uuid): # Also advance the FSM self.getVmFsm(domain_uuid).processEvent('guest_not_pingable') self._getJournalObject(domain_uuid).incrementFailedCount() def _with_heartbeat(domain_uuid): #The order matters as we want to decrease the counter first self._getJournalObject(domain_uuid).resetFailedCount() self.getVmFsm(domain_uuid).processEvent('guest_pingable') def _record(result): if result is None: LOG.debug(domain.UUIDString() + '\tqemu-ga_guest-ping is not responding.') if self._thresholdsCrossing(domain): self._masakari_notifier(domain.UUIDString()) _no_heartbeat(domain.UUIDString()) else: _with_heartbeat(domain.UUIDString()) """Send a Guest Agent ping to domain """ # must pass domain._o to the c library as virDomainPtr ret = libvirtmod_qemu.virDomainQemuAgentCommand( domain._o, '{"execute": "guest-ping"}', timeout, flags) _record(ret)
def qemuAgentCommand(domain, cmd, timeout, flags): """Send a Guest Agent command to domain """ ret = libvirtmod_qemu.virDomainQemuAgentCommand(domain._o, cmd, timeout, flags) if ret is None: raise libvirt.libvirtError("virDomainQemuAgentCommand() failed") return ret