Commit ffe12556 authored by Daniel P. Berrangé's avatar Daniel P. Berrangé

error: make GetNotImplementedError private

The GetNotImplementedError() method is only for internal use so should
not have a public name.
Signed-off-by: 's avatarDaniel P. Berrangé <berrange@redhat.com>
parent 9cd24ffa
......@@ -857,7 +857,7 @@ func (c *Connect) DomainDefineXML(xmlConfig string) (*Domain, error) {
// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainDefineXMLFlags
func (c *Connect) DomainDefineXMLFlags(xmlConfig string, flags DomainDefineFlags) (*Domain, error) {
if C.LIBVIR_VERSION_NUMBER < 1002012 {
return nil, GetNotImplementedError("virDomainDefineXMLFlags")
return nil, makeNotImplementedError("virDomainDefineXMLFlags")
}
cXml := C.CString(string(xmlConfig))
defer C.free(unsafe.Pointer(cXml))
......@@ -1266,7 +1266,7 @@ func (c *Connect) LookupStoragePoolByUUID(uuid []byte) (*StoragePool, error) {
// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolLookupByTargetPath
func (c *Connect) LookupStoragePoolByTargetPath(path string) (*StoragePool, error) {
if C.LIBVIR_VERSION_NUMBER < 4001000 {
return nil, GetNotImplementedError("virStoragePoolLookupByTargetPath")
return nil, makeNotImplementedError("virStoragePoolLookupByTargetPath")
}
cPath := C.CString(path)
defer C.free(unsafe.Pointer(cPath))
......@@ -1335,7 +1335,7 @@ func (c *Connect) LookupNWFilterByUUID(uuid []byte) (*NWFilter, error) {
// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterBindingLookupByPortDev
func (c *Connect) LookupNWFilterBindingByPortDev(name string) (*NWFilterBinding, error) {
if C.LIBVIR_VERSION_NUMBER < 4005000 {
return nil, GetNotImplementedError("virNWFilterBindingLookupByPortDev")
return nil, makeNotImplementedError("virNWFilterBindingLookupByPortDev")
}
cName := C.CString(name)
defer C.free(unsafe.Pointer(cName))
......@@ -1555,7 +1555,7 @@ func (c *Connect) ListAllNWFilters(flags uint32) ([]NWFilter, error) {
func (c *Connect) ListAllNWFilterBindings(flags uint32) ([]NWFilterBinding, error) {
var cList *C.virNWFilterBindingPtr
if C.LIBVIR_VERSION_NUMBER < 4005000 {
return []NWFilterBinding{}, GetNotImplementedError("virConnectListAllNWFilterBindings")
return []NWFilterBinding{}, makeNotImplementedError("virConnectListAllNWFilterBindings")
}
var err C.virError
numNWFilters := C.virConnectListAllNWFilterBindingsWrapper(c.ptr, (**C.virNWFilterBindingPtr)(&cList), C.uint(flags), &err)
......@@ -1675,7 +1675,7 @@ func (c *Connect) InterfaceChangeRollback(flags uint32) error {
// See also https://libvirt.org/html/libvirt-libvirt-host.html#virNodeAllocPages
func (c *Connect) AllocPages(pageSizes map[int]int64, startCell int, cellCount uint, flags NodeAllocPagesFlags) (int, error) {
if C.LIBVIR_VERSION_NUMBER < 1002009 {
return 0, GetNotImplementedError("virNodeAllocPages")
return 0, makeNotImplementedError("virNodeAllocPages")
}
cpages := make([]C.uint, len(pageSizes))
ccounts := make([]C.ulonglong, len(pageSizes))
......@@ -1812,7 +1812,7 @@ func (c *Connect) GetFreeMemory() (uint64, error) {
// See also https://libvirt.org/html/libvirt-libvirt-host.html#virNodeGetFreePages
func (c *Connect) GetFreePages(pageSizes []uint64, startCell int, maxCells uint, flags uint32) ([]uint64, error) {
if C.LIBVIR_VERSION_NUMBER < 1002006 {
return []uint64{}, GetNotImplementedError("virNodeGetFreePages")
return []uint64{}, makeNotImplementedError("virNodeGetFreePages")
}
cpageSizes := make([]C.uint, len(pageSizes))
ccounts := make([]C.ulonglong, len(pageSizes)*int(maxCells))
......@@ -2087,7 +2087,7 @@ func (c *Connect) BaselineCPU(xmlCPUs []string, flags ConnectBaselineCPUFlags) (
// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectBaselineHypervisorCPU
func (c *Connect) BaselineHypervisorCPU(emulator string, arch string, machine string, virttype string, xmlCPUs []string, flags ConnectBaselineCPUFlags) (string, error) {
if C.LIBVIR_VERSION_NUMBER < 4004000 {
return "", GetNotImplementedError("virConnectBaselineHypervisorCPU")
return "", makeNotImplementedError("virConnectBaselineHypervisorCPU")
}
var cemulator, carch, cmachine, cvirttype *C.char
......@@ -2142,7 +2142,7 @@ func (c *Connect) CompareCPU(xmlDesc string, flags ConnectCompareCPUFlags) (CPUC
// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectCompareHypervisorCPU
func (c *Connect) CompareHypervisorCPU(emulator string, arch string, machine string, virttype string, xmlDesc string, flags ConnectCompareCPUFlags) (CPUCompareResult, error) {
if C.LIBVIR_VERSION_NUMBER < 4004000 {
return CPU_COMPARE_ERROR, GetNotImplementedError("virConnectCompareHypervisorCPU")
return CPU_COMPARE_ERROR, makeNotImplementedError("virConnectCompareHypervisorCPU")
}
var cemulator, carch, cmachine, cvirttype *C.char
......@@ -2238,7 +2238,7 @@ func (c *Connect) GetCPUModelNames(arch string, flags uint32) ([]string, error)
// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectGetDomainCapabilities
func (c *Connect) GetDomainCapabilities(emulatorbin string, arch string, machine string, virttype string, flags uint32) (string, error) {
if C.LIBVIR_VERSION_NUMBER < 1002007 {
return "", GetNotImplementedError("virConnectGetDomainCapabilities")
return "", makeNotImplementedError("virConnectGetDomainCapabilities")
}
var cemulatorbin *C.char
if emulatorbin != "" {
......@@ -2776,7 +2776,7 @@ func getDomainStatsLengthsFieldInfo(params *domainStatsLengths) map[string]typed
// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectGetAllDomainStats
func (c *Connect) GetAllDomainStats(doms []*Domain, statsTypes DomainStatsTypes, flags ConnectGetAllDomainStatsFlags) ([]DomainStats, error) {
if C.LIBVIR_VERSION_NUMBER < 1002008 {
return []DomainStats{}, GetNotImplementedError("virConnectGetAllDomainStats")
return []DomainStats{}, makeNotImplementedError("virConnectGetAllDomainStats")
}
var ret C.int
var cstats *C.virDomainStatsRecordPtr
......@@ -2953,7 +2953,7 @@ func getNodeSEVFieldInfo(params *NodeSEVParameters) map[string]typedParamsFieldI
// See also https://libvirt.org/html/libvirt-libvirt-host.html#virNodeGetSEVInfo
func (c *Connect) GetSEVInfo(flags uint32) (*NodeSEVParameters, error) {
if C.LIBVIR_VERSION_NUMBER < 4005000 {
return nil, GetNotImplementedError("virNodeGetSEVInfo")
return nil, makeNotImplementedError("virNodeGetSEVInfo")
}
params := &NodeSEVParameters{}
......@@ -2981,7 +2981,7 @@ func (c *Connect) GetSEVInfo(flags uint32) (*NodeSEVParameters, error) {
// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virNWFilterBindingCreateXML
func (c *Connect) NWFilterBindingCreateXML(xmlConfig string, flags uint32) (*NWFilterBinding, error) {
if C.LIBVIR_VERSION_NUMBER < 4005000 {
return nil, GetNotImplementedError("virNWFilterBindingCreateXML")
return nil, makeNotImplementedError("virNWFilterBindingCreateXML")
}
cXml := C.CString(string(xmlConfig))
defer C.free(unsafe.Pointer(cXml))
......
This diff is collapsed.
......@@ -594,7 +594,7 @@ func makeError(err *C.virError) Error {
return ret
}
func GetNotImplementedError(apiname string) Error {
func makeNotImplementedError(apiname string) Error {
return Error{
Code: ERR_NO_SUPPORT,
Domain: FROM_NONE,
......
......@@ -141,7 +141,7 @@ func DomainLxcEnterSecurityLabel(model *NodeSecurityModel, label *SecurityLabel,
func (d *Domain) DomainLxcEnterCGroup(flags uint32) error {
if C.LIBVIR_VERSION_NUMBER < 2000000 {
return GetNotImplementedError("virDomainLxcEnterCGroup")
return makeNotImplementedError("virDomainLxcEnterCGroup")
}
var err C.virError
......
......@@ -301,7 +301,7 @@ func (n *Network) Update(cmd NetworkUpdateCommand, section NetworkUpdateSection,
// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetDHCPLeases
func (n *Network) GetDHCPLeases() ([]NetworkDHCPLease, error) {
if C.LIBVIR_VERSION_NUMBER < 1002006 {
return []NetworkDHCPLease{}, GetNotImplementedError("virNetworkGetDHCPLeases")
return []NetworkDHCPLease{}, makeNotImplementedError("virNetworkGetDHCPLeases")
}
var cLeases *C.virNetworkDHCPLeasePtr
var err C.virError
......
......@@ -69,7 +69,7 @@ func networkEventLifecycleCallback(c C.virConnectPtr, n C.virNetworkPtr,
func (c *Connect) NetworkEventLifecycleRegister(net *Network, callback NetworkEventLifecycleCallback) (int, error) {
goCallBackId := registerCallbackId(callback)
if C.LIBVIR_VERSION_NUMBER < 1002001 {
return 0, GetNotImplementedError("virConnectNetworkEventRegisterAny")
return 0, makeNotImplementedError("virConnectNetworkEventRegisterAny")
}
callbackPtr := unsafe.Pointer(C.networkEventLifecycleCallbackHelper)
......@@ -91,7 +91,7 @@ func (c *Connect) NetworkEventLifecycleRegister(net *Network, callback NetworkEv
func (c *Connect) NetworkEventDeregister(callbackId int) error {
if C.LIBVIR_VERSION_NUMBER < 1002001 {
return GetNotImplementedError("virConnectNetworkEventDeregisterAny")
return makeNotImplementedError("virConnectNetworkEventDeregisterAny")
}
// Deregister the callback
var err C.virError
......
......@@ -85,7 +85,7 @@ func nodeDeviceEventGenericCallback(c C.virConnectPtr, d C.virNodeDevicePtr,
func (c *Connect) NodeDeviceEventLifecycleRegister(device *NodeDevice, callback NodeDeviceEventLifecycleCallback) (int, error) {
if C.LIBVIR_VERSION_NUMBER < 2002000 {
return 0, GetNotImplementedError("virConnectNodeDeviceEventRegisterAny")
return 0, makeNotImplementedError("virConnectNodeDeviceEventRegisterAny")
}
goCallBackId := registerCallbackId(callback)
......@@ -128,7 +128,7 @@ func (c *Connect) NodeDeviceEventUpdateRegister(device *NodeDevice, callback Nod
func (c *Connect) NodeDeviceEventDeregister(callbackId int) error {
if C.LIBVIR_VERSION_NUMBER < 2002000 {
return GetNotImplementedError("virConnectNodeDeviceEventDeregisterAny")
return makeNotImplementedError("virConnectNodeDeviceEventDeregisterAny")
}
// Deregister the callback
var err C.virError
......
......@@ -43,7 +43,7 @@ type NWFilterBinding struct {
// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterBindingFree
func (f *NWFilterBinding) Free() error {
if C.LIBVIR_VERSION_NUMBER < 4005000 {
return GetNotImplementedError("virNWFilterBindingFree")
return makeNotImplementedError("virNWFilterBindingFree")
}
var err C.virError
ret := C.virNWFilterBindingFreeWrapper(f.ptr, &err)
......@@ -56,7 +56,7 @@ func (f *NWFilterBinding) Free() error {
// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterBindingRef
func (c *NWFilterBinding) Ref() error {
if C.LIBVIR_VERSION_NUMBER < 4005000 {
return GetNotImplementedError("virNWFilterBindingRef")
return makeNotImplementedError("virNWFilterBindingRef")
}
var err C.virError
ret := C.virNWFilterBindingRefWrapper(c.ptr, &err)
......@@ -69,7 +69,7 @@ func (c *NWFilterBinding) Ref() error {
// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterBindingDelete
func (f *NWFilterBinding) Delete() error {
if C.LIBVIR_VERSION_NUMBER < 4005000 {
return GetNotImplementedError("virNWFilterBindingDelete")
return makeNotImplementedError("virNWFilterBindingDelete")
}
var err C.virError
result := C.virNWFilterBindingDeleteWrapper(f.ptr, &err)
......@@ -82,7 +82,7 @@ func (f *NWFilterBinding) Delete() error {
// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterBindingGetPortDev
func (f *NWFilterBinding) GetPortDev() (string, error) {
if C.LIBVIR_VERSION_NUMBER < 4005000 {
return "", GetNotImplementedError("virNWFilterBindingGetPortDev")
return "", makeNotImplementedError("virNWFilterBindingGetPortDev")
}
var err C.virError
result := C.virNWFilterBindingGetPortDevWrapper(f.ptr, &err)
......@@ -97,7 +97,7 @@ func (f *NWFilterBinding) GetPortDev() (string, error) {
// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterBindingGetFilterName
func (f *NWFilterBinding) GetFilterName() (string, error) {
if C.LIBVIR_VERSION_NUMBER < 4005000 {
return "", GetNotImplementedError("virNWFilterBindingGetFilterName")
return "", makeNotImplementedError("virNWFilterBindingGetFilterName")
}
var err C.virError
result := C.virNWFilterBindingGetFilterNameWrapper(f.ptr, &err)
......@@ -112,7 +112,7 @@ func (f *NWFilterBinding) GetFilterName() (string, error) {
// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterBindingGetXMLDesc
func (f *NWFilterBinding) GetXMLDesc(flags uint32) (string, error) {
if C.LIBVIR_VERSION_NUMBER < 4005000 {
return "", GetNotImplementedError("virNWFilterBindingGetXMLDesc")
return "", makeNotImplementedError("virNWFilterBindingGetXMLDesc")
}
var err C.virError
result := C.virNWFilterBindingGetXMLDescWrapper(f.ptr, C.uint(flags), &err)
......
......@@ -151,7 +151,7 @@ func domainQemuMonitorEventCallback(c C.virConnectPtr, d C.virDomainPtr,
func (c *Connect) DomainQemuMonitorEventRegister(dom *Domain, event string, callback DomainQemuMonitorEventCallback, flags DomainQemuMonitorEventFlags) (int, error) {
if C.LIBVIR_VERSION_NUMBER < 1002003 {
return 0, GetNotImplementedError("virConnectDomainQemuMonitorEventRegister")
return 0, makeNotImplementedError("virConnectDomainQemuMonitorEventRegister")
}
cEvent := C.CString(event)
......@@ -176,7 +176,7 @@ func (c *Connect) DomainQemuMonitorEventRegister(dom *Domain, event string, call
func (c *Connect) DomainQemuEventDeregister(callbackId int) error {
if C.LIBVIR_VERSION_NUMBER < 1002003 {
return GetNotImplementedError("virConnectDomainQemuMonitorEventDeregister")
return makeNotImplementedError("virConnectDomainQemuMonitorEventDeregister")
}
// Deregister the callback
......
......@@ -86,7 +86,7 @@ func secretEventGenericCallback(c C.virConnectPtr, n C.virSecretPtr,
func (c *Connect) SecretEventLifecycleRegister(secret *Secret, callback SecretEventLifecycleCallback) (int, error) {
goCallBackId := registerCallbackId(callback)
if C.LIBVIR_VERSION_NUMBER < 3000000 {
return 0, GetNotImplementedError("virConnectSecretEventRegisterAny")
return 0, makeNotImplementedError("virConnectSecretEventRegisterAny")
}
callbackPtr := unsafe.Pointer(C.secretEventLifecycleCallbackHelper)
......@@ -109,7 +109,7 @@ func (c *Connect) SecretEventLifecycleRegister(secret *Secret, callback SecretEv
func (c *Connect) SecretEventValueChangedRegister(secret *Secret, callback SecretEventGenericCallback) (int, error) {
goCallBackId := registerCallbackId(callback)
if C.LIBVIR_VERSION_NUMBER < 3000000 {
return 0, GetNotImplementedError("virConnectSecretEventRegisterAny")
return 0, makeNotImplementedError("virConnectSecretEventRegisterAny")
}
callbackPtr := unsafe.Pointer(C.secretEventGenericCallbackHelper)
......@@ -131,7 +131,7 @@ func (c *Connect) SecretEventValueChangedRegister(secret *Secret, callback Secre
func (c *Connect) SecretEventDeregister(callbackId int) error {
if C.LIBVIR_VERSION_NUMBER < 3000000 {
return GetNotImplementedError("virConnectSecretEventDeregisterAny")
return makeNotImplementedError("virConnectSecretEventDeregisterAny")
}
// Deregister the callback
var err C.virError
......
......@@ -85,7 +85,7 @@ func storagePoolEventGenericCallback(c C.virConnectPtr, s C.virStoragePoolPtr,
func (c *Connect) StoragePoolEventLifecycleRegister(pool *StoragePool, callback StoragePoolEventLifecycleCallback) (int, error) {
if C.LIBVIR_VERSION_NUMBER < 2000000 {
return 0, GetNotImplementedError("virConnectStoragePoolEventRegisterAny")
return 0, makeNotImplementedError("virConnectStoragePoolEventRegisterAny")
}
goCallBackId := registerCallbackId(callback)
......@@ -109,7 +109,7 @@ func (c *Connect) StoragePoolEventLifecycleRegister(pool *StoragePool, callback
func (c *Connect) StoragePoolEventRefreshRegister(pool *StoragePool, callback StoragePoolEventGenericCallback) (int, error) {
if C.LIBVIR_VERSION_NUMBER < 2000000 {
return 0, GetNotImplementedError("virConnectStoragePoolEventRegisterAny")
return 0, makeNotImplementedError("virConnectStoragePoolEventRegisterAny")
}
goCallBackId := registerCallbackId(callback)
......@@ -133,7 +133,7 @@ func (c *Connect) StoragePoolEventRefreshRegister(pool *StoragePool, callback St
func (c *Connect) StoragePoolEventDeregister(callbackId int) error {
if C.LIBVIR_VERSION_NUMBER < 2000000 {
return GetNotImplementedError("virConnectStoragePoolEventDeregisterAny")
return makeNotImplementedError("virConnectStoragePoolEventDeregisterAny")
}
// Deregister the callback
......
......@@ -169,7 +169,7 @@ func (v *StorageVol) GetInfo() (*StorageVolInfo, error) {
// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolGetInfoFlags
func (v *StorageVol) GetInfoFlags(flags StorageVolInfoFlags) (*StorageVolInfo, error) {
if C.LIBVIR_VERSION_NUMBER < 3000000 {
return nil, GetNotImplementedError("virStorageVolGetInfoFlags")
return nil, makeNotImplementedError("virStorageVolGetInfoFlags")
}
var cinfo C.virStorageVolInfo
......
......@@ -121,7 +121,7 @@ func (v *Stream) Recv(p []byte) (int, error) {
// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamRecvFlags
func (v *Stream) RecvFlags(p []byte, flags StreamRecvFlagsValues) (int, error) {
if C.LIBVIR_VERSION_NUMBER < 3004000 {
return 0, GetNotImplementedError("virStreamRecvFlags")
return 0, makeNotImplementedError("virStreamRecvFlags")
}
var err C.virError
......@@ -139,7 +139,7 @@ func (v *Stream) RecvFlags(p []byte, flags StreamRecvFlagsValues) (int, error) {
// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamRecvHole
func (v *Stream) RecvHole(flags uint) (int64, error) {
if C.LIBVIR_VERSION_NUMBER < 3004000 {
return 0, GetNotImplementedError("virStreamSparseRecvHole")
return 0, makeNotImplementedError("virStreamSparseRecvHole")
}
var len C.longlong
......@@ -169,7 +169,7 @@ func (v *Stream) Send(p []byte) (int, error) {
// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamSendHole
func (v *Stream) SendHole(len int64, flags uint32) error {
if C.LIBVIR_VERSION_NUMBER < 3004000 {
return GetNotImplementedError("virStreamSendHole")
return makeNotImplementedError("virStreamSendHole")
}
var err C.virError
......@@ -242,7 +242,7 @@ func (v *Stream) RecvAll(handler StreamSinkFunc) error {
// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamSparseRecvAll
func (v *Stream) SparseRecvAll(handler StreamSinkFunc, holeHandler StreamSinkHoleFunc) error {
if C.LIBVIR_VERSION_NUMBER < 3004000 {
return GetNotImplementedError("virStreamSparseSendAll")
return makeNotImplementedError("virStreamSparseSendAll")
}
callbackID := registerCallbackId(handler)
......@@ -349,7 +349,7 @@ func (v *Stream) SendAll(handler StreamSourceFunc) error {
// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamSparseSendAll
func (v *Stream) SparseSendAll(handler StreamSourceFunc, holeHandler StreamSourceHoleFunc, skipHandler StreamSourceSkipFunc) error {
if C.LIBVIR_VERSION_NUMBER < 3004000 {
return GetNotImplementedError("virStreamSparseSendAll")
return makeNotImplementedError("virStreamSparseSendAll")
}
callbackID := registerCallbackId(handler)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment