Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ assets:
url: "https://github.com/cloud-hypervisor/cloud-hypervisor"
uscan-url: >-
https://github.com/cloud-hypervisor/cloud-hypervisor/tags.*/v?(\d\S+)\.tar\.gz
version: "v0.8.0"
version: "v0.9.0"

firecracker:
description: "Firecracker micro-VMM"
Expand Down Expand Up @@ -106,9 +106,9 @@ assets:
commit: "47c1cc30e440860aa695358f7c2dd0b9d7b53d16"

qemu-experimental:
description: "QEMU with virtiofs 3.0"
description: "QEMU with virtiofs support"
url: "https://gitlab.com/virtio-fs/qemu.git"
tag: "virtio-fs-v0.3"
tag: "qemu5.0-virtiofs-with51bits-dax"

image:
description: |
Expand Down
14 changes: 10 additions & 4 deletions virtcontainers/clh.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ type clhClient interface {
// Add/remove CPUs to/from the VM
VmResizePut(ctx context.Context, vmResize chclient.VmResize) (*http.Response, error)
// Add VFIO PCI device to the VM
VmAddDevicePut(ctx context.Context, vmAddDevice chclient.VmAddDevice) (*http.Response, error)
VmAddDevicePut(ctx context.Context, vmAddDevice chclient.VmAddDevice) (chclient.PciDeviceInfo, *http.Response, error)
// Add a new disk device to the VM
VmAddDiskPut(ctx context.Context, diskConfig chclient.DiskConfig) (*http.Response, error)
VmAddDiskPut(ctx context.Context, diskConfig chclient.DiskConfig) (chclient.PciDeviceInfo, *http.Response, error)
}

