All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Rosbrook <rosbrookn@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Nick Rosbrook <rosbrookn@ainfosec.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	kerriganb@ainfosec.com, George Dunlap <george.dunlap@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [Xen-devel] [PATCH 02/24] golang/xenlight: generate enum types from IDL
Date: Mon,  7 Oct 2019 11:12:49 -0400	[thread overview]
Message-ID: <2bef5bfd9cc33260be663b84d2b813f28f0f3c47.1570456846.git.rosbrookn@ainfosec.com> (raw)
In-Reply-To: <cover.1570456846.git.rosbrookn@ainfosec.com>

From: Nick Rosbrook <rosbrookn@ainfosec.com>

Introduce gengotypes.py to generate Go code the from IDL. As a first step,
implement 'enum' type generation.

As a result of the newly-generated code, remove the existing, and now
conflicting definitions in xenlight.go. In the case of the Error type,
rename the slice 'errors' to 'libxlErrors' so that it does not conflict
with the standard library package 'errors.' And, negate the values used
in 'libxlErrors' since the generated error values are negative.

Signed-off-by: Nick Rosbrook <rosbrookn@ainfosec.com>
---
Cc: George Dunlap <george.dunlap@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Wei Liu <wl@xen.org>

 tools/golang/xenlight/gengotypes.py     | 109 +++++++
 tools/golang/xenlight/xenlight.go       | 140 ++-------
 tools/golang/xenlight/xenlight_types.go | 378 ++++++++++++++++++++++++
 3 files changed, 515 insertions(+), 112 deletions(-)
 create mode 100644 tools/golang/xenlight/gengotypes.py
 create mode 100644 tools/golang/xenlight/xenlight_types.go

diff --git a/tools/golang/xenlight/gengotypes.py b/tools/golang/xenlight/gengotypes.py
new file mode 100644
index 0000000000..59307492cb
--- /dev/null
+++ b/tools/golang/xenlight/gengotypes.py
@@ -0,0 +1,109 @@
+#!/usr/bin/python
+
+import os
+import sys
+
+sys.path.append('{}/tools/libxl'.format(os.environ['XEN_ROOT']))
+import idl
+
+# Go versions of some builtin types.
+# Append the libxl-defined builtins after IDL parsing.
+builtin_type_names = {
+    idl.bool.typename: 'bool',
+    idl.string.typename: 'string',
+    idl.integer.typename: 'int',
+    idl.uint8.typename: 'byte',
+    idl.uint16.typename: 'uint16',
+    idl.uint32.typename: 'uint32',
+    idl.uint64.typename: 'uint64',
+}
+
+def xenlight_golang_generate_types(path = None, types = None, comment = None):
+    """
+    Generate a .go file (xenlight_types.go by default)
+    that contains a Go type for each type in types.
+    """
+    if path is None:
+        path = 'xenlight_types.go'
+
+    with open(path, 'w') as f:
+        if comment is not None:
+            f.write(comment)
+        f.write('package xenlight\n')
+
+        for ty in types:
+            f.write(xenlight_golang_type_define(ty))
+            f.write('\n')
+
+    go_fmt(path)
+
+def xenlight_golang_type_define(ty = None):
+    s = ''
+
+    if isinstance(ty, idl.Enumeration):
+        s += xenlight_golang_define_enum(ty)
+
+    return s
+
+def xenlight_golang_define_enum(ty = None):
+    s = ''
+    typename = ''
+
+    if ty.typename is not None:
+        typename = xenlight_golang_fmt_name(ty.typename)
+        s += 'type {} int\n'.format(typename)
+
+    # Start const block
+    s += 'const(\n'
+
+    for v in ty.values:
+        name = xenlight_golang_fmt_name(v.name)
+        s += '{} {} = {}\n'.format(name, typename, v.value)
+
+    # End const block
+    s += ')\n'
+
+    return s
+
+def xenlight_golang_fmt_name(name, exported = True):
+    """
+    Take a given type name and return an
+    appropriate Go type name.
+    """
+    if name in builtin_type_names.keys():
+        return builtin_type_names[name]
+
+    # Name is not a builtin, format it for Go.
+    words = name.split('_')
+
+    # Remove 'libxl' prefix
+    if words[0].lower() == 'libxl':
+        words.remove(words[0])
+
+    if exported:
+        return ''.join(x.title() for x in words)
+
+    return words[0] + ''.join(x.title() for x in words[1:])
+
+def go_fmt(path):
+    """ Call go fmt on the given path. """
+    os.system('go fmt {}'.format(path))
+
+if __name__ == '__main__':
+    idlname = sys.argv[1]
+
+    (builtins, types) = idl.parse(idlname)
+
+    for b in builtins:
+        name = b.typename
+        builtin_type_names[name] = xenlight_golang_fmt_name(name)
+
+    header_comment="""// DO NOT EDIT.
+    //
+    // This file is generated by:
+    // {}
+    //
+    """.format(' '.join(sys.argv))
+
+    xenlight_golang_generate_types(types=types,
+                                   comment=header_comment)
diff --git a/tools/golang/xenlight/xenlight.go b/tools/golang/xenlight/xenlight.go
index 59b8186a64..e617f22fcf 100644
--- a/tools/golang/xenlight/xenlight.go
+++ b/tools/golang/xenlight/xenlight.go
@@ -37,77 +37,42 @@ import (
 	"unsafe"
 )
 
