Skip to content

Commit bcce9ba

Browse files
scuzhangleifengye87
authored andcommitted
feat: Bump cloud-hypervisor to v26.0
1 parent a6b04e7 commit bcce9ba

File tree

4 files changed

+836
-669
lines changed

4 files changed

+836
-669
lines changed

build/virt-prerunner/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ RUN set -eux; \
2020
mkdir /var/lib/cloud-hypervisor; \
2121
case "$(uname -m)" in \
2222
'x86_64') \
23-
curl -sLo /usr/bin/cloud-hypervisor https://github.com/cloud-hypervisor/cloud-hypervisor/releases/download/v24.0/cloud-hypervisor-static; \
24-
curl -sLo /usr/bin/ch-remote https://github.com/cloud-hypervisor/cloud-hypervisor/releases/download/v24.0/ch-remote-static; \
23+
curl -sLo /usr/bin/cloud-hypervisor https://github.com/cloud-hypervisor/cloud-hypervisor/releases/download/v26.0/cloud-hypervisor-static; \
24+
curl -sLo /usr/bin/ch-remote https://github.com/cloud-hypervisor/cloud-hypervisor/releases/download/v26.0/ch-remote-static; \
2525
curl -sLo /var/lib/cloud-hypervisor/hypervisor-fw https://github.com/cloud-hypervisor/rust-hypervisor-firmware/releases/download/0.4.0/hypervisor-fw; \
2626
;; \
2727
'aarch64') \
28-
curl -sLo /usr/bin/cloud-hypervisor https://github.com/cloud-hypervisor/cloud-hypervisor/releases/download/v24.0/cloud-hypervisor-static-aarch64; \
29-
curl -sLo /usr/bin/ch-remote https://github.com/cloud-hypervisor/cloud-hypervisor/releases/download/v24.0/ch-remote-static-aarch64; \
28+
curl -sLo /usr/bin/cloud-hypervisor https://github.com/cloud-hypervisor/cloud-hypervisor/releases/download/v26.0/cloud-hypervisor-static-aarch64; \
29+
curl -sLo /usr/bin/ch-remote https://github.com/cloud-hypervisor/cloud-hypervisor/releases/download/v26.0/ch-remote-static-aarch64; \
3030
curl -sLo /var/lib/cloud-hypervisor/CLOUDHV_EFI.fd https://github.com/smartxworks/cloud-hypervisor-edk2-builder/releases/download/20220706/CLOUDHV_EFI.fd; \
3131
;; \
3232
*) echo >&2 "error: unsupported architecture '$(uname -m)'"; exit 1 ;; \

cmd/cloud-hypervisor-client-gen/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
var clientTemplate string
1919

2020
func main() {
21-
resp, err := http.Get("https://raw.githubusercontent.com/cloud-hypervisor/cloud-hypervisor/v24.0/vmm/src/api/openapi/cloud-hypervisor.yaml")
21+
resp, err := http.Get("https://raw.githubusercontent.com/cloud-hypervisor/cloud-hypervisor/v26.0/vmm/src/api/openapi/cloud-hypervisor.yaml")
2222
if err != nil {
2323
panic(err)
2424
}

cmd/virt-prerunner/main.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ func main() {
4343
}
4444

4545
cloudHypervisorCmd := []string{"cloud-hypervisor", "--api-socket", "/var/run/virtink/ch.sock", "--console", "pty", "--serial", "tty"}
46-
cloudHypervisorCmd = append(cloudHypervisorCmd, "--kernel", vmConfig.Kernel.Path)
47-
if vmConfig.Cmdline != nil {
48-
cloudHypervisorCmd = append(cloudHypervisorCmd, "--cmdline", fmt.Sprintf("'%s'", vmConfig.Cmdline.Args))
46+
cloudHypervisorCmd = append(cloudHypervisorCmd, "--kernel", vmConfig.Payload.Kernel)
47+
if vmConfig.Payload.Cmdline != "" {
48+
cloudHypervisorCmd = append(cloudHypervisorCmd, "--cmdline", fmt.Sprintf("'%s'", vmConfig.Payload.Cmdline))
4949
}
5050

5151
vcpuToPCPU := []string{}
@@ -94,8 +94,8 @@ func main() {
9494

9595
func buildVMConfig(ctx context.Context, vm *virtv1alpha1.VirtualMachine) (*cloudhypervisor.VmConfig, error) {
9696
vmConfig := cloudhypervisor.VmConfig{
97-
Kernel: &cloudhypervisor.KernelConfig{
98-
Path: "/var/lib/cloud-hypervisor/hypervisor-fw",
97+
Payload: &cloudhypervisor.PayloadConfig{
98+
Kernel: "/var/lib/cloud-hypervisor/hypervisor-fw",
9999
},
100100
Cpus: &cloudhypervisor.CpusConfig{
101101
BootVcpus: int(vm.Spec.Instance.CPU.Sockets * vm.Spec.Instance.CPU.CoresPerSocket),
@@ -112,14 +112,12 @@ func buildVMConfig(ctx context.Context, vm *virtv1alpha1.VirtualMachine) (*cloud
112112
}
113113

114114
if runtime.GOARCH == "arm64" {
115-
vmConfig.Kernel.Path = "/var/lib/cloud-hypervisor/CLOUDHV_EFI.fd"
115+
vmConfig.Payload.Kernel = "/var/lib/cloud-hypervisor/CLOUDHV_EFI.fd"
116116
}
117117

118118
if vm.Spec.Instance.Kernel != nil {
119-
vmConfig.Kernel.Path = "/mnt/virtink-kernel/vmlinux"
120-
vmConfig.Cmdline = &cloudhypervisor.CmdLineConfig{
121-
Args: vm.Spec.Instance.Kernel.Cmdline,
122-
}
119+
vmConfig.Payload.Kernel = "/mnt/virtink-kernel/vmlinux"
120+
vmConfig.Payload.Cmdline = vm.Spec.Instance.Kernel.Cmdline
123121
}
124122

125123
if vm.Spec.Instance.CPU.DedicatedCPUPlacement {

0 commit comments

Comments
 (0)