mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-23 05:04:07 +00:00
qemu: Add configuration structure to simplify LaunchQemu
LaunchQemu() now takes a Config structure that contains some more descriptive fields than raw qemu parameter strings. LaunchQemu is now simpler to call and more extensible as supporting more qemu parameters would mean expanding Config instead of changing the API. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
@@ -38,10 +38,10 @@ func Example() {
|
||||
// resources
|
||||
params = append(params, "-m", "370", "-smp", "cpus=2")
|
||||
|
||||
// LaunchQemu should return as soon as the instance has launched as we
|
||||
// LaunchCustomQemu should return as soon as the instance has launched as we
|
||||
// are using the --daemonize flag. It will set up a unix domain socket
|
||||
// called /tmp/qmp-socket that we can use to manage the instance.
|
||||
_, err := qemu.LaunchQemu(context.Background(), params, nil, nil)
|
||||
_, err := qemu.LaunchCustomQemu(context.Background(), "", params, nil, nil)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user