mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-28 19:54:35 +00:00
qemu: Add a UUID field to the Config structure
The qemu UUID will be used to set the guest system UUID. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
6239e846b7
commit
b198bc67e7
13
qemu.go
13
qemu.go
@ -148,6 +148,9 @@ type Config struct {
|
||||
// FilesystemDevices is a list of filesystem devices.
|
||||
FilesystemDevices []FSDevice
|
||||
|
||||
// UUID is the qemu process UUID.
|
||||
UUID string
|
||||
|
||||
// Kernel is the guest kernel configuration.
|
||||
Kernel Kernel
|
||||
|
||||
@ -303,6 +306,15 @@ func appendFilesystemDevices(params []string, config Config) []string {
|
||||
return params
|
||||
}
|
||||
|
||||
func appendUUID(params []string, config Config) []string {
|
||||
if config.UUID != "" {
|
||||
params = append(params, "-uuid")
|
||||
params = append(params, config.UUID)
|
||||
}
|
||||
|
||||
return params
|
||||
}
|
||||
|
||||
func appendKernel(params []string, config Config) []string {
|
||||
if config.Kernel.Path != "" {
|
||||
params = append(params, "-kernel")
|
||||
@ -330,6 +342,7 @@ func LaunchQemu(config Config, logger QMPLog) (string, error) {
|
||||
var params []string
|
||||
|
||||
params = appendName(params, config)
|
||||
params = appendUUID(params, config)
|
||||
params = appendMachineParams(params, config)
|
||||
params = appendCPUModel(params, config)
|
||||
params = appendQMPSocket(params, config)
|
||||
|
Loading…
Reference in New Issue
Block a user