Skip to content

Commit

Permalink
runtime: remote hypervisor updates to ttrpc
Browse files Browse the repository at this point in the history
- Update the remote hypervisor code to match the re-genned code for
the ttrpc Hypervisor Service

Fixes: #8519
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
  • Loading branch information
stevenhorsman committed Nov 29, 2023
1 parent d2bf8e7 commit e10e918
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/runtime/virtcontainers/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ package virtcontainers
import (
"context"
"fmt"
"net"
"os"
"strconv"
"time"

cri "github.com/containerd/containerd/pkg/cri/annotations"
"github.com/containerd/ttrpc"
persistapi "github.com/kata-containers/kata-containers/src/runtime/pkg/hypervisors"
pb "github.com/kata-containers/kata-containers/src/runtime/protocols/hypervisor"
hypannotations "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/annotations"
"github.com/kata-containers/kata-containers/src/runtime/virtcontainers/types"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)

const defaultMinTimeout = 60
Expand All @@ -32,18 +32,20 @@ type remoteHypervisor struct {
type remoteHypervisorSandboxID string

type remoteService struct {
conn *grpc.ClientConn
client pb.HypervisorClient
conn net.Conn
client pb.HypervisorService
}

func openRemoteService(socketPath string) (*remoteService, error) {

conn, err := grpc.Dial(fmt.Sprintf("unix://%s", socketPath), grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, err := net.Dial("unix", socketPath)
if err != nil {
return nil, fmt.Errorf("failed to connect to remote hypervisor socket: %w", err)
}
defer conn.Close()
client := pb.NewHypervisorClient(conn)

ttrpcClient := ttrpc.NewClient(conn)

client := pb.NewHypervisorClient(ttrpcClient)

s := &remoteService{
conn: conn,
Expand Down

0 comments on commit e10e918

Please sign in to comment.