mirror of
https://github.com/containers/podman.git
synced 2025-07-02 08:47:43 +08:00
Check AppleHypervisor before accessing it
In GetDefaultDevices(), make sure MachineConfig has an AppleHypervisor instance before attempting to access it. This fixes a SIGSEGV when running with libkrun as machine provider. Signed-off-by: Sergio Lopez <slp@redhat.com>
This commit is contained in:
@ -43,8 +43,7 @@ func GetDefaultDevices(mc *vmconfigs.MachineConfig) ([]vfConfig.VirtioDevice, *d
|
||||
}
|
||||
devices = append(devices, disk, rng, serial, readyDevice)
|
||||
|
||||
rosettaCfg := mc.AppleHypervisor.Vfkit.Rosetta
|
||||
if rosettaCfg {
|
||||
if mc.AppleHypervisor != nil && mc.AppleHypervisor.Vfkit.Rosetta {
|
||||
rosetta := &vfConfig.RosettaShare{
|
||||
DirectorySharingConfig: vfConfig.DirectorySharingConfig{
|
||||
MountTag: define.MountTag,
|
||||
|
Reference in New Issue
Block a user