Commit a9b16202 authored by Daniel P. Berrange's avatar Daniel P. Berrange

Remove VIR_ prefix on all constants

Signed-off-by: 's avatarDaniel P. Berrange <berrange@redhat.com>
parent 228de8fc
This diff is collapsed.
......@@ -405,7 +405,7 @@ func TestDomainCreateXML(t *testing.T) {
<type>hvm</type>
</os>
</domain>`
dom, err := conn.DomainCreateXML(xml, VIR_DOMAIN_NONE)
dom, err := conn.DomainCreateXML(xml, DOMAIN_NONE)
if err != nil {
t.Error(err)
return
......@@ -860,7 +860,7 @@ func TestLookupStorageVolByKey(t *testing.T) {
return
}
defer func() {
vol.Delete(VIR_STORAGE_VOL_DELETE_NORMAL)
vol.Delete(STORAGE_VOL_DELETE_NORMAL)
vol.Free()
}()
vol2, err := conn.LookupStorageVolByKey(defVolKey)
......@@ -902,7 +902,7 @@ func TestLookupStorageVolByPath(t *testing.T) {
return
}
defer func() {
vol.Delete(VIR_STORAGE_VOL_DELETE_NORMAL)
vol.Delete(STORAGE_VOL_DELETE_NORMAL)
vol.Free()
}()
vol2, err := conn.LookupStorageVolByPath(defVolPath)
......@@ -928,7 +928,7 @@ func TestListAllDomains(t *testing.T) {
t.Errorf("CloseConnection() == %d, expected 0", res)
}
}()
doms, err := conn.ListAllDomains(VIR_CONNECT_LIST_DOMAINS_PERSISTENT)
doms, err := conn.ListAllDomains(CONNECT_LIST_DOMAINS_PERSISTENT)
if err != nil {
t.Error(err)
return
......@@ -963,7 +963,7 @@ func TestListAllNetworks(t *testing.T) {
t.Errorf("CloseConnection() == %d, expected 0", res)
}
}()
nets, err := conn.ListAllNetworks(VIR_CONNECT_LIST_NETWORKS_INACTIVE)
nets, err := conn.ListAllNetworks(CONNECT_LIST_NETWORKS_INACTIVE)
if err != nil {
t.Fatal(err)
}
......@@ -993,7 +993,7 @@ func TestListAllStoragePools(t *testing.T) {
t.Errorf("CloseConnection() == %d, expected 0", res)
}
}()
pools, err := conn.ListAllStoragePools(VIR_CONNECT_LIST_STORAGE_POOLS_INACTIVE)
pools, err := conn.ListAllStoragePools(CONNECT_LIST_STORAGE_POOLS_INACTIVE)
if err != nil {
t.Fatal(err)
}
......
This diff is collapsed.
......@@ -397,33 +397,33 @@ func (c *Connect) DomainEventRegister(dom Domain,
goCallBackId := registerCallbackId(context)
switch eventId {
case VIR_DOMAIN_EVENT_ID_LIFECYCLE:
case DOMAIN_EVENT_ID_LIFECYCLE:
callbackPtr = unsafe.Pointer(C.domainEventLifecycleCallback_cgo)
case VIR_DOMAIN_EVENT_ID_REBOOT, VIR_DOMAIN_EVENT_ID_CONTROL_ERROR:
case DOMAIN_EVENT_ID_REBOOT, DOMAIN_EVENT_ID_CONTROL_ERROR:
callbackPtr = unsafe.Pointer(C.domainEventGenericCallback_cgo)
case VIR_DOMAIN_EVENT_ID_RTC_CHANGE:
case DOMAIN_EVENT_ID_RTC_CHANGE:
callbackPtr = unsafe.Pointer(C.domainEventRTCChangeCallback_cgo)
case VIR_DOMAIN_EVENT_ID_WATCHDOG:
case DOMAIN_EVENT_ID_WATCHDOG:
callbackPtr = unsafe.Pointer(C.domainEventWatchdogCallback_cgo)
case VIR_DOMAIN_EVENT_ID_IO_ERROR:
case DOMAIN_EVENT_ID_IO_ERROR:
callbackPtr = unsafe.Pointer(C.domainEventIOErrorCallback_cgo)
case VIR_DOMAIN_EVENT_ID_GRAPHICS:
case DOMAIN_EVENT_ID_GRAPHICS:
callbackPtr = unsafe.Pointer(C.domainEventGraphicsCallback_cgo)
case VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON:
case DOMAIN_EVENT_ID_IO_ERROR_REASON:
callbackPtr = unsafe.Pointer(C.domainEventIOErrorReasonCallback_cgo)
case VIR_DOMAIN_EVENT_ID_BLOCK_JOB:
case DOMAIN_EVENT_ID_BLOCK_JOB:
// TODO Post 1.2.4, uncomment later
// case VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2:
// case DOMAIN_EVENT_ID_BLOCK_JOB_2:
callbackPtr = unsafe.Pointer(C.domainEventBlockJobCallback_cgo)
case VIR_DOMAIN_EVENT_ID_DISK_CHANGE:
case DOMAIN_EVENT_ID_DISK_CHANGE:
callbackPtr = unsafe.Pointer(C.domainEventDiskChangeCallback_cgo)
case VIR_DOMAIN_EVENT_ID_TRAY_CHANGE:
case DOMAIN_EVENT_ID_TRAY_CHANGE:
callbackPtr = unsafe.Pointer(C.domainEventTrayChangeCallback_cgo)
case VIR_DOMAIN_EVENT_ID_PMWAKEUP, VIR_DOMAIN_EVENT_ID_PMSUSPEND, VIR_DOMAIN_EVENT_ID_PMSUSPEND_DISK:
case DOMAIN_EVENT_ID_PMWAKEUP, DOMAIN_EVENT_ID_PMSUSPEND, DOMAIN_EVENT_ID_PMSUSPEND_DISK:
callbackPtr = unsafe.Pointer(C.domainEventReasonCallback_cgo)
case VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE:
case DOMAIN_EVENT_ID_BALLOON_CHANGE:
callbackPtr = unsafe.Pointer(C.domainEventBalloonChangeCallback_cgo)
case VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED:
case DOMAIN_EVENT_ID_DEVICE_REMOVED:
callbackPtr = unsafe.Pointer(C.domainEventDeviceRemovedCallback_cgo)
default:
}
......@@ -448,98 +448,98 @@ func (c *Connect) DomainEventDeregister(callbackId int) error {
func (e DomainLifecycleEvent) String() string {
var detail, event string
switch e.Event {
case VIR_DOMAIN_EVENT_DEFINED:
case DOMAIN_EVENT_DEFINED:
event = "defined"
switch DomainEventDefinedDetailType(e.Detail) {
case VIR_DOMAIN_EVENT_DEFINED_ADDED:
case DOMAIN_EVENT_DEFINED_ADDED:
detail = "added"
case VIR_DOMAIN_EVENT_DEFINED_UPDATED:
case DOMAIN_EVENT_DEFINED_UPDATED:
detail = "updated"
default:
detail = "unknown"
}
case VIR_DOMAIN_EVENT_UNDEFINED:
case DOMAIN_EVENT_UNDEFINED:
event = "undefined"
switch DomainEventUndefinedDetailType(e.Detail) {
case VIR_DOMAIN_EVENT_UNDEFINED_REMOVED:
case DOMAIN_EVENT_UNDEFINED_REMOVED:
detail = "removed"
default:
detail = "unknown"
}
case VIR_DOMAIN_EVENT_STARTED:
case DOMAIN_EVENT_STARTED:
event = "started"
switch DomainEventStartedDetailType(e.Detail) {
case VIR_DOMAIN_EVENT_STARTED_BOOTED:
case DOMAIN_EVENT_STARTED_BOOTED:
detail = "booted"
case VIR_DOMAIN_EVENT_STARTED_MIGRATED:
case DOMAIN_EVENT_STARTED_MIGRATED:
detail = "migrated"
case VIR_DOMAIN_EVENT_STARTED_RESTORED:
case DOMAIN_EVENT_STARTED_RESTORED:
detail = "restored"
case VIR_DOMAIN_EVENT_STARTED_FROM_SNAPSHOT:
case DOMAIN_EVENT_STARTED_FROM_SNAPSHOT:
detail = "snapshot"
default:
detail = "unknown"
}
case VIR_DOMAIN_EVENT_SUSPENDED:
case DOMAIN_EVENT_SUSPENDED:
event = "suspended"
switch DomainEventSuspendedDetailType(e.Detail) {
case VIR_DOMAIN_EVENT_SUSPENDED_PAUSED:
case DOMAIN_EVENT_SUSPENDED_PAUSED:
detail = "paused"
case VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED:
case DOMAIN_EVENT_SUSPENDED_MIGRATED:
detail = "migrated"
case VIR_DOMAIN_EVENT_SUSPENDED_IOERROR:
case DOMAIN_EVENT_SUSPENDED_IOERROR:
detail = "I/O error"
case VIR_DOMAIN_EVENT_SUSPENDED_WATCHDOG:
case DOMAIN_EVENT_SUSPENDED_WATCHDOG:
detail = "watchdog"
case VIR_DOMAIN_EVENT_SUSPENDED_RESTORED:
case DOMAIN_EVENT_SUSPENDED_RESTORED:
detail = "restored"
case VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT:
case DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT:
detail = "snapshot"
default:
detail = "unknown"
}
case VIR_DOMAIN_EVENT_RESUMED:
case DOMAIN_EVENT_RESUMED:
event = "resumed"
switch DomainEventResumedDetailType(e.Detail) {
case VIR_DOMAIN_EVENT_RESUMED_UNPAUSED:
case DOMAIN_EVENT_RESUMED_UNPAUSED:
detail = "unpaused"
case VIR_DOMAIN_EVENT_RESUMED_MIGRATED:
case DOMAIN_EVENT_RESUMED_MIGRATED:
detail = "migrated"
case VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT:
case DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT:
detail = "snapshot"
default:
detail = "unknown"
}
case VIR_DOMAIN_EVENT_STOPPED:
case DOMAIN_EVENT_STOPPED:
event = "stopped"
switch DomainEventStoppedDetailType(e.Detail) {
case VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN:
case DOMAIN_EVENT_STOPPED_SHUTDOWN:
detail = "shutdown"
case VIR_DOMAIN_EVENT_STOPPED_DESTROYED:
case DOMAIN_EVENT_STOPPED_DESTROYED:
detail = "destroyed"
case VIR_DOMAIN_EVENT_STOPPED_CRASHED:
case DOMAIN_EVENT_STOPPED_CRASHED:
detail = "crashed"
case VIR_DOMAIN_EVENT_STOPPED_MIGRATED:
case DOMAIN_EVENT_STOPPED_MIGRATED:
detail = "migrated"
case VIR_DOMAIN_EVENT_STOPPED_SAVED:
case DOMAIN_EVENT_STOPPED_SAVED:
detail = "saved"
case VIR_DOMAIN_EVENT_STOPPED_FAILED:
case DOMAIN_EVENT_STOPPED_FAILED:
detail = "failed"
case VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT:
case DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT:
detail = "snapshot"
default:
detail = "unknown"
}
case VIR_DOMAIN_EVENT_SHUTDOWN:
case DOMAIN_EVENT_SHUTDOWN:
event = "shutdown"
switch DomainEventShutdownDetailType(e.Detail) {
case VIR_DOMAIN_EVENT_SHUTDOWN_FINISHED:
case DOMAIN_EVENT_SHUTDOWN_FINISHED:
detail = "finished"
default:
detail = "unknown"
......@@ -568,11 +568,11 @@ func (e DomainIOErrorEvent) String() string {
func (e DomainGraphicsEvent) String() string {
var phase string
switch e.Phase {
case VIR_DOMAIN_EVENT_GRAPHICS_CONNECT:
case DOMAIN_EVENT_GRAPHICS_CONNECT:
phase = "connected"
case VIR_DOMAIN_EVENT_GRAPHICS_INITIALIZE:
case DOMAIN_EVENT_GRAPHICS_INITIALIZE:
phase = "initialized"
case VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT:
case DOMAIN_EVENT_GRAPHICS_DISCONNECT:
phase = "disconnected"
default:
phase = "unknown"
......
......@@ -33,7 +33,7 @@ func TestDomainEventRegister(t *testing.T) {
callback := DomainEventCallback(
func(c *Connect, d *Domain, eventDetails interface{}, f func()) int {
if lifecycleEvent, ok := eventDetails.(DomainLifecycleEvent); ok {
if lifecycleEvent.Event == VIR_DOMAIN_EVENT_STARTED {
if lifecycleEvent.Event == DOMAIN_EVENT_STARTED {
domName, _ := d.GetName()
if defName != domName {
t.Fatalf("Name was not '%s': %s", defName, domName)
......@@ -54,7 +54,7 @@ func TestDomainEventRegister(t *testing.T) {
callbackId = conn.DomainEventRegister(
Domain{},
VIR_DOMAIN_EVENT_ID_LIFECYCLE,
DOMAIN_EVENT_ID_LIFECYCLE,
&callback,
func() {
nbEvents++
......@@ -69,7 +69,7 @@ func TestDomainEventRegister(t *testing.T) {
<type>hvm</type>
</os>
</domain>`
dom, err := conn.DomainCreateXML(xml, VIR_DOMAIN_NONE)
dom, err := conn.DomainCreateXML(xml, DOMAIN_NONE)
if err != nil {
t.Error(err)
return
......
......@@ -16,47 +16,47 @@ import (
type DomainSnapshotCreateFlags int
const (
VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE)
VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT)
VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA)
VIR_DOMAIN_SNAPSHOT_CREATE_HALT = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_HALT)
VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY)
VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT)
VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE)
VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC)
VIR_DOMAIN_SNAPSHOT_CREATE_LIVE = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_LIVE)
DOMAIN_SNAPSHOT_CREATE_REDEFINE = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE)
DOMAIN_SNAPSHOT_CREATE_CURRENT = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT)
DOMAIN_SNAPSHOT_CREATE_NO_METADATA = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA)
DOMAIN_SNAPSHOT_CREATE_HALT = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_HALT)
DOMAIN_SNAPSHOT_CREATE_DISK_ONLY = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY)
DOMAIN_SNAPSHOT_CREATE_REUSE_EXT = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT)
DOMAIN_SNAPSHOT_CREATE_QUIESCE = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE)
DOMAIN_SNAPSHOT_CREATE_ATOMIC = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC)
DOMAIN_SNAPSHOT_CREATE_LIVE = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_LIVE)
)
type DomainSnapshotListFlags int
const (
VIR_DOMAIN_SNAPSHOT_LIST_ROOTS = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_ROOTS)
VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS)
VIR_DOMAIN_SNAPSHOT_LIST_LEAVES = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_LEAVES)
VIR_DOMAIN_SNAPSHOT_LIST_NO_LEAVES = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_NO_LEAVES)
VIR_DOMAIN_SNAPSHOT_LIST_METADATA = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_METADATA)
VIR_DOMAIN_SNAPSHOT_LIST_NO_METADATA = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_NO_METADATA)
VIR_DOMAIN_SNAPSHOT_LIST_INACTIVE = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_INACTIVE)
VIR_DOMAIN_SNAPSHOT_LIST_ACTIVE = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_ACTIVE)
VIR_DOMAIN_SNAPSHOT_LIST_DISK_ONLY = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_DISK_ONLY)
VIR_DOMAIN_SNAPSHOT_LIST_INTERNAL = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_INTERNAL)
VIR_DOMAIN_SNAPSHOT_LIST_EXTERNAL = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_EXTERNAL)
DOMAIN_SNAPSHOT_LIST_ROOTS = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_ROOTS)
DOMAIN_SNAPSHOT_LIST_DESCENDANTS = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS)
DOMAIN_SNAPSHOT_LIST_LEAVES = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_LEAVES)
DOMAIN_SNAPSHOT_LIST_NO_LEAVES = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_NO_LEAVES)
DOMAIN_SNAPSHOT_LIST_METADATA = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_METADATA)
DOMAIN_SNAPSHOT_LIST_NO_METADATA = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_NO_METADATA)
DOMAIN_SNAPSHOT_LIST_INACTIVE = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_INACTIVE)
DOMAIN_SNAPSHOT_LIST_ACTIVE = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_ACTIVE)
DOMAIN_SNAPSHOT_LIST_DISK_ONLY = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_DISK_ONLY)
DOMAIN_SNAPSHOT_LIST_INTERNAL = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_INTERNAL)
DOMAIN_SNAPSHOT_LIST_EXTERNAL = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_EXTERNAL)
)
type DomainSnapshotRevertFlags int
const (
VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING = DomainSnapshotRevertFlags(C.VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING)
VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED = DomainSnapshotRevertFlags(C.VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED)
VIR_DOMAIN_SNAPSHOT_REVERT_FORCE = DomainSnapshotRevertFlags(C.VIR_DOMAIN_SNAPSHOT_REVERT_FORCE)
DOMAIN_SNAPSHOT_REVERT_RUNNING = DomainSnapshotRevertFlags(C.VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING)
DOMAIN_SNAPSHOT_REVERT_PAUSED = DomainSnapshotRevertFlags(C.VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED)
DOMAIN_SNAPSHOT_REVERT_FORCE = DomainSnapshotRevertFlags(C.VIR_DOMAIN_SNAPSHOT_REVERT_FORCE)
)
type DomainSnapshotDeleteFlags int
const (
VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN = DomainSnapshotDeleteFlags(C.VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN)
VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY = DomainSnapshotDeleteFlags(C.VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY)
VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY = DomainSnapshotDeleteFlags(C.VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY)
DOMAIN_SNAPSHOT_DELETE_CHILDREN = DomainSnapshotDeleteFlags(C.VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN)
DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY = DomainSnapshotDeleteFlags(C.VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY)
DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY = DomainSnapshotDeleteFlags(C.VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY)
)
type DomainSnapshot struct {
......
......@@ -45,7 +45,7 @@ func buildTransientTestDomain() (*Domain, *Connect) {
<os>
<type>hvm</type>
</os>
</domain>`, VIR_DOMAIN_NONE)
</domain>`, DOMAIN_NONE)
if err != nil {
panic(err)
}
......@@ -286,7 +286,7 @@ func TestCreateDestroyDomain(t *testing.T) {
t.Error(err)
return
}
if DomainState(state[0]) != VIR_DOMAIN_RUNNING {
if DomainState(state[0]) != DOMAIN_RUNNING {
t.Fatal("Domain should be running")
return
}
......@@ -299,7 +299,7 @@ func TestCreateDestroyDomain(t *testing.T) {
t.Error(err)
return
}
if DomainState(state[0]) != VIR_DOMAIN_SHUTOFF {
if DomainState(state[0]) != DOMAIN_SHUTOFF {
t.Fatal("Domain should be destroyed")
return
}
......@@ -500,7 +500,7 @@ func TestDomainSetVcpus(t *testing.T) {
t.Error(err)
return
}
if err := dom.SetVcpusFlags(1, VIR_DOMAIN_VCPU_LIVE); err != nil {
if err := dom.SetVcpusFlags(1, DOMAIN_VCPU_LIVE); err != nil {
t.Error(err)
return
}
......@@ -550,7 +550,7 @@ func TesDomainShutdownFlags(t *testing.T) {
t.Error(err)
return
}
if err := dom.ShutdownFlags(VIR_DOMAIN_SHUTDOWN_SIGNAL); err != nil {
if err := dom.ShutdownFlags(DOMAIN_SHUTDOWN_SIGNAL); err != nil {
t.Error(err)
return
}
......@@ -576,7 +576,7 @@ func TesDomainDestoryFlags(t *testing.T) {
t.Error(err)
return
}
if err := dom.DestroyFlags(VIR_DOMAIN_DESTROY_GRACEFUL); err != nil {
if err := dom.DestroyFlags(DOMAIN_DESTROY_GRACEFUL); err != nil {
t.Error(err)
return
}
......
This diff is collapsed.
......@@ -10,10 +10,10 @@ import "C"
type EventHandleType int
const (
VIR_EVENT_HANDLE_READABLE = EventHandleType(C.VIR_EVENT_HANDLE_READABLE)
VIR_EVENT_HANDLE_WRITABLE = EventHandleType(C.VIR_EVENT_HANDLE_WRITABLE)
VIR_EVENT_HANDLE_ERROR = EventHandleType(C.VIR_EVENT_HANDLE_ERROR)
VIR_EVENT_HANDLE_HANGUP = EventHandleType(C.VIR_EVENT_HANDLE_HANGUP)
EVENT_HANDLE_READABLE = EventHandleType(C.VIR_EVENT_HANDLE_READABLE)
EVENT_HANDLE_WRITABLE = EventHandleType(C.VIR_EVENT_HANDLE_WRITABLE)
EVENT_HANDLE_ERROR = EventHandleType(C.VIR_EVENT_HANDLE_ERROR)
EVENT_HANDLE_HANGUP = EventHandleType(C.VIR_EVENT_HANDLE_HANGUP)
)
func EventRegisterDefaultImpl() error {
......
......@@ -50,9 +50,9 @@ func TestMultipleCloseCallback(t *testing.T) {
}()
callback := func(conn Connect, reason ConnectCloseReason, opaque func()) {
if reason != VIR_CONNECT_CLOSE_REASON_KEEPALIVE {
if reason != CONNECT_CLOSE_REASON_KEEPALIVE {
t.Errorf("Expected close reason to be %d, got %d",
VIR_CONNECT_CLOSE_REASON_KEEPALIVE, reason)
CONNECT_CLOSE_REASON_KEEPALIVE, reason)
}
opaque()
}
......@@ -177,12 +177,12 @@ func TestQemuMonitorCommand(t *testing.T) {
return
}
if _, err := dom.QemuMonitorCommand(VIR_DOMAIN_QEMU_MONITOR_COMMAND_DEFAULT, "{\"execute\" : \"query-cpus\"}"); err != nil {
if _, err := dom.QemuMonitorCommand(DOMAIN_QEMU_MONITOR_COMMAND_DEFAULT, "{\"execute\" : \"query-cpus\"}"); err != nil {
t.Error(err)
return
}
if _, err := dom.QemuMonitorCommand(VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP, "info cpus"); err != nil {
if _, err := dom.QemuMonitorCommand(DOMAIN_QEMU_MONITOR_COMMAND_HMP, "info cpus"); err != nil {
t.Error(err)
return
}
......@@ -199,14 +199,14 @@ func TestDomainCreateWithFlags(t *testing.T) {
}
}()
if err := dom.CreateWithFlags(VIR_DOMAIN_START_PAUSED); err != nil {
if err := dom.CreateWithFlags(DOMAIN_START_PAUSED); err != nil {
state, err := dom.GetState()
if err != nil {
t.Error(err)
return
}
if DomainState(state[0]) != VIR_DOMAIN_PAUSED {
if DomainState(state[0]) != DOMAIN_PAUSED {
t.Fatalf("Domain should be paused")
}
}
......@@ -260,7 +260,7 @@ func TestIntegrationGetMetadata(t *testing.T) {
t.Error(err)
return
}
v, err := dom.GetMetadata(VIR_DOMAIN_METADATA_TITLE, "", 0)
v, err := dom.GetMetadata(DOMAIN_METADATA_TITLE, "", 0)
dom.Destroy()
if err != nil {
t.Error(err)
......@@ -297,17 +297,17 @@ func TestIntegrationSetMetadata(t *testing.T) {
dom.Free()
}()
const domTitle = "newtitle"
if err := dom.SetMetadata(VIR_DOMAIN_METADATA_TITLE, domTitle, "", "", 0); err != nil {
if err := dom.SetMetadata(DOMAIN_METADATA_TITLE, domTitle, "", "", 0); err != nil {
t.Error(err)
return
}
v, err := dom.GetMetadata(VIR_DOMAIN_METADATA_TITLE, "", 0)
v, err := dom.GetMetadata(DOMAIN_METADATA_TITLE, "", 0)
if err != nil {
t.Error(err)
return
}
if v != domTitle {
t.Fatalf("VIR_DOMAIN_METADATA_TITLE should have been %s, not %s", domTitle, v)
t.Fatalf("DOMAIN_METADATA_TITLE should have been %s, not %s", domTitle, v)
return
}
}
......@@ -586,11 +586,11 @@ func TestIntegrationDomainAttachDetachDevice(t *testing.T) {
<source network='default'/>
<model type='virtio'/>
</interface>`
if err := dom.AttachDeviceFlags(nwXml, VIR_DOMAIN_DEVICE_MODIFY_CONFIG); err != nil {
if err := dom.AttachDeviceFlags(nwXml, DOMAIN_DEVICE_MODIFY_CONFIG); err != nil {
t.Error(err)
return
}
if err := dom.DetachDeviceFlags(nwXml, VIR_DOMAIN_DEVICE_MODIFY_CONFIG); err != nil {
if err := dom.DetachDeviceFlags(nwXml, DOMAIN_DEVICE_MODIFY_CONFIG); err != nil {
t.Error(err)
return
}
......@@ -635,11 +635,11 @@ func TestStorageVolResize(t *testing.T) {
return
}
defer func() {
vol.Delete(VIR_STORAGE_VOL_DELETE_NORMAL)
vol.Delete(STORAGE_VOL_DELETE_NORMAL)
vol.Free()
}()
const newCapacityInBytes = 12582912
if err := vol.Resize(newCapacityInBytes, VIR_STORAGE_VOL_RESIZE_ALLOCATE); err != nil {
if err := vol.Resize(newCapacityInBytes, STORAGE_VOL_RESIZE_ALLOCATE); err != nil {
t.Fatal(err)
}
}
......@@ -683,7 +683,7 @@ func TestStorageVolWipe(t *testing.T) {
return
}
defer func() {
vol.Delete(VIR_STORAGE_VOL_DELETE_NORMAL)
vol.Delete(STORAGE_VOL_DELETE_NORMAL)
vol.Free()
}()
if err := vol.Wipe(0); err != nil {
......@@ -730,10 +730,10 @@ func TestStorageVolWipePattern(t *testing.T) {
return
}
defer func() {
vol.Delete(VIR_STORAGE_VOL_DELETE_NORMAL)
vol.Delete(STORAGE_VOL_DELETE_NORMAL)
vol.Free()
}()
if err := vol.WipePattern(VIR_STORAGE_VOL_WIPE_ALG_ZERO, 0); err != nil {
if err := vol.WipePattern(STORAGE_VOL_WIPE_ALG_ZERO, 0); err != nil {
t.Fatal(err)
}
}
......@@ -874,7 +874,7 @@ func TestIntegrationSecretGetUsageType(t *testing.T) {
t.Error(err)
return
}
if uType != VIR_SECRET_USAGE_TYPE_CEPH {
if uType != SECRET_USAGE_TYPE_CEPH {
t.Fatal("unexpected usage type.Expected usage type is Ceph")
}
}
......@@ -931,7 +931,7 @@ func TestIntegrationLookupSecretByUsage(t *testing.T) {
sec.Undefine()
sec.Free()
}()
sec2, err := conn.LookupSecretByUsage(VIR_SECRET_USAGE_TYPE_CEPH, usageID)
sec2, err := conn.LookupSecretByUsage(SECRET_USAGE_TYPE_CEPH, usageID)
if err != nil {
t.Fatal(err)
}
......@@ -1097,7 +1097,7 @@ func TestIntegrationDomainInterfaceStats(t *testing.T) {
<source network='default'/>
<model type='virtio'/>
</interface>`
if err := dom.AttachDeviceFlags(nwXml, VIR_DOMAIN_DEVICE_MODIFY_CONFIG); err != nil {
if err := dom.AttachDeviceFlags(nwXml, DOMAIN_DEVICE_MODIFY_CONFIG); err != nil {
t.Fatal(err)
}
......@@ -1113,7 +1113,7 @@ func TestIntegrationDomainInterfaceStats(t *testing.T) {
t.Fatal(err)
}
if err := dom.DetachDeviceFlags(nwXml, VIR_DOMAIN_DEVICE_MODIFY_CONFIG); err != nil {
if err := dom.DetachDeviceFlags(nwXml, DOMAIN_DEVICE_MODIFY_CONFIG); err != nil {
t.Fatal(err)
}
}
......@@ -1157,7 +1157,7 @@ func TestStorageVolUploadDownload(t *testing.T) {
return
}
defer func() {
vol.Delete(VIR_STORAGE_VOL_DELETE_NORMAL)
vol.Delete(STORAGE_VOL_DELETE_NORMAL)
vol.Free()
}()
......
......@@ -15,7 +15,7 @@ import (
type InterfaceXMLFlags int
const (
VIR_INTERFACE_XML_INACTIVE = InterfaceXMLFlags(C.VIR_INTERFACE_XML_INACTIVE)
INTERFACE_XML_INACTIVE = InterfaceXMLFlags(C.VIR_INTERFACE_XML_INACTIVE)
)
type Interface struct {
......
......@@ -17,65 +17,65 @@ import (
type IPAddrType int
const (
VIR_IP_ADDR_TYPE_IPV4 = IPAddrType(C.VIR_IP_ADDR_TYPE_IPV4)
VIR_IP_ADDR_TYPE_IPV6 = IPAddrType(C.VIR_IP_ADDR_TYPE_IPV6)
IP_ADDR_TYPE_IPV4 = IPAddrType(C.VIR_IP_ADDR_TYPE_IPV4)
IP_ADDR_TYPE_IPV6 = IPAddrType(C.VIR_IP_ADDR_TYPE_IPV6)
)
type NetworkXMLFlags int
const (
VIR_NETWORK_XML_INACTIVE = NetworkXMLFlags(C.VIR_NETWORK_XML_INACTIVE)
NETWORK_XML_INACTIVE = NetworkXMLFlags(C.VIR_NETWORK_XML_INACTIVE)
)
type NetworkUpdateCommand int
const (
VIR_NETWORK_UPDATE_COMMAND_NONE = NetworkUpdateCommand(C.VIR_NETWORK_UPDATE_COMMAND_NONE)
VIR_NETWORK_UPDATE_COMMAND_MODIFY = NetworkUpdateCommand(C.VIR_NETWORK_UPDATE_COMMAND_MODIFY)
VIR_NETWORK_UPDATE_COMMAND_DELETE = NetworkUpdateCommand(C.VIR_NETWORK_UPDATE_COMMAND_DELETE)
VIR_NETWORK_UPDATE_COMMAND_ADD_LAST = NetworkUpdateCommand(C.VIR_NETWORK_UPDATE_COMMAND_ADD_LAST)
VIR_NETWORK_UPDATE_COMMAND_ADD_FIRST = NetworkUpdateCommand(C.VIR_NETWORK_UPDATE_COMMAND_ADD_FIRST)
NETWORK_UPDATE_COMMAND_NONE = NetworkUpdateCommand(C.VIR_NETWORK_UPDATE_COMMAND_NONE)
NETWORK_UPDATE_COMMAND_MODIFY = NetworkUpdateCommand(C.VIR_NETWORK_UPDATE_COMMAND_MODIFY)
NETWORK_UPDATE_COMMAND_DELETE = NetworkUpdateCommand(C.VIR_NETWORK_UPDATE_COMMAND_DELETE)
NETWORK_UPDATE_COMMAND_ADD_LAST = NetworkUpdateCommand(C.VIR_NETWORK_UPDATE_COMMAND_ADD_LAST)
NETWORK_UPDATE_COMMAND_ADD_FIRST = NetworkUpdateCommand(C.VIR_NETWORK_UPDATE_COMMAND_ADD_FIRST)
)
type NetworkUpdateSection int
const (
VIR_NETWORK_SECTION_NONE = NetworkUpdateSection(C.VIR_NETWORK_SECTION_NONE)
VIR_NETWORK_SECTION_BRIDGE = NetworkUpdateSection(C.VIR_NETWORK_SECTION_BRIDGE)
VIR_NETWORK_SECTION_DOMAIN = NetworkUpdateSection(C.VIR_NETWORK_SECTION_DOMAIN)
VIR_NETWORK_SECTION_IP = NetworkUpdateSection(C.VIR_NETWORK_SECTION_IP)
VIR_NETWORK_SECTION_IP_DHCP_HOST = NetworkUpdateSection(C.VIR_NETWORK_SECTION_IP_DHCP_HOST)
VIR_NETWORK_SECTION_IP_DHCP_RANGE = NetworkUpdateSection(C.VIR_NETWORK_SECTION_IP_DHCP_RANGE)
VIR_NETWORK_SECTION_FORWARD = NetworkUpdateSection(C.VIR_NETWORK_SECTION_FORWARD)
VIR_NETWORK_SECTION_FORWARD_INTERFACE = NetworkUpdateSection(C.VIR_NETWORK_SECTION_FORWARD_INTERFACE)
VIR_NETWORK_SECTION_FORWARD_PF = NetworkUpdateSection(C.VIR_NETWORK_SECTION_FORWARD_PF)
VIR_NETWORK_SECTION_PORTGROUP = NetworkUpdateSection(C.VIR_NETWORK_SECTION_PORTGROUP)
VIR_NETWORK_SECTION_DNS_HOST = NetworkUpdateSection(C.VIR_NETWORK_SECTION_DNS_HOST)
VIR_NETWORK_SECTION_DNS_TXT = NetworkUpdateSection(C.VIR_NETWORK_SECTION_DNS_TXT)
VIR_NETWORK_SECTION_DNS_SRV = NetworkUpdateSection(C.VIR_NETWORK_SECTION_DNS_SRV)
NETWORK_SECTION_NONE = NetworkUpdateSection(C.VIR_NETWORK_SECTION_NONE)
NETWORK_SECTION_BRIDGE = NetworkUpdateSection(C.VIR_NETWORK_SECTION_BRIDGE)
NETWORK_SECTION_DOMAIN = NetworkUpdateSection(C.VIR_NETWORK_SECTION_DOMAIN)
NETWORK_SECTION_IP = NetworkUpdateSection(C.VIR_NETWORK_SECTION_IP)
NETWORK_SECTION_IP_DHCP_HOST = NetworkUpdateSection(C.VIR_NETWORK_SECTION_IP_DHCP_HOST)
NETWORK_SECTION_IP_DHCP_RANGE = NetworkUpdateSection(C.VIR_NETWORK_SECTION_IP_DHCP_RANGE)
NETWORK_SECTION_FORWARD = NetworkUpdateSection(C.VIR_NETWORK_SECTION_FORWARD)
NETWORK_SECTION_FORWARD_INTERFACE = NetworkUpdateSection(C.VIR_NETWORK_SECTION_FORWARD_INTERFACE)
NETWORK_SECTION_FORWARD_PF = NetworkUpdateSection(C.VIR_NETWORK_SECTION_FORWARD_PF)
NETWORK_SECTION_PORTGROUP = NetworkUpdateSection(C.VIR_NETWORK_SECTION_PORTGROUP)
NETWORK_SECTION_DNS_HOST = NetworkUpdateSection(C.VIR_NETWORK_SECTION_DNS_HOST)
NETWORK_SECTION_DNS_TXT = NetworkUpdateSection(C.VIR_NETWORK_SECTION_DNS_TXT)
NETWORK_SECTION_DNS_SRV = NetworkUpdateSection(C.VIR_NETWORK_SECTION_DNS_SRV)
)
type NetworkUpdateFlags int
const (
VIR_NETWORK_UPDATE_AFFECT_CURRENT = NetworkUpdateFlags(C.VIR_NETWORK_UPDATE_AFFECT_CURRENT)
VIR_NETWORK_UPDATE_AFFECT_LIVE = NetworkUpdateFlags(C.VIR_NETWORK_UPDATE_AFFECT_LIVE)
VIR_NETWORK_UPDATE_AFFECT_CONFIG = NetworkUpdateFlags(C.VIR_NETWORK_UPDATE_AFFECT_CONFIG)
NETWORK_UPDATE_AFFECT_CURRENT = NetworkUpdateFlags(C.VIR_NETWORK_UPDATE_AFFECT_CURRENT)
NETWORK_UPDATE_AFFECT_LIVE = NetworkUpdateFlags(C.VIR_NETWORK_UPDATE_AFFECT_LIVE)
NETWORK_UPDATE_AFFECT_CONFIG = NetworkUpdateFlags(C.VIR_NETWORK_UPDATE_AFFECT_CONFIG)
)
type NetworkEventLifecycleType int
const (
VIR_NETWORK_EVENT_DEFINED = NetworkEventLifecycleType(C.VIR_NETWORK_EVENT_DEFINED)
VIR_NETWORK_EVENT_UNDEFINED = NetworkEventLifecycleType(C.VIR_NETWORK_EVENT_UNDEFINED)
VIR_NETWORK_EVENT_STARTED = NetworkEventLifecycleType(C.VIR_NETWORK_EVENT_STARTED)
VIR_NETWORK_EVENT_STOPPED = NetworkEventLifecycleType(C.VIR_NETWORK_EVENT_STOPPED)
NETWORK_EVENT_DEFINED = NetworkEventLifecycleType(C.VIR_NETWORK_EVENT_DEFINED)
NETWORK_EVENT_UNDEFINED = NetworkEventLifecycleType(C.VIR_NETWORK_EVENT_UNDEFINED)
NETWORK_EVENT_STARTED = NetworkEventLifecycleType(C.VIR_NETWORK_EVENT_STARTED)
NETWORK_EVENT_STOPPED = NetworkEventLifecycleType(C.VIR_NETWORK_EVENT_STOPPED)
)
type NetworkEventID int
const (
VIR_NETWORK_EVENT_ID_LIFECYCLE = NetworkEventID(C.VIR_NETWORK_EVENT_ID_LIFECYCLE)
NETWORK_EVENT_ID_LIFECYCLE = NetworkEventID(C.VIR_NETWORK_EVENT_ID_LIFECYCLE)
)
type Network struct {
......
......@@ -15,15 +15,15 @@ import (
type NodeDeviceEventID int
const (
VIR_NODE_DEVICE_EVENT_ID_LIFECYCLE = NodeDeviceEventID(C.VIR_NODE_DEVICE_EVENT_ID_LIFECYCLE)
VIR_NODE_DEVICE_EVENT_ID_UPDATE = NodeDeviceEventID(C.VIR_NODE_DEVICE_EVENT_ID_UPDATE)
NODE_DEVICE_EVENT_ID_LIFECYCLE = NodeDeviceEventID(C.VIR_NODE_DEVICE_EVENT_ID_LIFECYCLE)
NODE_DEVICE_EVENT_ID_UPDATE = NodeDeviceEventID(C.VIR_NODE_DEVICE_EVENT_ID_UPDATE)
)
type NodeDeviceEventLifecycleType int
const (
VIR_NODE_DEVICE_EVENT_CREATED = NodeDeviceEventLifecycleType(C.VIR_NODE_DEVICE_EVENT_CREATED)
VIR_NODE_DEVICE_EVENT_DELETED = NodeDeviceEventLifecycleType(C.VIR_NODE_DEVICE_EVENT_DELETED)
NODE_DEVICE_EVENT_CREATED = NodeDeviceEventLifecycleType(C.VIR_NODE_DEVICE_EVENT_CREATED)
NODE_DEVICE_EVENT_DELETED = NodeDeviceEventLifecycleType(C.VIR_NODE_DEVICE_EVENT_DELETED)
)
type NodeDevice struct {
......
......@@ -15,11 +15,11 @@ import (
type SecretUsageType int
const (
VIR_SECRET_USAGE_TYPE_NONE = SecretUsageType(C.VIR_SECRET_USAGE_TYPE_NONE)
VIR_SECRET_USAGE_TYPE_VOLUME = SecretUsageType(C.VIR_SECRET_USAGE_TYPE_VOLUME)
VIR_SECRET_USAGE_TYPE_CEPH = SecretUsageType(C.VIR_SECRET_USAGE_TYPE_CEPH)
VIR_SECRET_USAGE_TYPE_ISCSI = SecretUsageType(C.VIR_SECRET_USAGE_TYPE_ISCSI)
VIR_SECRET_USAGE_TYPE_TLS = SecretUsageType(C.VIR_SECRET_USAGE_TYPE_TLS)
SECRET_USAGE_TYPE_NONE = SecretUsageType(C.VIR_SECRET_USAGE_TYPE_NONE)
SECRET_USAGE_TYPE_VOLUME = SecretUsageType(C.VIR_SECRET_USAGE_TYPE_VOLUME)
SECRET_USAGE_TYPE_CEPH = SecretUsageType(C.VIR_SECRET_USAGE_TYPE_CEPH)
SECRET_USAGE_TYPE_ISCSI = SecretUsageType(C.VIR_SECRET_USAGE_TYPE_ISCSI)
SECRET_USAGE_TYPE_TLS = SecretUsageType(C.VIR_SECRET_USAGE_TYPE_TLS)
)
type Secret struct {
......
......@@ -16,53 +16,53 @@ import (
type StoragePoolState int
const (
VIR_STORAGE_POOL_INACTIVE = StoragePoolState(C.VIR_STORAGE_POOL_INACTIVE) // Not running
VIR_STORAGE_POOL_BUILDING = StoragePoolState(C.VIR_STORAGE_POOL_BUILDING) // Initializing pool,not available
VIR_STORAGE_POOL_RUNNING = StoragePoolState(C.VIR_STORAGE_POOL_RUNNING) // Running normally