github.com/kata-containers/runtime@v0.0.0-20210505125100-04f29832a923/virtcontainers/persist/api/hypervisor.go (about)

     1  // Copyright (c) 2019 Huawei Corporation
     2  //
     3  // SPDX-License-Identifier: Apache-2.0
     4  //
     5  
     6  package persistapi
     7  
     8  // Bridge is a bridge where devices can be hot plugged
     9  type Bridge struct {
    10  	// DeviceAddr contains information about devices plugged and its address in the bridge
    11  	DeviceAddr map[uint32]string
    12  
    13  	// Type is the type of the bridge (pci, pcie, etc)
    14  	Type string
    15  
    16  	//ID is used to identify the bridge in the hypervisor
    17  	ID string
    18  
    19  	// Addr is the PCI/e slot of the bridge
    20  	Addr int
    21  }
    22  
    23  // CPUDevice represents a CPU device which was hot-added in a running VM
    24  type CPUDevice struct {
    25  	// ID is used to identify this CPU in the hypervisor options.
    26  	ID string
    27  }
    28  
    29  type HypervisorState struct {
    30  	Pid int
    31  	// Type of hypervisor, E.g. qemu/firecracker/acrn.
    32  	Type          string
    33  	BlockIndexMap map[int]struct{}
    34  	UUID          string
    35  
    36  	// Belows are qemu specific
    37  	// Refs: virtcontainers/qemu.go:QemuState
    38  	Bridges []Bridge
    39  	// HotpluggedCPUs is the list of CPUs that were hot-added
    40  	HotpluggedVCPUs      []CPUDevice
    41  	HotpluggedMemory     int
    42  	VirtiofsdPid         int
    43  	HotplugVFIOOnRootBus bool
    44  	PCIeRootPort         int
    45  
    46  	// clh sepcific: refer to 'virtcontainers/clh.go:CloudHypervisorState'
    47  	APISocket string
    48  }