Skip to content

Commit f2e0f62

Browse files
authored
fix(host): add check mem dev is null on guest setup (#22847)
1 parent ec40153 commit f2e0f62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/hostman/guestman/qemu-kvm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3015,7 +3015,7 @@ func (s *SKVMGuestInstance) startHotPlugVcpus(vcpuSet []int) error {
30153015

30163016
func (s *SKVMGuestInstance) hotPlugCpus() error {
30173017
var vcpuSet = make([]int, 0)
3018-
if len(s.Desc.MemDesc.Mem.Mems) > 0 {
3018+
if s.Desc.MemDesc.Mem != nil && len(s.Desc.MemDesc.Mem.Mems) > 0 {
30193019
for i := range s.Desc.CpuNumaPin {
30203020
for j := range s.Desc.CpuNumaPin[i].VcpuPin {
30213021
vcpuSet = append(vcpuSet, s.Desc.CpuNumaPin[i].VcpuPin[j].Vcpu)

0 commit comments

Comments
 (0)