예제 #1
0
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
예제 #2
0
    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)
예제 #3
0
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