From 7ee43f946837fba92f58714edb91c9886303b8da Mon Sep 17 00:00:00 2001 From: Bo Chen Date: Thu, 9 Sep 2021 14:44:04 -0700 Subject: [PATCH 1/3] versions: Upgrade to Cloud Hypervisor v18.0 Highlights from the Cloud Hypervisor release v18.0: 1) Experimental User Device (vfio-user) support; 2) Migration support for vhost-user devices; 3) VHDX disk image support; 4) Device pass through on MSHV hypervisor; 5) AArch64 for support virtio-mem; 6) Live migration on MSHV hypervisor; 7) AArch64 CPU topology support; 8) Power button support on AArch64; 9) Various bug fixes on PTY, TTY, signal handling, and live-migration on AArch64. Details can be found: https://github.com/cloud-hypervisor/cloud-hypervisor/releases/tag/v18.0 Fixes: #2543 Signed-off-by: Bo Chen (cherry picked from commit f0b533143025a86e88766219b900f610900c6f7e) --- versions.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions.yaml b/versions.yaml index 03a05cbdea..ebf143f185 100644 --- a/versions.yaml +++ b/versions.yaml @@ -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: "v17.0" + version: "v18.0" firecracker: description: "Firecracker micro-VMM" From c2c650500b76ea9925f7f27bf009483ea592bea9 Mon Sep 17 00:00:00 2001 From: Bo Chen Date: Thu, 9 Sep 2021 14:46:39 -0700 Subject: [PATCH 2/3] virtcontainers: clh: Re-generate the client code This patch re-generates the client code for Cloud Hypervisor v18.0. Note: The client code of cloud-hypervisor's (CLH) OpenAPI is automatically generated by openapi-generator [1-2]. [1] https://github.com/OpenAPITools/openapi-generator [2] https://github.com/kata-containers/kata-containers/blob/main/src/runtime/virtcontainers/pkg/cloud-hypervisor/README.md Signed-off-by: Bo Chen (cherry picked from commit 0e0e59dc5f0f4c149c4c608c5d836a1ce41b3bd3) --- .../cloud-hypervisor/client/api/openapi.yaml | 20 +++++++++---------- .../client/docs/MemoryConfig.md | 2 +- .../cloud-hypervisor/client/docs/NetConfig.md | 2 +- .../client/model_memory_config.go | 4 ++-- .../client/model_net_config.go | 4 ++-- .../cloud-hypervisor/cloud-hypervisor.yaml | 4 ++-- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/api/openapi.yaml b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/api/openapi.yaml index 5f8daf0d6e..fb9cc6a756 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/api/openapi.yaml +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/api/openapi.yaml @@ -383,7 +383,7 @@ components: id: id hotplug_size: 1 hotplug_size: 3 - hotplug_method: acpi + hotplug_method: Acpi disks: - path: path num_queues: 7 @@ -540,7 +540,7 @@ components: one_time_burst: 0 refill_time: 0 mac: mac - vhost_mode: client + vhost_mode: Client iommu: false vhost_socket: vhost_socket vhost_user: false @@ -563,7 +563,7 @@ components: one_time_burst: 0 refill_time: 0 mac: mac - vhost_mode: client + vhost_mode: Client iommu: false vhost_socket: vhost_socket vhost_user: false @@ -688,7 +688,7 @@ components: id: id hotplug_size: 1 hotplug_size: 3 - hotplug_method: acpi + hotplug_method: Acpi disks: - path: path num_queues: 7 @@ -845,7 +845,7 @@ components: one_time_burst: 0 refill_time: 0 mac: mac - vhost_mode: client + vhost_mode: Client iommu: false vhost_socket: vhost_socket vhost_user: false @@ -868,7 +868,7 @@ components: one_time_burst: 0 refill_time: 0 mac: mac - vhost_mode: client + vhost_mode: Client iommu: false vhost_socket: vhost_socket vhost_user: false @@ -1053,7 +1053,7 @@ components: id: id hotplug_size: 1 hotplug_size: 3 - hotplug_method: acpi + hotplug_method: Acpi properties: size: format: int64 @@ -1068,7 +1068,7 @@ components: default: false type: boolean hotplug_method: - default: acpi + default: Acpi type: string shared: default: false @@ -1236,7 +1236,7 @@ components: one_time_burst: 0 refill_time: 0 mac: mac - vhost_mode: client + vhost_mode: Client iommu: false vhost_socket: vhost_socket vhost_user: false @@ -1272,7 +1272,7 @@ components: vhost_socket: type: string vhost_mode: - default: client + default: Client type: string id: type: string diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/docs/MemoryConfig.md b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/docs/MemoryConfig.md index a9225aa445..e873e5348c 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/docs/MemoryConfig.md +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/docs/MemoryConfig.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **HotplugSize** | Pointer to **int64** | | [optional] **HotpluggedSize** | Pointer to **int64** | | [optional] **Mergeable** | Pointer to **bool** | | [optional] [default to false] -**HotplugMethod** | Pointer to **string** | | [optional] [default to "acpi"] +**HotplugMethod** | Pointer to **string** | | [optional] [default to "Acpi"] **Shared** | Pointer to **bool** | | [optional] [default to false] **Hugepages** | Pointer to **bool** | | [optional] [default to false] **HugepageSize** | Pointer to **int64** | | [optional] diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/docs/NetConfig.md b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/docs/NetConfig.md index e1ceffed30..3dff096f51 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/docs/NetConfig.md +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/docs/NetConfig.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **QueueSize** | Pointer to **int32** | | [optional] [default to 256] **VhostUser** | Pointer to **bool** | | [optional] [default to false] **VhostSocket** | Pointer to **string** | | [optional] -**VhostMode** | Pointer to **string** | | [optional] [default to "client"] +**VhostMode** | Pointer to **string** | | [optional] [default to "Client"] **Id** | Pointer to **string** | | [optional] **Fd** | Pointer to **[]int32** | | [optional] **RateLimiterConfig** | Pointer to [**RateLimiterConfig**](RateLimiterConfig.md) | | [optional] diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_memory_config.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_memory_config.go index f9a2f51eaa..52fca6fa5e 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_memory_config.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_memory_config.go @@ -36,7 +36,7 @@ func NewMemoryConfig(size int64) *MemoryConfig { this.Size = size var mergeable bool = false this.Mergeable = &mergeable - var hotplugMethod string = "acpi" + var hotplugMethod string = "Acpi" this.HotplugMethod = &hotplugMethod var shared bool = false this.Shared = &shared @@ -52,7 +52,7 @@ func NewMemoryConfigWithDefaults() *MemoryConfig { this := MemoryConfig{} var mergeable bool = false this.Mergeable = &mergeable - var hotplugMethod string = "acpi" + var hotplugMethod string = "Acpi" this.HotplugMethod = &hotplugMethod var shared bool = false this.Shared = &shared diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_net_config.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_net_config.go index 69c55fe229..dc9b599e89 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_net_config.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_net_config.go @@ -51,7 +51,7 @@ func NewNetConfig() *NetConfig { this.QueueSize = &queueSize var vhostUser bool = false this.VhostUser = &vhostUser - var vhostMode string = "client" + var vhostMode string = "Client" this.VhostMode = &vhostMode return &this } @@ -75,7 +75,7 @@ func NewNetConfigWithDefaults() *NetConfig { this.QueueSize = &queueSize var vhostUser bool = false this.VhostUser = &vhostUser - var vhostMode string = "client" + var vhostMode string = "Client" this.VhostMode = &vhostMode return &this } diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/cloud-hypervisor.yaml b/src/runtime/virtcontainers/pkg/cloud-hypervisor/cloud-hypervisor.yaml index ffb02a32e5..56f63a3be2 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/cloud-hypervisor.yaml +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/cloud-hypervisor.yaml @@ -567,7 +567,7 @@ components: default: false hotplug_method: type: string - default: "acpi" + default: "Acpi" shared: type: boolean default: false @@ -714,7 +714,7 @@ components: type: string vhost_mode: type: string - default: "client" + default: "Client" id: type: string fd: From a1874ccd62508f3a6a4e18a6b61030b5536d61f3 Mon Sep 17 00:00:00 2001 From: Bo Chen Date: Thu, 9 Sep 2021 14:49:07 -0700 Subject: [PATCH 3/3] virtcontainers: clh: Revert the workaround incorrect default values Given the fix to the bugs of the openapi spec file is included in the Cloud Hypervisor v18.0 [1], this patch reverts the workaround we carried in the CLH driver. This reverts commit 932ee41b3f18fe9036a5faa64c154fe6a39dc739. [1] https://github.com/cloud-hypervisor/cloud-hypervisor/pull/3029 Signed-off-by: Bo Chen (cherry picked from commit f785ff0bf21425d952a1acad8b1f72c859ad9396) --- src/runtime/virtcontainers/clh.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/runtime/virtcontainers/clh.go b/src/runtime/virtcontainers/clh.go index e7afc097d5..630054f85f 100644 --- a/src/runtime/virtcontainers/clh.go +++ b/src/runtime/virtcontainers/clh.go @@ -243,7 +243,6 @@ func (clh *cloudHypervisor) createSandbox(ctx context.Context, id string, networ clh.vmconfig.Memory = chclient.NewMemoryConfig(int64((utils.MemUnit(clh.config.MemorySize) * utils.MiB).ToBytes())) // shared memory should be enabled if using vhost-user(kata uses virtiofsd) clh.vmconfig.Memory.Shared = func(b bool) *bool { return &b }(true) - clh.vmconfig.Memory.HotplugMethod = func(s string) *string { return &s }("Acpi") hostMemKb, err := getHostMemorySizeKb(procMemInfo) if err != nil { return nil @@ -1123,7 +1122,6 @@ func (clh *cloudHypervisor) addNet(e Endpoint) error { net := chclient.NewNetConfig() net.Mac = &mac net.Tap = &tapPath - net.VhostMode = func(s string) *string { return &s }("Client") if clh.vmconfig.Net != nil { *clh.vmconfig.Net = append(*clh.vmconfig.Net, *net) } else {