mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-27 15:57:09 +00:00
qemu: show the thread name when enable the hypervisor.debug option
Add debug-threads=on in the name argument if debug enabled. Fixes: #9400 Signed-off-by: Guoqiang Ding <dgq8211@gmail.com>
This commit is contained in:
parent
7795f9c016
commit
cd0c31e185
@ -2782,6 +2782,8 @@ type Config struct {
|
||||
PidFile string
|
||||
|
||||
qemuParams []string
|
||||
|
||||
Debug bool
|
||||
}
|
||||
|
||||
// appendFDs appends a list of arbitrary file descriptors to the qemu configuration and
|
||||
@ -2818,8 +2820,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, ","))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -700,6 +700,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)
|
||||
|
Loading…
Reference in New Issue
Block a user