go-libvirt-plain/internal/constants/constants.go
Ben LeMasurier 5a1fe4c14a Adds Capabilities()
This adds a new method, Capabilities(), which returns an XML
definition of the hypervisor's system capabilities, much like
`virsh capabilities`.

I've only included integration tests for these two methods due to the
large amount of data returned by the capabilities call.
2016-12-01 14:09:24 -07:00

71 lines
2.2 KiB
Go

// Copyright 2016 The go-libvirt Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Package constants provides shared data for the libvirt package.
package constants
// protocol procedure numbers
const (
ProgramVersion = 1
ProgramRemote = 0x20008086
ProgramQEMU = 0x20008087
ProgramKeepAlive = 0x6b656570
)
// libvirt procedure identifiers
// These are libvirt procedure numbers which correspond to each respective
// API call between remote_internal driver and libvirtd. Although stable.
// Each call is identified by a unique number which *may change at any time*.
//
// Examples:
// REMOTE_PROC_CONNECT_OPEN = 1
// REMOTE_PROC_DOMAIN_DEFINE_XML = 11
// REMOTE_PROC_DOMAIN_MIGRATE_SET_MAX_SPEED = 207,
//
// See:
// https://libvirt.org/git/?p=libvirt.git;a=blob_plain;f=src/remote/remote_protocol.x;hb=HEAD
const (
ProcConnectOpen = 1
ProcConnectClose = 2
ProcConnectGetCapabilties = 7
ProcDomainGetXMLDesc = 14
ProcDomainLookupByName = 23
ProcAuthList = 66
ProcConnectGetLibVersion = 157
ProcDomainMigrateSetMaxSpeed = 207
ProcDomainUndefineFlags = 231
ProcDomainDestroyFlags = 234
ProcConnectListAllDomains = 273
ProcMigratePerformParams = 305
)
// qemu procedure identifiers
const (
QEMUDomainMonitor = 1
QEMUConnectDomainMonitorEventRegister = 4
QEMUConnectDomainMonitorEventDeregister = 5
QEMUDomainMonitorEvent = 6
)
const (
// PacketLengthSize is the packet length, in bytes.
PacketLengthSize = 4
// HeaderSize is the packet header size, in bytes.
HeaderSize = 24
// UUIDSize is the length of a UUID, in bytes.
UUIDSize = 16
)