-/*
- * Errors
- */
-
-type Error int
-
-const (
-	ErrorNonspecific                  = Error(-C.ERROR_NONSPECIFIC)
-	ErrorVersion                      = Error(-C.ERROR_VERSION)
-	ErrorFail                         = Error(-C.ERROR_FAIL)
-	ErrorNi                           = Error(-C.ERROR_NI)
-	ErrorNomem                        = Error(-C.ERROR_NOMEM)
-	ErrorInval                        = Error(-C.ERROR_INVAL)
-	ErrorBadfail                      = Error(-C.ERROR_BADFAIL)
-	ErrorGuestTimedout                = Error(-C.ERROR_GUEST_TIMEDOUT)
-	ErrorTimedout                     = Error(-C.ERROR_TIMEDOUT)
-	ErrorNoparavirt                   = Error(-C.ERROR_NOPARAVIRT)
-	ErrorNotReady                     = Error(-C.ERROR_NOT_READY)
-	ErrorOseventRegFail               = Error(-C.ERROR_OSEVENT_REG_FAIL)
-	ErrorBufferfull                   = Error(-C.ERROR_BUFFERFULL)
-	ErrorUnknownChild                 = Error(-C.ERROR_UNKNOWN_CHILD)
-	ErrorLockFail                     = Error(-C.ERROR_LOCK_FAIL)
-	ErrorJsonConfigEmpty              = Error(-C.ERROR_JSON_CONFIG_EMPTY)
-	ErrorDeviceExists                 = Error(-C.ERROR_DEVICE_EXISTS)
-	ErrorCheckpointDevopsDoesNotMatch = Error(-C.ERROR_CHECKPOINT_DEVOPS_DOES_NOT_MATCH)
-	ErrorCheckpointDeviceNotSupported = Error(-C.ERROR_CHECKPOINT_DEVICE_NOT_SUPPORTED)
-	ErrorVnumaConfigInvalid           = Error(-C.ERROR_VNUMA_CONFIG_INVALID)
-	ErrorDomainNotfound               = Error(-C.ERROR_DOMAIN_NOTFOUND)
-	ErrorAborted                      = Error(-C.ERROR_ABORTED)
-	ErrorNotfound                     = Error(-C.ERROR_NOTFOUND)
-	ErrorDomainDestroyed              = Error(-C.ERROR_DOMAIN_DESTROYED)
-	ErrorFeatureRemoved               = Error(-C.ERROR_FEATURE_REMOVED)
-)
-
-var errors = [...]string{
-	ErrorNonspecific:                  "Non-specific error",
-	ErrorVersion:                      "Wrong version",
-	ErrorFail:                         "Failed",
-	ErrorNi:                           "Not Implemented",
-	ErrorNomem:                        "No memory",
-	ErrorInval:                        "Invalid argument",
-	ErrorBadfail:                      "Bad Fail",
-	ErrorGuestTimedout:                "Guest timed out",
-	ErrorTimedout:                     "Timed out",
-	ErrorNoparavirt:                   "No Paravirtualization",
-	ErrorNotReady:                     "Not ready",
-	ErrorOseventRegFail:               "OS event registration failed",
-	ErrorBufferfull:                   "Buffer full",
-	ErrorUnknownChild:                 "Unknown child",
-	ErrorLockFail:                     "Lock failed",
-	ErrorJsonConfigEmpty:              "JSON config empty",
-	ErrorDeviceExists:                 "Device exists",
-	ErrorCheckpointDevopsDoesNotMatch: "Checkpoint devops does not match",
-	ErrorCheckpointDeviceNotSupported: "Checkpoint device not supported",
-	ErrorVnumaConfigInvalid:           "VNUMA config invalid",
-	ErrorDomainNotfound:               "Domain not found",
-	ErrorAborted:                      "Aborted",
-	ErrorNotfound:                     "Not found",
-	ErrorDomainDestroyed:              "Domain destroyed",
-	ErrorFeatureRemoved:               "Feature removed",
+var libxlErrors = [...]string{
+	-ErrorNonspecific:                  "Non-specific error",
+	-ErrorVersion:                      "Wrong version",
+	-ErrorFail:                         "Failed",
+	-ErrorNi:                           "Not Implemented",
+	-ErrorNomem:                        "No memory",
+	-ErrorInval:                        "Invalid argument",
+	-ErrorBadfail:                      "Bad Fail",
+	-ErrorGuestTimedout:                "Guest timed out",
+	-ErrorTimedout:                     "Timed out",
+	-ErrorNoparavirt:                   "No Paravirtualization",
+	-ErrorNotReady:                     "Not ready",
+	-ErrorOseventRegFail:               "OS event registration failed",
+	-ErrorBufferfull:                   "Buffer full",
+	-ErrorUnknownChild:                 "Unknown child",
+	-ErrorLockFail:                     "Lock failed",
+	-ErrorJsonConfigEmpty:              "JSON config empty",
+	-ErrorDeviceExists:                 "Device exists",
+	-ErrorCheckpointDevopsDoesNotMatch: "Checkpoint devops does not match",
+	-ErrorCheckpointDeviceNotSupported: "Checkpoint device not supported",
+	-ErrorVnumaConfigInvalid:           "VNUMA config invalid",
+	-ErrorDomainNotfound:               "Domain not found",
+	-ErrorAborted:                      "Aborted",
+	-ErrorNotfound:                     "Not found",
+	-ErrorDomainDestroyed:              "Domain destroyed",
+	-ErrorFeatureRemoved:               "Feature removed",
 }
 
 func (e Error) Error() string {
-	if 0 < int(e) && int(e) < len(errors) {
-		s := errors[e]
+	if 0 < int(e) && int(e) < len(libxlErrors) {
+		s := libxlErrors[e]
 		if s != "" {
 			return s
 		}
 	}
 	return fmt.Sprintf("libxl error: %d", -e)
-
 }
 
 /*
@@ -236,18 +201,6 @@ func (cinfo *C.libxl_version_info) toGo() (info *VersionInfo) {
 	return
 }
 
-type ShutdownReason int32
-
-const (
-	ShutdownReasonUnknown   = ShutdownReason(C.LIBXL_SHUTDOWN_REASON_UNKNOWN)
-	ShutdownReasonPoweroff  = ShutdownReason(C.LIBXL_SHUTDOWN_REASON_POWEROFF)
-	ShutdownReasonReboot    = ShutdownReason(C.LIBXL_SHUTDOWN_REASON_REBOOT)
-	ShutdownReasonSuspend   = ShutdownReason(C.LIBXL_SHUTDOWN_REASON_SUSPEND)
-	ShutdownReasonCrash     = ShutdownReason(C.LIBXL_SHUTDOWN_REASON_CRASH)
-	ShutdownReasonWatchdog  = ShutdownReason(C.LIBXL_SHUTDOWN_REASON_WATCHDOG)
-	ShutdownReasonSoftReset = ShutdownReason(C.LIBXL_SHUTDOWN_REASON_SOFT_RESET)
-)
-
 func (sr ShutdownReason) String() (str string) {
 	cstr := C.libxl_shutdown_reason_to_string(C.libxl_shutdown_reason(sr))
 	str = C.GoString(cstr)
@@ -255,14 +208,6 @@ func (sr ShutdownReason) String() (str string) {
 	return
 }
 
-type DomainType int32
-
-const (
-	DomainTypeInvalid = DomainType(C.LIBXL_DOMAIN_TYPE_INVALID)
-	DomainTypeHvm     = DomainType(C.LIBXL_DOMAIN_TYPE_HVM)
-	DomainTypePv      = DomainType(C.LIBXL_DOMAIN_TYPE_PV)
-)
-
 func (dt DomainType) String() (str string) {
 	cstr := C.libxl_domain_type_to_string(C.libxl_domain_type(dt))
 	str = C.GoString(cstr)
@@ -323,27 +268,6 @@ func (cdi *C.libxl_dominfo) toGo() (di *Dominfo) {
 	return
 }
 
-// # Consistent with values defined in domctl.h
-// # Except unknown which we have made up
-// libxl_scheduler = Enumeration("scheduler", [
-//     (0, "unknown"),
-//     (4, "sedf"),
-//     (5, "credit"),
-//     (6, "credit2"),
-//     (7, "arinc653"),
-//     (8, "rtds"),
-//     ])
-type Scheduler int
-
-var (
-	SchedulerUnknown  Scheduler = C.LIBXL_SCHEDULER_UNKNOWN
-	SchedulerSedf     Scheduler = C.LIBXL_SCHEDULER_SEDF
-	SchedulerCredit   Scheduler = C.LIBXL_SCHEDULER_CREDIT
-	SchedulerCredit2  Scheduler = C.LIBXL_SCHEDULER_CREDIT2
-	SchedulerArinc653 Scheduler = C.LIBXL_SCHEDULER_ARINC653
-	SchedulerRTDS     Scheduler = C.LIBXL_SCHEDULER_RTDS
-)
-
 // const char *libxl_scheduler_to_string(libxl_scheduler p);
 func (s Scheduler) String() string {
 	cs := C.libxl_scheduler_to_string(C.libxl_scheduler(s))
@@ -1141,14 +1065,6 @@ func (Ctx *Context) ListVcpu(id Domid) (glist []Vcpuinfo) {
 	return
 }
 
-type ConsoleType int
-
-const (
-	ConsoleTypeUnknown = ConsoleType(C.LIBXL_CONSOLE_TYPE_UNKNOWN)
-	ConsoleTypeSerial  = ConsoleType(C.LIBXL_CONSOLE_TYPE_SERIAL)
-	ConsoleTypePV      = ConsoleType(C.LIBXL_CONSOLE_TYPE_PV)
-)
-
 func (ct ConsoleType) String() (str string) {
 	cstr := C.libxl_console_type_to_string(C.libxl_console_type(ct))
 	str = C.GoString(cstr)
diff --git a/tools/golang/xenlight/xenlight_types.go b/tools/golang/xenlight/xenlight_types.go
new file mode 100644
index 0000000000..05f62182b7
--- /dev/null
+++ b/tools/golang/xenlight/xenlight_types.go
@@ -0,0 +1,378 @@
+// DO NOT EDIT.
+//
+// This file is generated by:
+// gengotypes.py ../../libxl/libxl_types.idl
+//
+package xenlight
+
+type Error int
+
+const (
+	ErrorNonspecific                  Error = -1
+	ErrorVersion                      Error = -2
+	ErrorFail                         Error = -3
+	ErrorNi                           Error = -4
+	ErrorNomem                        Error = -5
+	ErrorInval                        Error = -6
+	ErrorBadfail                      Error = -7
+	ErrorGuestTimedout                Error = -8
+	ErrorTimedout                     Error = -9
+	ErrorNoparavirt                   Error = -10
+	ErrorNotReady                     Error = -11
+	ErrorOseventRegFail               Error = -12
+	ErrorBufferfull                   Error = -13
+	ErrorUnknownChild                 Error = -14
+	ErrorLockFail                     Error = -15
+	ErrorJsonConfigEmpty              Error = -16
+	ErrorDeviceExists                 Error = -17
+	ErrorCheckpointDevopsDoesNotMatch Error = -18
+	ErrorCheckpointDeviceNotSupported Error = -19
+	ErrorVnumaConfigInvalid           Error = -20
+	ErrorDomainNotfound               Error = -21
+	ErrorAborted                      Error = -22
+	ErrorNotfound                     Error = -23
+	ErrorDomainDestroyed              Error = -24
+	ErrorFeatureRemoved               Error = -25
+	ErrorProtocolErrorQmp             Error = -26
+	ErrorUnknownQmpError              Error = -27
+	ErrorQmpGenericError              Error = -28
+	ErrorQmpCommandNotFound           Error = -29
+	ErrorQmpDeviceNotActive           Error = -30
+	ErrorQmpDeviceNotFound            Error = -31
+	ErrorQemuApi                      Error = -32
+)
+
+type DomainType int
+
+const (
+	DomainTypeInvalid DomainType = -1
+	DomainTypeHvm     DomainType = 1
+	DomainTypePv      DomainType = 2
+	DomainTypePvh     DomainType = 3
+)
+
+type RdmReserveStrategy int
+
+const (
+	RdmReserveStrategyIgnore RdmReserveStrategy = 0
+	RdmReserveStrategyHost   RdmReserveStrategy = 1
+)
+
+type RdmReservePolicy int
+
+const (
+	RdmReservePolicyInvalid RdmReservePolicy = -1
+	RdmReservePolicyStrict  RdmReservePolicy = 0
+	RdmReservePolicyRelaxed RdmReservePolicy = 1
+)
+
+type ChannelConnection int
+
+const (
+	ChannelConnectionUnknown ChannelConnection = 0
+	ChannelConnectionPty     ChannelConnection = 1
+	ChannelConnectionSocket  ChannelConnection = 2
+)
+
+type DeviceModelVersion int
+
+const (
+	DeviceModelVersionUnknown            DeviceModelVersion = 0
+	DeviceModelVersionQemuXenTraditional DeviceModelVersion = 1
+	DeviceModelVersionQemuXen            DeviceModelVersion = 2
+)
+
+type ConsoleType int
+
+const (
+	ConsoleTypeUnknown ConsoleType = 0
+	ConsoleTypeSerial  ConsoleType = 1
+	ConsoleTypePv      ConsoleType = 2
+	ConsoleTypeVuart   ConsoleType = 3
+)
+
+type DiskFormat int
+
+const (
+	DiskFormatUnknown DiskFormat = 0
+	DiskFormatQcow    DiskFormat = 1
+	DiskFormatQcow2   DiskFormat = 2
+	DiskFormatVhd     DiskFormat = 3
+	DiskFormatRaw     DiskFormat = 4
+	DiskFormatEmpty   DiskFormat = 5
+	DiskFormatQed     DiskFormat = 6
+)
+
+type DiskBackend int
+
+const (
+	DiskBackendUnknown DiskBackend = 0
+	DiskBackendPhy     DiskBackend = 1
+	DiskBackendTap     DiskBackend = 2
+	DiskBackendQdisk   DiskBackend = 3
+)
+
+type NicType int
+
+const (
+	NicTypeUnknown  NicType = 0
+	NicTypeVifIoemu NicType = 1
+	NicTypeVif      NicType = 2
+)
+
+type ActionOnShutdown int
+
+const (
+	ActionOnShutdownDestroy         ActionOnShutdown = 1
+	ActionOnShutdownRestart         ActionOnShutdown = 2
+	ActionOnShutdownRestartRename   ActionOnShutdown = 3
+	ActionOnShutdownPreserve        ActionOnShutdown = 4
+	ActionOnShutdownCoredumpDestroy ActionOnShutdown = 5
+	ActionOnShutdownCoredumpRestart ActionOnShutdown = 6
+	ActionOnShutdownSoftReset       ActionOnShutdown = 7
+)
+
+type Trigger int
+
+const (
+	TriggerUnknown  Trigger = 0
+	TriggerPower    Trigger = 1
+	TriggerSleep    Trigger = 2
+	TriggerNmi      Trigger = 3
+	TriggerInit     Trigger = 4
+	TriggerReset    Trigger = 5
+	TriggerS3Resume Trigger = 6
+)
+
+type TscMode int
+
+const (
+	TscModeDefault        TscMode = 0
+	TscModeAlwaysEmulate  TscMode = 1
+	TscModeNative         TscMode = 2
+	TscModeNativeParavirt TscMode = 3
+)
+
+type GfxPassthruKind int
+
+const (
+	GfxPassthruKindDefault GfxPassthruKind = 0
+	GfxPassthruKindIgd     GfxPassthruKind = 1
+)
+
+type TimerMode int
+
+const (
+	TimerModeUnknown               TimerMode = -1
+	TimerModeDelayForMissedTicks   TimerMode = 0
+	TimerModeNoDelayForMissedTicks TimerMode = 1
+	TimerModeNoMissedTicksPending  TimerMode = 2
+	TimerModeOneMissedTickPending  TimerMode = 3
+)
+
+type BiosType int
+
+const (
+	BiosTypeUnknown BiosType = 0
+	BiosTypeRombios BiosType = 1
+	BiosTypeSeabios BiosType = 2
+	BiosTypeOvmf    BiosType = 3
+)
+
+type Scheduler int
+
+const (
+	SchedulerUnknown  Scheduler = 0
+	SchedulerSedf     Scheduler = 4
+	SchedulerCredit   Scheduler = 5
+	SchedulerCredit2  Scheduler = 6
+	SchedulerArinc653 Scheduler = 7
+	SchedulerRtds     Scheduler = 8
+	SchedulerNull     Scheduler = 9
+)
+
+type ShutdownReason int
+
+const (
+	ShutdownReasonUnknown   ShutdownReason = -1
+	ShutdownReasonPoweroff  ShutdownReason = 0
+	ShutdownReasonReboot    ShutdownReason = 1
+	ShutdownReasonSuspend   ShutdownReason = 2
+	ShutdownReasonCrash     ShutdownReason = 3
+	ShutdownReasonWatchdog  ShutdownReason = 4
+	ShutdownReasonSoftReset ShutdownReason = 5
+)
+
+type VgaInterfaceType int
+
+const (
+	VgaInterfaceTypeUnknown VgaInterfaceType = 0
+	VgaInterfaceTypeCirrus  VgaInterfaceType = 1
+	VgaInterfaceTypeStd     VgaInterfaceType = 2
+	VgaInterfaceTypeNone    VgaInterfaceType = 3
+	VgaInterfaceTypeQxl     VgaInterfaceType = 4
+)
+
+type VendorDevice int
+
+const (
+	VendorDeviceNone      VendorDevice = 0
+	VendorDeviceXenserver VendorDevice = 1
+)
+
+type ViridianEnlightenment int
+
+const (
+	ViridianEnlightenmentBase                ViridianEnlightenment = 0
+	ViridianEnlightenmentFreq                ViridianEnlightenment = 1
+	ViridianEnlightenmentTimeRefCount        ViridianEnlightenment = 2
+	ViridianEnlightenmentReferenceTsc        ViridianEnlightenment = 3
+	ViridianEnlightenmentHcallRemoteTlbFlush ViridianEnlightenment = 4
+	ViridianEnlightenmentApicAssist          ViridianEnlightenment = 5
+	ViridianEnlightenmentCrashCtl            ViridianEnlightenment = 6
+	ViridianEnlightenmentSynic               ViridianEnlightenment = 7
+	ViridianEnlightenmentStimer              ViridianEnlightenment = 8
+	ViridianEnlightenmentHcallIpi            ViridianEnlightenment = 9
+)
+
+type Hdtype int
+
+const (
+	HdtypeIde  Hdtype = 1
+	HdtypeAhci Hdtype = 2
+)
+
+type CheckpointedStream int
+
+const (
+	CheckpointedStreamNone  CheckpointedStream = 0
+	CheckpointedStreamRemus CheckpointedStream = 1
+	CheckpointedStreamColo  CheckpointedStream = 2
+)
+
+type VuartType int
+
+const (
+	VuartTypeUnknown  VuartType = 0
+	VuartTypeSbsaUart VuartType = 1
+)
+
+type VkbBackend int
+
+const (
+	VkbBackendUnknown VkbBackend = 0
+	VkbBackendQemu    VkbBackend = 1
+	VkbBackendLinux   VkbBackend = 2
+)
+
+type GicVersion int
+
+const (
+	GicVersionDefault GicVersion = 0
+	GicVersionV2      GicVersion = 32
+	GicVersionV3      GicVersion = 48
+)
+
+type TeeType int
+
+const (
+	TeeTypeNone  TeeType = 0
+	TeeTypeOptee TeeType = 1
+)
+
+type Altp2MMode int
+
+const (
+	Altp2MModeDisabled Altp2MMode = 0
+	Altp2MModeMixed    Altp2MMode = 1
+	Altp2MModeExternal Altp2MMode = 2
+	Altp2MModeLimited  Altp2MMode = 3
+)
+
+type UsbctrlType int
+
+const (
+	UsbctrlTypeAuto        UsbctrlType = 0
+	UsbctrlTypePv          UsbctrlType = 1
+	UsbctrlTypeDevicemodel UsbctrlType = 2
+	UsbctrlTypeQusb        UsbctrlType = 3
+)
+
+type UsbdevType int
+
+const (
+	UsbdevTypeHostdev UsbdevType = 1
+)
+
+type VsndPcmFormat int
+
+const (
+	VsndPcmFormatS8               VsndPcmFormat = 1
+	VsndPcmFormatU8               VsndPcmFormat = 2
+	VsndPcmFormatS16Le            VsndPcmFormat = 3
+	VsndPcmFormatS16Be            VsndPcmFormat = 4
+	VsndPcmFormatU16Le            VsndPcmFormat = 5
+	VsndPcmFormatU16Be            VsndPcmFormat = 6
+	VsndPcmFormatS24Le            VsndPcmFormat = 7
+	VsndPcmFormatS24Be            VsndPcmFormat = 8
+	VsndPcmFormatU24Le            VsndPcmFormat = 9
+	VsndPcmFormatU24Be            VsndPcmFormat = 10
+	VsndPcmFormatS32Le            VsndPcmFormat = 11
+	VsndPcmFormatS32Be            VsndPcmFormat = 12
+	VsndPcmFormatU32Le            VsndPcmFormat = 13
+	VsndPcmFormatU32Be            VsndPcmFormat = 14
+	VsndPcmFormatF32Le            VsndPcmFormat = 15
+	VsndPcmFormatF32Be            VsndPcmFormat = 16
+	VsndPcmFormatF64Le            VsndPcmFormat = 17
+	VsndPcmFormatF64Be            VsndPcmFormat = 18
+	VsndPcmFormatIec958SubframeLe VsndPcmFormat = 19
+	VsndPcmFormatIec958SubframeBe VsndPcmFormat = 20
+	VsndPcmFormatMuLaw            VsndPcmFormat = 21
+	VsndPcmFormatALaw             VsndPcmFormat = 22
+	VsndPcmFormatImaAdpcm         VsndPcmFormat = 23
+	VsndPcmFormatMpeg             VsndPcmFormat = 24
+	VsndPcmFormatGsm              VsndPcmFormat = 25
+)
+
+type VsndStreamType int
+
+const (
+	VsndStreamTypeP VsndStreamType = 1
+	VsndStreamTypeC VsndStreamType = 2
+)
+
+type EventType int
+
+const (
+	EventTypeDomainShutdown               EventType = 1
+	EventTypeDomainDeath                  EventType = 2
+	EventTypeDiskEject                    EventType = 3
+	EventTypeOperationComplete            EventType = 4
+	EventTypeDomainCreateConsoleAvailable EventType = 5
+)
+
+type PsrCmtType int
+
+const (
+	PsrCmtTypeCacheOccupancy PsrCmtType = 1
+	PsrCmtTypeTotalMemCount  PsrCmtType = 2
+	PsrCmtTypeLocalMemCount  PsrCmtType = 3
+)
+
+type PsrCbmType int
+
+const (
+	PsrCbmTypeUnknown   PsrCbmType = 0
+	PsrCbmTypeL3Cbm     PsrCbmType = 1
+	PsrCbmTypeL3CbmCode PsrCbmType = 2
+	PsrCbmTypeL3CbmData PsrCbmType = 3
+	PsrCbmTypeL2Cbm     PsrCbmType = 4
+	PsrCbmTypeMbaThrtl  PsrCbmType = 5
+)
+
+type PsrFeatType int
+
+const (
+	PsrFeatTypeCat PsrFeatType = 1
+	PsrFeatTypeMba PsrFeatType = 2
+)
-- 
2.19.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2019-10-07 15:13 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-07 15:12 [Xen-devel] [PATCH 00/24] generated Go libxl bindings using IDL Nick Rosbrook
2019-10-07 15:12 ` [Xen-devel] [PATCH 01/24] golang/xenlight: fix calls to libxl_domain_unpause/pause Nick Rosbrook
2019-10-07 16:39   ` George Dunlap
2019-10-08  4:17     ` Jürgen Groß
2019-10-07 15:12 ` Nick Rosbrook [this message]
2019-10-24 14:35   ` [Xen-devel] [PATCH 02/24] golang/xenlight: generate enum types from IDL George Dunlap
2019-10-07 15:12 ` [Xen-devel] [PATCH 03/24] golang/xenlight: define Defbool builtin type Nick Rosbrook
2019-10-24 15:17   ` George Dunlap
2019-10-07 15:12 ` [Xen-devel] [PATCH 04/24] golang/xenlight: define Devid type as int Nick Rosbrook
2019-10-24 15:20   ` George Dunlap
2019-10-07 15:12 ` [Xen-devel] [PATCH 05/24] golang/xenlight: define KeyValueList builtin type Nick Rosbrook
2019-10-24 16:34   ` George Dunlap
2019-10-24 19:54     ` Nick Rosbrook
2019-10-25 11:26       ` George Dunlap
2019-10-25 12:30         ` Nick Rosbrook
2019-10-07 15:12 ` [Xen-devel] [PATCH 06/24] golang/xenlight: re-name Bitmap marshaling functions Nick Rosbrook
2019-11-13 15:21   ` George Dunlap
2019-11-13 20:53     ` Nick Rosbrook
2019-11-14 11:44       ` George Dunlap
2019-10-07 15:12 ` [Xen-devel] [PATCH 07/24] golang/xenlight: define StringList builtin type Nick Rosbrook
2019-11-13 15:37   ` George Dunlap
2019-11-13 21:14     ` Nick Rosbrook
2019-10-07 15:12 ` [Xen-devel] [PATCH 08/24] golang/xenlight: define Mac " Nick Rosbrook
2019-11-13 15:51   ` George Dunlap
2019-11-13 21:50     ` Nick Rosbrook
2019-11-14 12:27       ` George Dunlap
2019-11-14 15:34         ` Nick Rosbrook
2019-10-07 15:12 ` [Xen-devel] [PATCH 09/24] golang/xenlight: define MsVmGenid " Nick Rosbrook
2019-11-13 16:20   ` George Dunlap
2019-10-07 15:12 ` [Xen-devel] [PATCH 10/24] golang/xenlight: define EvLink builtin as empty struct Nick Rosbrook
2019-11-13 16:23   ` George Dunlap
2019-10-07 15:12 ` [Xen-devel] [PATCH 11/24] golang/xenlight: define CpuidPolicyList builtin type Nick Rosbrook
2019-11-13 17:34   ` George Dunlap
2019-11-14 14:58     ` Nick Rosbrook
2019-11-14 17:44       ` George Dunlap
2019-11-15 15:26         ` Nick Rosbrook
2019-11-15 15:42           ` George Dunlap
2019-11-15 15:51             ` Nick Rosbrook
2019-11-15 15:58               ` George Dunlap
2019-11-15 16:06                 ` Nick Rosbrook
2019-10-07 15:12 ` [Xen-devel] [PATCH 12/24] golang/xenlight: re-factor Uuid type implementation Nick Rosbrook
2019-11-13 17:47   ` George Dunlap
2019-10-07 15:13 ` [Xen-devel] [PATCH 13/24] golang/xenlight: re-factor Hwcap " Nick Rosbrook
2019-11-13 17:58   ` George Dunlap
2019-10-07 15:13 ` [Xen-devel] [PATCH 14/24] golang/xenlight: generate structs from the IDL Nick Rosbrook
2019-11-14 14:18   ` George Dunlap
2019-11-14 16:15     ` Nick Rosbrook
2019-10-07 15:13 ` [Xen-devel] [PATCH 15/24] golang/xenlight: remove no-longer used type MemKB Nick Rosbrook
2019-11-14 14:18   ` George Dunlap
2019-10-07 15:13 ` [Xen-devel] [PATCH 16/24] golang/xenlight: begin C to Go type marshaling Nick Rosbrook
2019-10-07 15:13 ` [Xen-devel] [PATCH 17/24] golang/xenlight: implement keyed union C to Go marshaling Nick Rosbrook
2019-10-07 15:13 ` [Xen-devel] [PATCH 18/24] golang/xenlight: implement array " Nick Rosbrook
2019-10-07 15:13 ` [Xen-devel] [PATCH 19/24] golang/xenlight: begin Go to C type marshaling Nick Rosbrook
2019-10-07 15:13 ` [Xen-devel] [PATCH 20/24] golang/xenlight: implement keyed union Go to C marshaling Nick Rosbrook
2019-10-07 15:13 ` [Xen-devel] [PATCH 21/24] golang/xenlight: implement array " Nick Rosbrook
2019-10-07 15:13 ` [Xen-devel] [PATCH 22/24] golang/xenlight: revise use of Context type Nick Rosbrook
2019-10-07 15:13 ` [Xen-devel] [PATCH 23/24] golang/xenlight: add error return type to Context.Cpupoolinfo Nick Rosbrook
2019-10-07 15:13 ` [Xen-devel] [PATCH 24/24] golang/xenlight: add make target for generated files Nick Rosbrook
2019-10-24 14:26   ` George Dunlap
2019-10-24 18:49     ` Nick Rosbrook
2019-11-14 17:19       ` George Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2bef5bfd9cc33260be663b84d2b813f28f0f3c47.1570456846.git.rosbrookn@ainfosec.com \
    --to=rosbrookn@gmail.com \
    --cc=george.dunlap@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=kerriganb@ainfosec.com \
    --cc=rosbrookn@ainfosec.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.