diff --git a/internal/qmp-gen/parse_test.go b/internal/qmp-gen/parse_test.go index 7baa318..5761f28 100644 --- a/internal/qmp-gen/parse_test.go +++ b/internal/qmp-gen/parse_test.go @@ -61,6 +61,36 @@ type StatusInfo struct { } `), }, + { + name: "MEM_UNPLUG_ERROR", + in: []byte(`## +# @MEM_UNPLUG_ERROR +# +# Emitted when memory hot unplug error occurs. +# +# @device: device name +# +# @msg: Informative message +# +# Since: 2.4 +## +{ + "event": "MEM_UNPLUG_ERROR", + "data": { + "device": "str", + "msg": "str" + } +}`), + out: []byte(`// MEM_UNPLUG_ERROR -> MemUnplugError (event) + +// MemUnplugError implements the "MEM_UNPLUG_ERROR" event. +type MemUnplugError struct { + Device string 'json:"device"' + Msg string 'json:"msg"' +} + +func (MemUnplugError) isEvent() {}`), + }, } for _, tt := range tests { diff --git a/internal/qmp-gen/templates/event b/internal/qmp-gen/templates/event index ac319be..b65acda 100644 --- a/internal/qmp-gen/templates/event +++ b/internal/qmp-gen/templates/event @@ -1 +1,54 @@ -// EVENT {{ .Name }} +// {{ .Name }} -> {{ .Name.Go }} (event) + +// {{ .Name.Go }} implements the "{{ .Name }}" event. +type {{ .Name.Go }} struct { + {{- range .Data.Fields API }} + {{ render . }} + {{- end }} +} + +{{- if (.Data.Fields API).HasInterfaceField API }} +// UnmarshalJSON implements json.Unmarshaler. +func (s *{{ .Name.Go }}) UnmarshalJSON(bs []byte) error { + v := struct{ + {{- range .Data.Fields API }} + {{- if .Type.InterfaceType API }} + {{- if .List }} + {{ abort "rendering of list of union/alternate not supported" }} + {{- else }} + {{ .Name.Go }} json.RawMessage `json:"{{ .Name }}"` + {{- end }} + {{- else }} + {{ render . }} + {{- end }} + {{- end }} + }{} + err := json.Unmarshal(bs, &v) + if err != nil { + return err + } + + {{- range .Data.Fields API }} + {{- if .Type.InterfaceType API }} + {{- if .Optional }} + if len(v.{{ .Name.Go }}) > 0 { + {{- end }} + s.{{ .Name.Go }}, err = decode{{ .Type.Go }}(v.{{ .Name.Go }}) + if err != nil { + return err + } + {{- if .Optional }} + } else { + s.{{ .Name.Go }} = nil + } + {{- end }} + {{- else }} + s.{{ .Name.Go }} = v.{{ .Name.Go }} + {{- end }} + {{- end }} + + return nil +} +{{- end }} + +func ({{ .Name.Go }}) isEvent() {} diff --git a/internal/qmp-gen/templates/main b/internal/qmp-gen/templates/main index 3066973..7cb16e5 100644 --- a/internal/qmp-gen/templates/main +++ b/internal/qmp-gen/templates/main @@ -17,10 +17,33 @@ package raw // Generated using `go generate`, do not edit by hand! import ( - "encoding/json" - "fmt" + "encoding/json" + "fmt" + + "github.com/digitalocean/go-qemu/qmp" ) {{ range . }} {{ render . }} {{ end }} + +func UnmarshalEvent(evt qmp.Event) (Event, error) { + raw, err := json.Marshal(evt.Data) + if err != nil { + return nil, err + } + switch evt.Event { + {{- range . }} + {{- if eq (typeOf .) "event" }} + case "{{ .Name }}": + var ret {{ .Name.Go }} + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + {{- end }} + {{- end }} + default: + return nil, fmt.Errorf("unknown event kind %q", evt.Event) + } +} diff --git a/internal/qmp-gen/types.go b/internal/qmp-gen/types.go index da0778d..0468d2d 100644 --- a/internal/qmp-gen/types.go +++ b/internal/qmp-gen/types.go @@ -57,7 +57,7 @@ func readDefinitions(path string) ([]definition, error) { default: return nil, fmt.Errorf("unexpected part of spec file %q: %s", path, string(part)) case 1: - if len(fs) == 1 && part[0] == '{' { + if len(fs) == 1 && part[0] == '{' && !bytes.HasPrefix(part, []byte("{ 'pragma'")) { return nil, fmt.Errorf("found type definition without a docstring in %q: %s", path, string(part)) } // This part looks like a non-docstring comment, just skip it. @@ -187,6 +187,9 @@ func parse(defs []definition) (map[name]interface{}, error) { return nil, err } ret[v.Name] = v + case m["pragma"] != nil: + // We ignore pragmas, they're there for the benefit of + // qemu's own self-validation. default: return nil, fmt.Errorf("unknown definition kind: %q", string(def.JSON)) } diff --git a/qemu/string.gen.go b/qemu/string.gen.go index 9a40139..00507f9 100644 --- a/qemu/string.gen.go +++ b/qemu/string.gen.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Code generated by "stringer -type=Status -output=string.gen.go"; DO NOT EDIT +// Code generated by "stringer -type=Status -output=string.gen.go"; DO NOT EDIT. package qemu diff --git a/qmp/raw/autogen.go b/qmp/raw/autogen.go index 98d30f1..512335e 100644 --- a/qmp/raw/autogen.go +++ b/qmp/raw/autogen.go @@ -19,6 +19,8 @@ package raw import ( "encoding/json" "fmt" + + "github.com/digitalocean/go-qemu/qmp" ) // ACPIOSTInfo -> ACPIOSTInfo (struct) @@ -84,7 +86,14 @@ func (e *ACPISlotType) UnmarshalJSON(bs []byte) error { return nil } -// EVENT ACPI_DEVICE_OST +// ACPI_DEVICE_OST -> ACPIDeviceOst (event) + +// ACPIDeviceOst implements the "ACPI_DEVICE_OST" event. +type ACPIDeviceOst struct { + Info ACPIOSTInfo `json:"info"` +} + +func (ACPIDeviceOst) isEvent() {} // Abort -> Abort (struct) @@ -152,21 +161,104 @@ type AddfdInfo struct { FD int64 `json:"fd"` } -// EVENT BALLOON_CHANGE +// BALLOON_CHANGE -> BalloonChange (event) + +// BalloonChange implements the "BALLOON_CHANGE" event. +type BalloonChange struct { + Actual int64 `json:"actual"` +} + +func (BalloonChange) isEvent() {} -// EVENT BLOCK_IMAGE_CORRUPTED +// BLOCK_IMAGE_CORRUPTED -> BlockImageCorrupted (event) -// EVENT BLOCK_IO_ERROR +// BlockImageCorrupted implements the "BLOCK_IMAGE_CORRUPTED" event. +type BlockImageCorrupted struct { + Device string `json:"device"` + NodeName *string `json:"node-name,omitempty"` + Msg string `json:"msg"` + Offset *int64 `json:"offset,omitempty"` + Size *int64 `json:"size,omitempty"` + Fatal bool `json:"fatal"` +} + +func (BlockImageCorrupted) isEvent() {} + +// BLOCK_IO_ERROR -> BlockIOError (event) + +// BlockIOError implements the "BLOCK_IO_ERROR" event. +type BlockIOError struct { + Device string `json:"device"` + NodeName string `json:"node-name"` + Operation IOOperationType `json:"operation"` + Action BlockErrorAction `json:"action"` + Nospace *bool `json:"nospace,omitempty"` + Reason string `json:"reason"` +} + +func (BlockIOError) isEvent() {} -// EVENT BLOCK_JOB_CANCELLED +// BLOCK_JOB_CANCELLED -> BlockJobCancelled (event) -// EVENT BLOCK_JOB_COMPLETED +// BlockJobCancelled implements the "BLOCK_JOB_CANCELLED" event. +type BlockJobCancelled struct { + Type BlockJobType `json:"type"` + Device string `json:"device"` + Len int64 `json:"len"` + Offset int64 `json:"offset"` + Speed int64 `json:"speed"` +} -// EVENT BLOCK_JOB_ERROR +func (BlockJobCancelled) isEvent() {} -// EVENT BLOCK_JOB_READY +// BLOCK_JOB_COMPLETED -> BlockJobCompleted (event) -// EVENT BLOCK_WRITE_THRESHOLD +// BlockJobCompleted implements the "BLOCK_JOB_COMPLETED" event. +type BlockJobCompleted struct { + Type BlockJobType `json:"type"` + Device string `json:"device"` + Len int64 `json:"len"` + Offset int64 `json:"offset"` + Speed int64 `json:"speed"` + Error *string `json:"error,omitempty"` +} + +func (BlockJobCompleted) isEvent() {} + +// BLOCK_JOB_ERROR -> BlockJobError (event) + +// BlockJobError implements the "BLOCK_JOB_ERROR" event. +type BlockJobError struct { + Device string `json:"device"` + Operation IOOperationType `json:"operation"` + Action BlockErrorAction `json:"action"` +} + +func (BlockJobError) isEvent() {} + +// BLOCK_JOB_READY -> BlockJobReady (event) + +// BlockJobReady implements the "BLOCK_JOB_READY" event. +type BlockJobReady struct { + Type BlockJobType `json:"type"` + Device string `json:"device"` + Len int64 `json:"len"` + Offset int64 `json:"offset"` + Speed int64 `json:"speed"` +} + +func (BlockJobReady) isEvent() {} + +// BLOCK_WRITE_THRESHOLD -> BlockWriteThreshold (event) + +// BlockWriteThreshold implements the "BLOCK_WRITE_THRESHOLD" event. +type BlockWriteThreshold struct { + NodeName string `json:"node-name"` + AmountExceeded uint64 `json:"amount-exceeded"` + WriteThreshold uint64 `json:"write-threshold"` +} + +func (BlockWriteThreshold) isEvent() {} // BalloonInfo -> BalloonInfo (struct) @@ -1157,8 +1249,7 @@ type BlockdevDriver int // Known values of BlockdevDriver. const ( - BlockdevDriverArchipelago BlockdevDriver = iota - BlockdevDriverBlkdebug + BlockdevDriverBlkdebug BlockdevDriver = iota BlockdevDriverBlkverify BlockdevDriverBochs BlockdevDriverCloop @@ -1171,6 +1262,7 @@ const ( BlockdevDriverHostDevice BlockdevDriverHTTP BlockdevDriverHTTPS + BlockdevDriverIscsi BlockdevDriverLUKS BlockdevDriverNBD BlockdevDriverNfs @@ -1182,7 +1274,9 @@ const ( BlockdevDriverQed BlockdevDriverQuorum BlockdevDriverRaw + BlockdevDriverRbd BlockdevDriverReplication + BlockdevDriverSheepdog BlockdevDriverSsh BlockdevDriverVdi BlockdevDriverVhdx @@ -1194,8 +1288,6 @@ const ( // String implements fmt.Stringer. func (e BlockdevDriver) String() string { switch e { - case BlockdevDriverArchipelago: - return "archipelago" case BlockdevDriverBlkdebug: return "blkdebug" case BlockdevDriverBlkverify: @@ -1222,6 +1314,8 @@ func (e BlockdevDriver) String() string { return "http" case BlockdevDriverHTTPS: return "https" + case BlockdevDriverIscsi: + return "iscsi" case BlockdevDriverLUKS: return "luks" case BlockdevDriverNBD: @@ -1244,8 +1338,12 @@ func (e BlockdevDriver) String() string { return "quorum" case BlockdevDriverRaw: return "raw" + case BlockdevDriverRbd: + return "rbd" case BlockdevDriverReplication: return "replication" + case BlockdevDriverSheepdog: + return "sheepdog" case BlockdevDriverSsh: return "ssh" case BlockdevDriverVdi: @@ -1266,8 +1364,6 @@ func (e BlockdevDriver) String() string { // MarshalJSON implements json.Marshaler. func (e BlockdevDriver) MarshalJSON() ([]byte, error) { switch e { - case BlockdevDriverArchipelago: - return json.Marshal("archipelago") case BlockdevDriverBlkdebug: return json.Marshal("blkdebug") case BlockdevDriverBlkverify: @@ -1294,6 +1390,8 @@ func (e BlockdevDriver) MarshalJSON() ([]byte, error) { return json.Marshal("http") case BlockdevDriverHTTPS: return json.Marshal("https") + case BlockdevDriverIscsi: + return json.Marshal("iscsi") case BlockdevDriverLUKS: return json.Marshal("luks") case BlockdevDriverNBD: @@ -1316,8 +1414,12 @@ func (e BlockdevDriver) MarshalJSON() ([]byte, error) { return json.Marshal("quorum") case BlockdevDriverRaw: return json.Marshal("raw") + case BlockdevDriverRbd: + return json.Marshal("rbd") case BlockdevDriverReplication: return json.Marshal("replication") + case BlockdevDriverSheepdog: + return json.Marshal("sheepdog") case BlockdevDriverSsh: return json.Marshal("ssh") case BlockdevDriverVdi: @@ -1342,8 +1444,6 @@ func (e *BlockdevDriver) UnmarshalJSON(bs []byte) error { return err } switch s { - case "archipelago": - *e = BlockdevDriverArchipelago case "blkdebug": *e = BlockdevDriverBlkdebug case "blkverify": @@ -1370,6 +1470,8 @@ func (e *BlockdevDriver) UnmarshalJSON(bs []byte) error { *e = BlockdevDriverHTTP case "https": *e = BlockdevDriverHTTPS + case "iscsi": + *e = BlockdevDriverIscsi case "luks": *e = BlockdevDriverLUKS case "nbd": @@ -1392,8 +1494,12 @@ func (e *BlockdevDriver) UnmarshalJSON(bs []byte) error { *e = BlockdevDriverQuorum case "raw": *e = BlockdevDriverRaw + case "rbd": + *e = BlockdevDriverRbd case "replication": *e = BlockdevDriverReplication + case "sheepdog": + *e = BlockdevDriverSheepdog case "ssh": *e = BlockdevDriverSsh case "vdi": @@ -1490,7 +1596,6 @@ func (e *BlockdevOnError) UnmarshalJSON(bs []byte) error { // BlockdevOptions implements the "BlockdevOptions" QMP API type. // // Can be one of: -// - BlockdevOptionsArchipelago // - BlockdevOptionsBlkdebug // - BlockdevOptionsBlkverify // - BlockdevOptionsBochs @@ -1504,6 +1609,7 @@ func (e *BlockdevOnError) UnmarshalJSON(bs []byte) error { // - BlockdevOptionsHostDevice // - BlockdevOptionsHTTP // - BlockdevOptionsHTTPS +// - BlockdevOptionsIscsi // - BlockdevOptionsLUKS // - BlockdevOptionsNBD // - BlockdevOptionsNfs @@ -1515,7 +1621,9 @@ func (e *BlockdevOnError) UnmarshalJSON(bs []byte) error { // - BlockdevOptionsQed // - BlockdevOptionsQuorum // - BlockdevOptionsRaw +// - BlockdevOptionsRbd // - BlockdevOptionsReplication +// - BlockdevOptionsSheepdog // - BlockdevOptionsSsh // - BlockdevOptionsVdi // - BlockdevOptionsVhdx @@ -1526,33 +1634,6 @@ type BlockdevOptions interface { isBlockdevOptions() } -// BlockdevOptionsArchipelago is an implementation of BlockdevOptions. -type BlockdevOptionsArchipelago struct { - NodeName *string `json:"node-name,omitempty"` - Discard *BlockdevDiscardOptions `json:"discard,omitempty"` - Cache *BlockdevCacheOptions `json:"cache,omitempty"` - ReadOnly *bool `json:"read-only,omitempty"` - DetectZeroes *BlockdevDetectZeroesOptions `json:"detect-zeroes,omitempty"` - Volume string `json:"volume"` - Mport *int64 `json:"mport,omitempty"` - Vport *int64 `json:"vport,omitempty"` - Segment *string `json:"segment,omitempty"` -} - -func (BlockdevOptionsArchipelago) isBlockdevOptions() {} - -// MarshalJSON implements json.Marshaler. -func (s BlockdevOptionsArchipelago) MarshalJSON() ([]byte, error) { - v := struct { - Driver BlockdevDriver `json:"driver"` - BlockdevOptionsArchipelago - }{ - BlockdevDriverArchipelago, - s, - } - return json.Marshal(v) -} - // BlockdevOptionsBlkdebug is an implementation of BlockdevOptions. type BlockdevOptionsBlkdebug struct { NodeName *string `json:"node-name,omitempty"` @@ -1760,7 +1841,7 @@ type BlockdevOptionsGluster struct { DetectZeroes *BlockdevDetectZeroesOptions `json:"detect-zeroes,omitempty"` Volume string `json:"volume"` Path string `json:"path"` - Server []GlusterServer `json:"server"` + Server []SocketAddressFlat `json:"server"` Debug *int64 `json:"debug,omitempty"` Logfile *string `json:"logfile,omitempty"` } @@ -1877,6 +1958,38 @@ func (s BlockdevOptionsHTTPS) MarshalJSON() ([]byte, error) { return json.Marshal(v) } +// BlockdevOptionsIscsi is an implementation of BlockdevOptions. +type BlockdevOptionsIscsi struct { + NodeName *string `json:"node-name,omitempty"` + Discard *BlockdevDiscardOptions `json:"discard,omitempty"` + Cache *BlockdevCacheOptions `json:"cache,omitempty"` + ReadOnly *bool `json:"read-only,omitempty"` + DetectZeroes *BlockdevDetectZeroesOptions `json:"detect-zeroes,omitempty"` + Transport IscsiTransport `json:"transport"` + Portal string `json:"portal"` + Target string `json:"target"` + Lun *int64 `json:"lun,omitempty"` + User *string `json:"user,omitempty"` + PasswordSecret *string `json:"password-secret,omitempty"` + InitiatorName *string `json:"initiator-name,omitempty"` + HeaderDigest *IscsiHeaderDigest `json:"header-digest,omitempty"` + Timeout *int64 `json:"timeout,omitempty"` +} + +func (BlockdevOptionsIscsi) isBlockdevOptions() {} + +// MarshalJSON implements json.Marshaler. +func (s BlockdevOptionsIscsi) MarshalJSON() ([]byte, error) { + v := struct { + Driver BlockdevDriver `json:"driver"` + BlockdevOptionsIscsi + }{ + BlockdevDriverIscsi, + s, + } + return json.Marshal(v) +} + // BlockdevOptionsLUKS is an implementation of BlockdevOptions. type BlockdevOptionsLUKS struct { NodeName *string `json:"node-name,omitempty"` @@ -2165,6 +2278,35 @@ func (s BlockdevOptionsRaw) MarshalJSON() ([]byte, error) { return json.Marshal(v) } +// BlockdevOptionsRbd is an implementation of BlockdevOptions. +type BlockdevOptionsRbd struct { + NodeName *string `json:"node-name,omitempty"` + Discard *BlockdevDiscardOptions `json:"discard,omitempty"` + Cache *BlockdevCacheOptions `json:"cache,omitempty"` + ReadOnly *bool `json:"read-only,omitempty"` + DetectZeroes *BlockdevDetectZeroesOptions `json:"detect-zeroes,omitempty"` + Pool string `json:"pool"` + Image string `json:"image"` + Conf *string `json:"conf,omitempty"` + Snapshot *string `json:"snapshot,omitempty"` + User *string `json:"user,omitempty"` + Server []InetSocketAddressBase `json:"server,omitempty"` +} + +func (BlockdevOptionsRbd) isBlockdevOptions() {} + +// MarshalJSON implements json.Marshaler. +func (s BlockdevOptionsRbd) MarshalJSON() ([]byte, error) { + v := struct { + Driver BlockdevDriver `json:"driver"` + BlockdevOptionsRbd + }{ + BlockdevDriverRbd, + s, + } + return json.Marshal(v) +} + // BlockdevOptionsReplication is an implementation of BlockdevOptions. type BlockdevOptionsReplication struct { NodeName *string `json:"node-name,omitempty"` @@ -2190,6 +2332,33 @@ func (s BlockdevOptionsReplication) MarshalJSON() ([]byte, error) { return json.Marshal(v) } +// BlockdevOptionsSheepdog is an implementation of BlockdevOptions. +type BlockdevOptionsSheepdog struct { + NodeName *string `json:"node-name,omitempty"` + Discard *BlockdevDiscardOptions `json:"discard,omitempty"` + Cache *BlockdevCacheOptions `json:"cache,omitempty"` + ReadOnly *bool `json:"read-only,omitempty"` + DetectZeroes *BlockdevDetectZeroesOptions `json:"detect-zeroes,omitempty"` + Addr SocketAddressFlat `json:"addr"` + Vdi string `json:"vdi"` + SnapID *uint32 `json:"snap-id,omitempty"` + Tag *string `json:"tag,omitempty"` +} + +func (BlockdevOptionsSheepdog) isBlockdevOptions() {} + +// MarshalJSON implements json.Marshaler. +func (s BlockdevOptionsSheepdog) MarshalJSON() ([]byte, error) { + v := struct { + Driver BlockdevDriver `json:"driver"` + BlockdevOptionsSheepdog + }{ + BlockdevDriverSheepdog, + s, + } + return json.Marshal(v) +} + // BlockdevOptionsSsh is an implementation of BlockdevOptions. type BlockdevOptionsSsh struct { NodeName *string `json:"node-name,omitempty"` @@ -2348,10 +2517,6 @@ func decodeBlockdevOptions(bs json.RawMessage) (BlockdevOptions, error) { return nil, err } switch v.Driver { - case BlockdevDriverArchipelago: - var ret BlockdevOptionsArchipelago - err := json.Unmarshal([]byte(bs), &ret) - return ret, err case BlockdevDriverBlkdebug: var ret BlockdevOptionsBlkdebug err := json.Unmarshal([]byte(bs), &ret) @@ -2404,6 +2569,10 @@ func decodeBlockdevOptions(bs json.RawMessage) (BlockdevOptions, error) { var ret BlockdevOptionsHTTPS err := json.Unmarshal([]byte(bs), &ret) return ret, err + case BlockdevDriverIscsi: + var ret BlockdevOptionsIscsi + err := json.Unmarshal([]byte(bs), &ret) + return ret, err case BlockdevDriverLUKS: var ret BlockdevOptionsLUKS err := json.Unmarshal([]byte(bs), &ret) @@ -2448,10 +2617,18 @@ func decodeBlockdevOptions(bs json.RawMessage) (BlockdevOptions, error) { var ret BlockdevOptionsRaw err := json.Unmarshal([]byte(bs), &ret) return ret, err + case BlockdevDriverRbd: + var ret BlockdevOptionsRbd + err := json.Unmarshal([]byte(bs), &ret) + return ret, err case BlockdevDriverReplication: var ret BlockdevOptionsReplication err := json.Unmarshal([]byte(bs), &ret) return ret, err + case BlockdevDriverSheepdog: + var ret BlockdevOptionsSheepdog + err := json.Unmarshal([]byte(bs), &ret) + return ret, err case BlockdevDriverSsh: var ret BlockdevOptionsSsh err := json.Unmarshal([]byte(bs), &ret) @@ -2495,7 +2672,6 @@ type BlockdevRef interface { // BlockdevRefDefinition is an implementation of BlockdevRef type BlockdevRefDefinition BlockdevOptions -func (BlockdevOptionsArchipelago) isBlockdevRef() {} func (BlockdevOptionsBlkdebug) isBlockdevRef() {} func (BlockdevOptionsBlkverify) isBlockdevRef() {} func (BlockdevOptionsBochs) isBlockdevRef() {} @@ -2509,6 +2685,7 @@ func (BlockdevOptionsHostCdrom) isBlockdevRef() {} func (BlockdevOptionsHostDevice) isBlockdevRef() {} func (BlockdevOptionsHTTP) isBlockdevRef() {} func (BlockdevOptionsHTTPS) isBlockdevRef() {} +func (BlockdevOptionsIscsi) isBlockdevRef() {} func (BlockdevOptionsLUKS) isBlockdevRef() {} func (BlockdevOptionsNBD) isBlockdevRef() {} func (BlockdevOptionsNfs) isBlockdevRef() {} @@ -2520,7 +2697,9 @@ func (BlockdevOptionsQcow2) isBlockdevRef() {} func (BlockdevOptionsQed) isBlockdevRef() {} func (BlockdevOptionsQuorum) isBlockdevRef() {} func (BlockdevOptionsRaw) isBlockdevRef() {} +func (BlockdevOptionsRbd) isBlockdevRef() {} func (BlockdevOptionsReplication) isBlockdevRef() {} +func (BlockdevOptionsSheepdog) isBlockdevRef() {} func (BlockdevOptionsSsh) isBlockdevRef() {} func (BlockdevOptionsVdi) isBlockdevRef() {} func (BlockdevOptionsVhdx) isBlockdevRef() {} @@ -2541,8 +2720,6 @@ func decodeBlockdevRef(bs json.RawMessage) (BlockdevRef, error) { if definition, err := decodeBlockdevOptions([]byte(bs)); err == nil { switch impl := definition.(type) { - case BlockdevOptionsArchipelago: - return impl, nil case BlockdevOptionsBlkdebug: return impl, nil case BlockdevOptionsBlkverify: @@ -2569,6 +2746,8 @@ func decodeBlockdevRef(bs json.RawMessage) (BlockdevRef, error) { return impl, nil case BlockdevOptionsHTTPS: return impl, nil + case BlockdevOptionsIscsi: + return impl, nil case BlockdevOptionsLUKS: return impl, nil case BlockdevOptionsNBD: @@ -2591,8 +2770,12 @@ func decodeBlockdevRef(bs json.RawMessage) (BlockdevRef, error) { return impl, nil case BlockdevOptionsRaw: return impl, nil + case BlockdevOptionsRbd: + return impl, nil case BlockdevOptionsReplication: return impl, nil + case BlockdevOptionsSheepdog: + return impl, nil case BlockdevOptionsSsh: return impl, nil case BlockdevOptionsVdi: @@ -2662,6 +2845,7 @@ type BlockdevSnapshotSync struct { // - ChardevBackendTestdev // - ChardevBackendUDP // - ChardevBackendVc +// - ChardevBackendWctablet type ChardevBackend interface { isChardevBackend() } @@ -2932,6 +3116,20 @@ func (s ChardevBackendVc) MarshalJSON() ([]byte, error) { return json.Marshal(v) } +// ChardevBackendWctablet is an implementation of ChardevBackend. +type ChardevBackendWctablet ChardevCommon + +func (ChardevBackendWctablet) isChardevBackend() {} + +// MarshalJSON implements json.Marshaler. +func (s ChardevBackendWctablet) MarshalJSON() ([]byte, error) { + v := map[string]interface{}{ + "type": "wctablet", + "data": s, + } + return json.Marshal(v) +} + func decodeChardevBackend(bs json.RawMessage) (ChardevBackend, error) { v := struct { T string `json:"type"` @@ -3055,6 +3253,12 @@ func decodeChardevBackend(bs json.RawMessage) (ChardevBackend, error) { return nil, err } return ret, nil + case "wctablet": + var ret ChardevBackendWctablet + if err := json.Unmarshal([]byte(v.V), &ret); err != nil { + return nil, err + } + return ret, nil default: return nil, fmt.Errorf("unknown subtype %q for union ChardevBackend", v.T) } @@ -3792,11 +3996,36 @@ type CPUModelInfo struct { Props *interface{} `json:"props,omitempty"` } -// EVENT DEVICE_DELETED +// DEVICE_DELETED -> DeviceDeleted (event) + +// DeviceDeleted implements the "DEVICE_DELETED" event. +type DeviceDeleted struct { + Device *string `json:"device,omitempty"` + Path string `json:"path"` +} -// EVENT DEVICE_TRAY_MOVED +func (DeviceDeleted) isEvent() {} -// EVENT DUMP_COMPLETED +// DEVICE_TRAY_MOVED -> DeviceTrayMoved (event) + +// DeviceTrayMoved implements the "DEVICE_TRAY_MOVED" event. +type DeviceTrayMoved struct { + Device string `json:"device"` + ID string `json:"id"` + TrayOpen bool `json:"tray-open"` +} + +func (DeviceTrayMoved) isEvent() {} + +// DUMP_COMPLETED -> DumpCompleted (event) + +// DumpCompleted implements the "DUMP_COMPLETED" event. +type DumpCompleted struct { + Result DumpQueryResult `json:"result"` + Error *string `json:"error,omitempty"` +} + +func (DumpCompleted) isEvent() {} // DataFormat -> DataFormat (enum) @@ -4135,187 +4364,193 @@ type GicCapability struct { Kernel bool `json:"kernel"` } -// EVENT GUEST_PANICKED - -// GlusterServer -> GlusterServer (flat union) - -// GlusterServer implements the "GlusterServer" QMP API type. -// -// Can be one of: -// - GlusterServerTCP -// - GlusterServerUnix -type GlusterServer interface { - isGlusterServer() -} - -// GlusterServerTCP is an implementation of GlusterServer. -type GlusterServerTCP struct { - Host string `json:"host"` - Port string `json:"port"` - Numeric *bool `json:"numeric,omitempty"` - To *uint16 `json:"to,omitempty"` - Ipv4 *bool `json:"ipv4,omitempty"` - Ipv6 *bool `json:"ipv6,omitempty"` -} - -func (GlusterServerTCP) isGlusterServer() {} - -// MarshalJSON implements json.Marshaler. -func (s GlusterServerTCP) MarshalJSON() ([]byte, error) { - v := struct { - Type GlusterTransport `json:"type"` - GlusterServerTCP - }{ - GlusterTransportTCP, - s, - } - return json.Marshal(v) -} - -// GlusterServerUnix is an implementation of GlusterServer. -type GlusterServerUnix struct { - Path string `json:"path"` -} - -func (GlusterServerUnix) isGlusterServer() {} +// GUEST_PANICKED -> GuestPanicked (event) -// MarshalJSON implements json.Marshaler. -func (s GlusterServerUnix) MarshalJSON() ([]byte, error) { - v := struct { - Type GlusterTransport `json:"type"` - GlusterServerUnix - }{ - GlusterTransportUnix, - s, - } - return json.Marshal(v) +// GuestPanicked implements the "GUEST_PANICKED" event. +type GuestPanicked struct { + Action GuestPanicAction `json:"action"` + Info GuestPanicInformation `json:"info,omitempty"` } -func decodeGlusterServer(bs json.RawMessage) (GlusterServer, error) { +// UnmarshalJSON implements json.Unmarshaler. +func (s *GuestPanicked) UnmarshalJSON(bs []byte) error { v := struct { - Type GlusterTransport `json:"type"` + Action GuestPanicAction `json:"action"` + Info json.RawMessage `json:"info"` }{} - if err := json.Unmarshal([]byte(bs), &v); err != nil { - return nil, err + err := json.Unmarshal(bs, &v) + if err != nil { + return err } - switch v.Type { - case GlusterTransportTCP: - var ret GlusterServerTCP - err := json.Unmarshal([]byte(bs), &ret) - return ret, err - case GlusterTransportUnix: - var ret GlusterServerUnix - err := json.Unmarshal([]byte(bs), &ret) - return ret, err - default: - return nil, fmt.Errorf("unknown flat union subtype %q for flat union GlusterServer", v.Type) + s.Action = v.Action + if len(v.Info) > 0 { + s.Info, err = decodeGuestPanicInformation(v.Info) + if err != nil { + return err + } + } else { + s.Info = nil } + + return nil } -// GlusterTransport -> GlusterTransport (enum) +func (GuestPanicked) isEvent() {} + +// GuestPanicAction -> GuestPanicAction (enum) -// GlusterTransport implements the "GlusterTransport" QMP API type. -type GlusterTransport int +// GuestPanicAction implements the "GuestPanicAction" QMP API type. +type GuestPanicAction int -// Known values of GlusterTransport. +// Known values of GuestPanicAction. const ( - GlusterTransportUnix GlusterTransport = iota - GlusterTransportTCP + GuestPanicActionPause GuestPanicAction = iota + GuestPanicActionPoweroff ) // String implements fmt.Stringer. -func (e GlusterTransport) String() string { +func (e GuestPanicAction) String() string { switch e { - case GlusterTransportUnix: - return "unix" - case GlusterTransportTCP: - return "tcp" + case GuestPanicActionPause: + return "pause" + case GuestPanicActionPoweroff: + return "poweroff" default: - return fmt.Sprintf("GlusterTransport(%d)", e) + return fmt.Sprintf("GuestPanicAction(%d)", e) } } // MarshalJSON implements json.Marshaler. -func (e GlusterTransport) MarshalJSON() ([]byte, error) { +func (e GuestPanicAction) MarshalJSON() ([]byte, error) { switch e { - case GlusterTransportUnix: - return json.Marshal("unix") - case GlusterTransportTCP: - return json.Marshal("tcp") + case GuestPanicActionPause: + return json.Marshal("pause") + case GuestPanicActionPoweroff: + return json.Marshal("poweroff") default: - return nil, fmt.Errorf("unknown enum value %q for GlusterTransport", e) + return nil, fmt.Errorf("unknown enum value %q for GuestPanicAction", e) } } // UnmarshalJSON implements json.Unmarshaler. -func (e *GlusterTransport) UnmarshalJSON(bs []byte) error { +func (e *GuestPanicAction) UnmarshalJSON(bs []byte) error { var s string if err := json.Unmarshal(bs, &s); err != nil { return err } switch s { - case "unix": - *e = GlusterTransportUnix - case "tcp": - *e = GlusterTransportTCP + case "pause": + *e = GuestPanicActionPause + case "poweroff": + *e = GuestPanicActionPoweroff default: - return fmt.Errorf("unknown enum value %q for GlusterTransport", s) + return fmt.Errorf("unknown enum value %q for GuestPanicAction", s) } return nil } -// GuestPanicAction -> GuestPanicAction (enum) +// GuestPanicInformation -> GuestPanicInformation (flat union) -// GuestPanicAction implements the "GuestPanicAction" QMP API type. -type GuestPanicAction int +// GuestPanicInformation implements the "GuestPanicInformation" QMP API type. +// +// Can be one of: +// - GuestPanicInformationHyperV +type GuestPanicInformation interface { + isGuestPanicInformation() +} -// Known values of GuestPanicAction. +// GuestPanicInformationHyperV is an implementation of GuestPanicInformation. +type GuestPanicInformationHyperV struct { + Arg1 uint64 `json:"arg1"` + Arg2 uint64 `json:"arg2"` + Arg3 uint64 `json:"arg3"` + Arg4 uint64 `json:"arg4"` + Arg5 uint64 `json:"arg5"` +} + +func (GuestPanicInformationHyperV) isGuestPanicInformation() {} + +// MarshalJSON implements json.Marshaler. +func (s GuestPanicInformationHyperV) MarshalJSON() ([]byte, error) { + v := struct { + Type GuestPanicInformationType `json:"type"` + GuestPanicInformationHyperV + }{ + GuestPanicInformationTypeHyperV, + s, + } + return json.Marshal(v) +} + +func decodeGuestPanicInformation(bs json.RawMessage) (GuestPanicInformation, error) { + v := struct { + Type GuestPanicInformationType `json:"type"` + }{} + if err := json.Unmarshal([]byte(bs), &v); err != nil { + return nil, err + } + switch v.Type { + case GuestPanicInformationTypeHyperV: + var ret GuestPanicInformationHyperV + err := json.Unmarshal([]byte(bs), &ret) + return ret, err + default: + return nil, fmt.Errorf("unknown flat union subtype %q for flat union GuestPanicInformation", v.Type) + } +} + +// GuestPanicInformationType -> GuestPanicInformationType (enum) + +// GuestPanicInformationType implements the "GuestPanicInformationType" QMP API type. +type GuestPanicInformationType int + +// Known values of GuestPanicInformationType. const ( - GuestPanicActionPause GuestPanicAction = iota - GuestPanicActionPoweroff + GuestPanicInformationTypeHyperV GuestPanicInformationType = iota ) // String implements fmt.Stringer. -func (e GuestPanicAction) String() string { +func (e GuestPanicInformationType) String() string { switch e { - case GuestPanicActionPause: - return "pause" - case GuestPanicActionPoweroff: - return "poweroff" + case GuestPanicInformationTypeHyperV: + return "hyper-v" default: - return fmt.Sprintf("GuestPanicAction(%d)", e) + return fmt.Sprintf("GuestPanicInformationType(%d)", e) } } // MarshalJSON implements json.Marshaler. -func (e GuestPanicAction) MarshalJSON() ([]byte, error) { +func (e GuestPanicInformationType) MarshalJSON() ([]byte, error) { switch e { - case GuestPanicActionPause: - return json.Marshal("pause") - case GuestPanicActionPoweroff: - return json.Marshal("poweroff") + case GuestPanicInformationTypeHyperV: + return json.Marshal("hyper-v") default: - return nil, fmt.Errorf("unknown enum value %q for GuestPanicAction", e) + return nil, fmt.Errorf("unknown enum value %q for GuestPanicInformationType", e) } } // UnmarshalJSON implements json.Unmarshaler. -func (e *GuestPanicAction) UnmarshalJSON(bs []byte) error { +func (e *GuestPanicInformationType) UnmarshalJSON(bs []byte) error { var s string if err := json.Unmarshal(bs, &s); err != nil { return err } switch s { - case "pause": - *e = GuestPanicActionPause - case "poweroff": - *e = GuestPanicActionPoweroff + case "hyper-v": + *e = GuestPanicInformationTypeHyperV default: - return fmt.Errorf("unknown enum value %q for GuestPanicAction", s) + return fmt.Errorf("unknown enum value %q for GuestPanicInformationType", s) } return nil } +// GuidInfo -> GuidInfo (struct) + +// GuidInfo implements the "GuidInfo" QMP API type. +type GuidInfo struct { + Guid string `json:"guid"` +} + // HostMemPolicy -> HostMemPolicy (enum) // HostMemPolicy implements the "HostMemPolicy" QMP API type. @@ -4396,8 +4631,11 @@ type HotpluggableCPU struct { // IOThreadInfo implements the "IOThreadInfo" QMP API type. type IOThreadInfo struct { - ID string `json:"id"` - ThreadID int64 `json:"thread-id"` + ID string `json:"id"` + ThreadID int64 `json:"thread-id"` + PollMaxNs int64 `json:"poll-max-ns"` + PollGrow int64 `json:"poll-grow"` + PollShrink int64 `json:"poll-shrink"` } // ImageInfo -> ImageInfo (struct) @@ -4582,6 +4820,14 @@ type InetSocketAddress struct { Ipv6 *bool `json:"ipv6,omitempty"` } +// InetSocketAddressBase -> InetSocketAddressBase (struct) + +// InetSocketAddressBase implements the "InetSocketAddressBase" QMP API type. +type InetSocketAddressBase struct { + Host string `json:"host"` + Port string `json:"port"` +} + // InputAxis -> InputAxis (enum) // InputAxis implements the "InputAxis" QMP API type. @@ -4654,6 +4900,8 @@ const ( InputButtonRight InputButtonWheelUp InputButtonWheelDown + InputButtonSide + InputButtonExtra ) // String implements fmt.Stringer. @@ -4669,6 +4917,10 @@ func (e InputButton) String() string { return "wheel-up" case InputButtonWheelDown: return "wheel-down" + case InputButtonSide: + return "side" + case InputButtonExtra: + return "extra" default: return fmt.Sprintf("InputButton(%d)", e) } @@ -4687,6 +4939,10 @@ func (e InputButton) MarshalJSON() ([]byte, error) { return json.Marshal("wheel-up") case InputButtonWheelDown: return json.Marshal("wheel-down") + case InputButtonSide: + return json.Marshal("side") + case InputButtonExtra: + return json.Marshal("extra") default: return nil, fmt.Errorf("unknown enum value %q for InputButton", e) } @@ -4709,6 +4965,10 @@ func (e *InputButton) UnmarshalJSON(bs []byte) error { *e = InputButtonWheelUp case "wheel-down": *e = InputButtonWheelDown + case "side": + *e = InputButtonSide + case "extra": + *e = InputButtonExtra default: return fmt.Errorf("unknown enum value %q for InputButton", s) } @@ -4909,6 +5169,124 @@ func (e *IOOperationType) UnmarshalJSON(bs []byte) error { return nil } +// IscsiHeaderDigest -> IscsiHeaderDigest (enum) + +// IscsiHeaderDigest implements the "IscsiHeaderDigest" QMP API type. +type IscsiHeaderDigest int + +// Known values of IscsiHeaderDigest. +const ( + IscsiHeaderDigestCrc32C IscsiHeaderDigest = iota + IscsiHeaderDigestNone + IscsiHeaderDigestCrc32CNone + IscsiHeaderDigestNoneCrc32C +) + +// String implements fmt.Stringer. +func (e IscsiHeaderDigest) String() string { + switch e { + case IscsiHeaderDigestCrc32C: + return "crc32c" + case IscsiHeaderDigestNone: + return "none" + case IscsiHeaderDigestCrc32CNone: + return "crc32c-none" + case IscsiHeaderDigestNoneCrc32C: + return "none-crc32c" + default: + return fmt.Sprintf("IscsiHeaderDigest(%d)", e) + } +} + +// MarshalJSON implements json.Marshaler. +func (e IscsiHeaderDigest) MarshalJSON() ([]byte, error) { + switch e { + case IscsiHeaderDigestCrc32C: + return json.Marshal("crc32c") + case IscsiHeaderDigestNone: + return json.Marshal("none") + case IscsiHeaderDigestCrc32CNone: + return json.Marshal("crc32c-none") + case IscsiHeaderDigestNoneCrc32C: + return json.Marshal("none-crc32c") + default: + return nil, fmt.Errorf("unknown enum value %q for IscsiHeaderDigest", e) + } +} + +// UnmarshalJSON implements json.Unmarshaler. +func (e *IscsiHeaderDigest) UnmarshalJSON(bs []byte) error { + var s string + if err := json.Unmarshal(bs, &s); err != nil { + return err + } + switch s { + case "crc32c": + *e = IscsiHeaderDigestCrc32C + case "none": + *e = IscsiHeaderDigestNone + case "crc32c-none": + *e = IscsiHeaderDigestCrc32CNone + case "none-crc32c": + *e = IscsiHeaderDigestNoneCrc32C + default: + return fmt.Errorf("unknown enum value %q for IscsiHeaderDigest", s) + } + return nil +} + +// IscsiTransport -> IscsiTransport (enum) + +// IscsiTransport implements the "IscsiTransport" QMP API type. +type IscsiTransport int + +// Known values of IscsiTransport. +const ( + IscsiTransportTCP IscsiTransport = iota + IscsiTransportIser +) + +// String implements fmt.Stringer. +func (e IscsiTransport) String() string { + switch e { + case IscsiTransportTCP: + return "tcp" + case IscsiTransportIser: + return "iser" + default: + return fmt.Sprintf("IscsiTransport(%d)", e) + } +} + +// MarshalJSON implements json.Marshaler. +func (e IscsiTransport) MarshalJSON() ([]byte, error) { + switch e { + case IscsiTransportTCP: + return json.Marshal("tcp") + case IscsiTransportIser: + return json.Marshal("iser") + default: + return nil, fmt.Errorf("unknown enum value %q for IscsiTransport", e) + } +} + +// UnmarshalJSON implements json.Unmarshaler. +func (e *IscsiTransport) UnmarshalJSON(bs []byte) error { + var s string + if err := json.Unmarshal(bs, &s); err != nil { + return err + } + switch s { + case "tcp": + *e = IscsiTransportTCP + case "iser": + *e = IscsiTransportIser + default: + return fmt.Errorf("unknown enum value %q for IscsiTransport", s) + } + return nil +} + // JSONType -> JSONType (enum) // JSONType implements the "JSONType" QMP API type. @@ -5076,11 +5454,33 @@ type KVMInfo struct { Present bool `json:"present"` } -// EVENT MEM_UNPLUG_ERROR +// MEM_UNPLUG_ERROR -> MemUnplugError (event) + +// MemUnplugError implements the "MEM_UNPLUG_ERROR" event. +type MemUnplugError struct { + Device string `json:"device"` + Msg string `json:"msg"` +} + +func (MemUnplugError) isEvent() {} + +// MIGRATION -> Migration (event) + +// Migration implements the "MIGRATION" event. +type Migration struct { + Status MigrationStatus `json:"status"` +} -// EVENT MIGRATION +func (Migration) isEvent() {} -// EVENT MIGRATION_PASS +// MIGRATION_PASS -> MigrationPass (event) + +// MigrationPass implements the "MIGRATION_PASS" event. +type MigrationPass struct { + Pass int64 `json:"pass"` +} + +func (MigrationPass) isEvent() {} // MachineInfo -> MachineInfo (struct) @@ -5165,6 +5565,7 @@ const ( MigrationCapabilityEvents MigrationCapabilityPostcopyRAM MigrationCapabilityXColo + MigrationCapabilityReleaseRAM ) // String implements fmt.Stringer. @@ -5186,6 +5587,8 @@ func (e MigrationCapability) String() string { return "postcopy-ram" case MigrationCapabilityXColo: return "x-colo" + case MigrationCapabilityReleaseRAM: + return "release-ram" default: return fmt.Sprintf("MigrationCapability(%d)", e) } @@ -5210,6 +5613,8 @@ func (e MigrationCapability) MarshalJSON() ([]byte, error) { return json.Marshal("postcopy-ram") case MigrationCapabilityXColo: return json.Marshal("x-colo") + case MigrationCapabilityReleaseRAM: + return json.Marshal("release-ram") default: return nil, fmt.Errorf("unknown enum value %q for MigrationCapability", e) } @@ -5238,6 +5643,8 @@ func (e *MigrationCapability) UnmarshalJSON(bs []byte) error { *e = MigrationCapabilityPostcopyRAM case "x-colo": *e = MigrationCapabilityXColo + case "release-ram": + *e = MigrationCapabilityReleaseRAM default: return fmt.Errorf("unknown enum value %q for MigrationCapability", s) } @@ -5531,7 +5938,15 @@ func (e *NfsTransport) UnmarshalJSON(bs []byte) error { return nil } -// EVENT NIC_RX_FILTER_CHANGED +// NIC_RX_FILTER_CHANGED -> NicRxFilterChanged (event) + +// NicRxFilterChanged implements the "NIC_RX_FILTER_CHANGED" event. +type NicRxFilterChanged struct { + Name *string `json:"name,omitempty"` + Path string `json:"path"` +} + +func (NicRxFilterChanged) isEvent() {} // NameInfo -> NameInfo (struct) @@ -5694,7 +6109,13 @@ type PcdimmDeviceInfo struct { Hotpluggable bool `json:"hotpluggable"` } -// EVENT POWERDOWN +// POWERDOWN -> Powerdown (event) + +// Powerdown implements the "POWERDOWN" event. +type Powerdown struct { +} + +func (Powerdown) isEvent() {} // PciBridgeInfo -> PCIBridgeInfo (struct) @@ -7082,9 +7503,29 @@ func (e *QKeyCode) UnmarshalJSON(bs []byte) error { return nil } -// EVENT QUORUM_FAILURE +// QUORUM_FAILURE -> QuorumFailure (event) + +// QuorumFailure implements the "QUORUM_FAILURE" event. +type QuorumFailure struct { + Reference string `json:"reference"` + SectorNum int64 `json:"sector-num"` + SectorsCount int64 `json:"sectors-count"` +} + +func (QuorumFailure) isEvent() {} -// EVENT QUORUM_REPORT_BAD +// QUORUM_REPORT_BAD -> QuorumReportBad (event) + +// QuorumReportBad implements the "QUORUM_REPORT_BAD" event. +type QuorumReportBad struct { + Type QuorumOpType `json:"type"` + Error *string `json:"error,omitempty"` + NodeName string `json:"node-name"` + SectorNum int64 `json:"sector-num"` + SectorsCount int64 `json:"sectors-count"` +} + +func (QuorumReportBad) isEvent() {} // Qcow2OverlapCheckFlags -> Qcow2OverlapCheckFlags (struct) @@ -7313,11 +7754,30 @@ func (e *QuorumReadPattern) UnmarshalJSON(bs []byte) error { return nil } -// EVENT RESET +// RESET -> Reset (event) + +// Reset implements the "RESET" event. +type Reset struct { +} + +func (Reset) isEvent() {} + +// RESUME -> Resume (event) + +// Resume implements the "RESUME" event. +type Resume struct { +} + +func (Resume) isEvent() {} + +// RTC_CHANGE -> RtcChange (event) -// EVENT RESUME +// RtcChange implements the "RTC_CHANGE" event. +type RtcChange struct { + Offset int64 `json:"offset"` +} -// EVENT RTC_CHANGE +func (RtcChange) isEvent() {} // ReplicationMode -> ReplicationMode (enum) @@ -7371,6 +7831,14 @@ func (e *ReplicationMode) UnmarshalJSON(bs []byte) error { return nil } +// ReplicationStatus -> ReplicationStatus (struct) + +// ReplicationStatus implements the "ReplicationStatus" QMP API type. +type ReplicationStatus struct { + Error bool `json:"error"` + Desc *string `json:"desc,omitempty"` +} + // RockerOfDpaFlow -> RockerOfDpaFlow (struct) // RockerOfDpaFlow implements the "RockerOfDpaFlow" QMP API type. @@ -7795,21 +8263,75 @@ func (e *RxState) UnmarshalJSON(bs []byte) error { return nil } -// EVENT SHUTDOWN +// SHUTDOWN -> Shutdown (event) + +// Shutdown implements the "SHUTDOWN" event. +type Shutdown struct { +} + +func (Shutdown) isEvent() {} + +// SPICE_CONNECTED -> SpiceConnected (event) + +// SpiceConnected implements the "SPICE_CONNECTED" event. +type SpiceConnected struct { + Server SpiceBasicInfo `json:"server"` + Client SpiceBasicInfo `json:"client"` +} + +func (SpiceConnected) isEvent() {} + +// SPICE_DISCONNECTED -> SpiceDisconnected (event) + +// SpiceDisconnected implements the "SPICE_DISCONNECTED" event. +type SpiceDisconnected struct { + Server SpiceBasicInfo `json:"server"` + Client SpiceBasicInfo `json:"client"` +} + +func (SpiceDisconnected) isEvent() {} + +// SPICE_INITIALIZED -> SpiceInitialized (event) + +// SpiceInitialized implements the "SPICE_INITIALIZED" event. +type SpiceInitialized struct { + Server SpiceServerInfo `json:"server"` + Client SpiceChannel `json:"client"` +} + +func (SpiceInitialized) isEvent() {} -// EVENT SPICE_CONNECTED +// SPICE_MIGRATE_COMPLETED -> SpiceMigrateCompleted (event) -// EVENT SPICE_DISCONNECTED +// SpiceMigrateCompleted implements the "SPICE_MIGRATE_COMPLETED" event. +type SpiceMigrateCompleted struct { +} -// EVENT SPICE_INITIALIZED +func (SpiceMigrateCompleted) isEvent() {} + +// STOP -> Stop (event) + +// Stop implements the "STOP" event. +type Stop struct { +} + +func (Stop) isEvent() {} + +// SUSPEND -> Suspend (event) + +// Suspend implements the "SUSPEND" event. +type Suspend struct { +} -// EVENT SPICE_MIGRATE_COMPLETED +func (Suspend) isEvent() {} -// EVENT STOP +// SUSPEND_DISK -> SuspendDisk (event) -// EVENT SUSPEND +// SuspendDisk implements the "SUSPEND_DISK" event. +type SuspendDisk struct { +} -// EVENT SUSPEND_DISK +func (SuspendDisk) isEvent() {} // SchemaInfo -> SchemaInfo (flat union) @@ -8242,6 +8764,131 @@ func decodeSocketAddress(bs json.RawMessage) (SocketAddress, error) { } } +// SocketAddressFlat -> SocketAddressFlat (flat union) + +// SocketAddressFlat implements the "SocketAddressFlat" QMP API type. +// +// Can be one of: +// - SocketAddressFlatInet +// - SocketAddressFlatUnix +type SocketAddressFlat interface { + isSocketAddressFlat() +} + +// SocketAddressFlatInet is an implementation of SocketAddressFlat. +type SocketAddressFlatInet struct { + Numeric *bool `json:"numeric,omitempty"` + To *uint16 `json:"to,omitempty"` + Ipv4 *bool `json:"ipv4,omitempty"` + Ipv6 *bool `json:"ipv6,omitempty"` +} + +func (SocketAddressFlatInet) isSocketAddressFlat() {} + +// MarshalJSON implements json.Marshaler. +func (s SocketAddressFlatInet) MarshalJSON() ([]byte, error) { + v := struct { + Type SocketAddressFlatType `json:"type"` + SocketAddressFlatInet + }{ + SocketAddressFlatTypeInet, + s, + } + return json.Marshal(v) +} + +// SocketAddressFlatUnix is an implementation of SocketAddressFlat. +type SocketAddressFlatUnix struct { + Path string `json:"path"` +} + +func (SocketAddressFlatUnix) isSocketAddressFlat() {} + +// MarshalJSON implements json.Marshaler. +func (s SocketAddressFlatUnix) MarshalJSON() ([]byte, error) { + v := struct { + Type SocketAddressFlatType `json:"type"` + SocketAddressFlatUnix + }{ + SocketAddressFlatTypeUnix, + s, + } + return json.Marshal(v) +} + +func decodeSocketAddressFlat(bs json.RawMessage) (SocketAddressFlat, error) { + v := struct { + Type SocketAddressFlatType `json:"type"` + }{} + if err := json.Unmarshal([]byte(bs), &v); err != nil { + return nil, err + } + switch v.Type { + case SocketAddressFlatTypeInet: + var ret SocketAddressFlatInet + err := json.Unmarshal([]byte(bs), &ret) + return ret, err + case SocketAddressFlatTypeUnix: + var ret SocketAddressFlatUnix + err := json.Unmarshal([]byte(bs), &ret) + return ret, err + default: + return nil, fmt.Errorf("unknown flat union subtype %q for flat union SocketAddressFlat", v.Type) + } +} + +// SocketAddressFlatType -> SocketAddressFlatType (enum) + +// SocketAddressFlatType implements the "SocketAddressFlatType" QMP API type. +type SocketAddressFlatType int + +// Known values of SocketAddressFlatType. +const ( + SocketAddressFlatTypeUnix SocketAddressFlatType = iota + SocketAddressFlatTypeInet +) + +// String implements fmt.Stringer. +func (e SocketAddressFlatType) String() string { + switch e { + case SocketAddressFlatTypeUnix: + return "unix" + case SocketAddressFlatTypeInet: + return "inet" + default: + return fmt.Sprintf("SocketAddressFlatType(%d)", e) + } +} + +// MarshalJSON implements json.Marshaler. +func (e SocketAddressFlatType) MarshalJSON() ([]byte, error) { + switch e { + case SocketAddressFlatTypeUnix: + return json.Marshal("unix") + case SocketAddressFlatTypeInet: + return json.Marshal("inet") + default: + return nil, fmt.Errorf("unknown enum value %q for SocketAddressFlatType", e) + } +} + +// UnmarshalJSON implements json.Unmarshaler. +func (e *SocketAddressFlatType) UnmarshalJSON(bs []byte) error { + var s string + if err := json.Unmarshal(bs, &s); err != nil { + return err + } + switch s { + case "unix": + *e = SocketAddressFlatTypeUnix + case "inet": + *e = SocketAddressFlatTypeInet + default: + return fmt.Errorf("unknown enum value %q for SocketAddressFlatType", s) + } + return nil +} + // SpiceBasicInfo -> SpiceBasicInfo (struct) // SpiceBasicInfo implements the "SpiceBasicInfo" QMP API type. @@ -8823,13 +9470,45 @@ type UUIDInfo struct { UUID string `json:"UUID"` } -// EVENT VNC_CONNECTED +// VNC_CONNECTED -> VNCConnected (event) + +// VNCConnected implements the "VNC_CONNECTED" event. +type VNCConnected struct { + Server VNCServerInfo `json:"server"` + Client VNCBasicInfo `json:"client"` +} + +func (VNCConnected) isEvent() {} + +// VNC_DISCONNECTED -> VNCDisconnected (event) + +// VNCDisconnected implements the "VNC_DISCONNECTED" event. +type VNCDisconnected struct { + Server VNCServerInfo `json:"server"` + Client VNCClientInfo `json:"client"` +} + +func (VNCDisconnected) isEvent() {} + +// VNC_INITIALIZED -> VNCInitialized (event) + +// VNCInitialized implements the "VNC_INITIALIZED" event. +type VNCInitialized struct { + Server VNCServerInfo `json:"server"` + Client VNCClientInfo `json:"client"` +} + +func (VNCInitialized) isEvent() {} -// EVENT VNC_DISCONNECTED +// VSERPORT_CHANGE -> VserportChange (event) -// EVENT VNC_INITIALIZED +// VserportChange implements the "VSERPORT_CHANGE" event. +type VserportChange struct { + ID string `json:"id"` + Open bool `json:"open"` +} -// EVENT VSERPORT_CHANGE +func (VserportChange) isEvent() {} // VersionInfo -> VersionInfo (struct) @@ -8887,7 +9566,7 @@ type VNCInfo struct { // VNCInfo2 implements the "VncInfo2" QMP API type. type VNCInfo2 struct { ID string `json:"id"` - Server []VNCBasicInfo `json:"server"` + Server []VNCServerInfo2 `json:"server"` Clients []VNCClientInfo `json:"clients"` Auth VNCPrimaryAuth `json:"auth"` Vencrypt *VNCVencryptSubAuth `json:"vencrypt,omitempty"` @@ -9006,6 +9685,18 @@ type VNCServerInfo struct { Auth *string `json:"auth,omitempty"` } +// VncServerInfo2 -> VNCServerInfo2 (struct) + +// VNCServerInfo2 implements the "VncServerInfo2" QMP API type. +type VNCServerInfo2 struct { + Host string `json:"host"` + Service string `json:"service"` + Family NetworkAddressFamily `json:"family"` + Websocket bool `json:"websocket"` + Auth VNCPrimaryAuth `json:"auth"` + Vencrypt *VNCVencryptSubAuth `json:"vencrypt,omitempty"` +} + // VncVencryptSubAuth -> VNCVencryptSubAuth (enum) // VNCVencryptSubAuth implements the "VncVencryptSubAuth" QMP API type. @@ -9115,9 +9806,22 @@ type VsockSocketAddress struct { Port string `json:"port"` } -// EVENT WAKEUP +// WAKEUP -> Wakeup (event) + +// Wakeup implements the "WAKEUP" event. +type Wakeup struct { +} + +func (Wakeup) isEvent() {} + +// WATCHDOG -> Watchdog (event) + +// Watchdog implements the "WATCHDOG" event. +type Watchdog struct { + Action WatchdogExpirationAction `json:"action"` +} -// EVENT WATCHDOG +func (Watchdog) isEvent() {} // WatchdogExpirationAction -> WatchdogExpirationAction (enum) @@ -9307,14 +10011,15 @@ func (m *Monitor) Balloon(value int64) (err error) { // block-commit -> BlockCommit (command) // BlockCommit implements the "block-commit" QMP API call. -func (m *Monitor) BlockCommit(jobID *string, device string, base *string, top *string, backingFile *string, speed *int64) (err error) { +func (m *Monitor) BlockCommit(jobID *string, device string, base *string, top *string, backingFile *string, speed *int64, filterNodeName *string) (err error) { cmd := struct { - JobID *string `json:"job-id,omitempty"` - Device string `json:"device"` - Base *string `json:"base,omitempty"` - Top *string `json:"top,omitempty"` - BackingFile *string `json:"backing-file,omitempty"` - Speed *int64 `json:"speed,omitempty"` + JobID *string `json:"job-id,omitempty"` + Device string `json:"device"` + Base *string `json:"base,omitempty"` + Top *string `json:"top,omitempty"` + BackingFile *string `json:"backing-file,omitempty"` + Speed *int64 `json:"speed,omitempty"` + FilterNodeName *string `json:"filter-node-name,omitempty"` }{ jobID, device, @@ -9322,6 +10027,7 @@ func (m *Monitor) BlockCommit(jobID *string, device string, base *string, top *s top, backingFile, speed, + filterNodeName, } bs, err := json.Marshal(map[string]interface{}{ "execute": "block-commit", @@ -9757,21 +10463,45 @@ func (m *Monitor) BlockdevCloseTray(device *string, id *string) (err error) { return } +// blockdev-del -> BlockdevDel (command) + +// BlockdevDel implements the "blockdev-del" QMP API call. +func (m *Monitor) BlockdevDel(nodeName string) (err error) { + cmd := struct { + NodeName string `json:"node-name"` + }{ + nodeName, + } + bs, err := json.Marshal(map[string]interface{}{ + "execute": "blockdev-del", + "arguments": cmd, + }) + if err != nil { + return + } + bs, err = m.mon.Run(bs) + if err != nil { + return + } + return +} + // blockdev-mirror -> BlockdevMirror (command) // BlockdevMirror implements the "blockdev-mirror" QMP API call. -func (m *Monitor) BlockdevMirror(jobID *string, device string, target string, replaces *string, sync MirrorSyncMode, speed *int64, granularity *uint32, bufSize *int64, onSourceError *BlockdevOnError, onTargetError *BlockdevOnError) (err error) { - cmd := struct { - JobID *string `json:"job-id,omitempty"` - Device string `json:"device"` - Target string `json:"target"` - Replaces *string `json:"replaces,omitempty"` - Sync MirrorSyncMode `json:"sync"` - Speed *int64 `json:"speed,omitempty"` - Granularity *uint32 `json:"granularity,omitempty"` - BufSize *int64 `json:"buf-size,omitempty"` - OnSourceError *BlockdevOnError `json:"on-source-error,omitempty"` - OnTargetError *BlockdevOnError `json:"on-target-error,omitempty"` +func (m *Monitor) BlockdevMirror(jobID *string, device string, target string, replaces *string, sync MirrorSyncMode, speed *int64, granularity *uint32, bufSize *int64, onSourceError *BlockdevOnError, onTargetError *BlockdevOnError, filterNodeName *string) (err error) { + cmd := struct { + JobID *string `json:"job-id,omitempty"` + Device string `json:"device"` + Target string `json:"target"` + Replaces *string `json:"replaces,omitempty"` + Sync MirrorSyncMode `json:"sync"` + Speed *int64 `json:"speed,omitempty"` + Granularity *uint32 `json:"granularity,omitempty"` + BufSize *int64 `json:"buf-size,omitempty"` + OnSourceError *BlockdevOnError `json:"on-source-error,omitempty"` + OnTargetError *BlockdevOnError `json:"on-target-error,omitempty"` + FilterNodeName *string `json:"filter-node-name,omitempty"` }{ jobID, device, @@ -9783,6 +10513,7 @@ func (m *Monitor) BlockdevMirror(jobID *string, device string, target string, re bufSize, onSourceError, onTargetError, + filterNodeName, } bs, err := json.Marshal(map[string]interface{}{ "execute": "blockdev-mirror", @@ -12528,6 +13259,35 @@ func (m *Monitor) QueryVersion() (ret VersionInfo, err error) { return } +// query-vm-generation-id -> QueryVMGenerationID (command) + +// QueryVMGenerationID implements the "query-vm-generation-id" QMP API call. +func (m *Monitor) QueryVMGenerationID() (ret GuidInfo, err error) { + cmd := struct { + }{} + bs, err := json.Marshal(map[string]interface{}{ + "execute": "query-vm-generation-id", + "arguments": cmd, + }) + if err != nil { + return + } + bs, err = m.mon.Run(bs) + if err != nil { + return + } + res := struct { + Res json.RawMessage `json:"return"` + }{} + if err = json.Unmarshal(bs, &res); err != nil { + return + } + if err = json.Unmarshal([]byte(res.Res), &ret); err != nil { + return + } + return +} + // query-vnc -> QueryVNC (command) // QueryVNC implements the "query-vnc" QMP API call. @@ -12586,6 +13346,35 @@ func (m *Monitor) QueryVNCServers() (ret []VNCInfo2, err error) { return } +// query-xen-replication-status -> QueryXenReplicationStatus (command) + +// QueryXenReplicationStatus implements the "query-xen-replication-status" QMP API call. +func (m *Monitor) QueryXenReplicationStatus() (ret ReplicationStatus, err error) { + cmd := struct { + }{} + bs, err := json.Marshal(map[string]interface{}{ + "execute": "query-xen-replication-status", + "arguments": cmd, + }) + if err != nil { + return + } + bs, err = m.mon.Run(bs) + if err != nil { + return + } + res := struct { + Res json.RawMessage `json:"return"` + }{} + if err = json.Unmarshal(bs, &res); err != nil { + return + } + if err = json.Unmarshal([]byte(res.Res), &ret); err != nil { + return + } + return +} + // quit -> Quit (command) // Quit implements the "quit" QMP API call. @@ -13009,29 +13798,6 @@ func (m *Monitor) XBlockdevChange(parent string, child *string, node *string) (e return } -// x-blockdev-del -> XBlockdevDel (command) - -// XBlockdevDel implements the "x-blockdev-del" QMP API call. -func (m *Monitor) XBlockdevDel(nodeName string) (err error) { - cmd := struct { - NodeName string `json:"node-name"` - }{ - nodeName, - } - bs, err := json.Marshal(map[string]interface{}{ - "execute": "x-blockdev-del", - "arguments": cmd, - }) - if err != nil { - return - } - bs, err = m.mon.Run(bs) - if err != nil { - return - } - return -} - // x-blockdev-insert-medium -> XBlockdevInsertMedium (command) // XBlockdevInsertMedium implements the "x-blockdev-insert-medium" QMP API call. @@ -13104,6 +13870,26 @@ func (m *Monitor) XColoLostHeartbeat() (err error) { return } +// xen-colo-do-checkpoint -> XenColoDoCheckpoint (command) + +// XenColoDoCheckpoint implements the "xen-colo-do-checkpoint" QMP API call. +func (m *Monitor) XenColoDoCheckpoint() (err error) { + cmd := struct { + }{} + bs, err := json.Marshal(map[string]interface{}{ + "execute": "xen-colo-do-checkpoint", + "arguments": cmd, + }) + if err != nil { + return + } + bs, err = m.mon.Run(bs) + if err != nil { + return + } + return +} + // xen-load-devices-state -> XenLoadDevicesState (command) // XenLoadDevicesState implements the "xen-load-devices-state" QMP API call. @@ -13172,3 +13958,263 @@ func (m *Monitor) XenSetGlobalDirtyLog(enable bool) (err error) { } return } + +// xen-set-replication -> XenSetReplication (command) + +// XenSetReplication implements the "xen-set-replication" QMP API call. +func (m *Monitor) XenSetReplication(enable bool, primary bool, failover *bool) (err error) { + cmd := struct { + Enable bool `json:"enable"` + Primary bool `json:"primary"` + Failover *bool `json:"failover,omitempty"` + }{ + enable, + primary, + failover, + } + bs, err := json.Marshal(map[string]interface{}{ + "execute": "xen-set-replication", + "arguments": cmd, + }) + if err != nil { + return + } + bs, err = m.mon.Run(bs) + if err != nil { + return + } + return +} + +func UnmarshalEvent(evt qmp.Event) (Event, error) { + raw, err := json.Marshal(evt.Data) + if err != nil { + return nil, err + } + switch evt.Event { + case "ACPI_DEVICE_OST": + var ret ACPIDeviceOst + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "BALLOON_CHANGE": + var ret BalloonChange + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "BLOCK_IMAGE_CORRUPTED": + var ret BlockImageCorrupted + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "BLOCK_IO_ERROR": + var ret BlockIOError + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "BLOCK_JOB_CANCELLED": + var ret BlockJobCancelled + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "BLOCK_JOB_COMPLETED": + var ret BlockJobCompleted + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "BLOCK_JOB_ERROR": + var ret BlockJobError + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "BLOCK_JOB_READY": + var ret BlockJobReady + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "BLOCK_WRITE_THRESHOLD": + var ret BlockWriteThreshold + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "DEVICE_DELETED": + var ret DeviceDeleted + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "DEVICE_TRAY_MOVED": + var ret DeviceTrayMoved + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "DUMP_COMPLETED": + var ret DumpCompleted + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "GUEST_PANICKED": + var ret GuestPanicked + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "MEM_UNPLUG_ERROR": + var ret MemUnplugError + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "MIGRATION": + var ret Migration + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "MIGRATION_PASS": + var ret MigrationPass + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "NIC_RX_FILTER_CHANGED": + var ret NicRxFilterChanged + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "POWERDOWN": + var ret Powerdown + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "QUORUM_FAILURE": + var ret QuorumFailure + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "QUORUM_REPORT_BAD": + var ret QuorumReportBad + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "RESET": + var ret Reset + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "RESUME": + var ret Resume + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "RTC_CHANGE": + var ret RtcChange + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "SHUTDOWN": + var ret Shutdown + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "SPICE_CONNECTED": + var ret SpiceConnected + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "SPICE_DISCONNECTED": + var ret SpiceDisconnected + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "SPICE_INITIALIZED": + var ret SpiceInitialized + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "SPICE_MIGRATE_COMPLETED": + var ret SpiceMigrateCompleted + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "STOP": + var ret Stop + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "SUSPEND": + var ret Suspend + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "SUSPEND_DISK": + var ret SuspendDisk + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "VNC_CONNECTED": + var ret VNCConnected + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "VNC_DISCONNECTED": + var ret VNCDisconnected + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "VNC_INITIALIZED": + var ret VNCInitialized + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "VSERPORT_CHANGE": + var ret VserportChange + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "WAKEUP": + var ret Wakeup + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + case "WATCHDOG": + var ret Watchdog + if err = json.Unmarshal(raw, &ret); err != nil { + return nil, err + } + return ret, nil + default: + return nil, fmt.Errorf("unknown event kind %q", evt.Event) + } +} diff --git a/qmp/raw/raw.go b/qmp/raw/raw.go index 952c589..da705f3 100644 --- a/qmp/raw/raw.go +++ b/qmp/raw/raw.go @@ -25,3 +25,8 @@ type Monitor struct { func NewMonitor(mon qmp.Monitor) *Monitor { return &Monitor{mon} } + +// Event is a QMP event. +type Event interface { + isEvent() +} diff --git a/qmp/raw/spec.txt b/qmp/raw/spec.txt index c3e499a..1142420 100644 --- a/qmp/raw/spec.txt +++ b/qmp/raw/spec.txt @@ -1,3 +1,27 @@ +# Whitelists to permit QAPI rule violations; think twice before you +# add to them! +{ + "pragma": { + "returns-whitelist": [ + "human-monitor-command", + "qom-get", + "query-migrate-cache-size", + "query-tpm-models", + "query-tpm-types", + "ringbuf-read" + ], + "name-case-whitelist": [ + "ACPISlotType", + "CpuInfoMIPS", + "CpuInfoTricore", + "QapiErrorClass", + "UuidInfo", + "X86CPURegister32", + "q_obj_CpuInfo-base" + ] + } +} + ## # @QapiErrorClass: # @@ -403,7 +427,7 @@ # # The options that apply to QCow/QCow2 AES-CBC encryption format # -# @key-secret: #optional the ID of a QCryptoSecret object providing the +# @key-secret: the ID of a QCryptoSecret object providing the # decryption key. Mandatory except when probing image for # metadata only. # @@ -421,7 +445,7 @@ # # The options that apply to LUKS encryption format # -# @key-secret: #optional the ID of a QCryptoSecret object providing the +# @key-secret: the ID of a QCryptoSecret object providing the # decryption key. Mandatory except when probing image for # metadata only. # Since: 2.6 @@ -439,17 +463,17 @@ # # The options that apply to LUKS encryption format initialization # -# @cipher-alg: #optional the cipher algorithm for data encryption +# @cipher-alg: the cipher algorithm for data encryption # Currently defaults to 'aes'. -# @cipher-mode: #optional the cipher mode for data encryption +# @cipher-mode: the cipher mode for data encryption # Currently defaults to 'cbc' -# @ivgen-alg: #optional the initialization vector generator +# @ivgen-alg: the initialization vector generator # Currently defaults to 'essiv' -# @ivgen-hash-alg: #optional the initialization vector generator hash +# @ivgen-hash-alg: the initialization vector generator hash # Currently defaults to 'sha256' -# @hash-alg: #optional the master key hash algorithm +# @hash-alg: the master key hash algorithm # Currently defaults to 'sha256' -# @iter-time: #optional number of milliseconds to spend in +# @iter-time: number of milliseconds to spend in # PBKDF passphrase processing. Currently defaults # to 2000. (since 2.8) # Since: 2.6 @@ -532,8 +556,8 @@ # # @active: whether the key slot is currently in use # @key-offset: offset to the key material in bytes -# @iters: #optional number of PBKDF2 iterations for key material -# @stripes: #optional number of stripes for splitting key material +# @iters: number of PBKDF2 iterations for key material +# @stripes: number of stripes for splitting key material # # Since: 2.7 ## @@ -556,7 +580,7 @@ # @cipher-alg: the cipher algorithm for data encryption # @cipher-mode: the cipher mode for data encryption # @ivgen-alg: the initialization vector generator -# @ivgen-hash-alg: #optional the initialization vector generator hash +# @ivgen-hash-alg: the initialization vector generator hash # @hash-alg: the master key hash algorithm # @payload-offset: offset to the payload data in bytes # @master-key-iters: number of PBKDF2 iterations for key material @@ -857,9 +881,9 @@ # # @compat: compatibility level # -# @lazy-refcounts: #optional on or off; only valid for compat >= 1.1 +# @lazy-refcounts: on or off; only valid for compat >= 1.1 # -# @corrupt: #optional true if the image has been marked corrupt; only valid for +# @corrupt: true if the image has been marked corrupt; only valid for # compat >= 1.1 (since 2.2) # # @refcount-bits: width of a refcount entry in bits (since 2.3) @@ -928,27 +952,27 @@ # # @virtual-size: maximum capacity in bytes of the image # -# @actual-size: #optional actual size on disk in bytes of the image +# @actual-size: actual size on disk in bytes of the image # -# @dirty-flag: #optional true if image is not cleanly closed +# @dirty-flag: true if image is not cleanly closed # -# @cluster-size: #optional size of a cluster in bytes +# @cluster-size: size of a cluster in bytes # -# @encrypted: #optional true if the image is encrypted +# @encrypted: true if the image is encrypted # -# @compressed: #optional true if the image is compressed (Since 1.7) +# @compressed: true if the image is compressed (Since 1.7) # -# @backing-filename: #optional name of the backing file +# @backing-filename: name of the backing file # -# @full-backing-filename: #optional full path of the backing file +# @full-backing-filename: full path of the backing file # -# @backing-filename-format: #optional the format of the backing file +# @backing-filename-format: the format of the backing file # -# @snapshots: #optional list of VM snapshots +# @snapshots: list of VM snapshots # -# @backing-image: #optional info of the backing image (since 1.6) +# @backing-image: info of the backing image (since 1.6) # -# @format-specific: #optional structure supplying additional format-specific +# @format-specific: structure supplying additional format-specific # information (since 1.7) # # Since: 1.3 @@ -987,31 +1011,31 @@ # # @check-errors: number of unexpected errors occurred during check # -# @image-end-offset: #optional offset (in bytes) where the image ends, this +# @image-end-offset: offset (in bytes) where the image ends, this # field is present if the driver for the image format # supports it # -# @corruptions: #optional number of corruptions found during the check if any +# @corruptions: number of corruptions found during the check if any # -# @leaks: #optional number of leaks found during the check if any +# @leaks: number of leaks found during the check if any # -# @corruptions-fixed: #optional number of corruptions fixed during the check +# @corruptions-fixed: number of corruptions fixed during the check # if any # -# @leaks-fixed: #optional number of leaks fixed during the check if any +# @leaks-fixed: number of leaks fixed during the check if any # -# @total-clusters: #optional total number of clusters, this field is present +# @total-clusters: total number of clusters, this field is present # if the driver for the image format supports it # -# @allocated-clusters: #optional total number of allocated clusters, this +# @allocated-clusters: total number of allocated clusters, this # field is present if the driver for the image format # supports it # -# @fragmented-clusters: #optional total number of fragmented clusters, this +# @fragmented-clusters: total number of fragmented clusters, this # field is present if the driver for the image format # supports it # -# @compressed-clusters: #optional total number of compressed clusters, this +# @compressed-clusters: total number of compressed clusters, this # field is present if the driver for the image format # supports it # @@ -1051,9 +1075,9 @@ # # @depth: the depth of the mapping # -# @offset: #optional the offset in file that the virtual sectors are mapped to +# @offset: the offset in file that the virtual sectors are mapped to # -# @filename: #optional filename that is referred to by @offset +# @filename: filename that is referred to by @offset # # Since: 2.6 # @@ -1098,7 +1122,7 @@ # # @file: the filename of the backing device # -# @node-name: #optional the name of the block driver node (Since 2.0) +# @node-name: the name of the block driver node (Since 2.0) # # @ro: true if the backing device was open read-only # @@ -1112,8 +1136,9 @@ # 2.5: 'host_floppy' dropped # 2.6: 'luks' added # 2.8: 'replication' added, 'tftp' dropped +# 2.9: 'archipelago' dropped # -# @backing_file: #optional the name of the backing file (for copy-on-write) +# @backing_file: the name of the backing file (for copy-on-write) # # @backing_file_depth: number of files in the backing file chain (since: 1.2) # @@ -1138,45 +1163,45 @@ # # @image: the info of image used (since: 1.6) # -# @bps_max: #optional total throughput limit during bursts, +# @bps_max: total throughput limit during bursts, # in bytes (Since 1.7) # -# @bps_rd_max: #optional read throughput limit during bursts, +# @bps_rd_max: read throughput limit during bursts, # in bytes (Since 1.7) # -# @bps_wr_max: #optional write throughput limit during bursts, +# @bps_wr_max: write throughput limit during bursts, # in bytes (Since 1.7) # -# @iops_max: #optional total I/O operations per second during bursts, +# @iops_max: total I/O operations per second during bursts, # in bytes (Since 1.7) # -# @iops_rd_max: #optional read I/O operations per second during bursts, +# @iops_rd_max: read I/O operations per second during bursts, # in bytes (Since 1.7) # -# @iops_wr_max: #optional write I/O operations per second during bursts, +# @iops_wr_max: write I/O operations per second during bursts, # in bytes (Since 1.7) # -# @bps_max_length: #optional maximum length of the @bps_max burst +# @bps_max_length: maximum length of the @bps_max burst # period, in seconds. (Since 2.6) # -# @bps_rd_max_length: #optional maximum length of the @bps_rd_max +# @bps_rd_max_length: maximum length of the @bps_rd_max # burst period, in seconds. (Since 2.6) # -# @bps_wr_max_length: #optional maximum length of the @bps_wr_max +# @bps_wr_max_length: maximum length of the @bps_wr_max # burst period, in seconds. (Since 2.6) # -# @iops_max_length: #optional maximum length of the @iops burst +# @iops_max_length: maximum length of the @iops burst # period, in seconds. (Since 2.6) # -# @iops_rd_max_length: #optional maximum length of the @iops_rd_max +# @iops_rd_max_length: maximum length of the @iops_rd_max # burst period, in seconds. (Since 2.6) # -# @iops_wr_max_length: #optional maximum length of the @iops_wr_max +# @iops_wr_max_length: maximum length of the @iops_wr_max # burst period, in seconds. (Since 2.6) # -# @iops_size: #optional an I/O size in bytes (Since 1.7) +# @iops_size: an I/O size in bytes (Since 1.7) # -# @group: #optional throttle group name (Since 2.4) +# @group: throttle group name (Since 2.4) # # @cache: the cache mode used for the block device (since: 2.3) # @@ -1313,7 +1338,7 @@ # # Block dirty bitmap information. # -# @name: #optional the name of the dirty bitmap (Since 2.4) +# @name: the name of the dirty bitmap (Since 2.4) # # @count: number of dirty bytes according to the dirty bitmap # @@ -1349,17 +1374,17 @@ # @locked: True if the guest has locked this device from having its media # removed # -# @tray_open: #optional True if the device's tray is open +# @tray_open: True if the device's tray is open # (only present if it has a tray) # -# @dirty-bitmaps: #optional dirty bitmaps information (only present if the +# @dirty-bitmaps: dirty bitmaps information (only present if the # driver has one or more dirty bitmaps) (Since 2.0) # -# @io-status: #optional @BlockDeviceIoStatus. Only present if the device +# @io-status: @BlockDeviceIoStatus. Only present if the device # supports it and the VM is configured to stop on errors # (supported device models: virtio-blk, ide, scsi-disk) # -# @inserted: #optional @BlockDeviceInfo describing the device if media is +# @inserted: @BlockDeviceInfo describing the device if media is # present # # Since: 0.14.0 @@ -1573,7 +1598,7 @@ # @wr_merged: Number of write requests that have been merged into another # request (Since 2.3). # -# @idle_time_ns: #optional Time since the last I/O operation, in +# @idle_time_ns: Time since the last I/O operation, in # nanoseconds. If the field is absent it means that # there haven't been any operations yet (Since 2.5). # @@ -1640,19 +1665,19 @@ # # Statistics of a virtual block device or a block backing device. # -# @device: #optional If the stats are for a virtual block device, the name +# @device: If the stats are for a virtual block device, the name # corresponding to the virtual block device. # -# @node-name: #optional The node name of the device. (Since 2.3) +# @node-name: The node name of the device. (Since 2.3) # # @stats: A @BlockDeviceStats for the device. # -# @parent: #optional This describes the file block device if it has one. +# @parent: This describes the file block device if it has one. # Contains recursively the statistics of the underlying # protocol (e.g. the host file for a qcow2 image). If there is # no underlying protocol, this field is omitted # -# @backing: #optional This describes the backing block device if it has one. +# @backing: This describes the backing block device if it has one. # (Since 2.0) # # Since: 0.14.0 @@ -1673,7 +1698,7 @@ # # Query the @BlockStats for all virtual block devices. # -# @query-nodes: #optional If true, the command will query all the block nodes +# @query-nodes: If true, the command will query all the block nodes # that have a node name, in a list which will include "parent" # information, but not "backing". # If false or omitted, the behavior is as before - query all the @@ -1955,9 +1980,9 @@ # # Either @device or @node-name must be set but not both. # -# @device: #optional the name of the block backend device to set the password on +# @device: the name of the block backend device to set the password on # -# @node-name: #optional graph node name to set the password on (Since 2.0) +# @node-name: graph node name to set the password on (Since 2.0) # # @password: the password to use for the device # @@ -1994,9 +2019,9 @@ # # Either @device or @node-name must be set but not both. # -# @device: #optional the name of the device to get the image resized +# @device: the name of the device to get the image resized # -# @node-name: #optional graph node name to get the image resized (Since 2.0) +# @node-name: graph node name to get the image resized (Since 2.0) # # @size: new image size in bytes # @@ -2048,19 +2073,19 @@ # # Either @device or @node-name must be set but not both. # -# @device: #optional the name of the device to generate the snapshot from. +# @device: the name of the device to generate the snapshot from. # -# @node-name: #optional graph node name to generate the snapshot from (Since 2.0) +# @node-name: graph node name to generate the snapshot from (Since 2.0) # # @snapshot-file: the target of the new image. If the file exists, or # if it is a device, the snapshot will be created in the existing # file/device. Otherwise, a new file will be created. # -# @snapshot-node-name: #optional the graph node name of the new image (Since 2.0) +# @snapshot-node-name: the graph node name of the new image (Since 2.0) # -# @format: #optional the format of the snapshot image, default is 'qcow2'. +# @format: the format of the snapshot image, default is 'qcow2'. # -# @mode: #optional whether and how QEMU should create a new image, default is +# @mode: whether and how QEMU should create a new image, default is # 'absolute-paths'. ## { @@ -2098,7 +2123,7 @@ ## # @DriveBackup: # -# @job-id: #optional identifier for the newly-created block job. If +# @job-id: identifier for the newly-created block job. If # omitted, the device name will be used. (Since 2.7) # # @device: the device name or node-name of a root node which should be copied. @@ -2107,30 +2132,30 @@ # is a device, the existing file/device will be used as the new # destination. If it does not exist, a new file will be created. # -# @format: #optional the format of the new destination, default is to +# @format: the format of the new destination, default is to # probe if @mode is 'existing', else the format of the source # # @sync: what parts of the disk image should be copied to the destination # (all the disk, only the sectors allocated in the topmost image, from a # dirty bitmap, or only new I/O). # -# @mode: #optional whether and how QEMU should create a new image, default is +# @mode: whether and how QEMU should create a new image, default is # 'absolute-paths'. # -# @speed: #optional the maximum speed, in bytes per second +# @speed: the maximum speed, in bytes per second # -# @bitmap: #optional the name of dirty bitmap if sync is "incremental". +# @bitmap: the name of dirty bitmap if sync is "incremental". # Must be present if sync is "incremental", must NOT be present # otherwise. (Since 2.4) # -# @compress: #optional true to compress data, if the target format supports it. +# @compress: true to compress data, if the target format supports it. # (default: false) (since 2.8) # -# @on-source-error: #optional the action to take on an error on the source, +# @on-source-error: the action to take on an error on the source, # default 'report'. 'stop' and 'enospc' can only be used # if the block device supports io-status (see BlockInfo). # -# @on-target-error: #optional the action to take on an error on the target, +# @on-target-error: the action to take on an error on the target, # default 'report' (no limitations, since this applies to # a different block device than @device). # @@ -2160,7 +2185,7 @@ ## # @BlockdevBackup: # -# @job-id: #optional identifier for the newly-created block job. If +# @job-id: identifier for the newly-created block job. If # omitted, the device name will be used. (Since 2.7) # # @device: the device name or node-name of a root node which should be copied. @@ -2171,17 +2196,17 @@ # (all the disk, only the sectors allocated in the topmost image, or # only new I/O). # -# @speed: #optional the maximum speed, in bytes per second. The default is 0, +# @speed: the maximum speed, in bytes per second. The default is 0, # for unlimited. # -# @compress: #optional true to compress data, if the target format supports it. +# @compress: true to compress data, if the target format supports it. # (default: false) (since 2.8) # -# @on-source-error: #optional the action to take on an error on the source, +# @on-source-error: the action to take on an error on the source, # default 'report'. 'stop' and 'enospc' can only be used # if the block device supports io-status (see BlockInfo). # -# @on-target-error: #optional the action to take on an error on the target, +# @on-target-error: the action to take on an error on the target, # default 'report' (no limitations, since this applies to # a different block device than @device). # @@ -2313,19 +2338,19 @@ # Live commit of data from overlay image nodes into backing nodes - i.e., # writes data between 'top' and 'base' into 'base'. # -# @job-id: #optional identifier for the newly-created block job. If +# @job-id: identifier for the newly-created block job. If # omitted, the device name will be used. (Since 2.7) # # @device: the device name or node-name of a root node # -# @base: #optional The file name of the backing image to write data into. +# @base: The file name of the backing image to write data into. # If not specified, this is the deepest backing image. # -# @top: #optional The file name of the backing image within the image chain, +# @top: The file name of the backing image within the image chain, # which contains the topmost data to be committed down. If # not specified, this is the active layer. # -# @backing-file: #optional The backing file string to write into the overlay +# @backing-file: The backing file string to write into the overlay # image of 'top'. If 'top' is the active layer, # specifying a backing file string is an error. This # filename is not validated. @@ -2354,7 +2379,12 @@ # size of the smaller top, you can safely truncate it # yourself once the commit operation successfully completes. # -# @speed: #optional the maximum speed, in bytes per second +# @speed: the maximum speed, in bytes per second +# +# @filter-node-name: the node name that should be assigned to the +# filter driver that the commit job inserts into the graph +# above @top. If this option is not given, a node name is +# autogenerated. (Since: 2.9) # # Returns: Nothing on success # If commit or stream is already active on this device, DeviceInUse @@ -2381,7 +2411,8 @@ "*base": "str", "*top": "str", "*backing-file": "str", - "*speed": "int" + "*speed": "int", + "*filter-node-name": "str" } } @@ -2394,8 +2425,6 @@ # The operation can be stopped before it has completed using the # block-job-cancel command. # -# For the arguments, see the documentation of DriveBackup. -# # Returns: nothing on success # If @device is not a valid block device, GenericError # @@ -2425,8 +2454,6 @@ # The operation can be stopped before it has completed using the # block-job-cancel command. # -# For the arguments, see the documentation of BlockdevBackup. -# # Returns: nothing on success # If @device is not a valid block device, DeviceNotFound # @@ -2522,8 +2549,6 @@ # format of the mirror image, default is to probe if mode='existing', # else the format of the source. # -# See DriveMirror for parameter descriptions -# # Returns: nothing on success # If @device is not a valid block device, GenericError # @@ -2550,7 +2575,7 @@ # # A set of parameters describing drive mirror setup. # -# @job-id: #optional identifier for the newly-created block job. If +# @job-id: identifier for the newly-created block job. If # omitted, the device name will be used. (Since 2.7) # # @device: the device name or node-name of a root node whose writes should be @@ -2560,41 +2585,41 @@ # is a device, the existing file/device will be used as the new # destination. If it does not exist, a new file will be created. # -# @format: #optional the format of the new destination, default is to +# @format: the format of the new destination, default is to # probe if @mode is 'existing', else the format of the source # -# @node-name: #optional the new block driver state node name in the graph +# @node-name: the new block driver state node name in the graph # (Since 2.1) # -# @replaces: #optional with sync=full graph node name to be replaced by the new +# @replaces: with sync=full graph node name to be replaced by the new # image when a whole image copy is done. This can be used to repair # broken Quorum files. (Since 2.1) # -# @mode: #optional whether and how QEMU should create a new image, default is +# @mode: whether and how QEMU should create a new image, default is # 'absolute-paths'. # -# @speed: #optional the maximum speed, in bytes per second +# @speed: the maximum speed, in bytes per second # # @sync: what parts of the disk image should be copied to the destination # (all the disk, only the sectors allocated in the topmost image, or # only new I/O). # -# @granularity: #optional granularity of the dirty bitmap, default is 64K +# @granularity: granularity of the dirty bitmap, default is 64K # if the image format doesn't have clusters, 4K if the clusters # are smaller than that, else the cluster size. Must be a # power of 2 between 512 and 64M (since 1.4). # -# @buf-size: #optional maximum amount of data in flight from source to +# @buf-size: maximum amount of data in flight from source to # target (since 1.4). # -# @on-source-error: #optional the action to take on an error on the source, +# @on-source-error: the action to take on an error on the source, # default 'report'. 'stop' and 'enospc' can only be used # if the block device supports io-status (see BlockInfo). # -# @on-target-error: #optional the action to take on an error on the target, +# @on-target-error: the action to take on an error on the target, # default 'report' (no limitations, since this applies to # a different block device than @device). -# @unmap: #optional Whether to try to unmap target sectors where source has +# @unmap: Whether to try to unmap target sectors where source has # only zero. If true, and target unallocated sectors will read as zero, # target image sectors will be unmapped; otherwise, zeroes will be # written. Both will result in identical contents. @@ -2646,7 +2671,7 @@ # # @name: name of the dirty bitmap # -# @granularity: #optional the bitmap granularity, default is 64k for +# @granularity: the bitmap granularity, default is 64k for # block-dirty-bitmap-add # # Since: 2.4 @@ -2738,7 +2763,7 @@ # # Start mirroring a block device's writes to a new destination. # -# @job-id: #optional identifier for the newly-created block job. If +# @job-id: identifier for the newly-created block job. If # omitted, the device name will be used. (Since 2.7) # # @device: The device name or node-name of a root node whose writes should be @@ -2747,32 +2772,37 @@ # @target: the id or node-name of the block device to mirror to. This mustn't be # attached to guest. # -# @replaces: #optional with sync=full graph node name to be replaced by the new +# @replaces: with sync=full graph node name to be replaced by the new # image when a whole image copy is done. This can be used to repair # broken Quorum files. # -# @speed: #optional the maximum speed, in bytes per second +# @speed: the maximum speed, in bytes per second # # @sync: what parts of the disk image should be copied to the destination # (all the disk, only the sectors allocated in the topmost image, or # only new I/O). # -# @granularity: #optional granularity of the dirty bitmap, default is 64K +# @granularity: granularity of the dirty bitmap, default is 64K # if the image format doesn't have clusters, 4K if the clusters # are smaller than that, else the cluster size. Must be a # power of 2 between 512 and 64M # -# @buf-size: #optional maximum amount of data in flight from source to +# @buf-size: maximum amount of data in flight from source to # target # -# @on-source-error: #optional the action to take on an error on the source, +# @on-source-error: the action to take on an error on the source, # default 'report'. 'stop' and 'enospc' can only be used # if the block device supports io-status (see BlockInfo). # -# @on-target-error: #optional the action to take on an error on the target, +# @on-target-error: the action to take on an error on the target, # default 'report' (no limitations, since this applies to # a different block device than @device). # +# @filter-node-name: the node name that should be assigned to the +# filter driver that the mirror job inserts into the graph +# above @device. If this option is not given, a node name is +# autogenerated. (Since: 2.9) +# # Returns: nothing on success. # # Since: 2.6 @@ -2798,7 +2828,8 @@ "*granularity": "uint32", "*buf-size": "int", "*on-source-error": "BlockdevOnError", - "*on-target-error": "BlockdevOnError" + "*on-target-error": "BlockdevOnError", + "*filter-node-name": "str" } } @@ -2814,9 +2845,9 @@ # # A set of parameters describing block throttling. # -# @device: #optional Block device name (deprecated, use @id instead) +# @device: Block device name (deprecated, use @id instead) # -# @id: #optional The name or QOM path of the guest device (since: 2.8) +# @id: The name or QOM path of the guest device (since: 2.8) # # @bps: total throughput limit in bytes per second # @@ -2830,57 +2861,57 @@ # # @iops_wr: write I/O operations per second # -# @bps_max: #optional total throughput limit during bursts, +# @bps_max: total throughput limit during bursts, # in bytes (Since 1.7) # -# @bps_rd_max: #optional read throughput limit during bursts, +# @bps_rd_max: read throughput limit during bursts, # in bytes (Since 1.7) # -# @bps_wr_max: #optional write throughput limit during bursts, +# @bps_wr_max: write throughput limit during bursts, # in bytes (Since 1.7) # -# @iops_max: #optional total I/O operations per second during bursts, +# @iops_max: total I/O operations per second during bursts, # in bytes (Since 1.7) # -# @iops_rd_max: #optional read I/O operations per second during bursts, +# @iops_rd_max: read I/O operations per second during bursts, # in bytes (Since 1.7) # -# @iops_wr_max: #optional write I/O operations per second during bursts, +# @iops_wr_max: write I/O operations per second during bursts, # in bytes (Since 1.7) # -# @bps_max_length: #optional maximum length of the @bps_max burst +# @bps_max_length: maximum length of the @bps_max burst # period, in seconds. It must only # be set if @bps_max is set as well. # Defaults to 1. (Since 2.6) # -# @bps_rd_max_length: #optional maximum length of the @bps_rd_max +# @bps_rd_max_length: maximum length of the @bps_rd_max # burst period, in seconds. It must only # be set if @bps_rd_max is set as well. # Defaults to 1. (Since 2.6) # -# @bps_wr_max_length: #optional maximum length of the @bps_wr_max +# @bps_wr_max_length: maximum length of the @bps_wr_max # burst period, in seconds. It must only # be set if @bps_wr_max is set as well. # Defaults to 1. (Since 2.6) # -# @iops_max_length: #optional maximum length of the @iops burst +# @iops_max_length: maximum length of the @iops burst # period, in seconds. It must only # be set if @iops_max is set as well. # Defaults to 1. (Since 2.6) # -# @iops_rd_max_length: #optional maximum length of the @iops_rd_max +# @iops_rd_max_length: maximum length of the @iops_rd_max # burst period, in seconds. It must only # be set if @iops_rd_max is set as well. # Defaults to 1. (Since 2.6) # -# @iops_wr_max_length: #optional maximum length of the @iops_wr_max +# @iops_wr_max_length: maximum length of the @iops_wr_max # burst period, in seconds. It must only # be set if @iops_wr_max is set as well. # Defaults to 1. (Since 2.6) # -# @iops_size: #optional an I/O size in bytes (Since 1.7) +# @iops_size: an I/O size in bytes (Since 1.7) # -# @group: #optional throttle group name (Since 2.4) +# @group: throttle group name (Since 2.4) # # Since: 1.1 ## @@ -2938,18 +2969,18 @@ # On successful completion the image file is updated to drop the backing file # and the BLOCK_JOB_COMPLETED event is emitted. # -# @job-id: #optional identifier for the newly-created block job. If +# @job-id: identifier for the newly-created block job. If # omitted, the device name will be used. (Since 2.7) # # @device: the device or node name of the top image # -# @base: #optional the common backing file name. +# @base: the common backing file name. # It cannot be set if @base-node is also set. # -# @base-node: #optional the node name of the backing file. +# @base-node: the node name of the backing file. # It cannot be set if @base is also set. (Since 2.8) # -# @backing-file: #optional The backing file string to write into the top +# @backing-file: The backing file string to write into the top # image. This filename is not validated. # # If a pathname string is such that it cannot be @@ -2964,9 +2995,9 @@ # protocol. # (Since 2.1) # -# @speed: #optional the maximum speed, in bytes per second +# @speed: the maximum speed, in bytes per second # -# @on-error: #optional the action to take on an error (default report). +# @on-error: the action to take on an error (default report). # 'stop' and 'enospc' can only be used if the block device # supports io-status (see BlockInfo). Since 1.3. # @@ -3046,7 +3077,7 @@ # the name of the parameter), but since QEMU 2.7 it can have # other values. # -# @force: #optional whether to allow cancellation of a paused job (default +# @force: whether to allow cancellation of a paused job (default # false). Since 1.3. # # Returns: Nothing on success @@ -3160,7 +3191,7 @@ # @ignore: Ignore the request # @unmap: Forward as an unmap request # -# Since: 1.7 +# Since: 2.9 ## { "enum": "BlockdevDiscardOptions", @@ -3200,7 +3231,7 @@ # @threads: Use qemu's thread pool # @native: Use native AIO backend (only Linux and Windows) # -# Since: 1.7 +# Since: 2.9 ## { "enum": "BlockdevAioOptions", @@ -3215,12 +3246,12 @@ # # Includes cache-related options for block devices # -# @direct: #optional enables use of O_DIRECT (bypass the host page cache; +# @direct: enables use of O_DIRECT (bypass the host page cache; # default: false) -# @no-flush: #optional ignore any flush requests for the device (default: +# @no-flush: ignore any flush requests for the device (default: # false) # -# Since: 1.7 +# Since: 2.9 ## { "struct": "BlockdevCacheOptions", @@ -3235,20 +3266,11 @@ # # Drivers that are supported in block device operations. # -# @host_device: Since 2.1 -# @host_cdrom: Since 2.1 -# @gluster: Since 2.7 -# @nbd: Since 2.8 -# @nfs: Since 2.8 -# @replication: Since 2.8 -# @ssh: Since 2.8 -# -# Since: 2.0 +# Since: 2.9 ## { "enum": "BlockdevDriver", "data": [ - "archipelago", "blkdebug", "blkverify", "bochs", @@ -3262,6 +3284,7 @@ "host_device", "http", "https", + "iscsi", "luks", "nbd", "nfs", @@ -3273,7 +3296,9 @@ "qed", "quorum", "raw", + "rbd", "replication", + "sheepdog", "ssh", "vdi", "vhdx", @@ -3289,9 +3314,9 @@ # Driver specific block device options for the file backend. # # @filename: path to the image file -# @aio: #optional AIO backend (default: threads) (since: 2.8) +# @aio: AIO backend (default: threads) (since: 2.8) # -# Since: 1.7 +# Since: 2.9 ## { "struct": "BlockdevOptionsFile", @@ -3306,12 +3331,12 @@ # # Driver specific block device options for the null backend. # -# @size: #optional size of the device in bytes. -# @latency-ns: #optional emulated latency (in nanoseconds) in processing +# @size: size of the device in bytes. +# @latency-ns: emulated latency (in nanoseconds) in processing # requests. Default to zero which completes requests immediately. # (Since 2.4) # -# Since: 2.2 +# Since: 2.9 ## { "struct": "BlockdevOptionsNull", @@ -3327,16 +3352,16 @@ # Driver specific block device options for the vvfat protocol. # # @dir: directory to be exported as FAT image -# @fat-type: #optional FAT type: 12, 16 or 32 -# @floppy: #optional whether to export a floppy image (true) or +# @fat-type: FAT type: 12, 16 or 32 +# @floppy: whether to export a floppy image (true) or # partitioned hard disk (false; default) -# @label: #optional set the volume label, limited to 11 bytes. FAT16 and +# @label: set the volume label, limited to 11 bytes. FAT16 and # FAT32 traditionally have some restrictions on labels, which are # ignored by most operating systems. Defaults to "QEMU VVFAT". # (since 2.4) -# @rw: #optional whether to allow write operations (default: false) +# @rw: whether to allow write operations (default: false) # -# Since: 1.7 +# Since: 2.9 ## { "struct": "BlockdevOptionsVVFAT", @@ -3357,7 +3382,7 @@ # # @file: reference to or definition of the data source block device # -# Since: 1.7 +# Since: 2.9 ## { "struct": "BlockdevOptionsGenericFormat", @@ -3371,11 +3396,11 @@ # # Driver specific block device options for LUKS. # -# @key-secret: #optional the ID of a QCryptoSecret object providing +# @key-secret: the ID of a QCryptoSecret object providing # the decryption key (since 2.6). Mandatory except when # doing a metadata-only probe of the image. # -# Since: 2.6 +# Since: 2.9 ## { "struct": "BlockdevOptionsLUKS", @@ -3392,12 +3417,12 @@ # Driver specific block device options for image format that have no option # besides their data source and an optional backing file. # -# @backing: #optional reference to or definition of the backing file block +# @backing: reference to or definition of the backing file block # device (if missing, taken from the image file content). It is # allowed to pass an empty string here in order to disable the # default backing file. # -# Since: 1.7 +# Since: 2.9 ## { "struct": "BlockdevOptionsGenericCOWFormat", @@ -3422,7 +3447,7 @@ # # @all: Perform all available overlap checks # -# Since: 2.2 +# Since: 2.9 ## { "enum": "Qcow2OverlapCheckMode", @@ -3444,7 +3469,7 @@ # @template: Specifies a template mode which can be adjusted using the other # flags, defaults to 'cached' # -# Since: 2.2 +# Since: 2.9 ## { "struct": "Qcow2OverlapCheckFlags", @@ -3472,7 +3497,7 @@ # # @mode: named mode which chooses a specific set of flags # -# Since: 2.2 +# Since: 2.9 ## { "alternate": "Qcow2OverlapChecks", @@ -3487,37 +3512,37 @@ # # Driver specific block device options for qcow2. # -# @lazy-refcounts: #optional whether to enable the lazy refcounts +# @lazy-refcounts: whether to enable the lazy refcounts # feature (default is taken from the image file) # -# @pass-discard-request: #optional whether discard requests to the qcow2 +# @pass-discard-request: whether discard requests to the qcow2 # device should be forwarded to the data source # -# @pass-discard-snapshot: #optional whether discard requests for the data source +# @pass-discard-snapshot: whether discard requests for the data source # should be issued when a snapshot operation (e.g. # deleting a snapshot) frees clusters in the qcow2 file # -# @pass-discard-other: #optional whether discard requests for the data source +# @pass-discard-other: whether discard requests for the data source # should be issued on other occasions where a cluster # gets freed # -# @overlap-check: #optional which overlap checks to perform for writes +# @overlap-check: which overlap checks to perform for writes # to the image, defaults to 'cached' (since 2.2) # -# @cache-size: #optional the maximum total size of the L2 table and +# @cache-size: the maximum total size of the L2 table and # refcount block caches in bytes (since 2.2) # -# @l2-cache-size: #optional the maximum size of the L2 table cache in +# @l2-cache-size: the maximum size of the L2 table cache in # bytes (since 2.2) # -# @refcount-cache-size: #optional the maximum size of the refcount block cache +# @refcount-cache-size: the maximum size of the refcount block cache # in bytes (since 2.2) # -# @cache-clean-interval: #optional clean unused entries in the L2 and refcount +# @cache-clean-interval: clean unused entries in the L2 and refcount # caches. The interval is in seconds. The default value # is 0 and it disables this feature (since 2.5) # -# Since: 1.7 +# Since: 2.9 ## { "struct": "BlockdevOptionsQcow2", @@ -3536,39 +3561,6 @@ } -## -# @BlockdevOptionsArchipelago: -# -# Driver specific block device options for Archipelago. -# -# @volume: Name of the Archipelago volume image -# -# @mport: #optional The port number on which mapperd is -# listening. This is optional -# and if not specified, QEMU will make Archipelago -# use the default port (1001). -# -# @vport: #optional The port number on which vlmcd is -# listening. This is optional -# and if not specified, QEMU will make Archipelago -# use the default port (501). -# -# @segment: #optional The name of the shared memory segment -# Archipelago stack is using. This is optional -# and if not specified, QEMU will make Archipelago -# use the default value, 'archipelago'. -# Since: 2.2 -## -{ - "struct": "BlockdevOptionsArchipelago", - "data": { - "volume": "str", - "*mport": "int", - "*vport": "int", - "*segment": "str" - } -} - ## # @BlockdevOptionsSsh: # @@ -3576,12 +3568,12 @@ # # @path: path to the image on the host # -# @user: #optional user as which to connect, defaults to current +# @user: user as which to connect, defaults to current # local user name # # TODO: Expose the host_key_check option in QMP # -# Since: 2.8 +# Since: 2.9 ## { "struct": "BlockdevOptionsSsh", @@ -3598,7 +3590,7 @@ # # Trigger events supported by blkdebug. # -# Since: 2.0 +# Since: 2.9 ## { "enum": "BlkdebugEvent", @@ -3657,22 +3649,22 @@ # # @event: trigger event # -# @state: #optional the state identifier blkdebug needs to be in to +# @state: the state identifier blkdebug needs to be in to # actually trigger the event; defaults to "any" # -# @errno: #optional error identifier (errno) to be returned; defaults to +# @errno: error identifier (errno) to be returned; defaults to # EIO # -# @sector: #optional specifies the sector index which has to be affected +# @sector: specifies the sector index which has to be affected # in order to actually trigger the event; defaults to "any # sector" # -# @once: #optional disables further events after this one has been +# @once: disables further events after this one has been # triggered; defaults to false # -# @immediately: #optional fail immediately; defaults to false +# @immediately: fail immediately; defaults to false # -# Since: 2.0 +# Since: 2.9 ## { "struct": "BlkdebugInjectErrorOptions", @@ -3693,13 +3685,13 @@ # # @event: trigger event # -# @state: #optional the current state identifier blkdebug needs to be in; +# @state: the current state identifier blkdebug needs to be in; # defaults to "any" # # @new_state: the state identifier blkdebug is supposed to assume if # this event is triggered # -# Since: 2.0 +# Since: 2.9 ## { "struct": "BlkdebugSetStateOptions", @@ -3717,16 +3709,16 @@ # # @image: underlying raw block device (or image file) # -# @config: #optional filename of the configuration file +# @config: filename of the configuration file # -# @align: #optional required alignment for requests in bytes, +# @align: required alignment for requests in bytes, # must be power of 2, or 0 for default # -# @inject-error: #optional array of error injection descriptions +# @inject-error: array of error injection descriptions # -# @set-state: #optional array of state-change descriptions +# @set-state: array of state-change descriptions # -# Since: 2.0 +# Since: 2.9 ## { "struct": "BlockdevOptionsBlkdebug", @@ -3752,7 +3744,7 @@ # # @raw: raw image used for verification # -# Since: 2.0 +# Since: 2.9 ## { "struct": "BlockdevOptionsBlkverify", @@ -3771,7 +3763,7 @@ # # @fifo: read only from the first child that has not failed # -# Since: 2.2 +# Since: 2.9 ## { "enum": "QuorumReadPattern", @@ -3786,20 +3778,20 @@ # # Driver specific block device options for Quorum # -# @blkverify: #optional true if the driver must print content mismatch +# @blkverify: true if the driver must print content mismatch # set to false by default # # @children: the children block devices to use # # @vote-threshold: the vote limit under which a read will fail # -# @rewrite-corrupted: #optional rewrite corrupted data when quorum is reached +# @rewrite-corrupted: rewrite corrupted data when quorum is reached # (Since 2.1) # -# @read-pattern: #optional choose read pattern and set to quorum by default +# @read-pattern: choose read pattern and set to quorum by default # (Since 2.2) # -# Since: 2.0 +# Since: 2.9 ## { "struct": "BlockdevOptionsQuorum", @@ -3815,88 +3807,172 @@ } ## -# @GlusterTransport: +# @BlockdevOptionsGluster: # -# An enumeration of Gluster transport types +# Driver specific block device options for Gluster # -# @tcp: TCP - Transmission Control Protocol +# @volume: name of gluster volume where VM image resides # -# @unix: UNIX - Unix domain socket +# @path: absolute path to image file in gluster volume # -# Since: 2.7 +# @server: gluster servers description +# +# @debug: libgfapi log level (default '4' which is Error) +# (Since 2.8) +# +# @logfile: libgfapi log file (default /dev/stderr) (Since 2.8) +# +# Since: 2.9 +## +{ + "struct": "BlockdevOptionsGluster", + "data": { + "volume": "str", + "path": "str", + "server": [ + "SocketAddressFlat" + ], + "*debug": "int", + "*logfile": "str" + } +} + +## +# @IscsiTransport: +# +# An enumeration of libiscsi transport types +# +# Since: 2.9 ## { - "enum": "GlusterTransport", + "enum": "IscsiTransport", "data": [ - "unix", - "tcp" + "tcp", + "iser" ] } +## +# @IscsiHeaderDigest: +# +# An enumeration of header digests supported by libiscsi +# +# Since: 2.9 +## +{ + "enum": "IscsiHeaderDigest", + "prefix": "QAPI_ISCSI_HEADER_DIGEST", + "data": [ + "crc32c", + "none", + "crc32c-none", + "none-crc32c" + ] +} ## -# @GlusterServer: +# @BlockdevOptionsIscsi: # -# Captures the address of a socket +# @transport: The iscsi transport type # -# Details for connecting to a gluster server +# @portal: The address of the iscsi portal # -# @type: Transport type used for gluster connection +# @target: The target iqn name # -# This is similar to SocketAddress, only distinction: +# @lun: LUN to connect to. Defaults to 0. # -# 1. GlusterServer is a flat union, SocketAddress is a simple union. -# A flat union is nicer than simple because it avoids nesting -# (i.e. more {}) on the wire. +# @user: User name to log in with. If omitted, no CHAP +# authentication is performed. # -# 2. GlusterServer lacks case 'fd', since gluster doesn't let you -# pass in a file descriptor. +# @password-secret: The ID of a QCryptoSecret object providing +# the password for the login. This option is required if +# @user is specified. # -# GlusterServer is actually not Gluster-specific, its a -# compatibility evolved into an alternate for SocketAddress. +# @initiator-name: The iqn name we want to identify to the target +# as. If this option is not specified, an initiator name is +# generated automatically. # -# Since: 2.7 +# @header-digest: The desired header digest. Defaults to +# none-crc32c. +# +# @timeout: Timeout in seconds after which a request will +# timeout. 0 means no timeout and is the default. +# +# Driver specific block device options for iscsi +# +# Since: 2.9 ## { - "union": "GlusterServer", - "base": { - "type": "GlusterTransport" - }, - "discriminator": "type", + "struct": "BlockdevOptionsIscsi", "data": { - "unix": "UnixSocketAddress", - "tcp": "InetSocketAddress" + "transport": "IscsiTransport", + "portal": "str", + "target": "str", + "*lun": "int", + "*user": "str", + "*password-secret": "str", + "*initiator-name": "str", + "*header-digest": "IscsiHeaderDigest", + "*timeout": "int" } } + ## -# @BlockdevOptionsGluster: +# @BlockdevOptionsRbd: # -# Driver specific block device options for Gluster +# @pool: Ceph pool name. # -# @volume: name of gluster volume where VM image resides +# @image: Image name in the Ceph pool. # -# @path: absolute path to image file in gluster volume +# @conf: path to Ceph configuration file. Values +# in the configuration file will be overridden by +# options specified via QAPI. # -# @server: gluster servers description +# @snapshot: Ceph snapshot name. # -# @debug: #optional libgfapi log level (default '4' which is Error) -# (Since 2.8) +# @user: Ceph id name. # -# @logfile: #optional libgfapi log file (default /dev/stderr) (Since 2.8) +# @server: Monitor host address and port. This maps +# to the "mon_host" Ceph option. # -# Since: 2.7 +# Since: 2.9 ## { - "struct": "BlockdevOptionsGluster", + "struct": "BlockdevOptionsRbd", "data": { - "volume": "str", - "path": "str", - "server": [ - "GlusterServer" - ], - "*debug": "int", - "*logfile": "str" + "pool": "str", + "image": "str", + "*conf": "str", + "*snapshot": "str", + "*user": "str", + "*server": [ + "InetSocketAddressBase" + ] + } +} + +## +# @BlockdevOptionsSheepdog: +# +# Driver specific block device options for sheepdog +# +# @vdi: Virtual disk image name +# @addr: The Sheepdog server to connect to +# @snap-id: Snapshot ID +# @tag: Snapshot tag name +# +# Only one of @snap-id and @tag may be present. +# +# Since: 2.9 +## +{ + "struct": "BlockdevOptionsSheepdog", + "data": { + "addr": "SocketAddressFlat", + "vdi": "str", + "*snap-id": "uint32", + "*tag": "str" } } @@ -3909,7 +3985,7 @@ # # @secondary: Secondary mode, receive the vm's state from primary QEMU. # -# Since: 2.8 +# Since: 2.9 ## { "enum": "ReplicationMode", @@ -3926,11 +4002,11 @@ # # @mode: the replication mode # -# @top-id: #optional In secondary mode, node name or device ID of the root +# @top-id: In secondary mode, node name or device ID of the root # node who owns the replication node chain. Must not be given in # primary mode. # -# Since: 2.8 +# Since: 2.9 ## { "struct": "BlockdevOptionsReplication", @@ -3948,7 +4024,7 @@ # # @inet: TCP transport # -# Since: 2.8 +# Since: 2.9 ## { "enum": "NFSTransport", @@ -3966,7 +4042,7 @@ # # @host: host address for NFS server # -# Since: 2.8 +# Since: 2.9 ## { "struct": "NFSServer", @@ -3985,27 +4061,27 @@ # # @path: path of the image on the host # -# @user: #optional UID value to use when talking to the +# @user: UID value to use when talking to the # server (defaults to 65534 on Windows and getuid() # on unix) # -# @group: #optional GID value to use when talking to the +# @group: GID value to use when talking to the # server (defaults to 65534 on Windows and getgid() # in unix) # -# @tcp-syn-count: #optional number of SYNs during the session +# @tcp-syn-count: number of SYNs during the session # establishment (defaults to libnfs default) # -# @readahead-size: #optional set the readahead size in bytes (defaults +# @readahead-size: set the readahead size in bytes (defaults # to libnfs default) # -# @page-cache-size: #optional set the pagecache size in bytes (defaults +# @page-cache-size: set the pagecache size in bytes (defaults # to libnfs default) # -# @debug: #optional set the NFS debug level (max 2) (defaults +# @debug: set the NFS debug level (max 2) (defaults # to libnfs default) # -# Since: 2.8 +# Since: 2.9 ## { "struct": "BlockdevOptionsNfs", @@ -4028,7 +4104,7 @@ # # @filename: path to the image file # -# Since: 1.7 +# Since: 2.9 ## { "struct": "BlockdevOptionsCurl", @@ -4044,11 +4120,11 @@ # # @server: NBD server address # -# @export: #optional export name +# @export: export name # -# @tls-creds: #optional TLS credentials ID +# @tls-creds: TLS credentials ID # -# Since: 2.8 +# Since: 2.9 ## { "struct": "BlockdevOptionsNbd", @@ -4064,10 +4140,10 @@ # # Driver specific block device options for the raw driver. # -# @offset: #optional position where the block device starts -# @size: #optional the assumed size of the device +# @offset: position where the block device starts +# @size: the assumed size of the device # -# Since: 2.8 +# Since: 2.9 ## { "struct": "BlockdevOptionsRaw", @@ -4085,18 +4161,18 @@ # block devices, independent of the block driver: # # @driver: block driver name -# @node-name: #optional the node name of the new node (Since 2.0). +# @node-name: the node name of the new node (Since 2.0). # This option is required on the top level of blockdev-add. -# @discard: #optional discard-related options (default: ignore) -# @cache: #optional cache-related options -# @read-only: #optional whether the block device should be read-only +# @discard: discard-related options (default: ignore) +# @cache: cache-related options +# @read-only: whether the block device should be read-only # (default: false) -# @detect-zeroes: #optional detect and optimize zero writes (Since 2.1) +# @detect-zeroes: detect and optimize zero writes (Since 2.1) # (default: off) # # Remaining options are determined by the block driver. # -# Since: 1.7 +# Since: 2.9 ## { "union": "BlockdevOptions", @@ -4110,7 +4186,6 @@ }, "discriminator": "driver", "data": { - "archipelago": "BlockdevOptionsArchipelago", "blkdebug": "BlockdevOptionsBlkdebug", "blkverify": "BlockdevOptionsBlkverify", "bochs": "BlockdevOptionsGenericFormat", @@ -4124,6 +4199,7 @@ "host_device": "BlockdevOptionsFile", "http": "BlockdevOptionsCurl", "https": "BlockdevOptionsCurl", + "iscsi": "BlockdevOptionsIscsi", "luks": "BlockdevOptionsLUKS", "nbd": "BlockdevOptionsNbd", "nfs": "BlockdevOptionsNfs", @@ -4135,7 +4211,9 @@ "qed": "BlockdevOptionsGenericCOWFormat", "quorum": "BlockdevOptionsQuorum", "raw": "BlockdevOptionsRaw", + "rbd": "BlockdevOptionsRbd", "replication": "BlockdevOptionsReplication", + "sheepdog": "BlockdevOptionsSheepdog", "ssh": "BlockdevOptionsSsh", "vdi": "BlockdevOptionsGenericFormat", "vhdx": "BlockdevOptionsGenericFormat", @@ -4155,7 +4233,7 @@ # empty string means that no block device should be # referenced. # -# Since: 1.7 +# Since: 2.9 ## { "alternate": "BlockdevRef", @@ -4172,47 +4250,43 @@ # BlockBackend will be created; otherwise, @node-name is mandatory at the top # level and no BlockBackend will be created. # -# For the arguments, see the documentation of BlockdevOptions. -# -# Note: This command is still a work in progress. It doesn't support all -# block drivers among other things. Stay away from it unless you want -# to help with its development. -# -# Since: 1.7 +# Since: 2.9 # # Example: # # 1. # -> { "execute": "blockdev-add", # "arguments": { -# "options" : { "driver": "qcow2", -# "file": { "driver": "file", -# "filename": "test.qcow2" } } } } +# "driver": "qcow2", +# "node-name": "test1", +# "file": { +# "driver": "file", +# "filename": "test.qcow2" +# } +# } +# } # <- { "return": {} } # # 2. # -> { "execute": "blockdev-add", # "arguments": { -# "options": { -# "driver": "qcow2", -# "node-name": "node0", -# "discard": "unmap", -# "cache": { -# "direct": true, -# "writeback": true +# "driver": "qcow2", +# "node-name": "node0", +# "discard": "unmap", +# "cache": { +# "direct": true # }, # "file": { -# "driver": "file", -# "filename": "/tmp/test.qcow2" +# "driver": "file", +# "filename": "/tmp/test.qcow2" # }, # "backing": { -# "driver": "raw", -# "file": { -# "driver": "file", -# "filename": "/dev/fdset/4" +# "driver": "raw", +# "file": { +# "driver": "file", +# "filename": "/dev/fdset/4" # } # } -# } # } # } # @@ -4226,7 +4300,7 @@ } ## -# @x-blockdev-del: +# @blockdev-del: # # Deletes a block device that has been added using blockdev-add. # The command will fail if the node is attached to a device or is @@ -4234,36 +4308,30 @@ # # @node-name: Name of the graph node to delete. # -# Note: This command is still a work in progress and is considered -# experimental. Stay away from it unless you want to help with its -# development. -# -# Since: 2.5 +# Since: 2.9 # # Example: # # -> { "execute": "blockdev-add", # "arguments": { -# "options": { -# "driver": "qcow2", -# "node-name": "node0", -# "file": { -# "driver": "file", -# "filename": "test.qcow2" -# } -# } +# "driver": "qcow2", +# "node-name": "node0", +# "file": { +# "driver": "file", +# "filename": "test.qcow2" +# } # } # } # <- { "return": {} } # -# -> { "execute": "x-blockdev-del", +# -> { "execute": "blockdev-del", # "arguments": { "node-name": "node0" } # } # <- { "return": {} } # ## { - "command": "x-blockdev-del", + "command": "blockdev-del", "data": { "node-name": "str" } @@ -4287,11 +4355,11 @@ # to it # - if the guest device does not have an actual tray # -# @device: #optional Block device name (deprecated, use @id instead) +# @device: Block device name (deprecated, use @id instead) # -# @id: #optional The name or QOM path of the guest device (since: 2.8) +# @id: The name or QOM path of the guest device (since: 2.8) # -# @force: #optional if false (the default), an eject request will be sent to +# @force: if false (the default), an eject request will be sent to # the guest if it has locked the tray (and the tray will not be opened # immediately); if true, the tray will be opened regardless of whether # it is locked @@ -4331,9 +4399,9 @@ # # If the tray was already closed before, this will be a no-op. # -# @device: #optional Block device name (deprecated, use @id instead) +# @device: Block device name (deprecated, use @id instead) # -# @id: #optional The name or QOM path of the guest device (since: 2.8) +# @id: The name or QOM path of the guest device (since: 2.8) # # Since: 2.5 # @@ -4369,9 +4437,9 @@ # # If the tray is open and there is no medium inserted, this will be a no-op. # -# @device: #optional Block device name (deprecated, use @id instead) +# @device: Block device name (deprecated, use @id instead) # -# @id: #optional The name or QOM path of the guest device (since: 2.8) +# @id: The name or QOM path of the guest device (since: 2.8) # # Note: This command is still a work in progress and is considered experimental. # Stay away from it unless you want to help with its development. @@ -4419,9 +4487,9 @@ # device's tray must currently be open (unless there is no attached guest # device) and there must be no medium inserted already. # -# @device: #optional Block device name (deprecated, use @id instead) +# @device: Block device name (deprecated, use @id instead) # -# @id: #optional The name or QOM path of the guest device (since: 2.8) +# @id: The name or QOM path of the guest device (since: 2.8) # # @node-name: name of a node in the block driver state graph # @@ -4490,17 +4558,17 @@ # combines blockdev-open-tray, x-blockdev-remove-medium, # x-blockdev-insert-medium and blockdev-close-tray). # -# @device: #optional Block device name (deprecated, use @id instead) +# @device: Block device name (deprecated, use @id instead) # -# @id: #optional The name or QOM path of the guest device +# @id: The name or QOM path of the guest device # (since: 2.8) # # @filename: filename of the new image to be loaded # -# @format: #optional format to open the new image with (defaults to +# @format: format to open the new image with (defaults to # the probed format) # -# @read-only-mode: #optional change the read-only mode of the device; defaults +# @read-only-mode: change the read-only mode of the device; defaults # to 'retain' # # Since: 2.5 @@ -4583,16 +4651,16 @@ # reasons, but it can be empty ("") if the image does not # have a device name associated. # -# @node-name: #optional node name (Since: 2.4) +# @node-name: node name (Since: 2.4) # # @msg: informative message for human consumption, such as the kind of # corruption being detected. It should not be parsed by machine as it is # not guaranteed to be stable # -# @offset: #optional if the corruption resulted from an image access, this is +# @offset: if the corruption resulted from an image access, this is # the host's access offset into the image # -# @size: #optional if the corruption resulted from an image access, this is +# @size: if the corruption resulted from an image access, this is # the access size # # @fatal: if set, the image is marked corrupt and therefore unusable after this @@ -4641,7 +4709,7 @@ # # @action: action that has been taken # -# @nospace: #optional true if I/O error was caused due to a no-space +# @nospace: true if I/O error was caused due to a no-space # condition. This key is only present if query-block's # io-status is present, please see query-block documentation # for more information (since: 2.2) @@ -4694,7 +4762,7 @@ # # @speed: rate limit, bytes per second # -# @error: #optional error message. Only present on failure. This field +# @error: error message. Only present on failure. This field # contains a human-readable error message. There are no semantics # other than that streaming has failed and clients should not try to # interpret the error string @@ -4935,9 +5003,9 @@ # # @parent: the id or name of the parent node. # -# @child: #optional the name of a child under the given parent node. +# @child: the name of a child under the given parent node. # -# @node: #optional the name of the node that will be added. +# @node: the name of the node that will be added. # # Note: this command is experimental, and its API is not stable. It # does not support all kinds of operations, all kinds of children, nor @@ -5197,7 +5265,7 @@ # @device: The device name or node name of the node to be exported # # @writable: Whether clients should be able to write to the device via the -# NBD connection (default false). #optional +# NBD connection (default false). # # Returns: error if the device is already marked for export. # @@ -5487,7 +5555,7 @@ # At this point, it's safe to reuse the specified device ID. Device removal can # be initiated by the guest or by HMP/QMP commands. # -# @device: #optional device name +# @device: device name # # @path: device path # @@ -5515,7 +5583,7 @@ # Emitted once until the 'query-rx-filter' command is executed, the first event # will always be emitted # -# @name: #optional net client name +# @name: net client name # # @path: device path # @@ -5841,6 +5909,8 @@ # # @action: action that has been taken, currently always "pause" # +# @info: information about a panic (since 2.9) +# # Since: 1.5 # # Example: @@ -5852,7 +5922,8 @@ { "event": "GUEST_PANICKED", "data": { - "action": "GuestPanicAction" + "action": "GuestPanicAction", + "*info": "GuestPanicInformation" } } @@ -5894,7 +5965,7 @@ # # @type: quorum operation type (Since 2.6) # -# @error: #optional error message. Only present on failure. This field +# @error: error message. Only present on failure. This field # contains a human-readable error message. There are no semantics other # than that the block layer reported an error and clients should not # try to interpret the error string. @@ -5998,7 +6069,7 @@ # # @result: DumpQueryResult type described in qapi-schema.json. # -# @error: #optional human-readable error string that provides +# @error: human-readable error string that provides # hint on why dump failed. Only presents on failure. The # user should not try to interpret the error string. # @@ -6071,7 +6142,7 @@ # Query the state of events. # # @name: Event name pattern (case-sensitive glob). -# @vcpu: #optional The vCPU to query (any by default; since 2.7). +# @vcpu: The vCPU to query (any by default; since 2.7). # # Returns: a list of @TraceEventInfo for the matching events # @@ -6111,8 +6182,8 @@ # # @name: Event name pattern (case-sensitive glob). # @enable: Whether to enable tracing. -# @ignore-unavailable: #optional Do not match unavailable events with @name. -# @vcpu: #optional The vCPU to act upon (all by default; since 2.7). +# @ignore-unavailable: Do not match unavailable events with @name. +# @vcpu: The vCPU to act upon (all by default; since 2.7). # # An event's state is modified if: # - its name matches the @name pattern, and @@ -6339,10 +6410,10 @@ # # @members: the object type's (non-variant) members, in no particular order. # -# @tag: #optional the name of the member serving as type tag. +# @tag: the name of the member serving as type tag. # An element of @members with this name must exist. # -# @variants: #optional variant members, i.e. additional members that +# @variants: variant members, i.e. additional members that # depend on the type tag's value. Present exactly when # @tag is present. The variants are in no particular order, # and may even differ from the order of the values of the @@ -6374,7 +6445,7 @@ # # @type: the name of the member's type. # -# @default: #optional default when used as command parameter. +# @default: default when used as command parameter. # If absent, the parameter is mandatory. # If present, the value must be null. The parameter is # optional, and behavior when it's missing is not specified @@ -6557,10 +6628,10 @@ # # @fdname: file descriptor name previously passed via 'getfd' command # -# @skipauth: #optional whether to skip authentication. Only applies +# @skipauth: whether to skip authentication. Only applies # to "vnc" and "spice" protocols # -# @tls: #optional whether to perform TLS. Only applies to the "spice" +# @tls: whether to perform TLS. Only applies to the "spice" # protocol # # Returns: nothing on success. @@ -6589,7 +6660,7 @@ # # Guest name information. # -# @name: #optional The name of the guest +# @name: The name of the guest # # Since: 0.14.0 ## @@ -6958,7 +7029,7 @@ # # @data: data to write # -# @format: #optional data encoding (default 'utf8'). +# @format: data encoding (default 'utf8'). # - base64: data must be base64 encoded text. Its binary # decoding gets written. # - utf8: data's UTF-8 encoding is written @@ -6996,7 +7067,7 @@ # # @size: how many bytes to read at most # -# @format: #optional data encoding (default 'utf8'). +# @format: data encoding (default 'utf8'). # - base64: the data read is returned in base64 encoding. # - utf8: the data read is interpreted as UTF-8. # Bug: can screw up when the buffer contains invalid UTF-8 @@ -7204,45 +7275,45 @@ # # Information about current migration process. # -# @status: #optional @MigrationStatus describing the current migration status. +# @status: @MigrationStatus describing the current migration status. # If this field is not returned, no migration process # has been initiated # -# @ram: #optional @MigrationStats containing detailed migration +# @ram: @MigrationStats containing detailed migration # status, only returned if status is 'active' or # 'completed'(since 1.2) # -# @disk: #optional @MigrationStats containing detailed disk migration +# @disk: @MigrationStats containing detailed disk migration # status, only returned if status is 'active' and it is a block # migration # -# @xbzrle-cache: #optional @XBZRLECacheStats containing detailed XBZRLE +# @xbzrle-cache: @XBZRLECacheStats containing detailed XBZRLE # migration statistics, only returned if XBZRLE feature is on and # status is 'active' or 'completed' (since 1.2) # -# @total-time: #optional total amount of milliseconds since migration started. +# @total-time: total amount of milliseconds since migration started. # If migration has ended, it returns the total migration # time. (since 1.2) # -# @downtime: #optional only present when migration finishes correctly +# @downtime: only present when migration finishes correctly # total downtime in milliseconds for the guest. # (since 1.3) # -# @expected-downtime: #optional only present while migration is active +# @expected-downtime: only present while migration is active # expected downtime in milliseconds for the guest in last walk # of the dirty bitmap. (since 1.3) # -# @setup-time: #optional amount of setup time in milliseconds _before_ the +# @setup-time: amount of setup time in milliseconds _before_ the # iterations begin but _after_ the QMP command is issued. This is designed # to provide an accounting of any activities (such as RDMA pinning) which # may be expensive, but do not actually occur during the iterative # migration rounds themselves. (since 1.6) # -# @cpu-throttle-percentage: #optional percentage of time guest cpus are being +# @cpu-throttle-percentage: percentage of time guest cpus are being # throttled during auto-converge. This is only present when auto-converge # has started throttling guest cpus. (Since 2.7) # -# @error-desc: #optional the human readable error description string, when +# @error-desc: the human readable error description string, when # @status is 'failed'. Clients should not attempt to parse the # error strings. (Since 2.7) # @@ -7433,6 +7504,9 @@ # side, this process is called COarse-Grain LOck Stepping (COLO) for # Non-stop Service. (since 2.8) # +# @release-ram: if enabled, qemu will free the migrated ram pages on the source +# during postcopy-ram migration. (since 2.9) +# # Since: 1.2 ## { @@ -7445,7 +7519,8 @@ "compress", "events", "postcopy-ram", - "x-colo" + "x-colo", + "release-ram" ] } @@ -7595,7 +7670,7 @@ ## # @migrate-set-parameters: # -# Set various migration parameters. See MigrationParameters for details. +# Set various migration parameters. # # Since: 2.4 # @@ -7619,34 +7694,38 @@ # ('query-migrate-parameters'), with the exception of tls-creds and # tls-hostname. # -# @compress-level: #optional compression level +# @compress-level: compression level # -# @compress-threads: #optional compression thread count +# @compress-threads: compression thread count # -# @decompress-threads: #optional decompression thread count +# @decompress-threads: decompression thread count # -# @cpu-throttle-initial: #optional Initial percentage of time guest cpus are +# @cpu-throttle-initial: Initial percentage of time guest cpus are # throttledwhen migration auto-converge is activated. # The default value is 20. (Since 2.7) # -# @cpu-throttle-increment: #optional throttle percentage increase each time +# @cpu-throttle-increment: throttle percentage increase each time # auto-converge detects that migration is not making # progress. The default value is 10. (Since 2.7) # -# @tls-creds: #optional ID of the 'tls-creds' object that provides credentials +# @tls-creds: ID of the 'tls-creds' object that provides credentials # for establishing a TLS connection over the migration data # channel. On the outgoing side of the migration, the credentials # must be for a 'client' endpoint, while for the incoming side the # credentials must be for a 'server' endpoint. Setting this # will enable TLS for all migrations. The default is unset, # resulting in unsecured migration at the QEMU level. (Since 2.7) +# An empty string means that QEMU will use plain text mode for +# migration, rather than TLS (Since 2.9) # -# @tls-hostname: #optional hostname of the target host for the migration. This +# @tls-hostname: hostname of the target host for the migration. This # is required when using x509 based TLS credentials and the # migration URI does not already include a hostname. For # example if using fd: or exec: based migration, the # hostname must be provided so that the server's x509 # certificate identity can be validated. (Since 2.7) +# An empty string means that QEMU will use the hostname +# associated with the migration URI, if any. (Since 2.9) # # @max-bandwidth: to set maximum speed for migration. maximum speed in # bytes per second. (Since 2.8) @@ -7712,9 +7791,9 @@ # # @protocol: must be "spice" # @hostname: migration target hostname -# @port: #optional spice tcp port for plaintext channels -# @tls-port: #optional spice tcp port for tls-secured channels -# @cert-subject: #optional server certificate subject +# @port: spice tcp port for plaintext channels +# @tls-port: spice tcp port for tls-secured channels +# @cert-subject: server certificate subject # # Since: 0.14.0 # @@ -7826,6 +7905,8 @@ # # @completed: finish the process of failover # +# @relaunch: restart the failover process, from 'none' -> 'completed' (Since 2.9) +# # Since: 2.8 ## { @@ -7834,7 +7915,8 @@ "none", "require", "active", - "completed" + "completed", + "relaunch" ] } @@ -8131,13 +8213,25 @@ # # @thread-id: ID of the underlying host thread # +# @poll-max-ns: maximum polling time in ns, 0 means polling is disabled +# (since 2.9) +# +# @poll-grow: how many ns will be added to polling time, 0 means that it's not +# configured (since 2.9) +# +# @poll-shrink: how many ns will be removed from polling time, 0 means that +# it's not configured (since 2.9) +# # Since: 2.0 ## { "struct": "IOThreadInfo", "data": { "id": "str", - "thread-id": "int" + "thread-id": "int", + "poll-max-ns": "int", + "poll-grow": "int", + "poll-shrink": "int" } } @@ -8237,7 +8331,8 @@ # # The network connection information for server # -# @auth: #optional authentication method +# @auth: authentication method used for +# the plain (non-websocket) VNC server # # Since: 2.1 ## @@ -8254,10 +8349,10 @@ # # Information about a connected VNC client. # -# @x509_dname: #optional If x509 authentication is in use, the Distinguished +# @x509_dname: If x509 authentication is in use, the Distinguished # Name of the client. # -# @sasl_username: #optional If SASL authentication is in use, the SASL username +# @sasl_username: If SASL authentication is in use, the SASL username # used for authentication. # # Since: 0.14.0 @@ -8278,19 +8373,19 @@ # # @enabled: true if the VNC server is enabled, false otherwise # -# @host: #optional The hostname the VNC server is bound to. This depends on +# @host: The hostname the VNC server is bound to. This depends on # the name resolution on the host and may be an IP address. # -# @family: #optional 'ipv6' if the host is listening for IPv6 connections +# @family: 'ipv6' if the host is listening for IPv6 connections # 'ipv4' if the host is listening for IPv4 connections # 'unix' if the host is listening on a unix domain socket # 'unknown' otherwise # -# @service: #optional The service name of the server's port. This may depends +# @service: The service name of the server's port. This may depends # on the host system's service database so symbolic names should not # be relied on. # -# @auth: #optional the current authentication type used by the server +# @auth: the current authentication type used by the server # 'none' if no authentication is being used # 'vnc' if VNC authentication is being used # 'vencrypt+plain' if VEncrypt is used with plain text authentication @@ -8365,6 +8460,29 @@ ] } + +## +# @VncServerInfo2: +# +# The network connection information for server +# +# @auth: The current authentication type used by the servers +# +# @vencrypt: The vencrypt sub authentication type used by the +# servers, only specified in case auth == vencrypt. +# +# Since: 2.9 +## +{ + "struct": "VncServerInfo2", + "base": "VncBasicInfo", + "data": { + "auth": "VncPrimaryAuth", + "*vencrypt": "VncVencryptSubAuth" + } +} + + ## # @VncInfo2: # @@ -8380,12 +8498,12 @@ # @clients: A list of @VncClientInfo of all currently connected clients. # The list can be empty, for obvious reasons. # -# @auth: The current authentication type used by the server +# @auth: The current authentication type used by the non-websockets servers # -# @vencrypt: #optional The vencrypt sub authentication type used by the server, +# @vencrypt: The vencrypt authentication type used by the servers, # only specified in case auth == vencrypt. # -# @display: #optional The display device the vnc server is linked to. +# @display: The display device the vnc server is linked to. # # Since: 2.3 ## @@ -8394,7 +8512,7 @@ "data": { "id": "str", "server": [ - "VncBasicInfo" + "VncServerInfo2" ], "clients": [ "VncClientInfo" @@ -8482,7 +8600,7 @@ # # Information about a SPICE server # -# @auth: #optional authentication method +# @auth: authentication method # # Since: 2.1 ## @@ -8560,16 +8678,16 @@ # @migrated: true if the last guest migration completed and spice # migration had completed as well. false otherwise. (since 1.4) # -# @host: #optional The hostname the SPICE server is bound to. This depends on +# @host: The hostname the SPICE server is bound to. This depends on # the name resolution on the host and may be an IP address. # -# @port: #optional The SPICE server's port number. +# @port: The SPICE server's port number. # -# @compiled-version: #optional SPICE server version. +# @compiled-version: SPICE server version. # -# @tls-port: #optional The SPICE server's TLS port number. +# @tls-port: The SPICE server's TLS port number. # -# @auth: #optional the current authentication type used by the server +# @auth: the current authentication type used by the server # 'none' if no authentication is being used # 'spice' uses SASL or direct TLS authentication, depending on command # line options @@ -8723,9 +8841,9 @@ # # @size: memory size # -# @prefetch: #optional if @type is 'memory', true if the memory is prefetchable +# @prefetch: if @type is 'memory', true if the memory is prefetchable # -# @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit +# @mem_type_64: if @type is 'memory', true if the BAR is 64-bit # # Since: 0.14.0 ## @@ -8802,7 +8920,7 @@ # # Information about the Class of a PCI device # -# @desc: #optional a string description of the device's class +# @desc: a string description of the device's class # # @class: the class code of the device # @@ -8850,7 +8968,7 @@ # # @id: the PCI device id # -# @irq: #optional if an IRQ is assigned to the device, the IRQ number +# @irq: if an IRQ is assigned to the device, the IRQ number # # @qdev_id: the device name of the PCI device # @@ -9168,7 +9286,7 @@ # # @filename: the file to save the memory to as binary data # -# @cpu-index: #optional the index of the virtual CPU to use for translating the +# @cpu-index: the index of the virtual CPU to use for translating the # virtual address (defaults to CPU 0) # # Returns: Nothing on success @@ -9436,7 +9554,7 @@ # # Optional arguments to modify the behavior of a Transaction. # -# @completion-mode: #optional Controls how jobs launched asynchronously by +# @completion-mode: Controls how jobs launched asynchronously by # Actions will complete or fail as a group. # See @ActionCompletionMode for details. # @@ -9481,7 +9599,7 @@ # @actions: List of @TransactionAction; # information needed for the respective operations. # -# @properties: #optional structure of additional options to control the +# @properties: structure of additional options to control the # execution of the transaction. See @TransactionProperties # for additional detail. # @@ -9534,7 +9652,7 @@ # # @command-line: the command to execute in the human monitor # -# @cpu-index: #optional The CPU to use for commands that require an implicit CPU +# @cpu-index: The CPU to use for commands that require an implicit CPU # # Returns: the output of the command as a string # @@ -9817,7 +9935,7 @@ # # @password: the new password # -# @connected: #optional how to handle existing clients when changing the +# @connected: how to handle existing clients when changing the # password. If nothing is specified, defaults to `keep' # `fail' to fail the command if clients are connected # `disconnect' to disconnect existing clients @@ -10010,7 +10128,7 @@ # # @name: the name of the property # @type: the typename of the property -# @description: #optional if specified, the description of the property. +# @description: if specified, the description of the property. # (since 2.2) # # Since: 1.2 @@ -10052,9 +10170,9 @@ # # @uri: the Uniform Resource Identifier of the destination VM # -# @blk: #optional do block migration (full disk copy) +# @blk: do block migration (full disk copy) # -# @inc: #optional incremental disk copy migration +# @inc: incremental disk copy migration # # @detach: this argument exists only for compatibility reasons and # is ignored by QEMU @@ -10185,9 +10303,9 @@ # # @driver: the name of the new device's driver # -# @bus: #optional the device's parent bus (device tree path) +# @bus: the device's parent bus (device tree path) # -# @id: #optional the device's ID, must be unique +# @id: the device's ID, must be unique # # Additional arguments depend on the type. # @@ -10318,17 +10436,17 @@ # 2. fd: the protocol starts with "fd:", and the following string # is the fd's name. # -# @detach: #optional if true, QMP will return immediately rather than +# @detach: if true, QMP will return immediately rather than # waiting for the dump to finish. The user can track progress # using "query-dump". (since 2.6). # -# @begin: #optional if specified, the starting physical address. +# @begin: if specified, the starting physical address. # -# @length: #optional if specified, the memory size, in bytes. If you don't +# @length: if specified, the memory size, in bytes. If you don't # want to dump all guest's memory, please specify the start @begin # and @length # -# @format: #optional if specified, the format of guest memory dump. But non-elf +# @format: if specified, the format of guest memory dump. But non-elf # format is conflict with paging and filter, ie. @paging, @begin and # @length is not allowed to be specified with non-elf @format at the # same time (since 2.0) @@ -10562,7 +10680,7 @@ # # @id: the name of the new object # -# @props: #optional a dictionary of properties to be passed to the backend +# @props: a dictionary of properties to be passed to the backend # # Returns: Nothing on success # Error if @qom-type is not a valid class name @@ -10628,15 +10746,15 @@ # # Create a new Network Interface Card. # -# @netdev: #optional id of -netdev to connect to +# @netdev: id of -netdev to connect to # -# @macaddr: #optional MAC address +# @macaddr: MAC address # -# @model: #optional device model (e1000, rtl8139, virtio etc.) +# @model: device model (e1000, rtl8139, virtio etc.) # -# @addr: #optional PCI device address +# @addr: PCI device address # -# @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X +# @vectors: number of MSI-x vectors, 0 to disable MSI-X # # Since: 1.2 ## @@ -10671,57 +10789,57 @@ # Use the user mode network stack which requires no administrator privilege to # run. # -# @hostname: #optional client hostname reported by the builtin DHCP server +# @hostname: client hostname reported by the builtin DHCP server # -# @restrict: #optional isolate the guest from the host +# @restrict: isolate the guest from the host # -# @ipv4: #optional whether to support IPv4, default true for enabled +# @ipv4: whether to support IPv4, default true for enabled # (since 2.6) # -# @ipv6: #optional whether to support IPv6, default true for enabled +# @ipv6: whether to support IPv6, default true for enabled # (since 2.6) # -# @ip: #optional legacy parameter, use net= instead +# @ip: legacy parameter, use net= instead # -# @net: #optional IP network address that the guest will see, in the +# @net: IP network address that the guest will see, in the # form addr[/netmask] The netmask is optional, and can be # either in the form a.b.c.d or as a number of valid top-most # bits. Default is 10.0.2.0/24. # -# @host: #optional guest-visible address of the host +# @host: guest-visible address of the host # -# @tftp: #optional root directory of the built-in TFTP server +# @tftp: root directory of the built-in TFTP server # -# @bootfile: #optional BOOTP filename, for use with tftp= +# @bootfile: BOOTP filename, for use with tftp= # -# @dhcpstart: #optional the first of the 16 IPs the built-in DHCP server can +# @dhcpstart: the first of the 16 IPs the built-in DHCP server can # assign # -# @dns: #optional guest-visible address of the virtual nameserver +# @dns: guest-visible address of the virtual nameserver # -# @dnssearch: #optional list of DNS suffixes to search, passed as DHCP option +# @dnssearch: list of DNS suffixes to search, passed as DHCP option # to the guest # -# @ipv6-prefix: #optional IPv6 network prefix (default is fec0::) (since +# @ipv6-prefix: IPv6 network prefix (default is fec0::) (since # 2.6). The network prefix is given in the usual # hexadecimal IPv6 address notation. # -# @ipv6-prefixlen: #optional IPv6 network prefix length (default is 64) +# @ipv6-prefixlen: IPv6 network prefix length (default is 64) # (since 2.6) # -# @ipv6-host: #optional guest-visible IPv6 address of the host (since 2.6) +# @ipv6-host: guest-visible IPv6 address of the host (since 2.6) # -# @ipv6-dns: #optional guest-visible IPv6 address of the virtual +# @ipv6-dns: guest-visible IPv6 address of the virtual # nameserver (since 2.6) # -# @smb: #optional root directory of the built-in SMB server +# @smb: root directory of the built-in SMB server # -# @smbserver: #optional IP address of the built-in SMB server +# @smbserver: IP address of the built-in SMB server # -# @hostfwd: #optional redirect incoming TCP or UDP host connections to guest +# @hostfwd: redirect incoming TCP or UDP host connections to guest # endpoints # -# @guestfwd: #optional forward guest TCP connections +# @guestfwd: forward guest TCP connections # # Since: 1.2 ## @@ -10762,37 +10880,37 @@ # # Connect the host TAP network interface name to the VLAN. # -# @ifname: #optional interface name +# @ifname: interface name # -# @fd: #optional file descriptor of an already opened tap +# @fd: file descriptor of an already opened tap # -# @fds: #optional multiple file descriptors of already opened multiqueue capable +# @fds: multiple file descriptors of already opened multiqueue capable # tap # -# @script: #optional script to initialize the interface +# @script: script to initialize the interface # -# @downscript: #optional script to shut down the interface +# @downscript: script to shut down the interface # -# @br: #optional bridge name (since 2.8) +# @br: bridge name (since 2.8) # -# @helper: #optional command to execute to configure bridge +# @helper: command to execute to configure bridge # -# @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes. +# @sndbuf: send buffer limit. Understands [TGMKkb] suffixes. # -# @vnet_hdr: #optional enable the IFF_VNET_HDR flag on the tap interface +# @vnet_hdr: enable the IFF_VNET_HDR flag on the tap interface # -# @vhost: #optional enable vhost-net network accelerator +# @vhost: enable vhost-net network accelerator # -# @vhostfd: #optional file descriptor of an already opened vhost net device +# @vhostfd: file descriptor of an already opened vhost net device # -# @vhostfds: #optional file descriptors of multiple already opened vhost net +# @vhostfds: file descriptors of multiple already opened vhost net # devices # -# @vhostforce: #optional vhost on for non-MSIX virtio guests +# @vhostforce: vhost on for non-MSIX virtio guests # -# @queues: #optional number of queues to be created for multiqueue capable tap +# @queues: number of queues to be created for multiqueue capable tap # -# @poll-us: #optional maximum number of microseconds that could +# @poll-us: maximum number of microseconds that could # be spent on busy polling for tap (since 2.7) # # Since: 1.2 @@ -10824,17 +10942,17 @@ # Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP # socket connection. # -# @fd: #optional file descriptor of an already opened socket +# @fd: file descriptor of an already opened socket # -# @listen: #optional port number, and optional hostname, to listen on +# @listen: port number, and optional hostname, to listen on # -# @connect: #optional port number, and optional hostname, to connect to +# @connect: port number, and optional hostname, to connect to # -# @mcast: #optional UDP multicast address and port number +# @mcast: UDP multicast address and port number # -# @localaddr: #optional source address and port for multicast and udp packets +# @localaddr: source address and port for multicast and udp packets # -# @udp: #optional UDP unicast address and port number +# @udp: UDP unicast address and port number # # Since: 1.2 ## @@ -10859,32 +10977,32 @@ # # @dst: destination address # -# @srcport: #optional source port - mandatory for udp, optional for ip +# @srcport: source port - mandatory for udp, optional for ip # -# @dstport: #optional destination port - mandatory for udp, optional for ip +# @dstport: destination port - mandatory for udp, optional for ip # -# @ipv6: #optional - force the use of ipv6 +# @ipv6: force the use of ipv6 # -# @udp: #optional - use the udp version of l2tpv3 encapsulation +# @udp: use the udp version of l2tpv3 encapsulation # -# @cookie64: #optional - use 64 bit coookies +# @cookie64: use 64 bit coookies # -# @counter: #optional have sequence counter +# @counter: have sequence counter # -# @pincounter: #optional pin sequence counter to zero - +# @pincounter: pin sequence counter to zero - # workaround for buggy implementations or # networks with packet reorder # -# @txcookie: #optional 32 or 64 bit transmit cookie +# @txcookie: 32 or 64 bit transmit cookie # -# @rxcookie: #optional 32 or 64 bit receive cookie +# @rxcookie: 32 or 64 bit receive cookie # # @txsession: 32 bit transmit session # -# @rxsession: #optional 32 bit receive session - if not specified +# @rxsession: 32 bit receive session - if not specified # set to the same value as transmit # -# @offset: #optional additional offset - allows the insertion of +# @offset: additional offset - allows the insertion of # additional application-specific data before the packet payload # # Since: 2.1 @@ -10914,13 +11032,13 @@ # # Connect the VLAN to a vde switch running on the host. # -# @sock: #optional socket path +# @sock: socket path # -# @port: #optional port number +# @port: port number # -# @group: #optional group owner of socket +# @group: group owner of socket # -# @mode: #optional permissions for socket +# @mode: permissions for socket # # Since: 1.2 ## @@ -10939,10 +11057,10 @@ # # Dump VLAN network traffic to a file. # -# @len: #optional per-packet size limit (64k default). Understands [TGMKkb] +# @len: per-packet size limit (64k default). Understands [TGMKkb] # suffixes. # -# @file: #optional dump file path (default is qemu-vlan0.pcap) +# @file: dump file path (default is qemu-vlan0.pcap) # # Since: 1.2 ## @@ -10959,9 +11077,9 @@ # # Connect a host TAP network interface to a host bridge device. # -# @br: #optional bridge name +# @br: bridge name # -# @helper: #optional command to execute to configure bridge +# @helper: command to execute to configure bridge # # Since: 1.2 ## @@ -11001,7 +11119,7 @@ # YYY identifies a port of the switch. VALE ports having the # same XXX are therefore connected to the same switch. # -# @devname: #optional path of the netmap device (default: '/dev/netmap'). +# @devname: path of the netmap device (default: '/dev/netmap'). # # Since: 2.0 ## @@ -11020,9 +11138,9 @@ # # @chardev: name of a unix socket chardev # -# @vhostforce: #optional vhost on for non-MSIX virtio guests (default: false). +# @vhostforce: vhost on for non-MSIX virtio guests (default: false). # -# @queues: #optional number of queues to be created for multiqueue vhost-user +# @queues: number of queues to be created for multiqueue vhost-user # (default: 1) (Since 2.5) # # Since: 2.1 @@ -11102,11 +11220,11 @@ # # Captures the configuration of a network device; legacy. # -# @vlan: #optional vlan number +# @vlan: vlan number # -# @id: #optional identifier for monitor commands +# @id: identifier for monitor commands # -# @name: #optional identifier for monitor commands, ignored if @id is present +# @name: identifier for monitor commands, ignored if @id is present # # @opts: device type specific properties (legacy) # @@ -11122,6 +11240,28 @@ } } +## +# @NetLegacyOptionsType: +# +# Since: 1.2 +## +{ + "enum": "NetLegacyOptionsType", + "data": [ + "none", + "nic", + "user", + "tap", + "l2tpv3", + "socket", + "vde", + "dump", + "bridge", + "netmap", + "vhost-user" + ] +} + ## # @NetLegacyOptions: # @@ -11131,6 +11271,10 @@ ## { "union": "NetLegacyOptions", + "base": { + "type": "NetLegacyOptionsType" + }, + "discriminator": "type", "data": { "none": "NetdevNoneOptions", "nic": "NetLegacyNicOptions", @@ -11173,33 +11317,41 @@ } ## -# @InetSocketAddress: -# -# Captures a socket address or address range in the Internet namespace. +# @InetSocketAddressBase: # # @host: host part of the address +# @port: port part of the address +## +{ + "struct": "InetSocketAddressBase", + "data": { + "host": "str", + "port": "str" + } +} + +## +# @InetSocketAddress: # -# @port: port part of the address, or lowest port if @to is present +# Captures a socket address or address range in the Internet namespace. # -# @numeric: #optional true if the host/port are guaranteed to be numeric, +# @numeric: true if the host/port are guaranteed to be numeric, # false if name resolution should be attempted. Defaults to false. # (Since 2.9) # -# @to: highest port to try +# @to: If present, this is range of possible addresses, with port +# between @port and @to. # # @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6 -# #optional # # @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6 -# #optional # # Since: 1.3 ## { "struct": "InetSocketAddress", + "base": "InetSocketAddressBase", "data": { - "host": "str", - "port": "str", "*numeric": "bool", "*to": "uint16", "*ipv4": "bool", @@ -11261,6 +11413,55 @@ } } +## +# @SocketAddressFlatType: +# +# Available SocketAddressFlat types +# +# @inet: Internet address +# +# @unix: Unix domain socket +# +# Since: 2.9 +## +{ + "enum": "SocketAddressFlatType", + "data": [ + "unix", + "inet" + ] +} + +## +# @SocketAddressFlat: +# +# Captures the address of a socket +# +# @type: Transport type +# +# This is similar to SocketAddress, only distinction: +# +# 1. SocketAddressFlat is a flat union, SocketAddress is a simple union. +# A flat union is nicer than simple because it avoids nesting +# (i.e. more {}) on the wire. +# +# 2. SocketAddressFlat supports only types 'unix' and 'inet', because +# that's what its current users need. +# +# Since: 2.9 +## +{ + "union": "SocketAddressFlat", + "base": { + "type": "SocketAddressFlatType" + }, + "discriminator": "type", + "data": { + "unix": "UnixSocketAddress", + "inet": "InetSocketAddress" + } +} + ## # @getfd: # @@ -11323,9 +11524,9 @@ # # @name: the name of the machine # -# @alias: #optional an alias for the machine name +# @alias: an alias for the machine name # -# @is-default: #optional whether the machine is default +# @is-default: whether the machine is default # # @cpu-max: maximum number of CPUs supported by the machine type # (since 1.5.0) @@ -11368,7 +11569,7 @@ # # @name: the name of the CPU definition # -# @migration-safe: #optional whether a CPU definition can be safely used for +# @migration-safe: whether a CPU definition can be safely used for # migration in combination with a QEMU compatibility machine # when migrating between different QMU versions and between # hosts with different sets of (hardware or software) @@ -11380,7 +11581,7 @@ # QEMU version, machine type, machine options and accelerator options. # A static model is always migration-safe. (since 2.8) # -# @unavailable-features: #optional List of properties that prevent +# @unavailable-features: List of properties that prevent # the CPU model from running in the current # host. (since 2.8) # @typename: Type name that can be used as argument to @device-list-properties, @@ -11445,7 +11646,7 @@ # However, if required, architectures can expose relevant properties. # # @name: the name of the CPU definition the model is based on -# @props: #optional a dictionary of QOM properties to be applied +# @props: a dictionary of QOM properties to be applied # # Since: 2.8.0 ## @@ -11474,6 +11675,15 @@ # migration-safe, but allows tooling to get an insight and work with # model details. # +# Note: When a non-migration-safe CPU model is expanded in static mode, some +# features enabled by the CPU model may be omitted, because they can't be +# implemented by a static CPU model definition (e.g. cache info passthrough and +# PMU passthrough in x86). If you need an accurate representation of the +# features enabled by a non-migration-safe CPU model, use @full. If you need a +# static representation that will keep ABI compatibility even when changing QEMU +# version or machine-type, use @static (but keep in mind that some features may +# be omitted). +# # Since: 2.8.0 ## { @@ -11732,9 +11942,9 @@ # # Add a file descriptor, that was passed via SCM rights, to an fd set. # -# @fdset-id: #optional The ID of the fd set to add the file descriptor to. +# @fdset-id: The ID of the fd set to add the file descriptor to. # -# @opaque: #optional A free-form string that can be used to describe the fd. +# @opaque: A free-form string that can be used to describe the fd. # # Returns: @AddfdInfo on success # @@ -11770,7 +11980,7 @@ # # @fdset-id: The ID of the fd set that the file descriptor belongs to. # -# @fd: #optional The file descriptor that is to be removed. +# @fd: The file descriptor that is to be removed. # # Returns: Nothing on success # If @fdset-id or @fd is not found, FdNotFound @@ -11803,7 +12013,7 @@ # # @fd: The file descriptor value. # -# @opaque: #optional A free-form string that can be used to describe the fd. +# @opaque: A free-form string that can be used to describe the fd. # # Since: 1.2.0 ## @@ -12097,7 +12307,7 @@ # directly to the guest, while @KeyValue.qcode must be a valid # @QKeyCode value # -# @hold-time: #optional time to delay key up events, milliseconds. Defaults +# @hold-time: time to delay key up events, milliseconds. Defaults # to 100 # # Returns: Nothing on success @@ -12155,8 +12365,8 @@ # # Configuration shared across all chardev backends # -# @logfile: #optional The name of a logfile to save output -# @logappend: #optional true to append instead of truncate +# @logfile: The name of a logfile to save output +# @logappend: true to append instead of truncate # (default to false to truncate) # # Since: 2.6 @@ -12174,9 +12384,9 @@ # # Configuration info for file chardevs. # -# @in: #optional The name of the input file +# @in: The name of the input file # @out: The name of the output file -# @append: #optional Open the file in append mode (default false to +# @append: Open the file in append mode (default false to # truncate) (Since 2.6) # # Since: 1.4 @@ -12216,14 +12426,14 @@ # # @addr: socket address to listen on (server=true) # or connect to (server=false) -# @tls-creds: #optional the ID of the TLS credentials object (since 2.6) -# @server: #optional create server socket (default: true) -# @wait: #optional wait for incoming connection on server +# @tls-creds: the ID of the TLS credentials object (since 2.6) +# @server: create server socket (default: true) +# @wait: wait for incoming connection on server # sockets (default: false). -# @nodelay: #optional set TCP_NODELAY socket option (default: false) -# @telnet: #optional enable telnet protocol on server +# @nodelay: set TCP_NODELAY socket option (default: false) +# @telnet: enable telnet protocol on server # sockets (default: false) -# @reconnect: #optional For a client socket, if a socket is disconnected, +# @reconnect: For a client socket, if a socket is disconnected, # then attempt a reconnect after the given number of seconds. # Setting this to zero disables this function. (default: 0) # (Since: 2.2) @@ -12250,7 +12460,7 @@ # Configuration info for datagram socket chardevs. # # @remote: remote address -# @local: #optional local address +# @local: local address # # Since: 1.5 ## @@ -12285,7 +12495,7 @@ # # Configuration info for stdio chardevs. # -# @signal: #optional Allow signals (such as SIGINT triggered by ^C) +# @signal: Allow signals (such as SIGINT triggered by ^C) # be delivered to qemu. Default: true in -nographic mode, # false otherwise. # @@ -12362,7 +12572,7 @@ # # Configuration info for ring buffer chardevs. # -# @size: #optional ring buffer size, must be power of two, default is 65536 +# @size: ring buffer size, must be power of two, default is 65536 # # Since: 1.5 ## @@ -12379,7 +12589,7 @@ # # Configuration info for the new chardev backend. # -# Since: 1.4 (testdev since 2.2) +# Since: 1.4 (testdev since 2.2, wctablet since 2.9) ## { "union": "ChardevBackend", @@ -12394,6 +12604,7 @@ "null": "ChardevCommon", "mux": "ChardevMux", "msmouse": "ChardevCommon", + "wctablet": "ChardevCommon", "braille": "ChardevCommon", "testdev": "ChardevCommon", "stdio": "ChardevStdio", @@ -12411,7 +12622,7 @@ # # Return info about the chardev backend just created. # -# @pty: #optional name of the slave pseudoterminal device, present if +# @pty: name of the slave pseudoterminal device, present if # and only if a chardev of type 'pty' was created # # Since: 1.4 @@ -12568,9 +12779,9 @@ # # Information about the TPM passthrough type # -# @path: #optional string describing the path used for accessing the TPM device +# @path: string describing the path used for accessing the TPM device # -# @cancel-path: #optional string showing the TPM's sysfs cancel file +# @cancel-path: string showing the TPM's sysfs cancel file # for cancellation of TPM commands while they are executing # # Since: 1.5 @@ -12674,28 +12885,28 @@ # String fields are copied into the matching ACPI member from lowest address # upwards, and silently truncated / NUL-padded to length. # -# @sig: #optional table signature / identifier (4 bytes) +# @sig: table signature / identifier (4 bytes) # -# @rev: #optional table revision number (dependent on signature, 1 byte) +# @rev: table revision number (dependent on signature, 1 byte) # -# @oem_id: #optional OEM identifier (6 bytes) +# @oem_id: OEM identifier (6 bytes) # -# @oem_table_id: #optional OEM table identifier (8 bytes) +# @oem_table_id: OEM table identifier (8 bytes) # -# @oem_rev: #optional OEM-supplied revision number (4 bytes) +# @oem_rev: OEM-supplied revision number (4 bytes) # -# @asl_compiler_id: #optional identifier of the utility that created the table +# @asl_compiler_id: identifier of the utility that created the table # (4 bytes) # -# @asl_compiler_rev: #optional revision number of the utility that created the +# @asl_compiler_rev: revision number of the utility that created the # table (4 bytes) # -# @file: #optional colon (:) separated list of pathnames to load and +# @file: colon (:) separated list of pathnames to load and # concatenate as table data. The resultant binary blob is expected to # have an ACPI table header. At least one file is required. This field # excludes @data. # -# @data: #optional colon (:) separated list of pathnames to load and +# @data: colon (:) separated list of pathnames to load and # concatenate as table data. The resultant binary blob must not have an # ACPI table header. At least one file is required. This field excludes # @file. @@ -12752,9 +12963,9 @@ # # @type: parameter @CommandLineParameterType # -# @help: #optional human readable text string, not suitable for parsing. +# @help: human readable text string, not suitable for parsing. # -# @default: #optional default value string (since 2.1) +# @default: default value string (since 2.1) # # Since: 1.5 ## @@ -12794,7 +13005,7 @@ # # Query command line option schema. # -# @option: #optional option name +# @option: option name # # Returns: list of @CommandLineOptionInfo for all options (or for the given # @option). Returns an error if the given @option doesn't exist. @@ -12861,7 +13072,7 @@ # # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word # -# @cpuid-input-ecx: #optional Input ECX value for CPUID instruction for that +# @cpuid-input-ecx: Input ECX value for CPUID instruction for that # feature word # # @cpuid-register: Output register containing the feature bits @@ -12979,7 +13190,7 @@ # # Return rx-filter information for all NICs (or for the given NIC). # -# @name: #optional net client name +# @name: net client name # # Returns: list of @RxFilterInfo for all NICs (or for the given NIC). # Returns an error if the given @name doesn't exist, or given @@ -13033,6 +13244,10 @@ # # Button of a pointer input device (mouse, tablet). # +# @side: front side button of a 5-button mouse (since 2.9) +# +# @extra: rear side button of a 5-button mouse (since 2.9) +# # Since: 2.0 ## { @@ -13042,7 +13257,9 @@ "middle", "right", "wheel-up", - "wheel-down" + "wheel-down", + "side", + "extra" ] } @@ -13144,8 +13361,8 @@ # # Send input event(s) to guest. # -# @device: #optional display device to send event(s) to. -# @head: #optional head to send event(s) to, in case the +# @device: display device to send event(s) to. +# @head: head to send event(s) to, in case the # display device supports multiple scanouts. # @events: List of InputEvent union. # @@ -13217,6 +13434,18 @@ } } +## +# @NumaOptionsType: +# +# Since: 2.1 +## +{ + "enum": "NumaOptionsType", + "data": [ + "node" + ] +} + ## # @NumaOptions: # @@ -13226,6 +13455,10 @@ ## { "union": "NumaOptions", + "base": { + "type": "NumaOptionsType" + }, + "discriminator": "type", "data": { "node": "NumaNodeOptions" } @@ -13236,16 +13469,16 @@ # # Create a guest NUMA node. (for OptsVisitor) # -# @nodeid: #optional NUMA node ID (increase by 1 from 0 if omitted) +# @nodeid: NUMA node ID (increase by 1 from 0 if omitted) # -# @cpus: #optional VCPUs belonging to this node (assign VCPUS round-robin +# @cpus: VCPUs belonging to this node (assign VCPUS round-robin # if omitted) # -# @mem: #optional memory size of this node; mutually exclusive with @memdev. +# @mem: memory size of this node; mutually exclusive with @memdev. # Equally divide total memory among nodes if both @mem and @memdev are # omitted. # -# @memdev: #optional memory backend object. If specified for one node, +# @memdev: memory backend object. If specified for one node, # it must be specified for all nodes. # # Since: 2.1 @@ -13294,7 +13527,7 @@ # # Information about memory backend # -# @id: #optional backend's ID if backend has 'id' property (since 2.9) +# @id: backend's ID if backend has 'id' property (since 2.9) # # @size: memory backend size # @@ -13371,7 +13604,7 @@ # # PCDIMMDevice state information # -# @id: #optional device's ID +# @id: device's ID # # @addr: physical address, where device is mapped # @@ -13468,7 +13701,7 @@ # For description of possible values of @source and @status fields # see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec. # -# @device: #optional device ID associated with slot +# @device: device ID associated with slot # # @slot: slot ID, unique per slot of a given @slot-type # @@ -13589,6 +13822,56 @@ ] } +## +# @GuestPanicInformationType: +# +# An enumeration of the guest panic information types +# +# Since: 2.9 +## +{ + "enum": "GuestPanicInformationType", + "data": [ + "hyper-v" + ] +} + +## +# @GuestPanicInformation: +# +# Information about a guest panic +# +# Since: 2.9 +## +{ + "union": "GuestPanicInformation", + "base": { + "type": "GuestPanicInformationType" + }, + "discriminator": "type", + "data": { + "hyper-v": "GuestPanicInformationHyperV" + } +} + +## +# @GuestPanicInformationHyperV: +# +# Hyper-V specific guest panic information (HV crash MSRs) +# +# Since: 2.9 +## +{ + "struct": "GuestPanicInformationHyperV", + "data": { + "arg1": "uint64", + "arg2": "uint64", + "arg3": "uint64", + "arg4": "uint64", + "arg5": "uint64" + } +} + ## # @rtc-reset-reinjection: # @@ -13761,26 +14044,26 @@ # # @tbl-id: flow table ID # -# @in-pport: #optional physical input port +# @in-pport: physical input port # -# @tunnel-id: #optional tunnel ID +# @tunnel-id: tunnel ID # -# @vlan-id: #optional VLAN ID +# @vlan-id: VLAN ID # -# @eth-type: #optional Ethernet header type +# @eth-type: Ethernet header type # -# @eth-src: #optional Ethernet header source MAC address +# @eth-src: Ethernet header source MAC address # -# @eth-dst: #optional Ethernet header destination MAC address +# @eth-dst: Ethernet header destination MAC address # -# @ip-proto: #optional IP Header protocol field +# @ip-proto: IP Header protocol field # -# @ip-tos: #optional IP header TOS field +# @ip-tos: IP header TOS field # -# @ip-dst: #optional IP header destination address +# @ip-dst: IP header destination address # -# Note: fields are marked #optional to indicate that they may or may not -# appear in the flow key depending if they're relevant to the flow key. +# Note: optional members may or may not appear in the flow key +# depending if they're relevant to the flow key. # # Since: 2.4 ## @@ -13806,22 +14089,22 @@ # # Rocker switch OF-DPA flow mask # -# @in-pport: #optional physical input port +# @in-pport: physical input port # -# @tunnel-id: #optional tunnel ID +# @tunnel-id: tunnel ID # -# @vlan-id: #optional VLAN ID +# @vlan-id: VLAN ID # -# @eth-src: #optional Ethernet header source MAC address +# @eth-src: Ethernet header source MAC address # -# @eth-dst: #optional Ethernet header destination MAC address +# @eth-dst: Ethernet header destination MAC address # -# @ip-proto: #optional IP Header protocol field +# @ip-proto: IP Header protocol field # -# @ip-tos: #optional IP header TOS field +# @ip-tos: IP header TOS field # -# Note: fields are marked #optional to indicate that they may or may not -# appear in the flow mask depending if they're relevant to the flow mask. +# Note: optional members may or may not appear in the flow mask +# depending if they're relevant to the flow mask. # # Since: 2.4 ## @@ -13843,20 +14126,20 @@ # # Rocker switch OF-DPA flow action # -# @goto-tbl: #optional next table ID +# @goto-tbl: next table ID # -# @group-id: #optional group ID +# @group-id: group ID # -# @tunnel-lport: #optional tunnel logical port ID +# @tunnel-lport: tunnel logical port ID # -# @vlan-id: #optional VLAN ID +# @vlan-id: VLAN ID # -# @new-vlan-id: #optional new VLAN ID +# @new-vlan-id: new VLAN ID # -# @out-pport: #optional physical output port +# @out-pport: physical output port # -# Note: fields are marked #optional to indicate that they may or may not -# appear in the flow action depending if they're relevant to the flow action. +# Note: optional members may or may not appear in the flow action +# depending if they're relevant to the flow action. # # Since: 2.4 ## @@ -13907,7 +14190,7 @@ # # @name: switch name # -# @tbl-id: #optional flow table ID. If tbl-id is not specified, returns +# @tbl-id: flow table ID. If tbl-id is not specified, returns # flow information for all tables. # # Returns: rocker OF-DPA flow information @@ -13948,30 +14231,30 @@ # # @type: group type # -# @vlan-id: #optional VLAN ID +# @vlan-id: VLAN ID # -# @pport: #optional physical port number +# @pport: physical port number # -# @index: #optional group index, unique with group type +# @index: group index, unique with group type # -# @out-pport: #optional output physical port number +# @out-pport: output physical port number # -# @group-id: #optional next group ID +# @group-id: next group ID # -# @set-vlan-id: #optional VLAN ID to set +# @set-vlan-id: VLAN ID to set # -# @pop-vlan: #optional pop VLAN headr from packet +# @pop-vlan: pop VLAN headr from packet # -# @group-ids: #optional list of next group IDs +# @group-ids: list of next group IDs # -# @set-eth-src: #optional set source MAC address in Ethernet header +# @set-eth-src: set source MAC address in Ethernet header # -# @set-eth-dst: #optional set destination MAC address in Ethernet header +# @set-eth-dst: set destination MAC address in Ethernet header # -# @ttl-check: #optional perform TTL check +# @ttl-check: perform TTL check # -# Note: fields are marked #optional to indicate that they may or may not -# appear in the group depending if they're relevant to the group type. +# Note: optional members may or may not appear in the group depending +# if they're relevant to the group type. # # Since: 2.4 ## @@ -14003,7 +14286,7 @@ # # @name: switch name # -# @type: #optional group type. If type is not specified, returns +# @type: group type. If type is not specified, returns # group information for all group types. # # Returns: rocker OF-DPA group information @@ -14091,6 +14374,94 @@ } } +## +# @xen-set-replication: +# +# Enable or disable replication. +# +# @enable: true to enable, false to disable. +# +# @primary: true for primary or false for secondary. +# +# @failover: true to do failover, false to stop. but cannot be +# specified if 'enable' is true. default value is false. +# +# Returns: nothing. +# +# Example: +# +# -> { "execute": "xen-set-replication", +# "arguments": {"enable": true, "primary": false} } +# <- { "return": {} } +# +# Since: 2.9 +## +{ + "command": "xen-set-replication", + "data": { + "enable": "bool", + "primary": "bool", + "*failover": "bool" + } +} + +## +# @ReplicationStatus: +# +# The result format for 'query-xen-replication-status'. +# +# @error: true if an error happened, false if replication is normal. +# +# @desc: the human readable error description string, when +# @error is 'true'. +# +# Since: 2.9 +## +{ + "struct": "ReplicationStatus", + "data": { + "error": "bool", + "*desc": "str" + } +} + +## +# @query-xen-replication-status: +# +# Query replication status while the vm is running. +# +# Returns: A @ReplicationResult object showing the status. +# +# Example: +# +# -> { "execute": "query-xen-replication-status" } +# <- { "return": { "error": false } } +# +# Since: 2.9 +## +{ + "command": "query-xen-replication-status", + "returns": "ReplicationStatus" +} + +## +# @xen-colo-do-checkpoint: +# +# Xen uses this command to notify replication to trigger a checkpoint. +# +# Returns: nothing. +# +# Example: +# +# -> { "execute": "xen-colo-do-checkpoint" } +# <- { "return": {} } +# +# Since: 2.9 +## +{ + "command": "xen-colo-do-checkpoint" +} + ## # @GICCapability: # @@ -14150,10 +14521,10 @@ # it should be passed by management with device_add command when # a CPU is being hotplugged. # -# @node-id: #optional NUMA node ID the CPU belongs to -# @socket-id: #optional socket number within node/board the CPU belongs to -# @core-id: #optional core number within socket the CPU belongs to -# @thread-id: #optional thread number within core the CPU belongs to +# @node-id: NUMA node ID the CPU belongs to +# @socket-id: socket number within node/board the CPU belongs to +# @core-id: core number within socket the CPU belongs to +# @thread-id: thread number within core the CPU belongs to # # Note: currently there are 4 properties that could be present # but management should be prepared to pass through other @@ -14179,7 +14550,7 @@ # @type: CPU object type for usage with device_add command # @props: list of properties to be used for hotplugging CPU # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides -# @qom-path: #optional link to existing CPU object if CPU is present or +# @qom-path: link to existing CPU object if CPU is present or # omitted if CPU is not present. # # Since: 2.7 @@ -14236,4 +14607,32 @@ ] } +## +# @GuidInfo: +# +# GUID information. +# +# @guid: the globally unique identifier +# +# Since: 2.9 +## +{ + "struct": "GuidInfo", + "data": { + "guid": "str" + } +} + +## +# @query-vm-generation-id: +# +# Show Virtual Machine Generation ID +# +# Since 2.9 +## +{ + "command": "query-vm-generation-id", + "returns": "GuidInfo" +} +