mirror of
				https://github.com/kata-containers/kata-containers.git
				synced 2025-10-31 09:26:52 +00:00 
			
		
		
		
	qemu: Add the daemonize qemu option to the Knobs structure
This way callers can choose if they want the qemu process to be a daemon or not. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
		
							
								
								
									
										7
									
								
								qemu.go
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								qemu.go
									
									
									
									
									
								
							| @@ -669,6 +669,9 @@ type Knobs struct { | ||||
|  | ||||
| 	// NoGraphic completely disables graphic output. | ||||
| 	NoGraphic bool | ||||
|  | ||||
| 	// Daemonize will turn the qemu process into a daemon | ||||
| 	Daemonize bool | ||||
| } | ||||
|  | ||||
| // Config is the qemu configuration structure. | ||||
| @@ -912,6 +915,10 @@ func (config *Config) appendKnobs() { | ||||
| 	if config.Knobs.NoGraphic == true { | ||||
| 		config.qemuParams = append(config.qemuParams, "-nographic") | ||||
| 	} | ||||
|  | ||||
| 	if config.Knobs.Daemonize == true { | ||||
| 		config.qemuParams = append(config.qemuParams, "-daemonize") | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // LaunchQemu can be used to launch a new qemu instance. | ||||
|   | ||||
| @@ -173,13 +173,14 @@ func TestAppendEmptyDevice(t *testing.T) { | ||||
| 	testAppend(device, "", t) | ||||
| } | ||||
|  | ||||
| var knobsString = "-no-user-config -nodefaults -nographic" | ||||
| var knobsString = "-no-user-config -nodefaults -nographic -daemonize" | ||||
|  | ||||
| func TestAppendKnobsAllTrue(t *testing.T) { | ||||
| 	knobs := Knobs{ | ||||
| 		NoUserConfig: true, | ||||
| 		NoDefaults:   true, | ||||
| 		NoGraphic:    true, | ||||
| 		Daemonize:    true, | ||||
| 	} | ||||
|  | ||||
| 	testAppend(knobs, knobsString, t) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user