func (object Object) QemuParams(config *Config) []string {
	var objectParams []string
	var deviceParams []string
	var qemuParams []string
	deviceParams = append(deviceParams, string(object.Driver))
	deviceParams = append(deviceParams, fmt.Sprintf(",id=%s", object.DeviceID))
	switch object.Type {
	case MemoryBackendFile:
		objectParams = append(objectParams, string(object.Type))
		objectParams = append(objectParams, fmt.Sprintf(",id=%s", object.ID))
		objectParams = append(objectParams, fmt.Sprintf(",mem-path=%s", object.MemPath))
		objectParams = append(objectParams, fmt.Sprintf(",size=%d", object.Size))
		deviceParams = append(deviceParams, fmt.Sprintf(",memdev=%s", object.ID))
	}
	qemuParams = append(qemuParams, "-device")
	qemuParams = append(qemuParams, strings.Join(deviceParams, ""))
	qemuParams = append(qemuParams, "-object")
	qemuParams = append(qemuParams, strings.Join(objectParams, ""))
	return qemuParams
}
QemuParams returns the qemu parameters built out of this Object device.
package qemu
import (
	"bytes"
	"fmt"
	"os"
	"os/exec"
	"strconv"
	"strings"
	"syscall"
	"context"
)
type Machine struct {
	Type string
	Acceleration string
}
type Device interface {
	Valid() bool
	QemuParams(config *Config) []string
}
type DeviceDriver string
const (
	NVDIMM DeviceDriver = "nvdimm"
	Virtio9P = "virtio-9p-pci"
	VirtioNet = "virtio-net"
	VirtioNetPCI = "virtio-net-pci"
	VirtioSerial = "virtio-serial-pci"
	VirtioBlock = "virtio-blk"
	Console = "virtconsole"
	VirtioSerialPort = "virtserialport"
)
type ObjectType string
const (
	MemoryBackendFile ObjectType = "memory-backend-file"
)
type Object struct {
	Driver DeviceDriver
	Type ObjectType
	ID string
	DeviceID string
	MemPath string
	Size uint64
}
func (object Object) Valid() bool {
	switch object.Type {
	case MemoryBackendFile:
		if object.ID == "" || object.MemPath == "" || object.Size == 0 {
			return false
		}
	default:
		return false
	}
	return true
}