github.com/cloud-foundations/dominator@v0.0.0-20221004181915-6e4fee580046/hypervisor/rpcd/getVmInfo.go (about)

     1  package rpcd
     2  
     3  import (
     4  	"github.com/Cloud-Foundations/Dominator/lib/errors"
     5  	"github.com/Cloud-Foundations/Dominator/lib/srpc"
     6  	"github.com/Cloud-Foundations/Dominator/proto/hypervisor"
     7  )
     8  
     9  func (t *srpcType) GetVmInfo(conn *srpc.Conn,
    10  	request hypervisor.GetVmInfoRequest,
    11  	reply *hypervisor.GetVmInfoResponse) error {
    12  	info, err := t.manager.GetVmInfo(request.IpAddress)
    13  	response := hypervisor.GetVmInfoResponse{
    14  		VmInfo: info,
    15  		Error:  errors.ErrorToString(err),
    16  	}
    17  	*reply = response
    18  	return nil
    19  }