Skip to content

Commit

Permalink
Merge pull request kata-containers#9402 from deagon/feat/debug-threads
Browse files Browse the repository at this point in the history
qemu: show the thread name when enable the hypervisor.debug option
  • Loading branch information
gkurz authored Apr 8, 2024
2 parents e39be7a + cd0c31e commit be8f0cb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/runtime/pkg/govmm/qemu/qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -2776,6 +2776,8 @@ type Config struct {
PidFile string

qemuParams []string

Debug bool
}

// appendFDs appends a list of arbitrary file descriptors to the qemu configuration and
Expand Down Expand Up @@ -2812,8 +2814,15 @@ func (config *Config) appendSeccompSandbox() {

func (config *Config) appendName() {
if config.Name != "" {
var nameParams []string
nameParams = append(nameParams, config.Name)

if config.Debug {
nameParams = append(nameParams, "debug-threads=on")
}

config.qemuParams = append(config.qemuParams, "-name")
config.qemuParams = append(config.qemuParams, config.Name)
config.qemuParams = append(config.qemuParams, strings.Join(nameParams, ","))
}
}

Expand Down
1 change: 1 addition & 0 deletions src/runtime/virtcontainers/qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,7 @@ func (q *qemu) CreateVM(ctx context.Context, id string, network Network, hypervi
Bios: firmwarePath,
PFlash: pflash,
PidFile: filepath.Join(q.config.VMStorePath, q.id, "pid"),
Debug: hypervisorConfig.Debug,
}

qemuConfig.Devices, qemuConfig.Bios, err = q.arch.appendProtectionDevice(qemuConfig.Devices, firmwarePath, firmwareVolumePath)
Expand Down

0 comments on commit be8f0cb

Please sign in to comment.