package qemuserver import ( "net/url" "os" "syscall" "time" ) type Options struct { QmpAddress string `yaml:"address"` Timeout time.Duration `yaml:"timeout"` Name string `yaml:"name"` VNCAddress string `yaml:"vnc"` AudioPipe string `yaml:"audio_pipe"` AudioDevice string `yaml:"audio_device"` } func ExampleOptions() *Options { return &Options{ QmpAddress: (&url.URL{ Scheme: "unix", Path: "/tmp/qemu.sock", }).String(), Timeout: time.Duration(60 * time.Second), Name: "ace-qemu", VNCAddress: "localhost:5900", AudioPipe: "/tmp/audio", AudioDevice: "snd0", } } func (o *Options) MakeFIFO() error { os.Remove(o.AudioPipe) return syscall.Mkfifo(o.AudioPipe, 0600) }