Skip to content

Commit

Permalink
Merge pull request kata-containers#2344 from jcvenegas/test-api-fixes…
Browse files Browse the repository at this point in the history
…-clh

clh: update to latest master
  • Loading branch information
GabyCT committed Dec 13, 2019
2 parents 76f9b34 + 9c3151e commit 449a3a9
Show file tree
Hide file tree
Showing 24 changed files with 419 additions and 189 deletions.
2 changes: 1 addition & 1 deletion versions.yaml
Expand Up @@ -75,7 +75,7 @@ assets:
url: "https://github.com/intel/cloud-hypervisor"
uscan-url: >-
https://github.com/intel/cloud-hypervisor/tags.*/v?(\d\S+)\.tar\.gz
version: "ca97385da5ebb798"
version: "v0.4.0"

firecracker:
description: "Firecracker micro-VMM"
Expand Down
22 changes: 6 additions & 16 deletions virtcontainers/clh.go
Expand Up @@ -48,8 +48,6 @@ const (
// Values are mandatory by http API
// Values based on:
// github.com/cloud-hypervisor/cloud-hypervisor/blob/v0.3.0/vmm/src/config.rs#L395
clhFsQueues = 1
clhFsQueueSize = 1024
clhTimeout = 10
clhAPITimeout = 1
clhStopSandboxTimeout = 3
Expand Down Expand Up @@ -176,9 +174,10 @@ func (clh *cloudHypervisor) createSandbox(ctx context.Context, id string, networ
clh.vmconfig.Memory.Size = int64(clh.config.MemorySize) << utils.MibToBytesShift
clh.vmconfig.Memory.File = "/dev/shm"
// Set initial amount of cpu's for the virtual machine
clh.vmconfig.Cpus = chclient.CpuConfig{
clh.vmconfig.Cpus = chclient.CpusConfig{
// cast to int32, as openAPI has a limitation that it does not support unsigned values
CpuCount: int32(clh.config.NumVCPUs),
BootVcpus: int32(clh.config.NumVCPUs),
MaxVcpus: int32(clh.config.DefaultMaxVCPUs),
}

// Add the kernel path
Expand Down Expand Up @@ -1041,12 +1040,7 @@ func (clh *cloudHypervisor) addNet(e Endpoint) {
"tap": tapPath,
}).Info("Adding Net")

// FIXME: This is required by CH
// remove after PR is merged:
// https://github.com/cloud-hypervisor/cloud-hypervisor/pull/480
ip := "0.0.0.0"
mask := "0.0.0.0"
clh.vmconfig.Net = append(clh.vmconfig.Net, chclient.NetConfig{Mac: mac, Tap: tapPath, Ip: ip, Mask: mask})
clh.vmconfig.Net = append(clh.vmconfig.Net, chclient.NetConfig{Mac: mac, Tap: tapPath})
}

// Add shared Volume using virtiofs
Expand All @@ -1066,17 +1060,13 @@ func (clh *cloudHypervisor) addVolume(volume types.Volume) error {
Tag: volume.MountTag,
CacheSize: int64(clh.config.VirtioFSCacheSize << 20),
Sock: vfsdSockPath,
NumQueues: clhFsQueues,
QueueSize: clhFsQueueSize,
},
}
} else {
clh.vmconfig.Fs = []chclient.FsConfig{
{
Tag: volume.MountTag,
Sock: vfsdSockPath,
NumQueues: clhFsQueues,
QueueSize: clhFsQueueSize,
Tag: volume.MountTag,
Sock: vfsdSockPath,
},
}

Expand Down
@@ -1 +1 @@
4.2.2-SNAPSHOT
4.2.3-SNAPSHOT
5 changes: 3 additions & 2 deletions virtcontainers/pkg/cloud-hypervisor/client/README.md
Expand Up @@ -41,14 +41,15 @@ Class | Method | HTTP request | Description
*DefaultApi* | [**ShutdownVM**](docs/DefaultApi.md#shutdownvm) | **Put** /vm.shutdown | Shut the VM instance down.
*DefaultApi* | [**ShutdownVMM**](docs/DefaultApi.md#shutdownvmm) | **Put** /vmm.shutdown | Shuts the cloud-hypervisor VMM.
*DefaultApi* | [**VmInfoGet**](docs/DefaultApi.md#vminfoget) | **Get** /vm.info | Returns general information about the cloud-hypervisor Virtual Machine (VM) instance.
*DefaultApi* | [**VmResizePut**](docs/DefaultApi.md#vmresizeput) | **Put** /vm.resize | Resize the VM
*DefaultApi* | [**VmmPingGet**](docs/DefaultApi.md#vmmpingget) | **Get** /vmm.ping | Ping the VMM to check for API server availability


## Documentation For Models

- [CmdLineConfig](docs/CmdLineConfig.md)
- [ConsoleConfig](docs/ConsoleConfig.md)
- [CpuConfig](docs/CpuConfig.md)
- [CpusConfig](docs/CpusConfig.md)
- [DeviceConfig](docs/DeviceConfig.md)
- [DiskConfig](docs/DiskConfig.md)
- [FsConfig](docs/FsConfig.md)
Expand All @@ -58,10 +59,10 @@ Class | Method | HTTP request | Description
- [PmemConfig](docs/PmemConfig.md)
- [RngConfig](docs/RngConfig.md)
- [VhostUserBlkConfig](docs/VhostUserBlkConfig.md)
- [VhostUserConfig](docs/VhostUserConfig.md)
- [VhostUserNetConfig](docs/VhostUserNetConfig.md)
- [VmConfig](docs/VmConfig.md)
- [VmInfo](docs/VmInfo.md)
- [VmResize](docs/VmResize.md)
- [VmmPingResponse](docs/VmmPingResponse.md)
- [VsockConfig](docs/VsockConfig.md)

Expand Down

0 comments on commit 449a3a9

Please sign in to comment.