type CloudHypervisorVersion struct {
Expand Down Expand Up @@ -296,6 +296,12 @@ func (clh *cloudHypervisor) createSandbox(ctx context.Context, id string, networ
Mode: cctOFF,
}

clh.vmconfig.Cpus.Topology = chclient.CpuTopology{
ThreadsPerCore: 1,
CoresPerDie: int32(clh.config.DefaultMaxVCPUs),
DiesPerPackage: 1,
Packages: 1,
}
// Overwrite the default value of HTTP API socket path for cloud hypervisor
apiSocketPath, err := clh.apiSocketPath(id)
if err != nil {
Expand Down Expand Up @@ -422,7 +428,7 @@ func (clh *cloudHypervisor) hotplugBlockDevice(drive *config.BlockDrive) error {
Readonly: drive.ReadOnly,
VhostUser: false,
}
_, err = cl.VmAddDiskPut(ctx, blkDevice)
_, _, err = cl.VmAddDiskPut(ctx, blkDevice)
}

if err != nil {
Expand All @@ -441,7 +447,7 @@ func (clh *cloudHypervisor) hotPlugVFIODevice(device config.VFIODev) error {
return openAPIClientError(err)
}

_, err = cl.VmAddDevicePut(ctx, chclient.VmAddDevice{Path: device.SysfsDev})
_, _, err = cl.VmAddDevicePut(ctx, chclient.VmAddDevice{Path: device.SysfsDev})
if err != nil {
err = fmt.Errorf("Failed to hotplug device %+v %s", device, openAPIClientError(err))
}
Expand Down
8 changes: 4 additions & 4 deletions virtcontainers/clh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ func (c *clhClientMock) VmResizePut(ctx context.Context, vmResize chclient.VmRes
}

//nolint:golint
func (c *clhClientMock) VmAddDevicePut(ctx context.Context, vmAddDevice chclient.VmAddDevice) (*http.Response, error) {
return nil, nil
func (c *clhClientMock) VmAddDevicePut(ctx context.Context, vmAddDevice chclient.VmAddDevice) (chclient.PciDeviceInfo, *http.Response, error) {
return chclient.PciDeviceInfo{}, nil, nil
}

//nolint:golint
func (c *clhClientMock) VmAddDiskPut(ctx context.Context, diskConfig chclient.DiskConfig) (*http.Response, error) {
return nil, nil
func (c *clhClientMock) VmAddDiskPut(ctx context.Context, diskConfig chclient.DiskConfig) (chclient.PciDeviceInfo, *http.Response, error) {
return chclient.PciDeviceInfo{}, nil, nil
}

func TestCloudHypervisorAddVSock(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
.gitignore
.openapi-generator-ignore
.travis.yml
README.md
api/openapi.yaml
api_default.go
client.go
configuration.go
docs/CmdLineConfig.md
docs/ConsoleConfig.md
docs/CpuTopology.md
docs/CpusConfig.md
docs/DefaultApi.md
docs/DeviceConfig.md
docs/DiskConfig.md
docs/FsConfig.md
docs/InitramfsConfig.md
docs/KernelConfig.md
docs/MemoryConfig.md
docs/NetConfig.md
docs/PciDeviceInfo.md
docs/PmemConfig.md
docs/RestoreConfig.md
docs/RngConfig.md
docs/SgxEpcConfig.md
docs/VmAddDevice.md
docs/VmConfig.md
docs/VmInfo.md
docs/VmRemoveDevice.md
docs/VmResize.md
docs/VmSnapshotConfig.md
docs/VmmPingResponse.md
docs/VsockConfig.md
git_push.sh
go.mod
go.sum
model_cmd_line_config.go
model_console_config.go
model_cpu_topology.go
model_cpus_config.go
model_device_config.go
model_disk_config.go
model_fs_config.go
model_initramfs_config.go
model_kernel_config.go
model_memory_config.go
model_net_config.go
model_pci_device_info.go
model_pmem_config.go
model_restore_config.go
model_rng_config.go
model_sgx_epc_config.go
model_vm_add_device.go
model_vm_config.go
model_vm_info.go
model_vm_remove_device.go
model_vm_resize.go
model_vm_snapshot_config.go
model_vmm_ping_response.go
model_vsock_config.go
response.go
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.3.1-SNAPSHOT
5.0.0-SNAPSHOT
4 changes: 4 additions & 0 deletions virtcontainers/pkg/cloud-hypervisor/client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Class | Method | HTTP request | Description
*DefaultApi* | [**VmAddNetPut**](docs/DefaultApi.md#vmaddnetput) | **Put** /vm.add-net | Add a new network device to the VM
*DefaultApi* | [**VmAddPmemPut**](docs/DefaultApi.md#vmaddpmemput) | **Put** /vm.add-pmem | Add a new pmem device to the VM
*DefaultApi* | [**VmAddVsockPut**](docs/DefaultApi.md#vmaddvsockput) | **Put** /vm.add-vsock | Add a new vsock device to the VM
*DefaultApi* | [**VmCountersGet**](docs/DefaultApi.md#vmcountersget) | **Get** /vm.counters | Get counters from the VM
*DefaultApi* | [**VmInfoGet**](docs/DefaultApi.md#vminfoget) | **Get** /vm.info | Returns general information about the cloud-hypervisor Virtual Machine (VM) instance.
*DefaultApi* | [**VmRemoveDevicePut**](docs/DefaultApi.md#vmremovedeviceput) | **Put** /vm.remove-device | Remove a device from the VM
*DefaultApi* | [**VmResizePut**](docs/DefaultApi.md#vmresizeput) | **Put** /vm.resize | Resize the VM
Expand All @@ -58,6 +59,7 @@ Class | Method | HTTP request | Description

- [CmdLineConfig](docs/CmdLineConfig.md)
- [ConsoleConfig](docs/ConsoleConfig.md)
- [CpuTopology](docs/CpuTopology.md)
- [CpusConfig](docs/CpusConfig.md)
- [DeviceConfig](docs/DeviceConfig.md)
- [DiskConfig](docs/DiskConfig.md)
Expand All @@ -66,9 +68,11 @@ Class | Method | HTTP request | Description
- [KernelConfig](docs/KernelConfig.md)
- [MemoryConfig](docs/MemoryConfig.md)
- [NetConfig](docs/NetConfig.md)
- [PciDeviceInfo](docs/PciDeviceInfo.md)
- [PmemConfig](docs/PmemConfig.md)
- [RestoreConfig](docs/RestoreConfig.md)
- [RngConfig](docs/RngConfig.md)
- [SgxEpcConfig](docs/SgxEpcConfig.md)
- [VmAddDevice](docs/VmAddDevice.md)
- [VmConfig](docs/VmConfig.md)
- [VmInfo](docs/VmInfo.md)
Expand Down
Loading