runtime: fix missing of VhostUserDeviceReconnect parameter assignment

Commit 'ca02c9f5124e' implements the vhost-user-blk reconnection functionality,
However, it has missed assigning VhostUserDeviceReconnect when new the QEMU
HypervisorConfig, resulting in VhostUserDeviceReconnect always set to default value 0.

Real change is this line, most of changes caused by go format,

return vc.HypervisorConfig{
	// ...
	VhostUserDeviceReconnect: h.VhostUserDeviceReconnect,
}, nil

Fixes: #9848
Signed-off-by: markyangcc <mmdou3@163.com>
This commit is contained in:
markyangcc 2024-06-14 19:27:09 +08:00
parent 99bf95f773
commit a28bf266f9

View File

@ -906,77 +906,78 @@ func newQemuHypervisorConfig(h hypervisor) (vc.HypervisorConfig, error) {
} }
return vc.HypervisorConfig{ return vc.HypervisorConfig{
HypervisorPath: hypervisor, HypervisorPath: hypervisor,
HypervisorPathList: h.HypervisorPathList, HypervisorPathList: h.HypervisorPathList,
KernelPath: kernel, KernelPath: kernel,
InitrdPath: initrd, InitrdPath: initrd,
ImagePath: image, ImagePath: image,
RootfsType: rootfsType, RootfsType: rootfsType,
FirmwarePath: firmware, FirmwarePath: firmware,
FirmwareVolumePath: firmwareVolume, FirmwareVolumePath: firmwareVolume,
PFlash: pflashes, PFlash: pflashes,
MachineAccelerators: machineAccelerators, MachineAccelerators: machineAccelerators,
CPUFeatures: cpuFeatures, CPUFeatures: cpuFeatures,
KernelParams: vc.DeserializeParams(vc.KernelParamFields(kernelParams)), KernelParams: vc.DeserializeParams(vc.KernelParamFields(kernelParams)),
HypervisorMachineType: machineType, HypervisorMachineType: machineType,
QgsPort: h.qgsPort(), QgsPort: h.qgsPort(),
NumVCPUsF: h.defaultVCPUs(), NumVCPUsF: h.defaultVCPUs(),
DefaultMaxVCPUs: h.defaultMaxVCPUs(), DefaultMaxVCPUs: h.defaultMaxVCPUs(),
MemorySize: h.defaultMemSz(), MemorySize: h.defaultMemSz(),
MemSlots: h.defaultMemSlots(), MemSlots: h.defaultMemSlots(),
MemOffset: h.defaultMemOffset(), MemOffset: h.defaultMemOffset(),
DefaultMaxMemorySize: h.defaultMaxMemSz(), DefaultMaxMemorySize: h.defaultMaxMemSz(),
VirtioMem: h.VirtioMem, VirtioMem: h.VirtioMem,
EntropySource: h.GetEntropySource(), EntropySource: h.GetEntropySource(),
EntropySourceList: h.EntropySourceList, EntropySourceList: h.EntropySourceList,
DefaultBridges: h.defaultBridges(), DefaultBridges: h.defaultBridges(),
DisableBlockDeviceUse: h.DisableBlockDeviceUse, DisableBlockDeviceUse: h.DisableBlockDeviceUse,
SharedFS: sharedFS, SharedFS: sharedFS,
VirtioFSDaemon: h.VirtioFSDaemon, VirtioFSDaemon: h.VirtioFSDaemon,
VirtioFSDaemonList: h.VirtioFSDaemonList, VirtioFSDaemonList: h.VirtioFSDaemonList,
VirtioFSCacheSize: h.VirtioFSCacheSize, VirtioFSCacheSize: h.VirtioFSCacheSize,
VirtioFSCache: h.defaultVirtioFSCache(), VirtioFSCache: h.defaultVirtioFSCache(),
VirtioFSQueueSize: h.VirtioFSQueueSize, VirtioFSQueueSize: h.VirtioFSQueueSize,
VirtioFSExtraArgs: h.VirtioFSExtraArgs, VirtioFSExtraArgs: h.VirtioFSExtraArgs,
MemPrealloc: h.MemPrealloc, MemPrealloc: h.MemPrealloc,
HugePages: h.HugePages, HugePages: h.HugePages,
IOMMU: h.IOMMU, IOMMU: h.IOMMU,
IOMMUPlatform: h.getIOMMUPlatform(), IOMMUPlatform: h.getIOMMUPlatform(),
FileBackedMemRootDir: h.FileBackedMemRootDir, FileBackedMemRootDir: h.FileBackedMemRootDir,
FileBackedMemRootList: h.FileBackedMemRootList, FileBackedMemRootList: h.FileBackedMemRootList,
Debug: h.Debug, Debug: h.Debug,
DisableNestingChecks: h.DisableNestingChecks, DisableNestingChecks: h.DisableNestingChecks,
BlockDeviceDriver: blockDriver, BlockDeviceDriver: blockDriver,
BlockDeviceAIO: blockAIO, BlockDeviceAIO: blockAIO,
BlockDeviceCacheSet: h.BlockDeviceCacheSet, BlockDeviceCacheSet: h.BlockDeviceCacheSet,
BlockDeviceCacheDirect: h.BlockDeviceCacheDirect, BlockDeviceCacheDirect: h.BlockDeviceCacheDirect,
BlockDeviceCacheNoflush: h.BlockDeviceCacheNoflush, BlockDeviceCacheNoflush: h.BlockDeviceCacheNoflush,
EnableIOThreads: h.EnableIOThreads, EnableIOThreads: h.EnableIOThreads,
Msize9p: h.msize9p(), Msize9p: h.msize9p(),
DisableImageNvdimm: h.DisableImageNvdimm, DisableImageNvdimm: h.DisableImageNvdimm,
HotPlugVFIO: h.hotPlugVFIO(), HotPlugVFIO: h.hotPlugVFIO(),
ColdPlugVFIO: h.coldPlugVFIO(), ColdPlugVFIO: h.coldPlugVFIO(),
PCIeRootPort: h.pcieRootPort(), PCIeRootPort: h.pcieRootPort(),
PCIeSwitchPort: h.pcieSwitchPort(), PCIeSwitchPort: h.pcieSwitchPort(),
DisableVhostNet: h.DisableVhostNet, DisableVhostNet: h.DisableVhostNet,
EnableVhostUserStore: h.EnableVhostUserStore, EnableVhostUserStore: h.EnableVhostUserStore,
VhostUserStorePath: h.vhostUserStorePath(), VhostUserStorePath: h.vhostUserStorePath(),
VhostUserStorePathList: h.VhostUserStorePathList, VhostUserStorePathList: h.VhostUserStorePathList,
SeccompSandbox: h.SeccompSandbox, VhostUserDeviceReconnect: h.VhostUserDeviceReconnect,
GuestHookPath: h.guestHookPath(), SeccompSandbox: h.SeccompSandbox,
RxRateLimiterMaxRate: rxRateLimiterMaxRate, GuestHookPath: h.guestHookPath(),
TxRateLimiterMaxRate: txRateLimiterMaxRate, RxRateLimiterMaxRate: rxRateLimiterMaxRate,
EnableAnnotations: h.EnableAnnotations, TxRateLimiterMaxRate: txRateLimiterMaxRate,
GuestMemoryDumpPath: h.GuestMemoryDumpPath, EnableAnnotations: h.EnableAnnotations,
GuestMemoryDumpPaging: h.GuestMemoryDumpPaging, GuestMemoryDumpPath: h.GuestMemoryDumpPath,
ConfidentialGuest: h.ConfidentialGuest, GuestMemoryDumpPaging: h.GuestMemoryDumpPaging,
SevSnpGuest: h.SevSnpGuest, ConfidentialGuest: h.ConfidentialGuest,
GuestSwap: h.GuestSwap, SevSnpGuest: h.SevSnpGuest,
Rootless: h.Rootless, GuestSwap: h.GuestSwap,
LegacySerial: h.LegacySerial, Rootless: h.Rootless,
DisableSeLinux: h.DisableSeLinux, LegacySerial: h.LegacySerial,
DisableGuestSeLinux: h.DisableGuestSeLinux, DisableSeLinux: h.DisableSeLinux,
ExtraMonitorSocket: extraMonitorSocket, DisableGuestSeLinux: h.DisableGuestSeLinux,
ExtraMonitorSocket: extraMonitorSocket,
}, nil }, nil
} }