diff --git a/README.md b/README.md index 685ff33..969a6b6 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ libvirt [![GoDoc](http://godoc.org/github.com/digitalocean/go-libvirt?status.svg)](http://godoc.org/github.com/digitalocean/go-libvirt) [![Build Status](https://travis-ci.org/digitalocean/go-libvirt.svg?branch=master)](https://travis-ci.org/digitalocean/go-libvirt) [![Report Card](https://goreportcard.com/badge/github.com/digitalocean/go-libvirt)](https://goreportcard.com/report/github.com/digitalocean/go-libvirt) ==== -Package `libvirt` provides a pure Go interface for interacting with Libvirt. +Package `go-libvirt` provides a pure Go interface for interacting with libvirt. Rather than using Libvirt's C bindings, this package makes use of -Libvirt's RPC interface, as documented [here](https://libvirt.org/internals/rpc.html). +libvirt's RPC interface, as documented [here](https://libvirt.org/internals/rpc.html). Connections to the libvirt server may be local, or remote. RPC packets are encoded using the XDR standard as defined by [RFC 4506](https://tools.ietf.org/html/rfc4506.html). -Libvirt's RPC interface is quite extensive, and changes from one version to the next, so +libvirt's RPC interface is quite extensive, and changes from one version to the next, so this project uses a code generator to build the go bindings. The code generator should be run whenever you want to build go-libvirt for a new version of libvirt. To do this, you'll need to set an environment variable `LIBVIRT_SOURCE` to the directory containing @@ -18,8 +18,64 @@ and produces go bindings for all the remote procedures defined there. [Pull requests are welcome](https://github.com/digitalocean/go-libvirt/blob/master/CONTRIBUTING.md)! -Feel free to join us in [`#go-qemu` on freenode](https://webchat.freenode.net/) -if you'd like to discuss the project. +How to Use This Library +----------------------- +Once you've vendored go-libvirt into your project, you'll probably want to call +some libvirt functions. There's some example code below showing how to connect +to libvirt and make one such call, but once you get past the introduction you'll +next want to call some other libvirt functions. How do you find them? + +Start with the [libvirt API reference](https://libvirt.org/html/index.html). +Let's say you want to gracefully shutdown a VM, and after reading through the +libvirt docs you determine that virDomainShutdown() is the function you want to +call to do that. Where's that function in go-libvirt? We transform the names +slightly when building the go bindings. There's no need for a global prefix like +"vir" in Go, since all our functions are inside the package namespace, so we +drop it. That means the Go function for `virDomainShutdown()` is just `DomainShutdown()`, +and sure enough, you can find the Go function `DomainShutdown()` in libvirt.gen.go, +with parameters and return values equivalent to those documented in the API +reference. + +Suppose you then decide you need more control over your shutdown, so you switch +over to `virDomainShutdownFlags()`. As its name suggests, this function takes a +flag parameter which has possible values specified in an enum called +`virDomainShutdownFlagValues`. Flag types like this are a little tricky for the +code generator, because the C functions just take an integer type - only the +libvirt documentation actually ties the flags to the enum types. In most cases +though we're able to generate a wrapper function with a distinct flag type, +making it easier for Go tooling to suggest possible flag values while you're +working. Checking the documentation for this function: + +`godoc github.com/digitalocean/go-libvirt DomainShutdownFlags` + +returns this: + +`func (l *Libvirt) DomainShutdownFlags(Dom Domain, Flags DomainShutdownFlagValues) (err error)` + +If you want to see the possible flag values, `godoc` can help again: + +``` +$ godoc github.com/digitalocean/go-libvirt DomainShutdownFlagValues + +type DomainShutdownFlagValues int32 + DomainShutdownFlagValues as declared in libvirt/libvirt-domain.h:1121 + +const ( + DomainShutdownDefault DomainShutdownFlagValues = iota + DomainShutdownAcpiPowerBtn DomainShutdownFlagValues = 1 + DomainShutdownGuestAgent DomainShutdownFlagValues = 2 + DomainShutdownInitctl DomainShutdownFlagValues = 4 + DomainShutdownSignal DomainShutdownFlagValues = 8 + DomainShutdownParavirt DomainShutdownFlagValues = 16 +) + DomainShutdownFlagValues enumeration from libvirt/libvirt-domain.h:1121 +``` + +One other suggestion: most of the code in go-libvirt is now generated, but a few +hand-written routines still exist in libvirt.go, and wrap calls to the generated +code with slightly different parameters or return values. We suggest avoiding +these hand-written routines and calling the generated routines in libvirt.gen.go +instead. Over time these handwritten routines will be removed from go-libvirt. Warning ------- diff --git a/const.gen.go b/const.gen.go new file mode 100644 index 0000000..9f444e8 --- /dev/null +++ b/const.gen.go @@ -0,0 +1,1995 @@ +// Copyright 2017 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. +// + +// WARNING: This file has automatically been generated +// by https://git.io/c-for-go. DO NOT EDIT. + +package libvirt + +const ( + // ExportVar as defined in libvirt/libvirt-common.h:58 + ExportVar = 0 + // TypedParamFieldLength as defined in libvirt/libvirt-common.h:171 + TypedParamFieldLength = 80 + // SecurityLabelBuflen as defined in libvirt/libvirt-host.h:85 + SecurityLabelBuflen = 4097 + // SecurityModelBuflen as defined in libvirt/libvirt-host.h:113 + SecurityModelBuflen = 257 + // SecurityDoiBuflen as defined in libvirt/libvirt-host.h:120 + SecurityDoiBuflen = 257 + // NodeCPUStatsFieldLength as defined in libvirt/libvirt-host.h:177 + NodeCPUStatsFieldLength = 80 + // NodeCPUStatsKernel as defined in libvirt/libvirt-host.h:194 + NodeCPUStatsKernel = "kernel" + // NodeCPUStatsUser as defined in libvirt/libvirt-host.h:202 + NodeCPUStatsUser = "user" + // NodeCPUStatsIdle as defined in libvirt/libvirt-host.h:210 + NodeCPUStatsIdle = "idle" + // NodeCPUStatsIowait as defined in libvirt/libvirt-host.h:218 + NodeCPUStatsIowait = "iowait" + // NodeCPUStatsIntr as defined in libvirt/libvirt-host.h:226 + NodeCPUStatsIntr = "intr" + // NodeCPUStatsUtilization as defined in libvirt/libvirt-host.h:235 + NodeCPUStatsUtilization = "utilization" + // NodeMemoryStatsFieldLength as defined in libvirt/libvirt-host.h:255 + NodeMemoryStatsFieldLength = 80 + // NodeMemoryStatsTotal as defined in libvirt/libvirt-host.h:272 + NodeMemoryStatsTotal = "total" + // NodeMemoryStatsFree as defined in libvirt/libvirt-host.h:281 + NodeMemoryStatsFree = "free" + // NodeMemoryStatsBuffers as defined in libvirt/libvirt-host.h:289 + NodeMemoryStatsBuffers = "buffers" + // NodeMemoryStatsCached as defined in libvirt/libvirt-host.h:297 + NodeMemoryStatsCached = "cached" + // NodeMemorySharedPagesToScan as defined in libvirt/libvirt-host.h:318 + NodeMemorySharedPagesToScan = "shm_pages_to_scan" + // NodeMemorySharedSleepMillisecs as defined in libvirt/libvirt-host.h:326 + NodeMemorySharedSleepMillisecs = "shm_sleep_millisecs" + // NodeMemorySharedPagesShared as defined in libvirt/libvirt-host.h:334 + NodeMemorySharedPagesShared = "shm_pages_shared" + // NodeMemorySharedPagesSharing as defined in libvirt/libvirt-host.h:342 + NodeMemorySharedPagesSharing = "shm_pages_sharing" + // NodeMemorySharedPagesUnshared as defined in libvirt/libvirt-host.h:350 + NodeMemorySharedPagesUnshared = "shm_pages_unshared" + // NodeMemorySharedPagesVolatile as defined in libvirt/libvirt-host.h:358 + NodeMemorySharedPagesVolatile = "shm_pages_volatile" + // NodeMemorySharedFullScans as defined in libvirt/libvirt-host.h:366 + NodeMemorySharedFullScans = "shm_full_scans" + // NodeMemorySharedMergeAcrossNodes as defined in libvirt/libvirt-host.h:378 + NodeMemorySharedMergeAcrossNodes = "shm_merge_across_nodes" + // UUIDBuflen as defined in libvirt/libvirt-host.h:513 + UUIDBuflen = 16 + // UUIDStringBuflen as defined in libvirt/libvirt-host.h:522 + UUIDStringBuflen = 37 + // DomainSchedulerCPUShares as defined in libvirt/libvirt-domain.h:315 + DomainSchedulerCPUShares = "cpu_shares" + // DomainSchedulerGlobalPeriod as defined in libvirt/libvirt-domain.h:323 + DomainSchedulerGlobalPeriod = "global_period" + // DomainSchedulerGlobalQuota as defined in libvirt/libvirt-domain.h:331 + DomainSchedulerGlobalQuota = "global_quota" + // DomainSchedulerVCPUPeriod as defined in libvirt/libvirt-domain.h:339 + DomainSchedulerVCPUPeriod = "vcpu_period" + // DomainSchedulerVCPUQuota as defined in libvirt/libvirt-domain.h:347 + DomainSchedulerVCPUQuota = "vcpu_quota" + // DomainSchedulerEmulatorPeriod as defined in libvirt/libvirt-domain.h:356 + DomainSchedulerEmulatorPeriod = "emulator_period" + // DomainSchedulerEmulatorQuota as defined in libvirt/libvirt-domain.h:365 + DomainSchedulerEmulatorQuota = "emulator_quota" + // DomainSchedulerIothreadPeriod as defined in libvirt/libvirt-domain.h:373 + DomainSchedulerIothreadPeriod = "iothread_period" + // DomainSchedulerIothreadQuota as defined in libvirt/libvirt-domain.h:381 + DomainSchedulerIothreadQuota = "iothread_quota" + // DomainSchedulerWeight as defined in libvirt/libvirt-domain.h:389 + DomainSchedulerWeight = "weight" + // DomainSchedulerCap as defined in libvirt/libvirt-domain.h:397 + DomainSchedulerCap = "cap" + // DomainSchedulerReservation as defined in libvirt/libvirt-domain.h:405 + DomainSchedulerReservation = "reservation" + // DomainSchedulerLimit as defined in libvirt/libvirt-domain.h:413 + DomainSchedulerLimit = "limit" + // DomainSchedulerShares as defined in libvirt/libvirt-domain.h:421 + DomainSchedulerShares = "shares" + // DomainBlockStatsFieldLength as defined in libvirt/libvirt-domain.h:479 + DomainBlockStatsFieldLength = 80 + // DomainBlockStatsReadBytes as defined in libvirt/libvirt-domain.h:487 + DomainBlockStatsReadBytes = "rd_bytes" + // DomainBlockStatsReadReq as defined in libvirt/libvirt-domain.h:495 + DomainBlockStatsReadReq = "rd_operations" + // DomainBlockStatsReadTotalTimes as defined in libvirt/libvirt-domain.h:503 + DomainBlockStatsReadTotalTimes = "rd_total_times" + // DomainBlockStatsWriteBytes as defined in libvirt/libvirt-domain.h:511 + DomainBlockStatsWriteBytes = "wr_bytes" + // DomainBlockStatsWriteReq as defined in libvirt/libvirt-domain.h:519 + DomainBlockStatsWriteReq = "wr_operations" + // DomainBlockStatsWriteTotalTimes as defined in libvirt/libvirt-domain.h:527 + DomainBlockStatsWriteTotalTimes = "wr_total_times" + // DomainBlockStatsFlushReq as defined in libvirt/libvirt-domain.h:535 + DomainBlockStatsFlushReq = "flush_operations" + // DomainBlockStatsFlushTotalTimes as defined in libvirt/libvirt-domain.h:543 + DomainBlockStatsFlushTotalTimes = "flush_total_times" + // DomainBlockStatsErrs as defined in libvirt/libvirt-domain.h:550 + DomainBlockStatsErrs = "errs" + // MigrateParamURI as defined in libvirt/libvirt-domain.h:842 + MigrateParamURI = "migrate_uri" + // MigrateParamDestName as defined in libvirt/libvirt-domain.h:852 + MigrateParamDestName = "destination_name" + // MigrateParamDestXML as defined in libvirt/libvirt-domain.h:871 + MigrateParamDestXML = "destination_xml" + // MigrateParamPersistXML as defined in libvirt/libvirt-domain.h:886 + MigrateParamPersistXML = "persistent_xml" + // MigrateParamBandwidth as defined in libvirt/libvirt-domain.h:896 + MigrateParamBandwidth = "bandwidth" + // MigrateParamGraphicsURI as defined in libvirt/libvirt-domain.h:917 + MigrateParamGraphicsURI = "graphics_uri" + // MigrateParamListenAddress as defined in libvirt/libvirt-domain.h:928 + MigrateParamListenAddress = "listen_address" + // MigrateParamMigrateDisks as defined in libvirt/libvirt-domain.h:937 + MigrateParamMigrateDisks = "migrate_disks" + // MigrateParamDisksPort as defined in libvirt/libvirt-domain.h:947 + MigrateParamDisksPort = "disks_port" + // MigrateParamCompression as defined in libvirt/libvirt-domain.h:957 + MigrateParamCompression = "compression" + // MigrateParamCompressionMtLevel as defined in libvirt/libvirt-domain.h:966 + MigrateParamCompressionMtLevel = "compression.mt.level" + // MigrateParamCompressionMtThreads as defined in libvirt/libvirt-domain.h:974 + MigrateParamCompressionMtThreads = "compression.mt.threads" + // MigrateParamCompressionMtDthreads as defined in libvirt/libvirt-domain.h:982 + MigrateParamCompressionMtDthreads = "compression.mt.dthreads" + // MigrateParamCompressionXbzrleCache as defined in libvirt/libvirt-domain.h:990 + MigrateParamCompressionXbzrleCache = "compression.xbzrle.cache" + // MigrateParamAutoConvergeInitial as defined in libvirt/libvirt-domain.h:999 + MigrateParamAutoConvergeInitial = "auto_converge.initial" + // MigrateParamAutoConvergeIncrement as defined in libvirt/libvirt-domain.h:1009 + MigrateParamAutoConvergeIncrement = "auto_converge.increment" + // DomainCPUStatsCputime as defined in libvirt/libvirt-domain.h:1252 + DomainCPUStatsCputime = "cpu_time" + // DomainCPUStatsUsertime as defined in libvirt/libvirt-domain.h:1258 + DomainCPUStatsUsertime = "user_time" + // DomainCPUStatsSystemtime as defined in libvirt/libvirt-domain.h:1264 + DomainCPUStatsSystemtime = "system_time" + // DomainCPUStatsVcputime as defined in libvirt/libvirt-domain.h:1271 + DomainCPUStatsVcputime = "vcpu_time" + // DomainBlkioWeight as defined in libvirt/libvirt-domain.h:1300 + DomainBlkioWeight = "weight" + // DomainBlkioDeviceWeight as defined in libvirt/libvirt-domain.h:1310 + DomainBlkioDeviceWeight = "device_weight" + // DomainBlkioDeviceReadIops as defined in libvirt/libvirt-domain.h:1321 + DomainBlkioDeviceReadIops = "device_read_iops_sec" + // DomainBlkioDeviceWriteIops as defined in libvirt/libvirt-domain.h:1332 + DomainBlkioDeviceWriteIops = "device_write_iops_sec" + // DomainBlkioDeviceReadBps as defined in libvirt/libvirt-domain.h:1343 + DomainBlkioDeviceReadBps = "device_read_bytes_sec" + // DomainBlkioDeviceWriteBps as defined in libvirt/libvirt-domain.h:1354 + DomainBlkioDeviceWriteBps = "device_write_bytes_sec" + // DomainMemoryParamUnlimited as defined in libvirt/libvirt-domain.h:1373 + DomainMemoryParamUnlimited = 9007199254740991 + // DomainMemoryHardLimit as defined in libvirt/libvirt-domain.h:1382 + DomainMemoryHardLimit = "hard_limit" + // DomainMemorySoftLimit as defined in libvirt/libvirt-domain.h:1391 + DomainMemorySoftLimit = "soft_limit" + // DomainMemoryMinGuarantee as defined in libvirt/libvirt-domain.h:1400 + DomainMemoryMinGuarantee = "min_guarantee" + // DomainMemorySwapHardLimit as defined in libvirt/libvirt-domain.h:1410 + DomainMemorySwapHardLimit = "swap_hard_limit" + // DomainNumaNodeset as defined in libvirt/libvirt-domain.h:1455 + DomainNumaNodeset = "numa_nodeset" + // DomainNumaMode as defined in libvirt/libvirt-domain.h:1463 + DomainNumaMode = "numa_mode" + // DomainBandwidthInAverage as defined in libvirt/libvirt-domain.h:1575 + DomainBandwidthInAverage = "inbound.average" + // DomainBandwidthInPeak as defined in libvirt/libvirt-domain.h:1582 + DomainBandwidthInPeak = "inbound.peak" + // DomainBandwidthInBurst as defined in libvirt/libvirt-domain.h:1589 + DomainBandwidthInBurst = "inbound.burst" + // DomainBandwidthInFloor as defined in libvirt/libvirt-domain.h:1596 + DomainBandwidthInFloor = "inbound.floor" + // DomainBandwidthOutAverage as defined in libvirt/libvirt-domain.h:1603 + DomainBandwidthOutAverage = "outbound.average" + // DomainBandwidthOutPeak as defined in libvirt/libvirt-domain.h:1610 + DomainBandwidthOutPeak = "outbound.peak" + // DomainBandwidthOutBurst as defined in libvirt/libvirt-domain.h:1617 + DomainBandwidthOutBurst = "outbound.burst" + // PerfParamCmt as defined in libvirt/libvirt-domain.h:2073 + PerfParamCmt = "cmt" + // PerfParamMbmt as defined in libvirt/libvirt-domain.h:2084 + PerfParamMbmt = "mbmt" + // PerfParamMbml as defined in libvirt/libvirt-domain.h:2094 + PerfParamMbml = "mbml" + // PerfParamCacheMisses as defined in libvirt/libvirt-domain.h:2104 + PerfParamCacheMisses = "cache_misses" + // PerfParamCacheReferences as defined in libvirt/libvirt-domain.h:2114 + PerfParamCacheReferences = "cache_references" + // PerfParamInstructions as defined in libvirt/libvirt-domain.h:2124 + PerfParamInstructions = "instructions" + // PerfParamCPUCycles as defined in libvirt/libvirt-domain.h:2134 + PerfParamCPUCycles = "cpu_cycles" + // PerfParamBranchInstructions as defined in libvirt/libvirt-domain.h:2144 + PerfParamBranchInstructions = "branch_instructions" + // PerfParamBranchMisses as defined in libvirt/libvirt-domain.h:2154 + PerfParamBranchMisses = "branch_misses" + // PerfParamBusCycles as defined in libvirt/libvirt-domain.h:2164 + PerfParamBusCycles = "bus_cycles" + // PerfParamStalledCyclesFrontend as defined in libvirt/libvirt-domain.h:2175 + PerfParamStalledCyclesFrontend = "stalled_cycles_frontend" + // PerfParamStalledCyclesBackend as defined in libvirt/libvirt-domain.h:2186 + PerfParamStalledCyclesBackend = "stalled_cycles_backend" + // PerfParamRefCPUCycles as defined in libvirt/libvirt-domain.h:2197 + PerfParamRefCPUCycles = "ref_cpu_cycles" + // PerfParamCPUClock as defined in libvirt/libvirt-domain.h:2208 + PerfParamCPUClock = "cpu_clock" + // PerfParamTaskClock as defined in libvirt/libvirt-domain.h:2219 + PerfParamTaskClock = "task_clock" + // PerfParamPageFaults as defined in libvirt/libvirt-domain.h:2229 + PerfParamPageFaults = "page_faults" + // PerfParamContextSwitches as defined in libvirt/libvirt-domain.h:2239 + PerfParamContextSwitches = "context_switches" + // PerfParamCPUMigrations as defined in libvirt/libvirt-domain.h:2249 + PerfParamCPUMigrations = "cpu_migrations" + // PerfParamPageFaultsMin as defined in libvirt/libvirt-domain.h:2259 + PerfParamPageFaultsMin = "page_faults_min" + // PerfParamPageFaultsMaj as defined in libvirt/libvirt-domain.h:2269 + PerfParamPageFaultsMaj = "page_faults_maj" + // PerfParamAlignmentFaults as defined in libvirt/libvirt-domain.h:2279 + PerfParamAlignmentFaults = "alignment_faults" + // PerfParamEmulationFaults as defined in libvirt/libvirt-domain.h:2289 + PerfParamEmulationFaults = "emulation_faults" + // DomainBlockCopyBandwidth as defined in libvirt/libvirt-domain.h:2453 + DomainBlockCopyBandwidth = "bandwidth" + // DomainBlockCopyGranularity as defined in libvirt/libvirt-domain.h:2464 + DomainBlockCopyGranularity = "granularity" + // DomainBlockCopyBufSize as defined in libvirt/libvirt-domain.h:2473 + DomainBlockCopyBufSize = "buf-size" + // DomainBlockIotuneTotalBytesSec as defined in libvirt/libvirt-domain.h:2514 + DomainBlockIotuneTotalBytesSec = "total_bytes_sec" + // DomainBlockIotuneReadBytesSec as defined in libvirt/libvirt-domain.h:2522 + DomainBlockIotuneReadBytesSec = "read_bytes_sec" + // DomainBlockIotuneWriteBytesSec as defined in libvirt/libvirt-domain.h:2530 + DomainBlockIotuneWriteBytesSec = "write_bytes_sec" + // DomainBlockIotuneTotalIopsSec as defined in libvirt/libvirt-domain.h:2538 + DomainBlockIotuneTotalIopsSec = "total_iops_sec" + // DomainBlockIotuneReadIopsSec as defined in libvirt/libvirt-domain.h:2546 + DomainBlockIotuneReadIopsSec = "read_iops_sec" + // DomainBlockIotuneWriteIopsSec as defined in libvirt/libvirt-domain.h:2553 + DomainBlockIotuneWriteIopsSec = "write_iops_sec" + // DomainBlockIotuneTotalBytesSecMax as defined in libvirt/libvirt-domain.h:2561 + DomainBlockIotuneTotalBytesSecMax = "total_bytes_sec_max" + // DomainBlockIotuneReadBytesSecMax as defined in libvirt/libvirt-domain.h:2569 + DomainBlockIotuneReadBytesSecMax = "read_bytes_sec_max" + // DomainBlockIotuneWriteBytesSecMax as defined in libvirt/libvirt-domain.h:2577 + DomainBlockIotuneWriteBytesSecMax = "write_bytes_sec_max" + // DomainBlockIotuneTotalIopsSecMax as defined in libvirt/libvirt-domain.h:2585 + DomainBlockIotuneTotalIopsSecMax = "total_iops_sec_max" + // DomainBlockIotuneReadIopsSecMax as defined in libvirt/libvirt-domain.h:2593 + DomainBlockIotuneReadIopsSecMax = "read_iops_sec_max" + // DomainBlockIotuneWriteIopsSecMax as defined in libvirt/libvirt-domain.h:2600 + DomainBlockIotuneWriteIopsSecMax = "write_iops_sec_max" + // DomainBlockIotuneTotalBytesSecMaxLength as defined in libvirt/libvirt-domain.h:2608 + DomainBlockIotuneTotalBytesSecMaxLength = "total_bytes_sec_max_length" + // DomainBlockIotuneReadBytesSecMaxLength as defined in libvirt/libvirt-domain.h:2616 + DomainBlockIotuneReadBytesSecMaxLength = "read_bytes_sec_max_length" + // DomainBlockIotuneWriteBytesSecMaxLength as defined in libvirt/libvirt-domain.h:2624 + DomainBlockIotuneWriteBytesSecMaxLength = "write_bytes_sec_max_length" + // DomainBlockIotuneTotalIopsSecMaxLength as defined in libvirt/libvirt-domain.h:2632 + DomainBlockIotuneTotalIopsSecMaxLength = "total_iops_sec_max_length" + // DomainBlockIotuneReadIopsSecMaxLength as defined in libvirt/libvirt-domain.h:2640 + DomainBlockIotuneReadIopsSecMaxLength = "read_iops_sec_max_length" + // DomainBlockIotuneWriteIopsSecMaxLength as defined in libvirt/libvirt-domain.h:2648 + DomainBlockIotuneWriteIopsSecMaxLength = "write_iops_sec_max_length" + // DomainBlockIotuneSizeIopsSec as defined in libvirt/libvirt-domain.h:2655 + DomainBlockIotuneSizeIopsSec = "size_iops_sec" + // DomainBlockIotuneGroupName as defined in libvirt/libvirt-domain.h:2662 + DomainBlockIotuneGroupName = "group_name" + // DomainSendKeyMaxKeys as defined in libvirt/libvirt-domain.h:2743 + DomainSendKeyMaxKeys = 16 + // DomainJobOperationStr as defined in libvirt/libvirt-domain.h:3155 + DomainJobOperationStr = "operation" + // DomainJobTimeElapsed as defined in libvirt/libvirt-domain.h:3165 + DomainJobTimeElapsed = "time_elapsed" + // DomainJobTimeElapsedNet as defined in libvirt/libvirt-domain.h:3175 + DomainJobTimeElapsedNet = "time_elapsed_net" + // DomainJobTimeRemaining as defined in libvirt/libvirt-domain.h:3185 + DomainJobTimeRemaining = "time_remaining" + // DomainJobDowntime as defined in libvirt/libvirt-domain.h:3195 + DomainJobDowntime = "downtime" + // DomainJobDowntimeNet as defined in libvirt/libvirt-domain.h:3204 + DomainJobDowntimeNet = "downtime_net" + // DomainJobSetupTime as defined in libvirt/libvirt-domain.h:3213 + DomainJobSetupTime = "setup_time" + // DomainJobDataTotal as defined in libvirt/libvirt-domain.h:3228 + DomainJobDataTotal = "data_total" + // DomainJobDataProcessed as defined in libvirt/libvirt-domain.h:3238 + DomainJobDataProcessed = "data_processed" + // DomainJobDataRemaining as defined in libvirt/libvirt-domain.h:3248 + DomainJobDataRemaining = "data_remaining" + // DomainJobMemoryTotal as defined in libvirt/libvirt-domain.h:3258 + DomainJobMemoryTotal = "memory_total" + // DomainJobMemoryProcessed as defined in libvirt/libvirt-domain.h:3268 + DomainJobMemoryProcessed = "memory_processed" + // DomainJobMemoryRemaining as defined in libvirt/libvirt-domain.h:3278 + DomainJobMemoryRemaining = "memory_remaining" + // DomainJobMemoryConstant as defined in libvirt/libvirt-domain.h:3290 + DomainJobMemoryConstant = "memory_constant" + // DomainJobMemoryNormal as defined in libvirt/libvirt-domain.h:3300 + DomainJobMemoryNormal = "memory_normal" + // DomainJobMemoryNormalBytes as defined in libvirt/libvirt-domain.h:3310 + DomainJobMemoryNormalBytes = "memory_normal_bytes" + // DomainJobMemoryBps as defined in libvirt/libvirt-domain.h:3318 + DomainJobMemoryBps = "memory_bps" + // DomainJobMemoryDirtyRate as defined in libvirt/libvirt-domain.h:3326 + DomainJobMemoryDirtyRate = "memory_dirty_rate" + // DomainJobMemoryIteration as defined in libvirt/libvirt-domain.h:3337 + DomainJobMemoryIteration = "memory_iteration" + // DomainJobDiskTotal as defined in libvirt/libvirt-domain.h:3347 + DomainJobDiskTotal = "disk_total" + // DomainJobDiskProcessed as defined in libvirt/libvirt-domain.h:3357 + DomainJobDiskProcessed = "disk_processed" + // DomainJobDiskRemaining as defined in libvirt/libvirt-domain.h:3367 + DomainJobDiskRemaining = "disk_remaining" + // DomainJobDiskBps as defined in libvirt/libvirt-domain.h:3375 + DomainJobDiskBps = "disk_bps" + // DomainJobCompressionCache as defined in libvirt/libvirt-domain.h:3384 + DomainJobCompressionCache = "compression_cache" + // DomainJobCompressionBytes as defined in libvirt/libvirt-domain.h:3392 + DomainJobCompressionBytes = "compression_bytes" + // DomainJobCompressionPages as defined in libvirt/libvirt-domain.h:3400 + DomainJobCompressionPages = "compression_pages" + // DomainJobCompressionCacheMisses as defined in libvirt/libvirt-domain.h:3409 + DomainJobCompressionCacheMisses = "compression_cache_misses" + // DomainJobCompressionOverflow as defined in libvirt/libvirt-domain.h:3419 + DomainJobCompressionOverflow = "compression_overflow" + // DomainJobAutoConvergeThrottle as defined in libvirt/libvirt-domain.h:3428 + DomainJobAutoConvergeThrottle = "auto_converge_throttle" + // DomainTunableCPUVcpupin as defined in libvirt/libvirt-domain.h:3981 + DomainTunableCPUVcpupin = "cputune.vcpupin%u" + // DomainTunableCPUEmulatorpin as defined in libvirt/libvirt-domain.h:3989 + DomainTunableCPUEmulatorpin = "cputune.emulatorpin" + // DomainTunableCPUIothreadspin as defined in libvirt/libvirt-domain.h:3998 + DomainTunableCPUIothreadspin = "cputune.iothreadpin%u" + // DomainTunableCPUCpuShares as defined in libvirt/libvirt-domain.h:4006 + DomainTunableCPUCpuShares = "cputune.cpu_shares" + // DomainTunableCPUGlobalPeriod as defined in libvirt/libvirt-domain.h:4014 + DomainTunableCPUGlobalPeriod = "cputune.global_period" + // DomainTunableCPUGlobalQuota as defined in libvirt/libvirt-domain.h:4022 + DomainTunableCPUGlobalQuota = "cputune.global_quota" + // DomainTunableCPUVCPUPeriod as defined in libvirt/libvirt-domain.h:4030 + DomainTunableCPUVCPUPeriod = "cputune.vcpu_period" + // DomainTunableCPUVCPUQuota as defined in libvirt/libvirt-domain.h:4038 + DomainTunableCPUVCPUQuota = "cputune.vcpu_quota" + // DomainTunableCPUEmulatorPeriod as defined in libvirt/libvirt-domain.h:4047 + DomainTunableCPUEmulatorPeriod = "cputune.emulator_period" + // DomainTunableCPUEmulatorQuota as defined in libvirt/libvirt-domain.h:4056 + DomainTunableCPUEmulatorQuota = "cputune.emulator_quota" + // DomainTunableCPUIothreadPeriod as defined in libvirt/libvirt-domain.h:4064 + DomainTunableCPUIothreadPeriod = "cputune.iothread_period" + // DomainTunableCPUIothreadQuota as defined in libvirt/libvirt-domain.h:4072 + DomainTunableCPUIothreadQuota = "cputune.iothread_quota" + // DomainTunableBlkdevDisk as defined in libvirt/libvirt-domain.h:4080 + DomainTunableBlkdevDisk = "blkdeviotune.disk" + // DomainTunableBlkdevTotalBytesSec as defined in libvirt/libvirt-domain.h:4088 + DomainTunableBlkdevTotalBytesSec = "blkdeviotune.total_bytes_sec" + // DomainTunableBlkdevReadBytesSec as defined in libvirt/libvirt-domain.h:4096 + DomainTunableBlkdevReadBytesSec = "blkdeviotune.read_bytes_sec" + // DomainTunableBlkdevWriteBytesSec as defined in libvirt/libvirt-domain.h:4104 + DomainTunableBlkdevWriteBytesSec = "blkdeviotune.write_bytes_sec" + // DomainTunableBlkdevTotalIopsSec as defined in libvirt/libvirt-domain.h:4112 + DomainTunableBlkdevTotalIopsSec = "blkdeviotune.total_iops_sec" + // DomainTunableBlkdevReadIopsSec as defined in libvirt/libvirt-domain.h:4120 + DomainTunableBlkdevReadIopsSec = "blkdeviotune.read_iops_sec" + // DomainTunableBlkdevWriteIopsSec as defined in libvirt/libvirt-domain.h:4128 + DomainTunableBlkdevWriteIopsSec = "blkdeviotune.write_iops_sec" + // DomainTunableBlkdevTotalBytesSecMax as defined in libvirt/libvirt-domain.h:4136 + DomainTunableBlkdevTotalBytesSecMax = "blkdeviotune.total_bytes_sec_max" + // DomainTunableBlkdevReadBytesSecMax as defined in libvirt/libvirt-domain.h:4144 + DomainTunableBlkdevReadBytesSecMax = "blkdeviotune.read_bytes_sec_max" + // DomainTunableBlkdevWriteBytesSecMax as defined in libvirt/libvirt-domain.h:4152 + DomainTunableBlkdevWriteBytesSecMax = "blkdeviotune.write_bytes_sec_max" + // DomainTunableBlkdevTotalIopsSecMax as defined in libvirt/libvirt-domain.h:4160 + DomainTunableBlkdevTotalIopsSecMax = "blkdeviotune.total_iops_sec_max" + // DomainTunableBlkdevReadIopsSecMax as defined in libvirt/libvirt-domain.h:4168 + DomainTunableBlkdevReadIopsSecMax = "blkdeviotune.read_iops_sec_max" + // DomainTunableBlkdevWriteIopsSecMax as defined in libvirt/libvirt-domain.h:4176 + DomainTunableBlkdevWriteIopsSecMax = "blkdeviotune.write_iops_sec_max" + // DomainTunableBlkdevSizeIopsSec as defined in libvirt/libvirt-domain.h:4184 + DomainTunableBlkdevSizeIopsSec = "blkdeviotune.size_iops_sec" + // DomainTunableBlkdevGroupName as defined in libvirt/libvirt-domain.h:4192 + DomainTunableBlkdevGroupName = "blkdeviotune.group_name" + // DomainTunableBlkdevTotalBytesSecMaxLength as defined in libvirt/libvirt-domain.h:4201 + DomainTunableBlkdevTotalBytesSecMaxLength = "blkdeviotune.total_bytes_sec_max_length" + // DomainTunableBlkdevReadBytesSecMaxLength as defined in libvirt/libvirt-domain.h:4210 + DomainTunableBlkdevReadBytesSecMaxLength = "blkdeviotune.read_bytes_sec_max_length" + // DomainTunableBlkdevWriteBytesSecMaxLength as defined in libvirt/libvirt-domain.h:4219 + DomainTunableBlkdevWriteBytesSecMaxLength = "blkdeviotune.write_bytes_sec_max_length" + // DomainTunableBlkdevTotalIopsSecMaxLength as defined in libvirt/libvirt-domain.h:4228 + DomainTunableBlkdevTotalIopsSecMaxLength = "blkdeviotune.total_iops_sec_max_length" + // DomainTunableBlkdevReadIopsSecMaxLength as defined in libvirt/libvirt-domain.h:4237 + DomainTunableBlkdevReadIopsSecMaxLength = "blkdeviotune.read_iops_sec_max_length" + // DomainTunableBlkdevWriteIopsSecMaxLength as defined in libvirt/libvirt-domain.h:4246 + DomainTunableBlkdevWriteIopsSecMaxLength = "blkdeviotune.write_iops_sec_max_length" + // DomainSchedFieldLength as defined in libvirt/libvirt-domain.h:4534 + DomainSchedFieldLength = 80 + // DomainBlkioFieldLength as defined in libvirt/libvirt-domain.h:4578 + DomainBlkioFieldLength = 80 + // DomainMemoryFieldLength as defined in libvirt/libvirt-domain.h:4622 + DomainMemoryFieldLength = 80 +) + +// ConnectCloseReason as declared in libvirt/libvirt-common.h:120 +type ConnectCloseReason int32 + +// ConnectCloseReason enumeration from libvirt/libvirt-common.h:120 +const ( + ConnectCloseReasonError ConnectCloseReason = iota + ConnectCloseReasonEOF ConnectCloseReason = 1 + ConnectCloseReasonKeepalive ConnectCloseReason = 2 + ConnectCloseReasonClient ConnectCloseReason = 3 +) + +// TypedParameterType as declared in libvirt/libvirt-common.h:139 +type TypedParameterType int32 + +// TypedParameterType enumeration from libvirt/libvirt-common.h:139 +const ( + TypedParamInt TypedParameterType = 1 + TypedParamUint TypedParameterType = 2 + TypedParamLlong TypedParameterType = 3 + TypedParamUllong TypedParameterType = 4 + TypedParamDouble TypedParameterType = 5 + TypedParamBoolean TypedParameterType = 6 + TypedParamString TypedParameterType = 7 +) + +// TypedParameterFlags as declared in libvirt/libvirt-common.h:164 +type TypedParameterFlags int32 + +// TypedParameterFlags enumeration from libvirt/libvirt-common.h:164 +const ( + TypedParamStringOkay TypedParameterFlags = 4 +) + +// NodeSuspendTarget as declared in libvirt/libvirt-host.h:62 +type NodeSuspendTarget int32 + +// NodeSuspendTarget enumeration from libvirt/libvirt-host.h:62 +const ( + NodeSuspendTargetMem NodeSuspendTarget = iota + NodeSuspendTargetDisk NodeSuspendTarget = 1 + NodeSuspendTargetHybrid NodeSuspendTarget = 2 +) + +// NodeGetCPUStatsAllCPUs as declared in libvirt/libvirt-host.h:186 +type NodeGetCPUStatsAllCPUs int32 + +// NodeGetCPUStatsAllCPUs enumeration from libvirt/libvirt-host.h:186 +const ( + NodeCPUStatsAllCpus NodeGetCPUStatsAllCPUs = -1 +) + +// NodeGetMemoryStatsAllCells as declared in libvirt/libvirt-host.h:264 +type NodeGetMemoryStatsAllCells int32 + +// NodeGetMemoryStatsAllCells enumeration from libvirt/libvirt-host.h:264 +const ( + NodeMemoryStatsAllCells NodeGetMemoryStatsAllCells = -1 +) + +// ConnectFlags as declared in libvirt/libvirt-host.h:443 +type ConnectFlags int32 + +// ConnectFlags enumeration from libvirt/libvirt-host.h:443 +const ( + ConnectRo ConnectFlags = 1 + ConnectNoAliases ConnectFlags = 2 +) + +// ConnectCredentialType as declared in libvirt/libvirt-host.h:460 +type ConnectCredentialType int32 + +// ConnectCredentialType enumeration from libvirt/libvirt-host.h:460 +const ( + CredUsername ConnectCredentialType = 1 + CredAuthname ConnectCredentialType = 2 + CredLanguage ConnectCredentialType = 3 + CredCnonce ConnectCredentialType = 4 + CredPassphrase ConnectCredentialType = 5 + CredEchoprompt ConnectCredentialType = 6 + CredNoechoprompt ConnectCredentialType = 7 + CredRealm ConnectCredentialType = 8 + CredExternal ConnectCredentialType = 9 +) + +// CPUCompareResult as declared in libvirt/libvirt-host.h:633 +type CPUCompareResult int32 + +// CPUCompareResult enumeration from libvirt/libvirt-host.h:633 +const ( + CPUCompareError CPUCompareResult = -1 + CPUCompareIncompatible CPUCompareResult = 0 + CPUCompareIdentical CPUCompareResult = 1 + CPUCompareSuperset CPUCompareResult = 2 +) + +// ConnectCompareCPUFlags as declared in libvirt/libvirt-host.h:638 +type ConnectCompareCPUFlags int32 + +// ConnectCompareCPUFlags enumeration from libvirt/libvirt-host.h:638 +const ( + ConnectCompareCPUFailIncompatible ConnectCompareCPUFlags = 1 +) + +// ConnectBaselineCPUFlags as declared in libvirt/libvirt-host.h:657 +type ConnectBaselineCPUFlags int32 + +// ConnectBaselineCPUFlags enumeration from libvirt/libvirt-host.h:657 +const ( + ConnectBaselineCPUExpandFeatures ConnectBaselineCPUFlags = 1 + ConnectBaselineCPUMigratable ConnectBaselineCPUFlags = 2 +) + +// NodeAllocPagesFlags as declared in libvirt/libvirt-host.h:679 +type NodeAllocPagesFlags int32 + +// NodeAllocPagesFlags enumeration from libvirt/libvirt-host.h:679 +const ( + NodeAllocPagesAdd NodeAllocPagesFlags = iota + NodeAllocPagesSet NodeAllocPagesFlags = 1 +) + +// DomainState as declared in libvirt/libvirt-domain.h:71 +type DomainState int32 + +// DomainState enumeration from libvirt/libvirt-domain.h:71 +const ( + DomainNostate DomainState = iota + DomainRunning DomainState = 1 + DomainBlocked DomainState = 2 + DomainPaused DomainState = 3 + DomainShutdown DomainState = 4 + DomainShutoff DomainState = 5 + DomainCrashed DomainState = 6 + DomainPmsuspended DomainState = 7 +) + +// DomainNostateReason as declared in libvirt/libvirt-domain.h:79 +type DomainNostateReason int32 + +// DomainNostateReason enumeration from libvirt/libvirt-domain.h:79 +const ( + DomainNostateUnknown DomainNostateReason = iota +) + +// DomainRunningReason as declared in libvirt/libvirt-domain.h:98 +type DomainRunningReason int32 + +// DomainRunningReason enumeration from libvirt/libvirt-domain.h:98 +const ( + DomainRunningUnknown DomainRunningReason = iota + DomainRunningBooted DomainRunningReason = 1 + DomainRunningMigrated DomainRunningReason = 2 + DomainRunningRestored DomainRunningReason = 3 + DomainRunningFromSnapshot DomainRunningReason = 4 + DomainRunningUnpaused DomainRunningReason = 5 + DomainRunningMigrationCanceled DomainRunningReason = 6 + DomainRunningSaveCanceled DomainRunningReason = 7 + DomainRunningWakeup DomainRunningReason = 8 + DomainRunningCrashed DomainRunningReason = 9 + DomainRunningPostcopy DomainRunningReason = 10 +) + +// DomainBlockedReason as declared in libvirt/libvirt-domain.h:106 +type DomainBlockedReason int32 + +// DomainBlockedReason enumeration from libvirt/libvirt-domain.h:106 +const ( + DomainBlockedUnknown DomainBlockedReason = iota +) + +// DomainPausedReason as declared in libvirt/libvirt-domain.h:127 +type DomainPausedReason int32 + +// DomainPausedReason enumeration from libvirt/libvirt-domain.h:127 +const ( + DomainPausedUnknown DomainPausedReason = iota + DomainPausedUser DomainPausedReason = 1 + DomainPausedMigration DomainPausedReason = 2 + DomainPausedSave DomainPausedReason = 3 + DomainPausedDump DomainPausedReason = 4 + DomainPausedIoerror DomainPausedReason = 5 + DomainPausedWatchdog DomainPausedReason = 6 + DomainPausedFromSnapshot DomainPausedReason = 7 + DomainPausedShuttingDown DomainPausedReason = 8 + DomainPausedSnapshot DomainPausedReason = 9 + DomainPausedCrashed DomainPausedReason = 10 + DomainPausedStartingUp DomainPausedReason = 11 + DomainPausedPostcopy DomainPausedReason = 12 + DomainPausedPostcopyFailed DomainPausedReason = 13 +) + +// DomainShutdownReason as declared in libvirt/libvirt-domain.h:136 +type DomainShutdownReason int32 + +// DomainShutdownReason enumeration from libvirt/libvirt-domain.h:136 +const ( + DomainShutdownUnknown DomainShutdownReason = iota + DomainShutdownUser DomainShutdownReason = 1 +) + +// DomainShutoffReason as declared in libvirt/libvirt-domain.h:151 +type DomainShutoffReason int32 + +// DomainShutoffReason enumeration from libvirt/libvirt-domain.h:151 +const ( + DomainShutoffUnknown DomainShutoffReason = iota + DomainShutoffShutdown DomainShutoffReason = 1 + DomainShutoffDestroyed DomainShutoffReason = 2 + DomainShutoffCrashed DomainShutoffReason = 3 + DomainShutoffMigrated DomainShutoffReason = 4 + DomainShutoffSaved DomainShutoffReason = 5 + DomainShutoffFailed DomainShutoffReason = 6 + DomainShutoffFromSnapshot DomainShutoffReason = 7 +) + +// DomainCrashedReason as declared in libvirt/libvirt-domain.h:160 +type DomainCrashedReason int32 + +// DomainCrashedReason enumeration from libvirt/libvirt-domain.h:160 +const ( + DomainCrashedUnknown DomainCrashedReason = iota + DomainCrashedPanicked DomainCrashedReason = 1 +) + +// DomainPMSuspendedReason as declared in libvirt/libvirt-domain.h:168 +type DomainPMSuspendedReason int32 + +// DomainPMSuspendedReason enumeration from libvirt/libvirt-domain.h:168 +const ( + DomainPmsuspendedUnknown DomainPMSuspendedReason = iota +) + +// DomainPMSuspendedDiskReason as declared in libvirt/libvirt-domain.h:176 +type DomainPMSuspendedDiskReason int32 + +// DomainPMSuspendedDiskReason enumeration from libvirt/libvirt-domain.h:176 +const ( + DomainPmsuspendedDiskUnknown DomainPMSuspendedDiskReason = iota +) + +// DomainControlState as declared in libvirt/libvirt-domain.h:196 +type DomainControlState int32 + +// DomainControlState enumeration from libvirt/libvirt-domain.h:196 +const ( + DomainControlOk DomainControlState = iota + DomainControlJob DomainControlState = 1 + DomainControlOccupied DomainControlState = 2 + DomainControlError DomainControlState = 3 +) + +// DomainControlErrorReason as declared in libvirt/libvirt-domain.h:216 +type DomainControlErrorReason int32 + +// DomainControlErrorReason enumeration from libvirt/libvirt-domain.h:216 +const ( + DomainControlErrorReasonNone DomainControlErrorReason = iota + DomainControlErrorReasonUnknown DomainControlErrorReason = 1 + DomainControlErrorReasonMonitor DomainControlErrorReason = 2 + DomainControlErrorReasonInternal DomainControlErrorReason = 3 +) + +// DomainModificationImpact as declared in libvirt/libvirt-domain.h:264 +type DomainModificationImpact int32 + +// DomainModificationImpact enumeration from libvirt/libvirt-domain.h:264 +const ( + DomainAffectCurrent DomainModificationImpact = iota + DomainAffectLive DomainModificationImpact = 1 + DomainAffectConfig DomainModificationImpact = 2 +) + +// DomainCreateFlags as declared in libvirt/libvirt-domain.h:304 +type DomainCreateFlags int32 + +// DomainCreateFlags enumeration from libvirt/libvirt-domain.h:304 +const ( + DomainNone DomainCreateFlags = iota + DomainStartPaused DomainCreateFlags = 1 + DomainStartAutodestroy DomainCreateFlags = 2 + DomainStartBypassCache DomainCreateFlags = 4 + DomainStartForceBoot DomainCreateFlags = 8 + DomainStartValidate DomainCreateFlags = 16 +) + +// DomainMemoryStatTags as declared in libvirt/libvirt-domain.h:640 +type DomainMemoryStatTags int32 + +// DomainMemoryStatTags enumeration from libvirt/libvirt-domain.h:640 +const ( + DomainMemoryStatSwapIn DomainMemoryStatTags = iota + DomainMemoryStatSwapOut DomainMemoryStatTags = 1 + DomainMemoryStatMajorFault DomainMemoryStatTags = 2 + DomainMemoryStatMinorFault DomainMemoryStatTags = 3 + DomainMemoryStatUnused DomainMemoryStatTags = 4 + DomainMemoryStatAvailable DomainMemoryStatTags = 5 + DomainMemoryStatActualBalloon DomainMemoryStatTags = 6 + DomainMemoryStatRss DomainMemoryStatTags = 7 + DomainMemoryStatUsable DomainMemoryStatTags = 8 + DomainMemoryStatLastUpdate DomainMemoryStatTags = 9 + DomainMemoryStatNr DomainMemoryStatTags = 10 +) + +// DomainCoreDumpFlags as declared in libvirt/libvirt-domain.h:659 +type DomainCoreDumpFlags int32 + +// DomainCoreDumpFlags enumeration from libvirt/libvirt-domain.h:659 +const ( + DumpCrash DomainCoreDumpFlags = 1 + DumpLive DomainCoreDumpFlags = 2 + DumpBypassCache DomainCoreDumpFlags = 4 + DumpReset DomainCoreDumpFlags = 8 + DumpMemoryOnly DomainCoreDumpFlags = 16 +) + +// DomainCoreDumpFormat as declared in libvirt/libvirt-domain.h:682 +type DomainCoreDumpFormat int32 + +// DomainCoreDumpFormat enumeration from libvirt/libvirt-domain.h:682 +const ( + DomainCoreDumpFormatRaw DomainCoreDumpFormat = iota + DomainCoreDumpFormatKdumpZlib DomainCoreDumpFormat = 1 + DomainCoreDumpFormatKdumpLzo DomainCoreDumpFormat = 2 + DomainCoreDumpFormatKdumpSnappy DomainCoreDumpFormat = 3 +) + +// DomainMigrateFlags as declared in libvirt/libvirt-domain.h:826 +type DomainMigrateFlags int32 + +// DomainMigrateFlags enumeration from libvirt/libvirt-domain.h:826 +const ( + MigrateLive DomainMigrateFlags = 1 + MigratePeer2peer DomainMigrateFlags = 2 + MigrateTunnelled DomainMigrateFlags = 4 + MigratePersistDest DomainMigrateFlags = 8 + MigrateUndefineSource DomainMigrateFlags = 16 + MigratePaused DomainMigrateFlags = 32 + MigrateNonSharedDisk DomainMigrateFlags = 64 + MigrateNonSharedInc DomainMigrateFlags = 128 + MigrateChangeProtection DomainMigrateFlags = 256 + MigrateUnsafe DomainMigrateFlags = 512 + MigrateOffline DomainMigrateFlags = 1024 + MigrateCompressed DomainMigrateFlags = 2048 + MigrateAbortOnError DomainMigrateFlags = 4096 + MigrateAutoConverge DomainMigrateFlags = 8192 + MigrateRdmaPinAll DomainMigrateFlags = 16384 + MigratePostcopy DomainMigrateFlags = 32768 + MigrateTLS DomainMigrateFlags = 65536 +) + +// DomainShutdownFlagValues as declared in libvirt/libvirt-domain.h:1117 +type DomainShutdownFlagValues int32 + +// DomainShutdownFlagValues enumeration from libvirt/libvirt-domain.h:1117 +const ( + DomainShutdownDefault DomainShutdownFlagValues = iota + DomainShutdownAcpiPowerBtn DomainShutdownFlagValues = 1 + DomainShutdownGuestAgent DomainShutdownFlagValues = 2 + DomainShutdownInitctl DomainShutdownFlagValues = 4 + DomainShutdownSignal DomainShutdownFlagValues = 8 + DomainShutdownParavirt DomainShutdownFlagValues = 16 +) + +// DomainRebootFlagValues as declared in libvirt/libvirt-domain.h:1130 +type DomainRebootFlagValues int32 + +// DomainRebootFlagValues enumeration from libvirt/libvirt-domain.h:1130 +const ( + DomainRebootDefault DomainRebootFlagValues = iota + DomainRebootAcpiPowerBtn DomainRebootFlagValues = 1 + DomainRebootGuestAgent DomainRebootFlagValues = 2 + DomainRebootInitctl DomainRebootFlagValues = 4 + DomainRebootSignal DomainRebootFlagValues = 8 + DomainRebootParavirt DomainRebootFlagValues = 16 +) + +// DomainDestroyFlagsValues as declared in libvirt/libvirt-domain.h:1148 +type DomainDestroyFlagsValues int32 + +// DomainDestroyFlagsValues enumeration from libvirt/libvirt-domain.h:1148 +const ( + DomainDestroyDefault DomainDestroyFlagsValues = iota + DomainDestroyGraceful DomainDestroyFlagsValues = 1 +) + +// DomainSaveRestoreFlags as declared in libvirt/libvirt-domain.h:1180 +type DomainSaveRestoreFlags int32 + +// DomainSaveRestoreFlags enumeration from libvirt/libvirt-domain.h:1180 +const ( + DomainSaveBypassCache DomainSaveRestoreFlags = 1 + DomainSaveRunning DomainSaveRestoreFlags = 2 + DomainSavePaused DomainSaveRestoreFlags = 4 +) + +// DomainMemoryModFlags as declared in libvirt/libvirt-domain.h:1429 +type DomainMemoryModFlags int32 + +// DomainMemoryModFlags enumeration from libvirt/libvirt-domain.h:1429 +const ( + DomainMemCurrent DomainMemoryModFlags = iota + DomainMemLive DomainMemoryModFlags = 1 + DomainMemConfig DomainMemoryModFlags = 2 + DomainMemMaximum DomainMemoryModFlags = 4 +) + +// DomainNumatuneMemMode as declared in libvirt/libvirt-domain.h:1447 +type DomainNumatuneMemMode int32 + +// DomainNumatuneMemMode enumeration from libvirt/libvirt-domain.h:1447 +const ( + DomainNumatuneMemStrict DomainNumatuneMemMode = iota + DomainNumatuneMemPreferred DomainNumatuneMemMode = 1 + DomainNumatuneMemInterleave DomainNumatuneMemMode = 2 +) + +// DomainMetadataType as declared in libvirt/libvirt-domain.h:1509 +type DomainMetadataType int32 + +// DomainMetadataType enumeration from libvirt/libvirt-domain.h:1509 +const ( + DomainMetadataDescription DomainMetadataType = iota + DomainMetadataTitle DomainMetadataType = 1 + DomainMetadataElement DomainMetadataType = 2 +) + +// DomainXMLFlags as declared in libvirt/libvirt-domain.h:1539 +type DomainXMLFlags int32 + +// DomainXMLFlags enumeration from libvirt/libvirt-domain.h:1539 +const ( + DomainXMLSecure DomainXMLFlags = 1 + DomainXMLInactive DomainXMLFlags = 2 + DomainXMLUpdateCPU DomainXMLFlags = 4 + DomainXMLMigratable DomainXMLFlags = 8 +) + +// DomainBlockResizeFlags as declared in libvirt/libvirt-domain.h:1644 +type DomainBlockResizeFlags int32 + +// DomainBlockResizeFlags enumeration from libvirt/libvirt-domain.h:1644 +const ( + DomainBlockResizeBytes DomainBlockResizeFlags = 1 +) + +// DomainMemoryFlags as declared in libvirt/libvirt-domain.h:1707 +type DomainMemoryFlags int32 + +// DomainMemoryFlags enumeration from libvirt/libvirt-domain.h:1707 +const ( + MemoryVirtual DomainMemoryFlags = 1 + MemoryPhysical DomainMemoryFlags = 2 +) + +// DomainDefineFlags as declared in libvirt/libvirt-domain.h:1717 +type DomainDefineFlags int32 + +// DomainDefineFlags enumeration from libvirt/libvirt-domain.h:1717 +const ( + DomainDefineValidate DomainDefineFlags = 1 +) + +// DomainUndefineFlagsValues as declared in libvirt/libvirt-domain.h:1741 +type DomainUndefineFlagsValues int32 + +// DomainUndefineFlagsValues enumeration from libvirt/libvirt-domain.h:1741 +const ( + DomainUndefineManagedSave DomainUndefineFlagsValues = 1 + DomainUndefineSnapshotsMetadata DomainUndefineFlagsValues = 2 + DomainUndefineNvram DomainUndefineFlagsValues = 4 + DomainUndefineKeepNvram DomainUndefineFlagsValues = 8 +) + +// ConnectListAllDomainsFlags as declared in libvirt/libvirt-domain.h:1777 +type ConnectListAllDomainsFlags int32 + +// ConnectListAllDomainsFlags enumeration from libvirt/libvirt-domain.h:1777 +const ( + ConnectListDomainsActive ConnectListAllDomainsFlags = 1 + ConnectListDomainsInactive ConnectListAllDomainsFlags = 2 + ConnectListDomainsPersistent ConnectListAllDomainsFlags = 4 + ConnectListDomainsTransient ConnectListAllDomainsFlags = 8 + ConnectListDomainsRunning ConnectListAllDomainsFlags = 16 + ConnectListDomainsPaused ConnectListAllDomainsFlags = 32 + ConnectListDomainsShutoff ConnectListAllDomainsFlags = 64 + ConnectListDomainsOther ConnectListAllDomainsFlags = 128 + ConnectListDomainsManagedsave ConnectListAllDomainsFlags = 256 + ConnectListDomainsNoManagedsave ConnectListAllDomainsFlags = 512 + ConnectListDomainsAutostart ConnectListAllDomainsFlags = 1024 + ConnectListDomainsNoAutostart ConnectListAllDomainsFlags = 2048 + ConnectListDomainsHasSnapshot ConnectListAllDomainsFlags = 4096 + ConnectListDomainsNoSnapshot ConnectListAllDomainsFlags = 8192 +) + +// VCPUState as declared in libvirt/libvirt-domain.h:1808 +type VCPUState int32 + +// VCPUState enumeration from libvirt/libvirt-domain.h:1808 +const ( + VCPUOffline VCPUState = iota + VCPURunning VCPUState = 1 + VCPUBlocked VCPUState = 2 +) + +// DomainVCPUFlags as declared in libvirt/libvirt-domain.h:1830 +type DomainVCPUFlags int32 + +// DomainVCPUFlags enumeration from libvirt/libvirt-domain.h:1830 +const ( + DomainVCPUCurrent DomainVCPUFlags = iota + DomainVCPULive DomainVCPUFlags = 1 + DomainVCPUConfig DomainVCPUFlags = 2 + DomainVCPUMaximum DomainVCPUFlags = 4 + DomainVCPUGuest DomainVCPUFlags = 8 + DomainVCPUHotpluggable DomainVCPUFlags = 16 +) + +// DomainDeviceModifyFlags as declared in libvirt/libvirt-domain.h:2003 +type DomainDeviceModifyFlags int32 + +// DomainDeviceModifyFlags enumeration from libvirt/libvirt-domain.h:2003 +const ( + DomainDeviceModifyCurrent DomainDeviceModifyFlags = iota + DomainDeviceModifyLive DomainDeviceModifyFlags = 1 + DomainDeviceModifyConfig DomainDeviceModifyFlags = 2 + DomainDeviceModifyForce DomainDeviceModifyFlags = 4 +) + +// DomainStatsTypes as declared in libvirt/libvirt-domain.h:2031 +type DomainStatsTypes int32 + +// DomainStatsTypes enumeration from libvirt/libvirt-domain.h:2031 +const ( + DomainStatsState DomainStatsTypes = 1 + DomainStatsCPUTotal DomainStatsTypes = 2 + DomainStatsBalloon DomainStatsTypes = 4 + DomainStatsVCPU DomainStatsTypes = 8 + DomainStatsInterface DomainStatsTypes = 16 + DomainStatsBlock DomainStatsTypes = 32 + DomainStatsPerf DomainStatsTypes = 64 +) + +// ConnectGetAllDomainStatsFlags as declared in libvirt/libvirt-domain.h:2047 +type ConnectGetAllDomainStatsFlags int32 + +// ConnectGetAllDomainStatsFlags enumeration from libvirt/libvirt-domain.h:2047 +const ( + ConnectGetAllDomainsStatsActive ConnectGetAllDomainStatsFlags = 1 + ConnectGetAllDomainsStatsInactive ConnectGetAllDomainStatsFlags = 2 + ConnectGetAllDomainsStatsPersistent ConnectGetAllDomainStatsFlags = 4 + ConnectGetAllDomainsStatsTransient ConnectGetAllDomainStatsFlags = 8 + ConnectGetAllDomainsStatsRunning ConnectGetAllDomainStatsFlags = 16 + ConnectGetAllDomainsStatsPaused ConnectGetAllDomainStatsFlags = 32 + ConnectGetAllDomainsStatsShutoff ConnectGetAllDomainStatsFlags = 64 + ConnectGetAllDomainsStatsOther ConnectGetAllDomainStatsFlags = 128 + ConnectGetAllDomainsStatsBacking ConnectGetAllDomainStatsFlags = 1073741824 + ConnectGetAllDomainsStatsEnforceStats ConnectGetAllDomainStatsFlags = -2147483648 +) + +// DomainBlockJobType as declared in libvirt/libvirt-domain.h:2331 +type DomainBlockJobType int32 + +// DomainBlockJobType enumeration from libvirt/libvirt-domain.h:2331 +const ( + DomainBlockJobTypeUnknown DomainBlockJobType = iota + DomainBlockJobTypePull DomainBlockJobType = 1 + DomainBlockJobTypeCopy DomainBlockJobType = 2 + DomainBlockJobTypeCommit DomainBlockJobType = 3 + DomainBlockJobTypeActiveCommit DomainBlockJobType = 4 +) + +// DomainBlockJobAbortFlags as declared in libvirt/libvirt-domain.h:2343 +type DomainBlockJobAbortFlags int32 + +// DomainBlockJobAbortFlags enumeration from libvirt/libvirt-domain.h:2343 +const ( + DomainBlockJobAbortAsync DomainBlockJobAbortFlags = 1 + DomainBlockJobAbortPivot DomainBlockJobAbortFlags = 2 +) + +// DomainBlockJobInfoFlags as declared in libvirt/libvirt-domain.h:2352 +type DomainBlockJobInfoFlags int32 + +// DomainBlockJobInfoFlags enumeration from libvirt/libvirt-domain.h:2352 +const ( + DomainBlockJobInfoBandwidthBytes DomainBlockJobInfoFlags = 1 +) + +// DomainBlockJobSetSpeedFlags as declared in libvirt/libvirt-domain.h:2381 +type DomainBlockJobSetSpeedFlags int32 + +// DomainBlockJobSetSpeedFlags enumeration from libvirt/libvirt-domain.h:2381 +const ( + DomainBlockJobSpeedBandwidthBytes DomainBlockJobSetSpeedFlags = 1 +) + +// DomainBlockPullFlags as declared in libvirt/libvirt-domain.h:2391 +type DomainBlockPullFlags int32 + +// DomainBlockPullFlags enumeration from libvirt/libvirt-domain.h:2391 +const ( + DomainBlockPullBandwidthBytes DomainBlockPullFlags = 64 +) + +// DomainBlockRebaseFlags as declared in libvirt/libvirt-domain.h:2415 +type DomainBlockRebaseFlags int32 + +// DomainBlockRebaseFlags enumeration from libvirt/libvirt-domain.h:2415 +const ( + DomainBlockRebaseShallow DomainBlockRebaseFlags = 1 + DomainBlockRebaseReuseExt DomainBlockRebaseFlags = 2 + DomainBlockRebaseCopyRaw DomainBlockRebaseFlags = 4 + DomainBlockRebaseCopy DomainBlockRebaseFlags = 8 + DomainBlockRebaseRelative DomainBlockRebaseFlags = 16 + DomainBlockRebaseCopyDev DomainBlockRebaseFlags = 32 + DomainBlockRebaseBandwidthBytes DomainBlockRebaseFlags = 64 +) + +// DomainBlockCopyFlags as declared in libvirt/libvirt-domain.h:2434 +type DomainBlockCopyFlags int32 + +// DomainBlockCopyFlags enumeration from libvirt/libvirt-domain.h:2434 +const ( + DomainBlockCopyShallow DomainBlockCopyFlags = 1 + DomainBlockCopyReuseExt DomainBlockCopyFlags = 2 + DomainBlockCopyTransientJob DomainBlockCopyFlags = 4 +) + +// DomainBlockCommitFlags as declared in libvirt/libvirt-domain.h:2499 +type DomainBlockCommitFlags int32 + +// DomainBlockCommitFlags enumeration from libvirt/libvirt-domain.h:2499 +const ( + DomainBlockCommitShallow DomainBlockCommitFlags = 1 + DomainBlockCommitDelete DomainBlockCommitFlags = 2 + DomainBlockCommitActive DomainBlockCommitFlags = 4 + DomainBlockCommitRelative DomainBlockCommitFlags = 8 + DomainBlockCommitBandwidthBytes DomainBlockCommitFlags = 16 +) + +// DomainDiskErrorCode as declared in libvirt/libvirt-domain.h:2690 +type DomainDiskErrorCode int32 + +// DomainDiskErrorCode enumeration from libvirt/libvirt-domain.h:2690 +const ( + DomainDiskErrorNone DomainDiskErrorCode = iota + DomainDiskErrorUnspec DomainDiskErrorCode = 1 + DomainDiskErrorNoSpace DomainDiskErrorCode = 2 +) + +// KeycodeSet as declared in libvirt/libvirt-domain.h:2736 +type KeycodeSet int32 + +// KeycodeSet enumeration from libvirt/libvirt-domain.h:2736 +const ( + KeycodeSetLinux KeycodeSet = iota + KeycodeSetXt KeycodeSet = 1 + KeycodeSetAtset1 KeycodeSet = 2 + KeycodeSetAtset2 KeycodeSet = 3 + KeycodeSetAtset3 KeycodeSet = 4 + KeycodeSetOsx KeycodeSet = 5 + KeycodeSetXtKbd KeycodeSet = 6 + KeycodeSetUsb KeycodeSet = 7 + KeycodeSetWin32 KeycodeSet = 8 + KeycodeSetRfb KeycodeSet = 9 +) + +// DomainProcessSignal as declared in libvirt/libvirt-domain.h:2838 +type DomainProcessSignal int32 + +// DomainProcessSignal enumeration from libvirt/libvirt-domain.h:2838 +const ( + DomainProcessSignalNop DomainProcessSignal = iota + DomainProcessSignalHup DomainProcessSignal = 1 + DomainProcessSignalInt DomainProcessSignal = 2 + DomainProcessSignalQuit DomainProcessSignal = 3 + DomainProcessSignalIll DomainProcessSignal = 4 + DomainProcessSignalTrap DomainProcessSignal = 5 + DomainProcessSignalAbrt DomainProcessSignal = 6 + DomainProcessSignalBus DomainProcessSignal = 7 + DomainProcessSignalFpe DomainProcessSignal = 8 + DomainProcessSignalKill DomainProcessSignal = 9 + DomainProcessSignalUsr1 DomainProcessSignal = 10 + DomainProcessSignalSegv DomainProcessSignal = 11 + DomainProcessSignalUsr2 DomainProcessSignal = 12 + DomainProcessSignalPipe DomainProcessSignal = 13 + DomainProcessSignalAlrm DomainProcessSignal = 14 + DomainProcessSignalTerm DomainProcessSignal = 15 + DomainProcessSignalStkflt DomainProcessSignal = 16 + DomainProcessSignalChld DomainProcessSignal = 17 + DomainProcessSignalCont DomainProcessSignal = 18 + DomainProcessSignalStop DomainProcessSignal = 19 + DomainProcessSignalTstp DomainProcessSignal = 20 + DomainProcessSignalTtin DomainProcessSignal = 21 + DomainProcessSignalTtou DomainProcessSignal = 22 + DomainProcessSignalUrg DomainProcessSignal = 23 + DomainProcessSignalXcpu DomainProcessSignal = 24 + DomainProcessSignalXfsz DomainProcessSignal = 25 + DomainProcessSignalVtalrm DomainProcessSignal = 26 + DomainProcessSignalProf DomainProcessSignal = 27 + DomainProcessSignalWinch DomainProcessSignal = 28 + DomainProcessSignalPoll DomainProcessSignal = 29 + DomainProcessSignalPwr DomainProcessSignal = 30 + DomainProcessSignalSys DomainProcessSignal = 31 + DomainProcessSignalRt0 DomainProcessSignal = 32 + DomainProcessSignalRt1 DomainProcessSignal = 33 + DomainProcessSignalRt2 DomainProcessSignal = 34 + DomainProcessSignalRt3 DomainProcessSignal = 35 + DomainProcessSignalRt4 DomainProcessSignal = 36 + DomainProcessSignalRt5 DomainProcessSignal = 37 + DomainProcessSignalRt6 DomainProcessSignal = 38 + DomainProcessSignalRt7 DomainProcessSignal = 39 + DomainProcessSignalRt8 DomainProcessSignal = 40 + DomainProcessSignalRt9 DomainProcessSignal = 41 + DomainProcessSignalRt10 DomainProcessSignal = 42 + DomainProcessSignalRt11 DomainProcessSignal = 43 + DomainProcessSignalRt12 DomainProcessSignal = 44 + DomainProcessSignalRt13 DomainProcessSignal = 45 + DomainProcessSignalRt14 DomainProcessSignal = 46 + DomainProcessSignalRt15 DomainProcessSignal = 47 + DomainProcessSignalRt16 DomainProcessSignal = 48 + DomainProcessSignalRt17 DomainProcessSignal = 49 + DomainProcessSignalRt18 DomainProcessSignal = 50 + DomainProcessSignalRt19 DomainProcessSignal = 51 + DomainProcessSignalRt20 DomainProcessSignal = 52 + DomainProcessSignalRt21 DomainProcessSignal = 53 + DomainProcessSignalRt22 DomainProcessSignal = 54 + DomainProcessSignalRt23 DomainProcessSignal = 55 + DomainProcessSignalRt24 DomainProcessSignal = 56 + DomainProcessSignalRt25 DomainProcessSignal = 57 + DomainProcessSignalRt26 DomainProcessSignal = 58 + DomainProcessSignalRt27 DomainProcessSignal = 59 + DomainProcessSignalRt28 DomainProcessSignal = 60 + DomainProcessSignalRt29 DomainProcessSignal = 61 + DomainProcessSignalRt30 DomainProcessSignal = 62 + DomainProcessSignalRt31 DomainProcessSignal = 63 + DomainProcessSignalRt32 DomainProcessSignal = 64 +) + +// DomainEventType as declared in libvirt/libvirt-domain.h:2876 +type DomainEventType int32 + +// DomainEventType enumeration from libvirt/libvirt-domain.h:2876 +const ( + DomainEventDefined DomainEventType = iota + DomainEventUndefined DomainEventType = 1 + DomainEventStarted DomainEventType = 2 + DomainEventSuspended DomainEventType = 3 + DomainEventResumed DomainEventType = 4 + DomainEventStopped DomainEventType = 5 + DomainEventShutdown DomainEventType = 6 + DomainEventPmsuspended DomainEventType = 7 + DomainEventCrashed DomainEventType = 8 +) + +// DomainEventDefinedDetailType as declared in libvirt/libvirt-domain.h:2892 +type DomainEventDefinedDetailType int32 + +// DomainEventDefinedDetailType enumeration from libvirt/libvirt-domain.h:2892 +const ( + DomainEventDefinedAdded DomainEventDefinedDetailType = iota + DomainEventDefinedUpdated DomainEventDefinedDetailType = 1 + DomainEventDefinedRenamed DomainEventDefinedDetailType = 2 + DomainEventDefinedFromSnapshot DomainEventDefinedDetailType = 3 +) + +// DomainEventUndefinedDetailType as declared in libvirt/libvirt-domain.h:2906 +type DomainEventUndefinedDetailType int32 + +// DomainEventUndefinedDetailType enumeration from libvirt/libvirt-domain.h:2906 +const ( + DomainEventUndefinedRemoved DomainEventUndefinedDetailType = iota + DomainEventUndefinedRenamed DomainEventUndefinedDetailType = 1 +) + +// DomainEventStartedDetailType as declared in libvirt/libvirt-domain.h:2923 +type DomainEventStartedDetailType int32 + +// DomainEventStartedDetailType enumeration from libvirt/libvirt-domain.h:2923 +const ( + DomainEventStartedBooted DomainEventStartedDetailType = iota + DomainEventStartedMigrated DomainEventStartedDetailType = 1 + DomainEventStartedRestored DomainEventStartedDetailType = 2 + DomainEventStartedFromSnapshot DomainEventStartedDetailType = 3 + DomainEventStartedWakeup DomainEventStartedDetailType = 4 +) + +// DomainEventSuspendedDetailType as declared in libvirt/libvirt-domain.h:2944 +type DomainEventSuspendedDetailType int32 + +// DomainEventSuspendedDetailType enumeration from libvirt/libvirt-domain.h:2944 +const ( + DomainEventSuspendedPaused DomainEventSuspendedDetailType = iota + DomainEventSuspendedMigrated DomainEventSuspendedDetailType = 1 + DomainEventSuspendedIoerror DomainEventSuspendedDetailType = 2 + DomainEventSuspendedWatchdog DomainEventSuspendedDetailType = 3 + DomainEventSuspendedRestored DomainEventSuspendedDetailType = 4 + DomainEventSuspendedFromSnapshot DomainEventSuspendedDetailType = 5 + DomainEventSuspendedAPIError DomainEventSuspendedDetailType = 6 + DomainEventSuspendedPostcopy DomainEventSuspendedDetailType = 7 + DomainEventSuspendedPostcopyFailed DomainEventSuspendedDetailType = 8 +) + +// DomainEventResumedDetailType as declared in libvirt/libvirt-domain.h:2961 +type DomainEventResumedDetailType int32 + +// DomainEventResumedDetailType enumeration from libvirt/libvirt-domain.h:2961 +const ( + DomainEventResumedUnpaused DomainEventResumedDetailType = iota + DomainEventResumedMigrated DomainEventResumedDetailType = 1 + DomainEventResumedFromSnapshot DomainEventResumedDetailType = 2 + DomainEventResumedPostcopy DomainEventResumedDetailType = 3 +) + +// DomainEventStoppedDetailType as declared in libvirt/libvirt-domain.h:2980 +type DomainEventStoppedDetailType int32 + +// DomainEventStoppedDetailType enumeration from libvirt/libvirt-domain.h:2980 +const ( + DomainEventStoppedShutdown DomainEventStoppedDetailType = iota + DomainEventStoppedDestroyed DomainEventStoppedDetailType = 1 + DomainEventStoppedCrashed DomainEventStoppedDetailType = 2 + DomainEventStoppedMigrated DomainEventStoppedDetailType = 3 + DomainEventStoppedSaved DomainEventStoppedDetailType = 4 + DomainEventStoppedFailed DomainEventStoppedDetailType = 5 + DomainEventStoppedFromSnapshot DomainEventStoppedDetailType = 6 +) + +// DomainEventShutdownDetailType as declared in libvirt/libvirt-domain.h:3003 +type DomainEventShutdownDetailType int32 + +// DomainEventShutdownDetailType enumeration from libvirt/libvirt-domain.h:3003 +const ( + DomainEventShutdownFinished DomainEventShutdownDetailType = iota + DomainEventShutdownGuest DomainEventShutdownDetailType = 1 + DomainEventShutdownHost DomainEventShutdownDetailType = 2 +) + +// DomainEventPMSuspendedDetailType as declared in libvirt/libvirt-domain.h:3017 +type DomainEventPMSuspendedDetailType int32 + +// DomainEventPMSuspendedDetailType enumeration from libvirt/libvirt-domain.h:3017 +const ( + DomainEventPmsuspendedMemory DomainEventPMSuspendedDetailType = iota + DomainEventPmsuspendedDisk DomainEventPMSuspendedDetailType = 1 +) + +// DomainEventCrashedDetailType as declared in libvirt/libvirt-domain.h:3030 +type DomainEventCrashedDetailType int32 + +// DomainEventCrashedDetailType enumeration from libvirt/libvirt-domain.h:3030 +const ( + DomainEventCrashedPanicked DomainEventCrashedDetailType = iota +) + +// DomainJobType as declared in libvirt/libvirt-domain.h:3074 +type DomainJobType int32 + +// DomainJobType enumeration from libvirt/libvirt-domain.h:3074 +const ( + DomainJobNone DomainJobType = iota + DomainJobBounded DomainJobType = 1 + DomainJobUnbounded DomainJobType = 2 + DomainJobCompleted DomainJobType = 3 + DomainJobFailed DomainJobType = 4 + DomainJobCancelled DomainJobType = 5 +) + +// DomainGetJobStatsFlags as declared in libvirt/libvirt-domain.h:3121 +type DomainGetJobStatsFlags int32 + +// DomainGetJobStatsFlags enumeration from libvirt/libvirt-domain.h:3121 +const ( + DomainJobStatsCompleted DomainGetJobStatsFlags = 1 +) + +// DomainJobOperation as declared in libvirt/libvirt-domain.h:3146 +type DomainJobOperation int32 + +// DomainJobOperation enumeration from libvirt/libvirt-domain.h:3146 +const ( + DomainJobOperationStrUnknown DomainJobOperation = iota + DomainJobOperationStrStart DomainJobOperation = 1 + DomainJobOperationStrSave DomainJobOperation = 2 + DomainJobOperationStrRestore DomainJobOperation = 3 + DomainJobOperationStrMigrationIn DomainJobOperation = 4 + DomainJobOperationStrMigrationOut DomainJobOperation = 5 + DomainJobOperationStrSnapshot DomainJobOperation = 6 + DomainJobOperationStrSnapshotRevert DomainJobOperation = 7 + DomainJobOperationStrDump DomainJobOperation = 8 +) + +// DomainEventWatchdogAction as declared in libvirt/libvirt-domain.h:3479 +type DomainEventWatchdogAction int32 + +// DomainEventWatchdogAction enumeration from libvirt/libvirt-domain.h:3479 +const ( + DomainEventWatchdogNone DomainEventWatchdogAction = iota + DomainEventWatchdogPause DomainEventWatchdogAction = 1 + DomainEventWatchdogReset DomainEventWatchdogAction = 2 + DomainEventWatchdogPoweroff DomainEventWatchdogAction = 3 + DomainEventWatchdogShutdown DomainEventWatchdogAction = 4 + DomainEventWatchdogDebug DomainEventWatchdogAction = 5 + DomainEventWatchdogInjectnmi DomainEventWatchdogAction = 6 +) + +// DomainEventIOErrorAction as declared in libvirt/libvirt-domain.h:3510 +type DomainEventIOErrorAction int32 + +// DomainEventIOErrorAction enumeration from libvirt/libvirt-domain.h:3510 +const ( + DomainEventIoErrorNone DomainEventIOErrorAction = iota + DomainEventIoErrorPause DomainEventIOErrorAction = 1 + DomainEventIoErrorReport DomainEventIOErrorAction = 2 +) + +// DomainEventGraphicsPhase as declared in libvirt/libvirt-domain.h:3573 +type DomainEventGraphicsPhase int32 + +// DomainEventGraphicsPhase enumeration from libvirt/libvirt-domain.h:3573 +const ( + DomainEventGraphicsConnect DomainEventGraphicsPhase = iota + DomainEventGraphicsInitialize DomainEventGraphicsPhase = 1 + DomainEventGraphicsDisconnect DomainEventGraphicsPhase = 2 +) + +// DomainEventGraphicsAddressType as declared in libvirt/libvirt-domain.h:3588 +type DomainEventGraphicsAddressType int32 + +// DomainEventGraphicsAddressType enumeration from libvirt/libvirt-domain.h:3588 +const ( + DomainEventGraphicsAddressIpv4 DomainEventGraphicsAddressType = iota + DomainEventGraphicsAddressIpv6 DomainEventGraphicsAddressType = 1 + DomainEventGraphicsAddressUnix DomainEventGraphicsAddressType = 2 +) + +// ConnectDomainEventBlockJobStatus as declared in libvirt/libvirt-domain.h:3676 +type ConnectDomainEventBlockJobStatus int32 + +// ConnectDomainEventBlockJobStatus enumeration from libvirt/libvirt-domain.h:3676 +const ( + DomainBlockJobCompleted ConnectDomainEventBlockJobStatus = iota + DomainBlockJobFailed ConnectDomainEventBlockJobStatus = 1 + DomainBlockJobCanceled ConnectDomainEventBlockJobStatus = 2 + DomainBlockJobReady ConnectDomainEventBlockJobStatus = 3 +) + +// ConnectDomainEventDiskChangeReason as declared in libvirt/libvirt-domain.h:3725 +type ConnectDomainEventDiskChangeReason int32 + +// ConnectDomainEventDiskChangeReason enumeration from libvirt/libvirt-domain.h:3725 +const ( + DomainEventDiskChangeMissingOnStart ConnectDomainEventDiskChangeReason = iota + DomainEventDiskDropMissingOnStart ConnectDomainEventDiskChangeReason = 1 +) + +// DomainEventTrayChangeReason as declared in libvirt/libvirt-domain.h:3766 +type DomainEventTrayChangeReason int32 + +// DomainEventTrayChangeReason enumeration from libvirt/libvirt-domain.h:3766 +const ( + DomainEventTrayChangeOpen DomainEventTrayChangeReason = iota + DomainEventTrayChangeClose DomainEventTrayChangeReason = 1 +) + +// ConnectDomainEventAgentLifecycleState as declared in libvirt/libvirt-domain.h:4281 +type ConnectDomainEventAgentLifecycleState int32 + +// ConnectDomainEventAgentLifecycleState enumeration from libvirt/libvirt-domain.h:4281 +const ( + ConnectDomainEventAgentLifecycleStateConnected ConnectDomainEventAgentLifecycleState = 1 + ConnectDomainEventAgentLifecycleStateDisconnected ConnectDomainEventAgentLifecycleState = 2 +) + +// ConnectDomainEventAgentLifecycleReason as declared in libvirt/libvirt-domain.h:4291 +type ConnectDomainEventAgentLifecycleReason int32 + +// ConnectDomainEventAgentLifecycleReason enumeration from libvirt/libvirt-domain.h:4291 +const ( + ConnectDomainEventAgentLifecycleReasonUnknown ConnectDomainEventAgentLifecycleReason = iota + ConnectDomainEventAgentLifecycleReasonDomainStarted ConnectDomainEventAgentLifecycleReason = 1 + ConnectDomainEventAgentLifecycleReasonChannel ConnectDomainEventAgentLifecycleReason = 2 +) + +// DomainEventID as declared in libvirt/libvirt-domain.h:4395 +type DomainEventID int32 + +// DomainEventID enumeration from libvirt/libvirt-domain.h:4395 +const ( + DomainEventIDLifecycle DomainEventID = iota + DomainEventIDReboot DomainEventID = 1 + DomainEventIDRtcChange DomainEventID = 2 + DomainEventIDWatchdog DomainEventID = 3 + DomainEventIDIoError DomainEventID = 4 + DomainEventIDGraphics DomainEventID = 5 + DomainEventIDIoErrorReason DomainEventID = 6 + DomainEventIDControlError DomainEventID = 7 + DomainEventIDBlockJob DomainEventID = 8 + DomainEventIDDiskChange DomainEventID = 9 + DomainEventIDTrayChange DomainEventID = 10 + DomainEventIDPmwakeup DomainEventID = 11 + DomainEventIDPmsuspend DomainEventID = 12 + DomainEventIDBalloonChange DomainEventID = 13 + DomainEventIDPmsuspendDisk DomainEventID = 14 + DomainEventIDDeviceRemoved DomainEventID = 15 + DomainEventIDBlockJob2 DomainEventID = 16 + DomainEventIDTunable DomainEventID = 17 + DomainEventIDAgentLifecycle DomainEventID = 18 + DomainEventIDDeviceAdded DomainEventID = 19 + DomainEventIDMigrationIteration DomainEventID = 20 + DomainEventIDJobCompleted DomainEventID = 21 + DomainEventIDDeviceRemovalFailed DomainEventID = 22 + DomainEventIDMetadataChange DomainEventID = 23 + DomainEventIDBlockThreshold DomainEventID = 24 +) + +// DomainConsoleFlags as declared in libvirt/libvirt-domain.h:4422 +type DomainConsoleFlags int32 + +// DomainConsoleFlags enumeration from libvirt/libvirt-domain.h:4422 +const ( + DomainConsoleForce DomainConsoleFlags = 1 + DomainConsoleSafe DomainConsoleFlags = 2 +) + +// DomainChannelFlags as declared in libvirt/libvirt-domain.h:4438 +type DomainChannelFlags int32 + +// DomainChannelFlags enumeration from libvirt/libvirt-domain.h:4438 +const ( + DomainChannelForce DomainChannelFlags = 1 +) + +// DomainOpenGraphicsFlags as declared in libvirt/libvirt-domain.h:4447 +type DomainOpenGraphicsFlags int32 + +// DomainOpenGraphicsFlags enumeration from libvirt/libvirt-domain.h:4447 +const ( + DomainOpenGraphicsSkipauth DomainOpenGraphicsFlags = 1 +) + +// DomainSetTimeFlags as declared in libvirt/libvirt-domain.h:4504 +type DomainSetTimeFlags int32 + +// DomainSetTimeFlags enumeration from libvirt/libvirt-domain.h:4504 +const ( + DomainTimeSync DomainSetTimeFlags = 1 +) + +// SchedParameterType as declared in libvirt/libvirt-domain.h:4525 +type SchedParameterType int32 + +// SchedParameterType enumeration from libvirt/libvirt-domain.h:4525 +const ( + DomainSchedFieldInt SchedParameterType = 1 + DomainSchedFieldUint SchedParameterType = 2 + DomainSchedFieldLlong SchedParameterType = 3 + DomainSchedFieldUllong SchedParameterType = 4 + DomainSchedFieldDouble SchedParameterType = 5 + DomainSchedFieldBoolean SchedParameterType = 6 +) + +// BlkioParameterType as declared in libvirt/libvirt-domain.h:4569 +type BlkioParameterType int32 + +// BlkioParameterType enumeration from libvirt/libvirt-domain.h:4569 +const ( + DomainBlkioParamInt BlkioParameterType = 1 + DomainBlkioParamUint BlkioParameterType = 2 + DomainBlkioParamLlong BlkioParameterType = 3 + DomainBlkioParamUllong BlkioParameterType = 4 + DomainBlkioParamDouble BlkioParameterType = 5 + DomainBlkioParamBoolean BlkioParameterType = 6 +) + +// MemoryParameterType as declared in libvirt/libvirt-domain.h:4613 +type MemoryParameterType int32 + +// MemoryParameterType enumeration from libvirt/libvirt-domain.h:4613 +const ( + DomainMemoryParamInt MemoryParameterType = 1 + DomainMemoryParamUint MemoryParameterType = 2 + DomainMemoryParamLlong MemoryParameterType = 3 + DomainMemoryParamUllong MemoryParameterType = 4 + DomainMemoryParamDouble MemoryParameterType = 5 + DomainMemoryParamBoolean MemoryParameterType = 6 +) + +// DomainInterfaceAddressesSource as declared in libvirt/libvirt-domain.h:4650 +type DomainInterfaceAddressesSource int32 + +// DomainInterfaceAddressesSource enumeration from libvirt/libvirt-domain.h:4650 +const ( + DomainInterfaceAddressesSrcLease DomainInterfaceAddressesSource = iota + DomainInterfaceAddressesSrcAgent DomainInterfaceAddressesSource = 1 +) + +// DomainSetUserPasswordFlags as declared in libvirt/libvirt-domain.h:4678 +type DomainSetUserPasswordFlags int32 + +// DomainSetUserPasswordFlags enumeration from libvirt/libvirt-domain.h:4678 +const ( + DomainPasswordEncrypted DomainSetUserPasswordFlags = 1 +) + +// DomainSnapshotCreateFlags as declared in libvirt/libvirt-domain-snapshot.h:73 +type DomainSnapshotCreateFlags int32 + +// DomainSnapshotCreateFlags enumeration from libvirt/libvirt-domain-snapshot.h:73 +const ( + DomainSnapshotCreateRedefine DomainSnapshotCreateFlags = 1 + DomainSnapshotCreateCurrent DomainSnapshotCreateFlags = 2 + DomainSnapshotCreateNoMetadata DomainSnapshotCreateFlags = 4 + DomainSnapshotCreateHalt DomainSnapshotCreateFlags = 8 + DomainSnapshotCreateDiskOnly DomainSnapshotCreateFlags = 16 + DomainSnapshotCreateReuseExt DomainSnapshotCreateFlags = 32 + DomainSnapshotCreateQuiesce DomainSnapshotCreateFlags = 64 + DomainSnapshotCreateAtomic DomainSnapshotCreateFlags = 128 + DomainSnapshotCreateLive DomainSnapshotCreateFlags = 256 +) + +// DomainSnapshotListFlags as declared in libvirt/libvirt-domain-snapshot.h:133 +type DomainSnapshotListFlags int32 + +// DomainSnapshotListFlags enumeration from libvirt/libvirt-domain-snapshot.h:133 +const ( + DomainSnapshotListRoots DomainSnapshotListFlags = 1 + DomainSnapshotListDescendants DomainSnapshotListFlags = 1 + DomainSnapshotListLeaves DomainSnapshotListFlags = 4 + DomainSnapshotListNoLeaves DomainSnapshotListFlags = 8 + DomainSnapshotListMetadata DomainSnapshotListFlags = 2 + DomainSnapshotListNoMetadata DomainSnapshotListFlags = 16 + DomainSnapshotListInactive DomainSnapshotListFlags = 32 + DomainSnapshotListActive DomainSnapshotListFlags = 64 + DomainSnapshotListDiskOnly DomainSnapshotListFlags = 128 + DomainSnapshotListInternal DomainSnapshotListFlags = 256 + DomainSnapshotListExternal DomainSnapshotListFlags = 512 +) + +// DomainSnapshotRevertFlags as declared in libvirt/libvirt-domain-snapshot.h:190 +type DomainSnapshotRevertFlags int32 + +// DomainSnapshotRevertFlags enumeration from libvirt/libvirt-domain-snapshot.h:190 +const ( + DomainSnapshotRevertRunning DomainSnapshotRevertFlags = 1 + DomainSnapshotRevertPaused DomainSnapshotRevertFlags = 2 + DomainSnapshotRevertForce DomainSnapshotRevertFlags = 4 +) + +// DomainSnapshotDeleteFlags as declared in libvirt/libvirt-domain-snapshot.h:204 +type DomainSnapshotDeleteFlags int32 + +// DomainSnapshotDeleteFlags enumeration from libvirt/libvirt-domain-snapshot.h:204 +const ( + DomainSnapshotDeleteChildren DomainSnapshotDeleteFlags = 1 + DomainSnapshotDeleteMetadataOnly DomainSnapshotDeleteFlags = 2 + DomainSnapshotDeleteChildrenOnly DomainSnapshotDeleteFlags = 4 +) + +// EventHandleType as declared in libvirt/libvirt-event.h:44 +type EventHandleType int32 + +// EventHandleType enumeration from libvirt/libvirt-event.h:44 +const ( + EventHandleReadable EventHandleType = 1 + EventHandleWritable EventHandleType = 2 + EventHandleError EventHandleType = 4 + EventHandleHangup EventHandleType = 8 +) + +// ConnectListAllInterfacesFlags as declared in libvirt/libvirt-interface.h:65 +type ConnectListAllInterfacesFlags int32 + +// ConnectListAllInterfacesFlags enumeration from libvirt/libvirt-interface.h:65 +const ( + ConnectListInterfacesInactive ConnectListAllInterfacesFlags = 1 + ConnectListInterfacesActive ConnectListAllInterfacesFlags = 2 +) + +// InterfaceXMLFlags as declared in libvirt/libvirt-interface.h:81 +type InterfaceXMLFlags int32 + +// InterfaceXMLFlags enumeration from libvirt/libvirt-interface.h:81 +const ( + InterfaceXMLInactive InterfaceXMLFlags = 1 +) + +// NetworkXMLFlags as declared in libvirt/libvirt-network.h:33 +type NetworkXMLFlags int32 + +// NetworkXMLFlags enumeration from libvirt/libvirt-network.h:33 +const ( + NetworkXMLInactive NetworkXMLFlags = 1 +) + +// ConnectListAllNetworksFlags as declared in libvirt/libvirt-network.h:85 +type ConnectListAllNetworksFlags int32 + +// ConnectListAllNetworksFlags enumeration from libvirt/libvirt-network.h:85 +const ( + ConnectListNetworksInactive ConnectListAllNetworksFlags = 1 + ConnectListNetworksActive ConnectListAllNetworksFlags = 2 + ConnectListNetworksPersistent ConnectListAllNetworksFlags = 4 + ConnectListNetworksTransient ConnectListAllNetworksFlags = 8 + ConnectListNetworksAutostart ConnectListAllNetworksFlags = 16 + ConnectListNetworksNoAutostart ConnectListAllNetworksFlags = 32 +) + +// NetworkUpdateCommand as declared in libvirt/libvirt-network.h:134 +type NetworkUpdateCommand int32 + +// NetworkUpdateCommand enumeration from libvirt/libvirt-network.h:134 +const ( + NetworkUpdateCommandNone NetworkUpdateCommand = iota + NetworkUpdateCommandModify NetworkUpdateCommand = 1 + NetworkUpdateCommandDelete NetworkUpdateCommand = 2 + NetworkUpdateCommandAddLast NetworkUpdateCommand = 3 + NetworkUpdateCommandAddFirst NetworkUpdateCommand = 4 +) + +// NetworkUpdateSection as declared in libvirt/libvirt-network.h:160 +type NetworkUpdateSection int32 + +// NetworkUpdateSection enumeration from libvirt/libvirt-network.h:160 +const ( + NetworkSectionNone NetworkUpdateSection = iota + NetworkSectionBridge NetworkUpdateSection = 1 + NetworkSectionDomain NetworkUpdateSection = 2 + NetworkSectionIP NetworkUpdateSection = 3 + NetworkSectionIPDhcpHost NetworkUpdateSection = 4 + NetworkSectionIPDhcpRange NetworkUpdateSection = 5 + NetworkSectionForward NetworkUpdateSection = 6 + NetworkSectionForwardInterface NetworkUpdateSection = 7 + NetworkSectionForwardPf NetworkUpdateSection = 8 + NetworkSectionPortgroup NetworkUpdateSection = 9 + NetworkSectionDNSHost NetworkUpdateSection = 10 + NetworkSectionDNSTxt NetworkUpdateSection = 11 + NetworkSectionDNSSrv NetworkUpdateSection = 12 +) + +// NetworkUpdateFlags as declared in libvirt/libvirt-network.h:172 +type NetworkUpdateFlags int32 + +// NetworkUpdateFlags enumeration from libvirt/libvirt-network.h:172 +const ( + NetworkUpdateAffectCurrent NetworkUpdateFlags = iota + NetworkUpdateAffectLive NetworkUpdateFlags = 1 + NetworkUpdateAffectConfig NetworkUpdateFlags = 2 +) + +// NetworkEventLifecycleType as declared in libvirt/libvirt-network.h:230 +type NetworkEventLifecycleType int32 + +// NetworkEventLifecycleType enumeration from libvirt/libvirt-network.h:230 +const ( + NetworkEventDefined NetworkEventLifecycleType = iota + NetworkEventUndefined NetworkEventLifecycleType = 1 + NetworkEventStarted NetworkEventLifecycleType = 2 + NetworkEventStopped NetworkEventLifecycleType = 3 +) + +// NetworkEventID as declared in libvirt/libvirt-network.h:278 +type NetworkEventID int32 + +// NetworkEventID enumeration from libvirt/libvirt-network.h:278 +const ( + NetworkEventIDLifecycle NetworkEventID = iota +) + +// IPAddrType as declared in libvirt/libvirt-network.h:287 +type IPAddrType int32 + +// IPAddrType enumeration from libvirt/libvirt-network.h:287 +const ( + IPAddrTypeIpv4 IPAddrType = iota + IPAddrTypeIpv6 IPAddrType = 1 +) + +// ConnectListAllNodeDeviceFlags as declared in libvirt/libvirt-nodedev.h:85 +type ConnectListAllNodeDeviceFlags int32 + +// ConnectListAllNodeDeviceFlags enumeration from libvirt/libvirt-nodedev.h:85 +const ( + ConnectListNodeDevicesCapSystem ConnectListAllNodeDeviceFlags = 1 + ConnectListNodeDevicesCapPciDev ConnectListAllNodeDeviceFlags = 2 + ConnectListNodeDevicesCapUsbDev ConnectListAllNodeDeviceFlags = 4 + ConnectListNodeDevicesCapUsbInterface ConnectListAllNodeDeviceFlags = 8 + ConnectListNodeDevicesCapNet ConnectListAllNodeDeviceFlags = 16 + ConnectListNodeDevicesCapScsiHost ConnectListAllNodeDeviceFlags = 32 + ConnectListNodeDevicesCapScsiTarget ConnectListAllNodeDeviceFlags = 64 + ConnectListNodeDevicesCapScsi ConnectListAllNodeDeviceFlags = 128 + ConnectListNodeDevicesCapStorage ConnectListAllNodeDeviceFlags = 256 + ConnectListNodeDevicesCapFcHost ConnectListAllNodeDeviceFlags = 512 + ConnectListNodeDevicesCapVports ConnectListAllNodeDeviceFlags = 1024 + ConnectListNodeDevicesCapScsiGeneric ConnectListAllNodeDeviceFlags = 2048 + ConnectListNodeDevicesCapDrm ConnectListAllNodeDeviceFlags = 4096 + ConnectListNodeDevicesCapMdevTypes ConnectListAllNodeDeviceFlags = 8192 + ConnectListNodeDevicesCapMdev ConnectListAllNodeDeviceFlags = 16384 + ConnectListNodeDevicesCapCcwDev ConnectListAllNodeDeviceFlags = 32768 +) + +// NodeDeviceEventID as declared in libvirt/libvirt-nodedev.h:155 +type NodeDeviceEventID int32 + +// NodeDeviceEventID enumeration from libvirt/libvirt-nodedev.h:155 +const ( + NodeDeviceEventIDLifecycle NodeDeviceEventID = iota + NodeDeviceEventIDUpdate NodeDeviceEventID = 1 +) + +// NodeDeviceEventLifecycleType as declared in libvirt/libvirt-nodedev.h:197 +type NodeDeviceEventLifecycleType int32 + +// NodeDeviceEventLifecycleType enumeration from libvirt/libvirt-nodedev.h:197 +const ( + NodeDeviceEventCreated NodeDeviceEventLifecycleType = iota + NodeDeviceEventDeleted NodeDeviceEventLifecycleType = 1 +) + +// SecretUsageType as declared in libvirt/libvirt-secret.h:56 +type SecretUsageType int32 + +// SecretUsageType enumeration from libvirt/libvirt-secret.h:56 +const ( + SecretUsageTypeNone SecretUsageType = iota + SecretUsageTypeVolume SecretUsageType = 1 + SecretUsageTypeCeph SecretUsageType = 2 + SecretUsageTypeIscsi SecretUsageType = 3 + SecretUsageTypeTLS SecretUsageType = 4 +) + +// ConnectListAllSecretsFlags as declared in libvirt/libvirt-secret.h:79 +type ConnectListAllSecretsFlags int32 + +// ConnectListAllSecretsFlags enumeration from libvirt/libvirt-secret.h:79 +const ( + ConnectListSecretsEphemeral ConnectListAllSecretsFlags = 1 + ConnectListSecretsNoEphemeral ConnectListAllSecretsFlags = 2 + ConnectListSecretsPrivate ConnectListAllSecretsFlags = 4 + ConnectListSecretsNoPrivate ConnectListAllSecretsFlags = 8 +) + +// SecretEventID as declared in libvirt/libvirt-secret.h:140 +type SecretEventID int32 + +// SecretEventID enumeration from libvirt/libvirt-secret.h:140 +const ( + SecretEventIDLifecycle SecretEventID = iota + SecretEventIDValueChanged SecretEventID = 1 +) + +// SecretEventLifecycleType as declared in libvirt/libvirt-secret.h:182 +type SecretEventLifecycleType int32 + +// SecretEventLifecycleType enumeration from libvirt/libvirt-secret.h:182 +const ( + SecretEventDefined SecretEventLifecycleType = iota + SecretEventUndefined SecretEventLifecycleType = 1 +) + +// StoragePoolState as declared in libvirt/libvirt-storage.h:58 +type StoragePoolState int32 + +// StoragePoolState enumeration from libvirt/libvirt-storage.h:58 +const ( + StoragePoolInactive StoragePoolState = iota + StoragePoolBuilding StoragePoolState = 1 + StoragePoolRunning StoragePoolState = 2 + StoragePoolDegraded StoragePoolState = 3 + StoragePoolInaccessible StoragePoolState = 4 +) + +// StoragePoolBuildFlags as declared in libvirt/libvirt-storage.h:66 +type StoragePoolBuildFlags int32 + +// StoragePoolBuildFlags enumeration from libvirt/libvirt-storage.h:66 +const ( + StoragePoolBuildNew StoragePoolBuildFlags = iota + StoragePoolBuildRepair StoragePoolBuildFlags = 1 + StoragePoolBuildResize StoragePoolBuildFlags = 2 + StoragePoolBuildNoOverwrite StoragePoolBuildFlags = 4 + StoragePoolBuildOverwrite StoragePoolBuildFlags = 8 +) + +// StoragePoolDeleteFlags as declared in libvirt/libvirt-storage.h:71 +type StoragePoolDeleteFlags int32 + +// StoragePoolDeleteFlags enumeration from libvirt/libvirt-storage.h:71 +const ( + StoragePoolDeleteNormal StoragePoolDeleteFlags = iota + StoragePoolDeleteZeroed StoragePoolDeleteFlags = 1 +) + +// StoragePoolCreateFlags as declared in libvirt/libvirt-storage.h:88 +type StoragePoolCreateFlags int32 + +// StoragePoolCreateFlags enumeration from libvirt/libvirt-storage.h:88 +const ( + StoragePoolCreateNormal StoragePoolCreateFlags = iota + StoragePoolCreateWithBuild StoragePoolCreateFlags = 1 + StoragePoolCreateWithBuildOverwrite StoragePoolCreateFlags = 2 + StoragePoolCreateWithBuildNoOverwrite StoragePoolCreateFlags = 4 +) + +// StorageVolType as declared in libvirt/libvirt-storage.h:130 +type StorageVolType int32 + +// StorageVolType enumeration from libvirt/libvirt-storage.h:130 +const ( + StorageVolFile StorageVolType = iota + StorageVolBlock StorageVolType = 1 + StorageVolDir StorageVolType = 2 + StorageVolNetwork StorageVolType = 3 + StorageVolNetdir StorageVolType = 4 + StorageVolPloop StorageVolType = 5 +) + +// StorageVolDeleteFlags as declared in libvirt/libvirt-storage.h:136 +type StorageVolDeleteFlags int32 + +// StorageVolDeleteFlags enumeration from libvirt/libvirt-storage.h:136 +const ( + StorageVolDeleteNormal StorageVolDeleteFlags = iota + StorageVolDeleteZeroed StorageVolDeleteFlags = 1 + StorageVolDeleteWithSnapshots StorageVolDeleteFlags = 2 +) + +// StorageVolWipeAlgorithm as declared in libvirt/libvirt-storage.h:168 +type StorageVolWipeAlgorithm int32 + +// StorageVolWipeAlgorithm enumeration from libvirt/libvirt-storage.h:168 +const ( + StorageVolWipeAlgZero StorageVolWipeAlgorithm = iota + StorageVolWipeAlgNnsa StorageVolWipeAlgorithm = 1 + StorageVolWipeAlgDod StorageVolWipeAlgorithm = 2 + StorageVolWipeAlgBsi StorageVolWipeAlgorithm = 3 + StorageVolWipeAlgGutmann StorageVolWipeAlgorithm = 4 + StorageVolWipeAlgSchneier StorageVolWipeAlgorithm = 5 + StorageVolWipeAlgPfitzner7 StorageVolWipeAlgorithm = 6 + StorageVolWipeAlgPfitzner33 StorageVolWipeAlgorithm = 7 + StorageVolWipeAlgRandom StorageVolWipeAlgorithm = 8 + StorageVolWipeAlgTrim StorageVolWipeAlgorithm = 9 +) + +// StorageVolInfoFlags as declared in libvirt/libvirt-storage.h:176 +type StorageVolInfoFlags int32 + +// StorageVolInfoFlags enumeration from libvirt/libvirt-storage.h:176 +const ( + StorageVolUseAllocation StorageVolInfoFlags = iota + StorageVolGetPhysical StorageVolInfoFlags = 1 +) + +// StorageXMLFlags as declared in libvirt/libvirt-storage.h:190 +type StorageXMLFlags int32 + +// StorageXMLFlags enumeration from libvirt/libvirt-storage.h:190 +const ( + StorageXMLInactive StorageXMLFlags = 1 +) + +// ConnectListAllStoragePoolsFlags as declared in libvirt/libvirt-storage.h:244 +type ConnectListAllStoragePoolsFlags int32 + +// ConnectListAllStoragePoolsFlags enumeration from libvirt/libvirt-storage.h:244 +const ( + ConnectListStoragePoolsInactive ConnectListAllStoragePoolsFlags = 1 + ConnectListStoragePoolsActive ConnectListAllStoragePoolsFlags = 2 + ConnectListStoragePoolsPersistent ConnectListAllStoragePoolsFlags = 4 + ConnectListStoragePoolsTransient ConnectListAllStoragePoolsFlags = 8 + ConnectListStoragePoolsAutostart ConnectListAllStoragePoolsFlags = 16 + ConnectListStoragePoolsNoAutostart ConnectListAllStoragePoolsFlags = 32 + ConnectListStoragePoolsDir ConnectListAllStoragePoolsFlags = 64 + ConnectListStoragePoolsFs ConnectListAllStoragePoolsFlags = 128 + ConnectListStoragePoolsNetfs ConnectListAllStoragePoolsFlags = 256 + ConnectListStoragePoolsLogical ConnectListAllStoragePoolsFlags = 512 + ConnectListStoragePoolsDisk ConnectListAllStoragePoolsFlags = 1024 + ConnectListStoragePoolsIscsi ConnectListAllStoragePoolsFlags = 2048 + ConnectListStoragePoolsScsi ConnectListAllStoragePoolsFlags = 4096 + ConnectListStoragePoolsMpath ConnectListAllStoragePoolsFlags = 8192 + ConnectListStoragePoolsRbd ConnectListAllStoragePoolsFlags = 16384 + ConnectListStoragePoolsSheepdog ConnectListAllStoragePoolsFlags = 32768 + ConnectListStoragePoolsGluster ConnectListAllStoragePoolsFlags = 65536 + ConnectListStoragePoolsZfs ConnectListAllStoragePoolsFlags = 131072 + ConnectListStoragePoolsVstorage ConnectListAllStoragePoolsFlags = 262144 +) + +// StorageVolCreateFlags as declared in libvirt/libvirt-storage.h:340 +type StorageVolCreateFlags int32 + +// StorageVolCreateFlags enumeration from libvirt/libvirt-storage.h:340 +const ( + StorageVolCreatePreallocMetadata StorageVolCreateFlags = 1 + StorageVolCreateReflink StorageVolCreateFlags = 2 +) + +// StorageVolDownloadFlags as declared in libvirt/libvirt-storage.h:352 +type StorageVolDownloadFlags int32 + +// StorageVolDownloadFlags enumeration from libvirt/libvirt-storage.h:352 +const ( + StorageVolDownloadSparseStream StorageVolDownloadFlags = 1 +) + +// StorageVolUploadFlags as declared in libvirt/libvirt-storage.h:361 +type StorageVolUploadFlags int32 + +// StorageVolUploadFlags enumeration from libvirt/libvirt-storage.h:361 +const ( + StorageVolUploadSparseStream StorageVolUploadFlags = 1 +) + +// StorageVolResizeFlags as declared in libvirt/libvirt-storage.h:392 +type StorageVolResizeFlags int32 + +// StorageVolResizeFlags enumeration from libvirt/libvirt-storage.h:392 +const ( + StorageVolResizeAllocate StorageVolResizeFlags = 1 + StorageVolResizeDelta StorageVolResizeFlags = 2 + StorageVolResizeShrink StorageVolResizeFlags = 4 +) + +// StoragePoolEventID as declared in libvirt/libvirt-storage.h:428 +type StoragePoolEventID int32 + +// StoragePoolEventID enumeration from libvirt/libvirt-storage.h:428 +const ( + StoragePoolEventIDLifecycle StoragePoolEventID = iota + StoragePoolEventIDRefresh StoragePoolEventID = 1 +) + +// StoragePoolEventLifecycleType as declared in libvirt/libvirt-storage.h:472 +type StoragePoolEventLifecycleType int32 + +// StoragePoolEventLifecycleType enumeration from libvirt/libvirt-storage.h:472 +const ( + StoragePoolEventDefined StoragePoolEventLifecycleType = iota + StoragePoolEventUndefined StoragePoolEventLifecycleType = 1 + StoragePoolEventStarted StoragePoolEventLifecycleType = 2 + StoragePoolEventStopped StoragePoolEventLifecycleType = 3 +) + +// StreamFlags as declared in libvirt/libvirt-stream.h:34 +type StreamFlags int32 + +// StreamFlags enumeration from libvirt/libvirt-stream.h:34 +const ( + StreamNonblock StreamFlags = 1 +) + +// StreamRecvFlagsValues as declared in libvirt/libvirt-stream.h:50 +type StreamRecvFlagsValues int32 + +// StreamRecvFlagsValues enumeration from libvirt/libvirt-stream.h:50 +const ( + StreamRecvStopAtHole StreamRecvFlagsValues = 1 +) + +// StreamEventType as declared in libvirt/libvirt-stream.h:223 +type StreamEventType int32 + +// StreamEventType enumeration from libvirt/libvirt-stream.h:223 +const ( + StreamEventReadable StreamEventType = 1 + StreamEventWritable StreamEventType = 2 + StreamEventError StreamEventType = 4 + StreamEventHangup StreamEventType = 8 +) diff --git a/internal/lvgen/generate.go b/internal/lvgen/generate.go index a60d9b0..35d7658 100644 --- a/internal/lvgen/generate.go +++ b/internal/lvgen/generate.go @@ -16,6 +16,7 @@ package lvgen import ( "fmt" + "go/ast" "io" "os" "strconv" @@ -23,6 +24,8 @@ import ( "text/template" "unicode" "unicode/utf8" + + "golang.org/x/tools/go/loader" ) // If you're making changes to the generator, or troubleshooting the generated @@ -375,6 +378,8 @@ func fixAbbrevs(s string) string { // defined in the protocol file. If one or both of these structs is not defined // then either the args or return values are empty. func procLink() { + flagTypes := mapFlagTypes() + for ix, proc := range Gen.Procs { argsName := proc.Name + "Args" retName := proc.Name + "Ret" @@ -383,6 +388,7 @@ func procLink() { if hasArgs { argsStruct := Gen.Structs[argsIx] Gen.Procs[ix].ArgsStruct = argsStruct.Name + changeFlagType(proc.Name, &argsStruct, flagTypes) Gen.Procs[ix].Args = argsStruct.Members } if hasRet { @@ -393,6 +399,138 @@ func procLink() { } } +// mapFlagTypes builds a map of the C types which appear to correspond to the +// various flags fields in libvirt calls. Determining whether a type actually +// corresponds to a set of flags is done by pattern matching the type name; +// libvirt isn't completely consistent about the names of flag types, but they +// all seem to have one of three suffixes, so that's what we look for here. +// +// This code uses the loader package to load the constants file generated by +// c-for-go, which runs against libvirt's C sources. This file is generated by +// 'go generate ./...' prior to the lvgen/ generator being run. +func mapFlagTypes() map[string]ast.Expr { + pconf := loader.Config{} + f, err := pconf.ParseFile("../../const.gen.go", nil) + if err != nil { + panic(fmt.Sprintln("failed to read constants file: ", err)) + } + pconf.CreateFromFiles("const", f) + prog, err := pconf.Load() + if err != nil { + panic(fmt.Sprintln("failed to load package: ", err)) + } + cpkg := prog.Package("const") + + tmap := make(map[string]ast.Expr) + ast.Inspect(cpkg.Files[0], func(n ast.Node) bool { + switch t := n.(type) { + case *ast.TypeSpec: + // There isn't a single name pattern that covers all of the flag + // types, so we'll collect all the types that map to int32 here. + if fmt.Sprintf("%s", t.Type) == "int32" { + tmap[t.Name.String()] = t.Type + } + } + return true + }) + return tmap +} + +// Many libvirt calls use flags whose values come from a set of definitions +// whose name we can't predict. So this map exists to do the translation for us. +// The only way to remove this fragile map would be to use the comments from the +// .c files in libvirt, which contain doxygen-style parameter comments that +// specify the valid value types for flags. +var flagMap = map[string]string{ + "ConnectOpen": "ConnectFlags", + "DomainAddIothread": "DomainModificationImpact", + "DomainCoreDumpWithFormat": "DomainCoreDumpFlags", + "DomainCreateXML": "DomainCreateFlags", + "DomainCreateWithFiles": "DomainCreateFlags", + "DomainCreateXMLWithFiles": "DomainCreateFlags", + "DomainDefineXMLFlags": "DomainDefineFlags", + "DomainDelIothread": "DomainModificationImpact", + "DomainDestroyFlags": "DomainDestroyFlagsValues", + "DomainGetCPUStats": "TypedParameterFlags", + "DomainGetEmulatorPinInfo": "DomainModificationImpact", + "DomainGetInterfaceParameters": "DomainModificationImpact", + "DomainGetIothreadInfo": "DomainModificationImpact", + "DomainGetMetadata": "DomainModificationImpact", + "DomainGetPerfEvents": "DomainModificationImpact", + "DomainGetXMLDesc": "DomainXMLFlags", + "DomainManagedSaveDefineXML": "DomainSaveRestoreFlags", + "DomainManagedSaveGetXMLDesc": "DomainXMLFlags", + "DomainMemoryPeek": "DomainMemoryFlags", + "DomainMigratePerform3Params": "DomainMigrateFlags", + "DomainOpenChannel": "DomainChannelFlags", + "DomainOpenGraphicsFd": "DomainOpenGraphicsFlags", + "DomainPinEmulator": "DomainModificationImpact", + "DomainPinIothread": "DomainModificationImpact", + "DomainSetLifecycleAction": "DomainModificationImpact", + "DomainSetMemoryStatsPeriod": "DomainMemoryModFlags", + "DomainSetMetadata": "DomainModificationImpact", + "DomainSetPerfEvents": "DomainModificationImpact", + "DomainSetVcpu": "DomainModificationImpact", + "DomainShutdownFlags": "DomainShutdownFlagValues", + "DomainUndefineFlags": "DomainUndefineFlagsValues", + "StoragePoolCreateXML": "StoragePoolCreateFlags", + "StoragePoolGetXMLDesc": "StorageXMLFlags", + "StorageVolCreateXML": "StorageVolCreateFlags", + "StorageVolCreateXMLFrom": "StorageVolCreateFlags", +} + +// findFlagType attempts to find a real type for the flags passed to a given +// libvirt routine. +func findFlagType(procName string, flagTypes map[string]ast.Expr) (string, bool) { + flagName, ok := flagMap[procName] + if ok { + // Verify the mapped name exists + if _, ok = flagTypes[flagName]; ok == false { + // If one of the manual flag mappings is wrong, complain but + // continue. This happens with older versions of libvirt. + fmt.Printf("manual flag type %v for %v not found, continuing", flagName, procName) + return "", false + } + return flagName, true + } + + // Not in the manual map, so do a search using the 3 patterns libvirt uses. + tnames := [...]string{procName + "Flags", procName + "FlagValues", procName + "FlagsValues"} + for _, n := range tnames { + if _, ok := flagTypes[n]; ok == true { + return n, true + } + } + + return "", false +} + +// changeFlagType looks up the go type for a libvirt call's flags field. In C +// these flags are all uint32, and you have to consult the documentation to +// determine what the valid set of flags is for a given libvirt call. For Go +// we're attempting to do better by specifying an actual type so that the +// possible values are easier to determine. This is a heuristic, however, based +// on naming patterns in the libvirt code. To do better we would need to look at +// the doxygen-style comments in the libvirt sources. +// +// Failing to find a flags type isn't a fatal error, it just means that we'll +// leave the flags with a type of uint32. +func changeFlagType(procName string, s *Structure, flagTypes map[string]ast.Expr) { + for ix, d := range s.Members { + if d.Name == "Flags" { + tname, found := findFlagType(procName, flagTypes) + + if found { + s.Members[ix].Type = tname + } else { + // If you're adding procedures to to the manual map, you may + // want to uncomment this to see what flag types are not found. + // fmt.Println("flags type for", procName, "not found") + } + } + } +} + //--------------------------------------------------------------------------- // Routines called by the parser's actions. //--------------------------------------------------------------------------- @@ -592,7 +730,6 @@ func AddOptValue(identifier, itype string) { atype := "[]" + itype decl := NewDecl(identifier, atype) newType := "Opt" + decl.Name - fmt.Printf("Adding mapping %v = %v\n", decl.Name, newType) goEquivTypes[decl.Name] = newType decl.Name = newType addDecl(decl) diff --git a/libvirt.gen.go b/libvirt.gen.go index 7679f30..b6aabaf 100644 --- a/libvirt.gen.go +++ b/libvirt.gen.go @@ -171,7 +171,7 @@ type DomainDiskError struct { // ConnectOpenArgs is libvirt's remote_connect_open_args type ConnectOpenArgs struct { Name OptString - Flags uint32 + Flags ConnectFlags } // ConnectSupportsFeatureArgs is libvirt's remote_connect_supports_feature_args @@ -394,7 +394,7 @@ type DomainBlockResizeArgs struct { Dom Domain Disk string Size uint64 - Flags uint32 + Flags DomainBlockResizeFlags } // DomainSetNumaParametersArgs is libvirt's remote_domain_set_numa_parameters_args @@ -421,13 +421,13 @@ type DomainGetNumaParametersRet struct { type DomainSetPerfEventsArgs struct { Dom Domain Params []TypedParam - Flags uint32 + Flags DomainModificationImpact } // DomainGetPerfEventsArgs is libvirt's remote_domain_get_perf_events_args type DomainGetPerfEventsArgs struct { Dom Domain - Flags uint32 + Flags DomainModificationImpact } // DomainGetPerfEventsRet is libvirt's remote_domain_get_perf_events_ret @@ -495,7 +495,7 @@ type DomainGetInterfaceParametersArgs struct { Dom Domain Device string Nparams int32 - Flags uint32 + Flags DomainModificationImpact } // DomainGetInterfaceParametersRet is libvirt's remote_domain_get_interface_parameters_ret @@ -541,7 +541,7 @@ type DomainMemoryPeekArgs struct { Dom Domain Offset uint64 Size uint32 - Flags uint32 + Flags DomainMemoryFlags } // DomainMemoryPeekRet is libvirt's remote_domain_memory_peek_ret @@ -581,7 +581,7 @@ type ConnectNumOfDomainsRet struct { // DomainCreateXMLArgs is libvirt's remote_domain_create_xml_args type DomainCreateXMLArgs struct { XMLDesc string - Flags uint32 + Flags DomainCreateFlags } // DomainCreateXMLRet is libvirt's remote_domain_create_xml_ret @@ -592,7 +592,7 @@ type DomainCreateXMLRet struct { // DomainCreateXMLWithFilesArgs is libvirt's remote_domain_create_xml_with_files_args type DomainCreateXMLWithFilesArgs struct { XMLDesc string - Flags uint32 + Flags DomainCreateFlags } // DomainCreateXMLWithFilesRet is libvirt's remote_domain_create_xml_with_files_ret @@ -662,7 +662,7 @@ type DomainShutdownArgs struct { // DomainRebootArgs is libvirt's remote_domain_reboot_args type DomainRebootArgs struct { Dom Domain - Flags uint32 + Flags DomainRebootFlagValues } // DomainResetArgs is libvirt's remote_domain_reset_args @@ -679,7 +679,7 @@ type DomainDestroyArgs struct { // DomainDestroyFlagsArgs is libvirt's remote_domain_destroy_flags_args type DomainDestroyFlagsArgs struct { Dom Domain - Flags uint32 + Flags DomainDestroyFlagsValues } // DomainGetOsTypeArgs is libvirt's remote_domain_get_os_type_args @@ -725,7 +725,7 @@ type DomainSetMemoryFlagsArgs struct { type DomainSetMemoryStatsPeriodArgs struct { Dom Domain Period int32 - Flags uint32 + Flags DomainMemoryModFlags } // DomainGetInfoArgs is libvirt's remote_domain_get_info_args @@ -790,7 +790,7 @@ type DomainSaveImageDefineXMLArgs struct { type DomainCoreDumpArgs struct { Dom Domain To string - Flags uint32 + Flags DomainCoreDumpFlags } // DomainCoreDumpWithFormatArgs is libvirt's remote_domain_core_dump_with_format_args @@ -798,7 +798,7 @@ type DomainCoreDumpWithFormatArgs struct { Dom Domain To string Dumpformat uint32 - Flags uint32 + Flags DomainCoreDumpFlags } // DomainScreenshotArgs is libvirt's remote_domain_screenshot_args @@ -816,7 +816,7 @@ type DomainScreenshotRet struct { // DomainGetXMLDescArgs is libvirt's remote_domain_get_xml_desc_args type DomainGetXMLDescArgs struct { Dom Domain - Flags uint32 + Flags DomainXMLFlags } // DomainGetXMLDescRet is libvirt's remote_domain_get_xml_desc_ret @@ -924,7 +924,7 @@ type DomainCreateWithFlagsRet struct { // DomainCreateWithFilesArgs is libvirt's remote_domain_create_with_files_args type DomainCreateWithFilesArgs struct { Dom Domain - Flags uint32 + Flags DomainCreateFlags } // DomainCreateWithFilesRet is libvirt's remote_domain_create_with_files_ret @@ -945,7 +945,7 @@ type DomainDefineXMLRet struct { // DomainDefineXMLFlagsArgs is libvirt's remote_domain_define_xml_flags_args type DomainDefineXMLFlagsArgs struct { XML string - Flags uint32 + Flags DomainDefineFlags } // DomainDefineXMLFlagsRet is libvirt's remote_domain_define_xml_flags_ret @@ -961,7 +961,7 @@ type DomainUndefineArgs struct { // DomainUndefineFlagsArgs is libvirt's remote_domain_undefine_flags_args type DomainUndefineFlagsArgs struct { Dom Domain - Flags uint32 + Flags DomainUndefineFlagsValues } // DomainInjectNmiArgs is libvirt's remote_domain_inject_nmi_args @@ -1044,14 +1044,14 @@ type DomainGetVcpuPinInfoRet struct { type DomainPinEmulatorArgs struct { Dom Domain Cpumap []byte - Flags uint32 + Flags DomainModificationImpact } // DomainGetEmulatorPinInfoArgs is libvirt's remote_domain_get_emulator_pin_info_args type DomainGetEmulatorPinInfoArgs struct { Dom Domain Maplen int32 - Flags uint32 + Flags DomainModificationImpact } // DomainGetEmulatorPinInfoRet is libvirt's remote_domain_get_emulator_pin_info_ret @@ -1092,7 +1092,7 @@ type DomainIothreadInfo struct { // DomainGetIothreadInfoArgs is libvirt's remote_domain_get_iothread_info_args type DomainGetIothreadInfoArgs struct { Dom Domain - Flags uint32 + Flags DomainModificationImpact } // DomainGetIothreadInfoRet is libvirt's remote_domain_get_iothread_info_ret @@ -1106,21 +1106,21 @@ type DomainPinIothreadArgs struct { Dom Domain IothreadsID uint32 Cpumap []byte - Flags uint32 + Flags DomainModificationImpact } // DomainAddIothreadArgs is libvirt's remote_domain_add_iothread_args type DomainAddIothreadArgs struct { Dom Domain IothreadID uint32 - Flags uint32 + Flags DomainModificationImpact } // DomainDelIothreadArgs is libvirt's remote_domain_del_iothread_args type DomainDelIothreadArgs struct { Dom Domain IothreadID uint32 - Flags uint32 + Flags DomainModificationImpact } // DomainGetSecurityLabelArgs is libvirt's remote_domain_get_security_label_args @@ -1207,7 +1207,7 @@ type DomainSetMetadataArgs struct { Metadata OptString Key OptString Uri OptString - Flags uint32 + Flags DomainModificationImpact } // DomainGetMetadataArgs is libvirt's remote_domain_get_metadata_args @@ -1215,7 +1215,7 @@ type DomainGetMetadataArgs struct { Dom Domain Type int32 Uri OptString - Flags uint32 + Flags DomainModificationImpact } // DomainGetMetadataRet is libvirt's remote_domain_get_metadata_ret @@ -1227,7 +1227,7 @@ type DomainGetMetadataRet struct { type DomainBlockJobAbortArgs struct { Dom Domain Path string - Flags uint32 + Flags DomainBlockJobAbortFlags } // DomainGetBlockJobInfoArgs is libvirt's remote_domain_get_block_job_info_args @@ -1251,7 +1251,7 @@ type DomainBlockJobSetSpeedArgs struct { Dom Domain Path string Bandwidth uint64 - Flags uint32 + Flags DomainBlockJobSetSpeedFlags } // DomainBlockPullArgs is libvirt's remote_domain_block_pull_args @@ -1259,7 +1259,7 @@ type DomainBlockPullArgs struct { Dom Domain Path string Bandwidth uint64 - Flags uint32 + Flags DomainBlockPullFlags } // DomainBlockRebaseArgs is libvirt's remote_domain_block_rebase_args @@ -1268,7 +1268,7 @@ type DomainBlockRebaseArgs struct { Path string Base OptString Bandwidth uint64 - Flags uint32 + Flags DomainBlockRebaseFlags } // DomainBlockCopyArgs is libvirt's remote_domain_block_copy_args @@ -1277,7 +1277,7 @@ type DomainBlockCopyArgs struct { Path string Destxml string Params []TypedParam - Flags uint32 + Flags DomainBlockCopyFlags } // DomainBlockCommitArgs is libvirt's remote_domain_block_commit_args @@ -1287,7 +1287,7 @@ type DomainBlockCommitArgs struct { Base OptString Top OptString Bandwidth uint64 - Flags uint32 + Flags DomainBlockCommitFlags } // DomainSetBlockIOTuneArgs is libvirt's remote_domain_set_block_io_tune_args @@ -1318,7 +1318,7 @@ type DomainGetCPUStatsArgs struct { Nparams uint32 StartCPU int32 Ncpus uint32 - Flags uint32 + Flags TypedParameterFlags } // DomainGetCPUStatsRet is libvirt's remote_domain_get_cpu_stats_ret @@ -1420,7 +1420,7 @@ type NetworkUpdateArgs struct { Section uint32 ParentIndex int32 XML string - Flags uint32 + Flags NetworkUpdateFlags } // NetworkCreateArgs is libvirt's remote_network_create_args @@ -1752,7 +1752,7 @@ type StoragePoolLookupByVolumeRet struct { // StoragePoolCreateXMLArgs is libvirt's remote_storage_pool_create_xml_args type StoragePoolCreateXMLArgs struct { XML string - Flags uint32 + Flags StoragePoolCreateFlags } // StoragePoolCreateXMLRet is libvirt's remote_storage_pool_create_xml_ret @@ -1774,7 +1774,7 @@ type StoragePoolDefineXMLRet struct { // StoragePoolBuildArgs is libvirt's remote_storage_pool_build_args type StoragePoolBuildArgs struct { Pool StoragePool - Flags uint32 + Flags StoragePoolBuildFlags } // StoragePoolUndefineArgs is libvirt's remote_storage_pool_undefine_args @@ -1785,7 +1785,7 @@ type StoragePoolUndefineArgs struct { // StoragePoolCreateArgs is libvirt's remote_storage_pool_create_args type StoragePoolCreateArgs struct { Pool StoragePool - Flags uint32 + Flags StoragePoolCreateFlags } // StoragePoolDestroyArgs is libvirt's remote_storage_pool_destroy_args @@ -1796,7 +1796,7 @@ type StoragePoolDestroyArgs struct { // StoragePoolDeleteArgs is libvirt's remote_storage_pool_delete_args type StoragePoolDeleteArgs struct { Pool StoragePool - Flags uint32 + Flags StoragePoolDeleteFlags } // StoragePoolRefreshArgs is libvirt's remote_storage_pool_refresh_args @@ -1808,7 +1808,7 @@ type StoragePoolRefreshArgs struct { // StoragePoolGetXMLDescArgs is libvirt's remote_storage_pool_get_xml_desc_args type StoragePoolGetXMLDescArgs struct { Pool StoragePool - Flags uint32 + Flags StorageXMLFlags } // StoragePoolGetXMLDescRet is libvirt's remote_storage_pool_get_xml_desc_ret @@ -1901,7 +1901,7 @@ type StorageVolLookupByPathRet struct { type StorageVolCreateXMLArgs struct { Pool StoragePool XML string - Flags uint32 + Flags StorageVolCreateFlags } // StorageVolCreateXMLRet is libvirt's remote_storage_vol_create_xml_ret @@ -1914,7 +1914,7 @@ type StorageVolCreateXMLFromArgs struct { Pool StoragePool XML string Clonevol StorageVol - Flags uint32 + Flags StorageVolCreateFlags } // StorageVolCreateXMLFromRet is libvirt's remote_storage_vol_create_xml_from_ret @@ -1925,7 +1925,7 @@ type StorageVolCreateXMLFromRet struct { // StorageVolDeleteArgs is libvirt's remote_storage_vol_delete_args type StorageVolDeleteArgs struct { Vol StorageVol - Flags uint32 + Flags StorageVolDeleteFlags } // StorageVolWipeArgs is libvirt's remote_storage_vol_wipe_args @@ -1991,7 +1991,7 @@ type StorageVolGetPathRet struct { type StorageVolResizeArgs struct { Vol StorageVol Capacity uint64 - Flags uint32 + Flags StorageVolResizeFlags } // NodeNumOfDevicesArgs is libvirt's remote_node_num_of_devices_args @@ -2343,7 +2343,7 @@ type InterfaceIsActiveRet struct { // ConnectCompareCPUArgs is libvirt's remote_connect_compare_cpu_args type ConnectCompareCPUArgs struct { XML string - Flags uint32 + Flags ConnectCompareCPUFlags } // ConnectCompareCPURet is libvirt's remote_connect_compare_cpu_ret @@ -2354,7 +2354,7 @@ type ConnectCompareCPURet struct { // ConnectBaselineCPUArgs is libvirt's remote_connect_baseline_cpu_args type ConnectBaselineCPUArgs struct { XMLCPUs []string - Flags uint32 + Flags ConnectBaselineCPUFlags } // ConnectBaselineCPURet is libvirt's remote_connect_baseline_cpu_ret @@ -2386,7 +2386,7 @@ type DomainGetJobInfoRet struct { // DomainGetJobStatsArgs is libvirt's remote_domain_get_job_stats_args type DomainGetJobStatsArgs struct { Dom Domain - Flags uint32 + Flags DomainGetJobStatsFlags } // DomainGetJobStatsRet is libvirt's remote_domain_get_job_stats_ret @@ -2689,7 +2689,7 @@ type DomainManagedSaveRemoveArgs struct { // DomainManagedSaveGetXMLDescArgs is libvirt's remote_domain_managed_save_get_xml_desc_args type DomainManagedSaveGetXMLDescArgs struct { Dom Domain - Flags uint32 + Flags DomainXMLFlags } // DomainManagedSaveGetXMLDescRet is libvirt's remote_domain_managed_save_get_xml_desc_ret @@ -2701,7 +2701,7 @@ type DomainManagedSaveGetXMLDescRet struct { type DomainManagedSaveDefineXMLArgs struct { Dom Domain Dxml OptString - Flags uint32 + Flags DomainSaveRestoreFlags } // DomainSnapshotCreateXMLArgs is libvirt's remote_domain_snapshot_create_xml_args @@ -2875,7 +2875,7 @@ type DomainRevertToSnapshotArgs struct { // DomainSnapshotDeleteArgs is libvirt's remote_domain_snapshot_delete_args type DomainSnapshotDeleteArgs struct { Snap DomainSnapshot - Flags uint32 + Flags DomainSnapshotDeleteFlags } // DomainOpenConsoleArgs is libvirt's remote_domain_open_console_args @@ -2889,7 +2889,7 @@ type DomainOpenConsoleArgs struct { type DomainOpenChannelArgs struct { Dom Domain Name OptString - Flags uint32 + Flags DomainChannelFlags } // StorageVolUploadArgs is libvirt's remote_storage_vol_upload_args @@ -2897,7 +2897,7 @@ type StorageVolUploadArgs struct { Vol StorageVol Offset uint64 Length uint64 - Flags uint32 + Flags StorageVolUploadFlags } // StorageVolDownloadArgs is libvirt's remote_storage_vol_download_args @@ -2905,7 +2905,7 @@ type StorageVolDownloadArgs struct { Vol StorageVol Offset uint64 Length uint64 - Flags uint32 + Flags StorageVolDownloadFlags } // DomainGetStateArgs is libvirt's remote_domain_get_state_args @@ -3034,14 +3034,14 @@ type DomainGetControlInfoRet struct { type DomainOpenGraphicsArgs struct { Dom Domain Idx uint32 - Flags uint32 + Flags DomainOpenGraphicsFlags } // DomainOpenGraphicsFdArgs is libvirt's remote_domain_open_graphics_fd_args type DomainOpenGraphicsFdArgs struct { Dom Domain Idx uint32 - Flags uint32 + Flags DomainOpenGraphicsFlags } // NodeSuspendForDurationArgs is libvirt's remote_node_suspend_for_duration_args @@ -3054,7 +3054,7 @@ type NodeSuspendForDurationArgs struct { // DomainShutdownFlagsArgs is libvirt's remote_domain_shutdown_flags_args type DomainShutdownFlagsArgs struct { Dom Domain - Flags uint32 + Flags DomainShutdownFlagValues } // DomainGetDiskErrorsArgs is libvirt's remote_domain_get_disk_errors_args @@ -3073,7 +3073,7 @@ type DomainGetDiskErrorsRet struct { // ConnectListAllDomainsArgs is libvirt's remote_connect_list_all_domains_args type ConnectListAllDomainsArgs struct { NeedResults int32 - Flags uint32 + Flags ConnectListAllDomainsFlags } // ConnectListAllDomainsRet is libvirt's remote_connect_list_all_domains_ret @@ -3085,7 +3085,7 @@ type ConnectListAllDomainsRet struct { // ConnectListAllStoragePoolsArgs is libvirt's remote_connect_list_all_storage_pools_args type ConnectListAllStoragePoolsArgs struct { NeedResults int32 - Flags uint32 + Flags ConnectListAllStoragePoolsFlags } // ConnectListAllStoragePoolsRet is libvirt's remote_connect_list_all_storage_pools_ret @@ -3110,7 +3110,7 @@ type StoragePoolListAllVolumesRet struct { // ConnectListAllNetworksArgs is libvirt's remote_connect_list_all_networks_args type ConnectListAllNetworksArgs struct { NeedResults int32 - Flags uint32 + Flags ConnectListAllNetworksFlags } // ConnectListAllNetworksRet is libvirt's remote_connect_list_all_networks_ret @@ -3122,7 +3122,7 @@ type ConnectListAllNetworksRet struct { // ConnectListAllInterfacesArgs is libvirt's remote_connect_list_all_interfaces_args type ConnectListAllInterfacesArgs struct { NeedResults int32 - Flags uint32 + Flags ConnectListAllInterfacesFlags } // ConnectListAllInterfacesRet is libvirt's remote_connect_list_all_interfaces_ret @@ -3158,7 +3158,7 @@ type ConnectListAllNwfiltersRet struct { // ConnectListAllSecretsArgs is libvirt's remote_connect_list_all_secrets_args type ConnectListAllSecretsArgs struct { NeedResults int32 - Flags uint32 + Flags ConnectListAllSecretsFlags } // ConnectListAllSecretsRet is libvirt's remote_connect_list_all_secrets_ret @@ -3224,7 +3224,7 @@ type DomainSetTimeArgs struct { Dom Domain Seconds int64 Nseconds uint32 - Flags uint32 + Flags DomainSetTimeFlags } // DomainMigrateBegin3ParamsArgs is libvirt's remote_domain_migrate_begin3_params_args @@ -3271,7 +3271,7 @@ type DomainMigratePerform3ParamsArgs struct { Dconnuri OptString Params []TypedParam CookieIn []byte - Flags uint32 + Flags DomainMigrateFlags } // DomainMigratePerform3ParamsRet is libvirt's remote_domain_migrate_perform3_params_ret @@ -3492,7 +3492,7 @@ type NodeAllocPagesArgs struct { PageCounts []uint64 StartCell int32 CellCount uint32 - Flags uint32 + Flags NodeAllocPagesFlags } // NodeAllocPagesRet is libvirt's remote_node_alloc_pages_ret @@ -3537,7 +3537,7 @@ type DomainStatsRecord struct { type ConnectGetAllDomainStatsArgs struct { Doms []Domain Stats uint32 - Flags uint32 + Flags ConnectGetAllDomainStatsFlags } // DomainEventCallbackAgentLifecycleMsg is libvirt's remote_domain_event_callback_agent_lifecycle_msg @@ -3604,7 +3604,7 @@ type DomainSetUserPasswordArgs struct { Dom Domain User OptString Password OptString - Flags uint32 + Flags DomainSetUserPasswordFlags } // DomainRenameArgs is libvirt's remote_domain_rename_args @@ -3670,7 +3670,7 @@ type DomainSetVcpuArgs struct { Dom Domain Cpumap string State int32 - Flags uint32 + Flags DomainModificationImpact } // DomainEventCallbackMetadataChangeMsg is libvirt's remote_domain_event_callback_metadata_change_msg @@ -3724,7 +3724,7 @@ type DomainSetLifecycleActionArgs struct { Dom Domain Type uint32 Action uint32 - Flags uint32 + Flags DomainModificationImpact } @@ -3938,7 +3938,7 @@ func decodeTypedParams(dec *xdr.Decoder) ([]TypedParam, error) { // ConnectOpen is the go wrapper for REMOTE_PROC_CONNECT_OPEN. -func (l *Libvirt) ConnectOpen(Name OptString, Flags uint32) (err error) { +func (l *Libvirt) ConnectOpen(Name OptString, Flags ConnectFlags) (err error) { var buf bytes.Buffer args := ConnectOpenArgs { @@ -4227,7 +4227,7 @@ func (l *Libvirt) DomainCreate(Dom Domain) (err error) { } // DomainCreateXML is the go wrapper for REMOTE_PROC_DOMAIN_CREATE_XML. -func (l *Libvirt) DomainCreateXML(XMLDesc string, Flags uint32) (rDom Domain, err error) { +func (l *Libvirt) DomainCreateXML(XMLDesc string, Flags DomainCreateFlags) (rDom Domain, err error) { var buf bytes.Buffer args := DomainCreateXMLArgs { @@ -4359,7 +4359,7 @@ func (l *Libvirt) DomainDetachDevice(Dom Domain, XML string) (err error) { } // DomainGetXMLDesc is the go wrapper for REMOTE_PROC_DOMAIN_GET_XML_DESC. -func (l *Libvirt) DomainGetXMLDesc(Dom Domain, Flags uint32) (rXML string, err error) { +func (l *Libvirt) DomainGetXMLDesc(Dom Domain, Flags DomainXMLFlags) (rXML string, err error) { var buf bytes.Buffer args := DomainGetXMLDescArgs { @@ -4852,7 +4852,7 @@ func (l *Libvirt) DomainPinVcpu(Dom Domain, Vcpu uint32, Cpumap []byte) (err err } // DomainReboot is the go wrapper for REMOTE_PROC_DOMAIN_REBOOT. -func (l *Libvirt) DomainReboot(Dom Domain, Flags uint32) (err error) { +func (l *Libvirt) DomainReboot(Dom Domain, Flags DomainRebootFlagValues) (err error) { var buf bytes.Buffer args := DomainRebootArgs { @@ -5677,7 +5677,7 @@ func (l *Libvirt) ConnectNumOfNetworks() (rNum int32, err error) { } // DomainCoreDump is the go wrapper for REMOTE_PROC_DOMAIN_CORE_DUMP. -func (l *Libvirt) DomainCoreDump(Dom Domain, To string, Flags uint32) (err error) { +func (l *Libvirt) DomainCoreDump(Dom Domain, To string, Flags DomainCoreDumpFlags) (err error) { var buf bytes.Buffer args := DomainCoreDumpArgs { @@ -6538,7 +6538,7 @@ func (l *Libvirt) ConnectFindStoragePoolSources(Type string, SrcSpec OptString, } // StoragePoolCreateXML is the go wrapper for REMOTE_PROC_STORAGE_POOL_CREATE_XML. -func (l *Libvirt) StoragePoolCreateXML(XML string, Flags uint32) (rPool StoragePool, err error) { +func (l *Libvirt) StoragePoolCreateXML(XML string, Flags StoragePoolCreateFlags) (rPool StoragePool, err error) { var buf bytes.Buffer args := StoragePoolCreateXMLArgs { @@ -6614,7 +6614,7 @@ func (l *Libvirt) StoragePoolDefineXML(XML string, Flags uint32) (rPool StorageP } // StoragePoolCreate is the go wrapper for REMOTE_PROC_STORAGE_POOL_CREATE. -func (l *Libvirt) StoragePoolCreate(Pool StoragePool, Flags uint32) (err error) { +func (l *Libvirt) StoragePoolCreate(Pool StoragePool, Flags StoragePoolCreateFlags) (err error) { var buf bytes.Buffer args := StoragePoolCreateArgs { @@ -6643,7 +6643,7 @@ func (l *Libvirt) StoragePoolCreate(Pool StoragePool, Flags uint32) (err error) } // StoragePoolBuild is the go wrapper for REMOTE_PROC_STORAGE_POOL_BUILD. -func (l *Libvirt) StoragePoolBuild(Pool StoragePool, Flags uint32) (err error) { +func (l *Libvirt) StoragePoolBuild(Pool StoragePool, Flags StoragePoolBuildFlags) (err error) { var buf bytes.Buffer args := StoragePoolBuildArgs { @@ -6700,7 +6700,7 @@ func (l *Libvirt) StoragePoolDestroy(Pool StoragePool) (err error) { } // StoragePoolDelete is the go wrapper for REMOTE_PROC_STORAGE_POOL_DELETE. -func (l *Libvirt) StoragePoolDelete(Pool StoragePool, Flags uint32) (err error) { +func (l *Libvirt) StoragePoolDelete(Pool StoragePool, Flags StoragePoolDeleteFlags) (err error) { var buf bytes.Buffer args := StoragePoolDeleteArgs { @@ -6949,7 +6949,7 @@ func (l *Libvirt) StoragePoolGetInfo(Pool StoragePool) (rState uint8, rCapacity } // StoragePoolGetXMLDesc is the go wrapper for REMOTE_PROC_STORAGE_POOL_GET_XML_DESC. -func (l *Libvirt) StoragePoolGetXMLDesc(Pool StoragePool, Flags uint32) (rXML string, err error) { +func (l *Libvirt) StoragePoolGetXMLDesc(Pool StoragePool, Flags StorageXMLFlags) (rXML string, err error) { var buf bytes.Buffer args := StoragePoolGetXMLDescArgs { @@ -7128,7 +7128,7 @@ func (l *Libvirt) StoragePoolListVolumes(Pool StoragePool, Maxnames int32) (rNam } // StorageVolCreateXML is the go wrapper for REMOTE_PROC_STORAGE_VOL_CREATE_XML. -func (l *Libvirt) StorageVolCreateXML(Pool StoragePool, XML string, Flags uint32) (rVol StorageVol, err error) { +func (l *Libvirt) StorageVolCreateXML(Pool StoragePool, XML string, Flags StorageVolCreateFlags) (rVol StorageVol, err error) { var buf bytes.Buffer args := StorageVolCreateXMLArgs { @@ -7167,7 +7167,7 @@ func (l *Libvirt) StorageVolCreateXML(Pool StoragePool, XML string, Flags uint32 } // StorageVolDelete is the go wrapper for REMOTE_PROC_STORAGE_VOL_DELETE. -func (l *Libvirt) StorageVolDelete(Vol StorageVol, Flags uint32) (err error) { +func (l *Libvirt) StorageVolDelete(Vol StorageVol, Flags StorageVolDeleteFlags) (err error) { var buf bytes.Buffer args := StorageVolDeleteArgs { @@ -7537,7 +7537,7 @@ func (l *Libvirt) DomainBlockPeek(Dom Domain, Path string, Offset uint64, Size u } // DomainMemoryPeek is the go wrapper for REMOTE_PROC_DOMAIN_MEMORY_PEEK. -func (l *Libvirt) DomainMemoryPeek(Dom Domain, Offset uint64, Size uint32, Flags uint32) (rBuffer []byte, err error) { +func (l *Libvirt) DomainMemoryPeek(Dom Domain, Offset uint64, Size uint32, Flags DomainMemoryFlags) (rBuffer []byte, err error) { var buf bytes.Buffer args := DomainMemoryPeekArgs { @@ -8256,7 +8256,7 @@ func (l *Libvirt) NodeDeviceDestroy(Name string) (err error) { } // StorageVolCreateXMLFrom is the go wrapper for REMOTE_PROC_STORAGE_VOL_CREATE_XML_FROM. -func (l *Libvirt) StorageVolCreateXMLFrom(Pool StoragePool, XML string, Clonevol StorageVol, Flags uint32) (rVol StorageVol, err error) { +func (l *Libvirt) StorageVolCreateXMLFrom(Pool StoragePool, XML string, Clonevol StorageVol, Flags StorageVolCreateFlags) (rVol StorageVol, err error) { var buf bytes.Buffer args := StorageVolCreateXMLFromArgs { @@ -9398,7 +9398,7 @@ func (l *Libvirt) ConnectGetLibVersion() (rLibVer uint64, err error) { } // ConnectCompareCPU is the go wrapper for REMOTE_PROC_CONNECT_COMPARE_CPU. -func (l *Libvirt) ConnectCompareCPU(XML string, Flags uint32) (rResult int32, err error) { +func (l *Libvirt) ConnectCompareCPU(XML string, Flags ConnectCompareCPUFlags) (rResult int32, err error) { var buf bytes.Buffer args := ConnectCompareCPUArgs { @@ -9535,7 +9535,7 @@ func (l *Libvirt) DomainDetachDeviceFlags(Dom Domain, XML string, Flags uint32) } // ConnectBaselineCPU is the go wrapper for REMOTE_PROC_CONNECT_BASELINE_CPU. -func (l *Libvirt) ConnectBaselineCPU(XMLCPUs []string, Flags uint32) (rCPU string, err error) { +func (l *Libvirt) ConnectBaselineCPU(XMLCPUs []string, Flags ConnectBaselineCPUFlags) (rCPU string, err error) { var buf bytes.Buffer args := ConnectBaselineCPUArgs { @@ -10569,7 +10569,7 @@ func (l *Libvirt) DomainRevertToSnapshot(Snap DomainSnapshot, Flags uint32) (err } // DomainSnapshotDelete is the go wrapper for REMOTE_PROC_DOMAIN_SNAPSHOT_DELETE. -func (l *Libvirt) DomainSnapshotDelete(Snap DomainSnapshot, Flags uint32) (err error) { +func (l *Libvirt) DomainSnapshotDelete(Snap DomainSnapshot, Flags DomainSnapshotDeleteFlags) (err error) { var buf bytes.Buffer args := DomainSnapshotDeleteArgs { @@ -11086,7 +11086,7 @@ func (l *Libvirt) DomainMigrateSetMaxSpeed(Dom Domain, Bandwidth uint64, Flags u } // StorageVolUpload is the go wrapper for REMOTE_PROC_STORAGE_VOL_UPLOAD. -func (l *Libvirt) StorageVolUpload(Vol StorageVol, Offset uint64, Length uint64, Flags uint32) (err error) { +func (l *Libvirt) StorageVolUpload(Vol StorageVol, Offset uint64, Length uint64, Flags StorageVolUploadFlags) (err error) { var buf bytes.Buffer args := StorageVolUploadArgs { @@ -11117,7 +11117,7 @@ func (l *Libvirt) StorageVolUpload(Vol StorageVol, Offset uint64, Length uint64, } // StorageVolDownload is the go wrapper for REMOTE_PROC_STORAGE_VOL_DOWNLOAD. -func (l *Libvirt) StorageVolDownload(Vol StorageVol, Offset uint64, Length uint64, Flags uint32) (err error) { +func (l *Libvirt) StorageVolDownload(Vol StorageVol, Offset uint64, Length uint64, Flags StorageVolDownloadFlags) (err error) { var buf bytes.Buffer args := StorageVolDownloadArgs { @@ -11932,7 +11932,7 @@ func (l *Libvirt) DomainGetVcpuPinInfo(Dom Domain, Ncpumaps int32, Maplen int32, } // DomainUndefineFlags is the go wrapper for REMOTE_PROC_DOMAIN_UNDEFINE_FLAGS. -func (l *Libvirt) DomainUndefineFlags(Dom Domain, Flags uint32) (err error) { +func (l *Libvirt) DomainUndefineFlags(Dom Domain, Flags DomainUndefineFlagsValues) (err error) { var buf bytes.Buffer args := DomainUndefineFlagsArgs { @@ -12022,7 +12022,7 @@ func (l *Libvirt) DomainRestoreFlags(From string, Dxml OptString, Flags uint32) } // DomainDestroyFlags is the go wrapper for REMOTE_PROC_DOMAIN_DESTROY_FLAGS. -func (l *Libvirt) DomainDestroyFlags(Dom Domain, Flags uint32) (err error) { +func (l *Libvirt) DomainDestroyFlags(Dom Domain, Flags DomainDestroyFlagsValues) (err error) { var buf bytes.Buffer args := DomainDestroyFlagsArgs { @@ -12119,7 +12119,7 @@ func (l *Libvirt) DomainSaveImageDefineXML(File string, Dxml string, Flags uint3 } // DomainBlockJobAbort is the go wrapper for REMOTE_PROC_DOMAIN_BLOCK_JOB_ABORT. -func (l *Libvirt) DomainBlockJobAbort(Dom Domain, Path string, Flags uint32) (err error) { +func (l *Libvirt) DomainBlockJobAbort(Dom Domain, Path string, Flags DomainBlockJobAbortFlags) (err error) { var buf bytes.Buffer args := DomainBlockJobAbortArgs { @@ -12208,7 +12208,7 @@ func (l *Libvirt) DomainGetBlockJobInfo(Dom Domain, Path string, Flags uint32) ( } // DomainBlockJobSetSpeed is the go wrapper for REMOTE_PROC_DOMAIN_BLOCK_JOB_SET_SPEED. -func (l *Libvirt) DomainBlockJobSetSpeed(Dom Domain, Path string, Bandwidth uint64, Flags uint32) (err error) { +func (l *Libvirt) DomainBlockJobSetSpeed(Dom Domain, Path string, Bandwidth uint64, Flags DomainBlockJobSetSpeedFlags) (err error) { var buf bytes.Buffer args := DomainBlockJobSetSpeedArgs { @@ -12239,7 +12239,7 @@ func (l *Libvirt) DomainBlockJobSetSpeed(Dom Domain, Path string, Bandwidth uint } // DomainBlockPull is the go wrapper for REMOTE_PROC_DOMAIN_BLOCK_PULL. -func (l *Libvirt) DomainBlockPull(Dom Domain, Path string, Bandwidth uint64, Flags uint32) (err error) { +func (l *Libvirt) DomainBlockPull(Dom Domain, Path string, Bandwidth uint64, Flags DomainBlockPullFlags) (err error) { var buf bytes.Buffer args := DomainBlockPullArgs { @@ -12536,7 +12536,7 @@ func (l *Libvirt) DomainEventDiskChange() (err error) { } // DomainOpenGraphics is the go wrapper for REMOTE_PROC_DOMAIN_OPEN_GRAPHICS. -func (l *Libvirt) DomainOpenGraphics(Dom Domain, Idx uint32, Flags uint32) (err error) { +func (l *Libvirt) DomainOpenGraphics(Dom Domain, Idx uint32, Flags DomainOpenGraphicsFlags) (err error) { var buf bytes.Buffer args := DomainOpenGraphicsArgs { @@ -12596,7 +12596,7 @@ func (l *Libvirt) NodeSuspendForDuration(Target uint32, Duration uint64, Flags u } // DomainBlockResize is the go wrapper for REMOTE_PROC_DOMAIN_BLOCK_RESIZE. -func (l *Libvirt) DomainBlockResize(Dom Domain, Disk string, Size uint64, Flags uint32) (err error) { +func (l *Libvirt) DomainBlockResize(Dom Domain, Disk string, Size uint64, Flags DomainBlockResizeFlags) (err error) { var buf bytes.Buffer args := DomainBlockResizeArgs { @@ -12810,7 +12810,7 @@ func (l *Libvirt) DomainSetInterfaceParameters(Dom Domain, Device string, Params } // DomainGetInterfaceParameters is the go wrapper for REMOTE_PROC_DOMAIN_GET_INTERFACE_PARAMETERS. -func (l *Libvirt) DomainGetInterfaceParameters(Dom Domain, Device string, Nparams int32, Flags uint32) (rParams []TypedParam, rNparams int32, err error) { +func (l *Libvirt) DomainGetInterfaceParameters(Dom Domain, Device string, Nparams int32, Flags DomainModificationImpact) (rParams []TypedParam, rNparams int32, err error) { var buf bytes.Buffer args := DomainGetInterfaceParametersArgs { @@ -12856,7 +12856,7 @@ func (l *Libvirt) DomainGetInterfaceParameters(Dom Domain, Device string, Nparam } // DomainShutdownFlags is the go wrapper for REMOTE_PROC_DOMAIN_SHUTDOWN_FLAGS. -func (l *Libvirt) DomainShutdownFlags(Dom Domain, Flags uint32) (err error) { +func (l *Libvirt) DomainShutdownFlags(Dom Domain, Flags DomainShutdownFlagValues) (err error) { var buf bytes.Buffer args := DomainShutdownFlagsArgs { @@ -12915,7 +12915,7 @@ func (l *Libvirt) StorageVolWipePattern(Vol StorageVol, Algorithm uint32, Flags } // StorageVolResize is the go wrapper for REMOTE_PROC_STORAGE_VOL_RESIZE. -func (l *Libvirt) StorageVolResize(Vol StorageVol, Capacity uint64, Flags uint32) (err error) { +func (l *Libvirt) StorageVolResize(Vol StorageVol, Capacity uint64, Flags StorageVolResizeFlags) (err error) { var buf bytes.Buffer args := StorageVolResizeArgs { @@ -12976,7 +12976,7 @@ func (l *Libvirt) DomainPmSuspendForDuration(Dom Domain, Target uint32, Duration } // DomainGetCPUStats is the go wrapper for REMOTE_PROC_DOMAIN_GET_CPU_STATS. -func (l *Libvirt) DomainGetCPUStats(Dom Domain, Nparams uint32, StartCPU int32, Ncpus uint32, Flags uint32) (rParams []TypedParam, rNparams int32, err error) { +func (l *Libvirt) DomainGetCPUStats(Dom Domain, Nparams uint32, StartCPU int32, Ncpus uint32, Flags TypedParameterFlags) (rParams []TypedParam, rNparams int32, err error) { var buf bytes.Buffer args := DomainGetCPUStatsArgs { @@ -13067,7 +13067,7 @@ func (l *Libvirt) DomainGetDiskErrors(Dom Domain, Maxerrors uint32, Flags uint32 } // DomainSetMetadata is the go wrapper for REMOTE_PROC_DOMAIN_SET_METADATA. -func (l *Libvirt) DomainSetMetadata(Dom Domain, Type int32, Metadata OptString, Key OptString, Uri OptString, Flags uint32) (err error) { +func (l *Libvirt) DomainSetMetadata(Dom Domain, Type int32, Metadata OptString, Key OptString, Uri OptString, Flags DomainModificationImpact) (err error) { var buf bytes.Buffer args := DomainSetMetadataArgs { @@ -13100,7 +13100,7 @@ func (l *Libvirt) DomainSetMetadata(Dom Domain, Type int32, Metadata OptString, } // DomainGetMetadata is the go wrapper for REMOTE_PROC_DOMAIN_GET_METADATA. -func (l *Libvirt) DomainGetMetadata(Dom Domain, Type int32, Uri OptString, Flags uint32) (rMetadata string, err error) { +func (l *Libvirt) DomainGetMetadata(Dom Domain, Type int32, Uri OptString, Flags DomainModificationImpact) (rMetadata string, err error) { var buf bytes.Buffer args := DomainGetMetadataArgs { @@ -13140,7 +13140,7 @@ func (l *Libvirt) DomainGetMetadata(Dom Domain, Type int32, Uri OptString, Flags } // DomainBlockRebase is the go wrapper for REMOTE_PROC_DOMAIN_BLOCK_REBASE. -func (l *Libvirt) DomainBlockRebase(Dom Domain, Path string, Base OptString, Bandwidth uint64, Flags uint32) (err error) { +func (l *Libvirt) DomainBlockRebase(Dom Domain, Path string, Base OptString, Bandwidth uint64, Flags DomainBlockRebaseFlags) (err error) { var buf bytes.Buffer args := DomainBlockRebaseArgs { @@ -13334,7 +13334,7 @@ func (l *Libvirt) DomainSnapshotHasMetadata(Snap DomainSnapshot, Flags uint32) ( } // ConnectListAllDomains is the go wrapper for REMOTE_PROC_CONNECT_LIST_ALL_DOMAINS. -func (l *Libvirt) ConnectListAllDomains(NeedResults int32, Flags uint32) (rDomains []Domain, rRet uint32, err error) { +func (l *Libvirt) ConnectListAllDomains(NeedResults int32, Flags ConnectListAllDomainsFlags) (rDomains []Domain, rRet uint32, err error) { var buf bytes.Buffer args := ConnectListAllDomainsArgs { @@ -13564,7 +13564,7 @@ func (l *Libvirt) DomainGetSecurityLabelList(Dom Domain) (rLabels []DomainGetSec } // DomainPinEmulator is the go wrapper for REMOTE_PROC_DOMAIN_PIN_EMULATOR. -func (l *Libvirt) DomainPinEmulator(Dom Domain, Cpumap []byte, Flags uint32) (err error) { +func (l *Libvirt) DomainPinEmulator(Dom Domain, Cpumap []byte, Flags DomainModificationImpact) (err error) { var buf bytes.Buffer args := DomainPinEmulatorArgs { @@ -13594,7 +13594,7 @@ func (l *Libvirt) DomainPinEmulator(Dom Domain, Cpumap []byte, Flags uint32) (er } // DomainGetEmulatorPinInfo is the go wrapper for REMOTE_PROC_DOMAIN_GET_EMULATOR_PIN_INFO. -func (l *Libvirt) DomainGetEmulatorPinInfo(Dom Domain, Maplen int32, Flags uint32) (rCpumaps []byte, rRet int32, err error) { +func (l *Libvirt) DomainGetEmulatorPinInfo(Dom Domain, Maplen int32, Flags DomainModificationImpact) (rCpumaps []byte, rRet int32, err error) { var buf bytes.Buffer args := DomainGetEmulatorPinInfoArgs { @@ -13638,7 +13638,7 @@ func (l *Libvirt) DomainGetEmulatorPinInfo(Dom Domain, Maplen int32, Flags uint3 } // ConnectListAllStoragePools is the go wrapper for REMOTE_PROC_CONNECT_LIST_ALL_STORAGE_POOLS. -func (l *Libvirt) ConnectListAllStoragePools(NeedResults int32, Flags uint32) (rPools []StoragePool, rRet uint32, err error) { +func (l *Libvirt) ConnectListAllStoragePools(NeedResults int32, Flags ConnectListAllStoragePoolsFlags) (rPools []StoragePool, rRet uint32, err error) { var buf bytes.Buffer args := ConnectListAllStoragePoolsArgs { @@ -13725,7 +13725,7 @@ func (l *Libvirt) StoragePoolListAllVolumes(Pool StoragePool, NeedResults int32, } // ConnectListAllNetworks is the go wrapper for REMOTE_PROC_CONNECT_LIST_ALL_NETWORKS. -func (l *Libvirt) ConnectListAllNetworks(NeedResults int32, Flags uint32) (rNets []Network, rRet uint32, err error) { +func (l *Libvirt) ConnectListAllNetworks(NeedResults int32, Flags ConnectListAllNetworksFlags) (rNets []Network, rRet uint32, err error) { var buf bytes.Buffer args := ConnectListAllNetworksArgs { @@ -13768,7 +13768,7 @@ func (l *Libvirt) ConnectListAllNetworks(NeedResults int32, Flags uint32) (rNets } // ConnectListAllInterfaces is the go wrapper for REMOTE_PROC_CONNECT_LIST_ALL_INTERFACES. -func (l *Libvirt) ConnectListAllInterfaces(NeedResults int32, Flags uint32) (rIfaces []Interface, rRet uint32, err error) { +func (l *Libvirt) ConnectListAllInterfaces(NeedResults int32, Flags ConnectListAllInterfacesFlags) (rIfaces []Interface, rRet uint32, err error) { var buf bytes.Buffer args := ConnectListAllInterfacesArgs { @@ -13897,7 +13897,7 @@ func (l *Libvirt) ConnectListAllNwfilters(NeedResults int32, Flags uint32) (rFil } // ConnectListAllSecrets is the go wrapper for REMOTE_PROC_CONNECT_LIST_ALL_SECRETS. -func (l *Libvirt) ConnectListAllSecrets(NeedResults int32, Flags uint32) (rSecrets []Secret, rRet uint32, err error) { +func (l *Libvirt) ConnectListAllSecrets(NeedResults int32, Flags ConnectListAllSecretsFlags) (rSecrets []Secret, rRet uint32, err error) { var buf bytes.Buffer args := ConnectListAllSecretsArgs { @@ -14013,7 +14013,7 @@ func (l *Libvirt) NodeGetMemoryParameters(Nparams int32, Flags uint32) (rParams } // DomainBlockCommit is the go wrapper for REMOTE_PROC_DOMAIN_BLOCK_COMMIT. -func (l *Libvirt) DomainBlockCommit(Dom Domain, Disk string, Base OptString, Top OptString, Bandwidth uint64, Flags uint32) (err error) { +func (l *Libvirt) DomainBlockCommit(Dom Domain, Disk string, Base OptString, Top OptString, Bandwidth uint64, Flags DomainBlockCommitFlags) (err error) { var buf bytes.Buffer args := DomainBlockCommitArgs { @@ -14046,7 +14046,7 @@ func (l *Libvirt) DomainBlockCommit(Dom Domain, Disk string, Base OptString, Top } // NetworkUpdate is the go wrapper for REMOTE_PROC_NETWORK_UPDATE. -func (l *Libvirt) NetworkUpdate(Net Network, Command uint32, Section uint32, ParentIndex int32, XML string, Flags uint32) (err error) { +func (l *Libvirt) NetworkUpdate(Net Network, Command uint32, Section uint32, ParentIndex int32, XML string, Flags NetworkUpdateFlags) (err error) { var buf bytes.Buffer args := NetworkUpdateArgs { @@ -14209,7 +14209,7 @@ func (l *Libvirt) DomainSendProcessSignal(Dom Domain, PidValue int64, Signum uin } // DomainOpenChannel is the go wrapper for REMOTE_PROC_DOMAIN_OPEN_CHANNEL. -func (l *Libvirt) DomainOpenChannel(Dom Domain, Name OptString, Flags uint32) (err error) { +func (l *Libvirt) DomainOpenChannel(Dom Domain, Name OptString, Flags DomainChannelFlags) (err error) { var buf bytes.Buffer args := DomainOpenChannelArgs { @@ -14278,7 +14278,7 @@ func (l *Libvirt) NodeDeviceLookupScsiHostByWwn(Wwnn string, Wwpn string, Flags } // DomainGetJobStats is the go wrapper for REMOTE_PROC_DOMAIN_GET_JOB_STATS. -func (l *Libvirt) DomainGetJobStats(Dom Domain, Flags uint32) (rType int32, rParams []TypedParam, err error) { +func (l *Libvirt) DomainGetJobStats(Dom Domain, Flags DomainGetJobStatsFlags) (rType int32, rParams []TypedParam, err error) { var buf bytes.Buffer args := DomainGetJobStatsArgs { @@ -14547,7 +14547,7 @@ func (l *Libvirt) DomainMigratePrepareTunnel3Params(Params []TypedParam, CookieI } // DomainMigratePerform3Params is the go wrapper for REMOTE_PROC_DOMAIN_MIGRATE_PERFORM3_PARAMS. -func (l *Libvirt) DomainMigratePerform3Params(Dom Domain, Dconnuri OptString, Params []TypedParam, CookieIn []byte, Flags uint32) (rCookieOut []byte, err error) { +func (l *Libvirt) DomainMigratePerform3Params(Dom Domain, Dconnuri OptString, Params []TypedParam, CookieIn []byte, Flags DomainMigrateFlags) (rCookieOut []byte, err error) { var buf bytes.Buffer args := DomainMigratePerform3ParamsArgs { @@ -14665,7 +14665,7 @@ func (l *Libvirt) DomainMigrateConfirm3Params(Dom Domain, Params []TypedParam, C } // DomainSetMemoryStatsPeriod is the go wrapper for REMOTE_PROC_DOMAIN_SET_MEMORY_STATS_PERIOD. -func (l *Libvirt) DomainSetMemoryStatsPeriod(Dom Domain, Period int32, Flags uint32) (err error) { +func (l *Libvirt) DomainSetMemoryStatsPeriod(Dom Domain, Period int32, Flags DomainMemoryModFlags) (err error) { var buf bytes.Buffer args := DomainSetMemoryStatsPeriodArgs { @@ -14695,7 +14695,7 @@ func (l *Libvirt) DomainSetMemoryStatsPeriod(Dom Domain, Period int32, Flags uin } // DomainCreateXMLWithFiles is the go wrapper for REMOTE_PROC_DOMAIN_CREATE_XML_WITH_FILES. -func (l *Libvirt) DomainCreateXMLWithFiles(XMLDesc string, Flags uint32) (rDom Domain, err error) { +func (l *Libvirt) DomainCreateXMLWithFiles(XMLDesc string, Flags DomainCreateFlags) (rDom Domain, err error) { var buf bytes.Buffer args := DomainCreateXMLWithFilesArgs { @@ -14733,7 +14733,7 @@ func (l *Libvirt) DomainCreateXMLWithFiles(XMLDesc string, Flags uint32) (rDom D } // DomainCreateWithFiles is the go wrapper for REMOTE_PROC_DOMAIN_CREATE_WITH_FILES. -func (l *Libvirt) DomainCreateWithFiles(Dom Domain, Flags uint32) (rDom Domain, err error) { +func (l *Libvirt) DomainCreateWithFiles(Dom Domain, Flags DomainCreateFlags) (rDom Domain, err error) { var buf bytes.Buffer args := DomainCreateWithFilesArgs { @@ -15289,7 +15289,7 @@ func (l *Libvirt) DomainEventCallbackDeviceRemoved() (err error) { } // DomainCoreDumpWithFormat is the go wrapper for REMOTE_PROC_DOMAIN_CORE_DUMP_WITH_FORMAT. -func (l *Libvirt) DomainCoreDumpWithFormat(Dom Domain, To string, Dumpformat uint32, Flags uint32) (err error) { +func (l *Libvirt) DomainCoreDumpWithFormat(Dom Domain, To string, Dumpformat uint32, Flags DomainCoreDumpFlags) (err error) { var buf bytes.Buffer args := DomainCoreDumpWithFormatArgs { @@ -15441,7 +15441,7 @@ func (l *Libvirt) DomainGetTime(Dom Domain, Flags uint32) (rSeconds int64, rNsec } // DomainSetTime is the go wrapper for REMOTE_PROC_DOMAIN_SET_TIME. -func (l *Libvirt) DomainSetTime(Dom Domain, Seconds int64, Nseconds uint32, Flags uint32) (err error) { +func (l *Libvirt) DomainSetTime(Dom Domain, Seconds int64, Nseconds uint32, Flags DomainSetTimeFlags) (err error) { var buf bytes.Buffer args := DomainSetTimeArgs { @@ -15617,7 +15617,7 @@ func (l *Libvirt) ConnectGetDomainCapabilities(Emulatorbin OptString, Arch OptSt } // DomainOpenGraphicsFd is the go wrapper for REMOTE_PROC_DOMAIN_OPEN_GRAPHICS_FD. -func (l *Libvirt) DomainOpenGraphicsFd(Dom Domain, Idx uint32, Flags uint32) (err error) { +func (l *Libvirt) DomainOpenGraphicsFd(Dom Domain, Idx uint32, Flags DomainOpenGraphicsFlags) (err error) { var buf bytes.Buffer args := DomainOpenGraphicsFdArgs { @@ -15647,7 +15647,7 @@ func (l *Libvirt) DomainOpenGraphicsFd(Dom Domain, Idx uint32, Flags uint32) (er } // ConnectGetAllDomainStats is the go wrapper for REMOTE_PROC_CONNECT_GET_ALL_DOMAIN_STATS. -func (l *Libvirt) ConnectGetAllDomainStats(Doms []Domain, Stats uint32, Flags uint32) (rRetStats []DomainStatsRecord, err error) { +func (l *Libvirt) ConnectGetAllDomainStats(Doms []Domain, Stats uint32, Flags ConnectGetAllDomainStatsFlags) (rRetStats []DomainStatsRecord, err error) { var buf bytes.Buffer args := ConnectGetAllDomainStatsArgs { @@ -15686,7 +15686,7 @@ func (l *Libvirt) ConnectGetAllDomainStats(Doms []Domain, Stats uint32, Flags ui } // DomainBlockCopy is the go wrapper for REMOTE_PROC_DOMAIN_BLOCK_COPY. -func (l *Libvirt) DomainBlockCopy(Dom Domain, Path string, Destxml string, Params []TypedParam, Flags uint32) (err error) { +func (l *Libvirt) DomainBlockCopy(Dom Domain, Path string, Destxml string, Params []TypedParam, Flags DomainBlockCopyFlags) (err error) { var buf bytes.Buffer args := DomainBlockCopyArgs { @@ -15737,7 +15737,7 @@ func (l *Libvirt) DomainEventCallbackTunable() (err error) { } // NodeAllocPages is the go wrapper for REMOTE_PROC_NODE_ALLOC_PAGES. -func (l *Libvirt) NodeAllocPages(PageSizes []uint32, PageCounts []uint64, StartCell int32, CellCount uint32, Flags uint32) (rRet int32, err error) { +func (l *Libvirt) NodeAllocPages(PageSizes []uint32, PageCounts []uint64, StartCell int32, CellCount uint32, Flags NodeAllocPagesFlags) (rRet int32, err error) { var buf bytes.Buffer args := NodeAllocPagesArgs { @@ -15840,7 +15840,7 @@ func (l *Libvirt) DomainGetFsinfo(Dom Domain, Flags uint32) (rInfo []DomainFsinf } // DomainDefineXMLFlags is the go wrapper for REMOTE_PROC_DOMAIN_DEFINE_XML_FLAGS. -func (l *Libvirt) DomainDefineXMLFlags(XML string, Flags uint32) (rDom Domain, err error) { +func (l *Libvirt) DomainDefineXMLFlags(XML string, Flags DomainDefineFlags) (rDom Domain, err error) { var buf bytes.Buffer args := DomainDefineXMLFlagsArgs { @@ -15878,7 +15878,7 @@ func (l *Libvirt) DomainDefineXMLFlags(XML string, Flags uint32) (rDom Domain, e } // DomainGetIothreadInfo is the go wrapper for REMOTE_PROC_DOMAIN_GET_IOTHREAD_INFO. -func (l *Libvirt) DomainGetIothreadInfo(Dom Domain, Flags uint32) (rInfo []DomainIothreadInfo, rRet uint32, err error) { +func (l *Libvirt) DomainGetIothreadInfo(Dom Domain, Flags DomainModificationImpact) (rInfo []DomainIothreadInfo, rRet uint32, err error) { var buf bytes.Buffer args := DomainGetIothreadInfoArgs { @@ -15921,7 +15921,7 @@ func (l *Libvirt) DomainGetIothreadInfo(Dom Domain, Flags uint32) (rInfo []Domai } // DomainPinIothread is the go wrapper for REMOTE_PROC_DOMAIN_PIN_IOTHREAD. -func (l *Libvirt) DomainPinIothread(Dom Domain, IothreadsID uint32, Cpumap []byte, Flags uint32) (err error) { +func (l *Libvirt) DomainPinIothread(Dom Domain, IothreadsID uint32, Cpumap []byte, Flags DomainModificationImpact) (err error) { var buf bytes.Buffer args := DomainPinIothreadArgs { @@ -16010,7 +16010,7 @@ func (l *Libvirt) DomainEventCallbackDeviceAdded() (err error) { } // DomainAddIothread is the go wrapper for REMOTE_PROC_DOMAIN_ADD_IOTHREAD. -func (l *Libvirt) DomainAddIothread(Dom Domain, IothreadID uint32, Flags uint32) (err error) { +func (l *Libvirt) DomainAddIothread(Dom Domain, IothreadID uint32, Flags DomainModificationImpact) (err error) { var buf bytes.Buffer args := DomainAddIothreadArgs { @@ -16040,7 +16040,7 @@ func (l *Libvirt) DomainAddIothread(Dom Domain, IothreadID uint32, Flags uint32) } // DomainDelIothread is the go wrapper for REMOTE_PROC_DOMAIN_DEL_IOTHREAD. -func (l *Libvirt) DomainDelIothread(Dom Domain, IothreadID uint32, Flags uint32) (err error) { +func (l *Libvirt) DomainDelIothread(Dom Domain, IothreadID uint32, Flags DomainModificationImpact) (err error) { var buf bytes.Buffer args := DomainDelIothreadArgs { @@ -16070,7 +16070,7 @@ func (l *Libvirt) DomainDelIothread(Dom Domain, IothreadID uint32, Flags uint32) } // DomainSetUserPassword is the go wrapper for REMOTE_PROC_DOMAIN_SET_USER_PASSWORD. -func (l *Libvirt) DomainSetUserPassword(Dom Domain, User OptString, Password OptString, Flags uint32) (err error) { +func (l *Libvirt) DomainSetUserPassword(Dom Domain, User OptString, Password OptString, Flags DomainSetUserPasswordFlags) (err error) { var buf bytes.Buffer args := DomainSetUserPasswordArgs { @@ -16264,7 +16264,7 @@ func (l *Libvirt) DomainMigrateStartPostCopy(Dom Domain, Flags uint32) (err erro } // DomainGetPerfEvents is the go wrapper for REMOTE_PROC_DOMAIN_GET_PERF_EVENTS. -func (l *Libvirt) DomainGetPerfEvents(Dom Domain, Flags uint32) (rParams []TypedParam, err error) { +func (l *Libvirt) DomainGetPerfEvents(Dom Domain, Flags DomainModificationImpact) (rParams []TypedParam, err error) { var buf bytes.Buffer args := DomainGetPerfEventsArgs { @@ -16303,7 +16303,7 @@ func (l *Libvirt) DomainGetPerfEvents(Dom Domain, Flags uint32) (rParams []Typed } // DomainSetPerfEvents is the go wrapper for REMOTE_PROC_DOMAIN_SET_PERF_EVENTS. -func (l *Libvirt) DomainSetPerfEvents(Dom Domain, Params []TypedParam, Flags uint32) (err error) { +func (l *Libvirt) DomainSetPerfEvents(Dom Domain, Params []TypedParam, Flags DomainModificationImpact) (err error) { var buf bytes.Buffer args := DomainSetPerfEventsArgs { @@ -16801,7 +16801,7 @@ func (l *Libvirt) SecretEventValueChanged() (err error) { } // DomainSetVcpu is the go wrapper for REMOTE_PROC_DOMAIN_SET_VCPU. -func (l *Libvirt) DomainSetVcpu(Dom Domain, Cpumap string, State int32, Flags uint32) (err error) { +func (l *Libvirt) DomainSetVcpu(Dom Domain, Cpumap string, State int32, Flags DomainModificationImpact) (err error) { var buf bytes.Buffer args := DomainSetVcpuArgs { @@ -16920,7 +16920,7 @@ func (l *Libvirt) DomainMigrateGetMaxDowntime(Dom Domain, Flags uint32) (rDownti } // DomainManagedSaveGetXMLDesc is the go wrapper for REMOTE_PROC_DOMAIN_MANAGED_SAVE_GET_XML_DESC. -func (l *Libvirt) DomainManagedSaveGetXMLDesc(Dom Domain, Flags uint32) (rXML string, err error) { +func (l *Libvirt) DomainManagedSaveGetXMLDesc(Dom Domain, Flags DomainXMLFlags) (rXML string, err error) { var buf bytes.Buffer args := DomainManagedSaveGetXMLDescArgs { @@ -16958,7 +16958,7 @@ func (l *Libvirt) DomainManagedSaveGetXMLDesc(Dom Domain, Flags uint32) (rXML st } // DomainManagedSaveDefineXML is the go wrapper for REMOTE_PROC_DOMAIN_MANAGED_SAVE_DEFINE_XML. -func (l *Libvirt) DomainManagedSaveDefineXML(Dom Domain, Dxml OptString, Flags uint32) (err error) { +func (l *Libvirt) DomainManagedSaveDefineXML(Dom Domain, Dxml OptString, Flags DomainSaveRestoreFlags) (err error) { var buf bytes.Buffer args := DomainManagedSaveDefineXMLArgs { @@ -16988,7 +16988,7 @@ func (l *Libvirt) DomainManagedSaveDefineXML(Dom Domain, Dxml OptString, Flags u } // DomainSetLifecycleAction is the go wrapper for REMOTE_PROC_DOMAIN_SET_LIFECYCLE_ACTION. -func (l *Libvirt) DomainSetLifecycleAction(Dom Domain, Type uint32, Action uint32, Flags uint32) (err error) { +func (l *Libvirt) DomainSetLifecycleAction(Dom Domain, Type uint32, Action uint32, Flags DomainModificationImpact) (err error) { var buf bytes.Buffer args := DomainSetLifecycleActionArgs { diff --git a/libvirt.go b/libvirt.go index fba6ea8..7f17dfb 100644 --- a/libvirt.go +++ b/libvirt.go @@ -16,6 +16,10 @@ // For more information on the protocol, see https://libvirt.org/internals/l.html package libvirt +// We'll use c-for-go to extract the consts and typedefs from the libvirt +// sources so we don't have to duplicate them here. +//go:generate scripts/gen-consts.sh + import ( "bufio" "bytes" @@ -34,7 +38,7 @@ import ( // are unsupported by either QEMU or libvirt. var ErrEventsNotSupported = errors.New("event monitor is not supported") -// Libvirt implements LibVirt's remote procedure call protocol. +// Libvirt implements libvirt's remote procedure call protocol. type Libvirt struct { conn net.Conn r *bufio.Reader @@ -72,371 +76,6 @@ type qemuError struct { } `json:"error"` } -// DomainXMLFlags specifies options for dumping a domain's XML. -type DomainXMLFlags uint32 - -// DomainAffectFlags specifies options for whether an operation affects the -// running VM, or the persistent VM configuration on disk. See FlagDomain... -// consts for values. -type DomainAffectFlags uint32 - -// Consts used for flags - -// virDomainModificationImpact and virTypedParameterFlags values. These are -// combined here because they are both used to set the same flags fields in the -// libvirt API. -const ( - // FlagDomainAffectCurrent means affect the current domain state - FlagDomainAffectCurrent DomainAffectFlags = 0 - // FlagDomainAffectLive means affect the running domain state - FlagDomainAffectLive = 1 << (iota - 1) - // FlagDomainAffectConfig means affect the persistent domain state. - FlagDomainAffectConfig - // FlagTypedParamStringOkay tells the server that this client understands - // TypedParamStrings. - FlagTypedParamStringOkay -) - -const ( - // DomainXMLFlagSecure dumps XML with sensitive information included. - DomainXMLFlagSecure DomainXMLFlags = 1 << iota - - // DomainXMLFlagInactive dumps XML with inactive domain information. - DomainXMLFlagInactive - - // DomainXMLFlagUpdateCPU dumps XML with guest CPU requirements according to the host CPU. - DomainXMLFlagUpdateCPU - - // DomainXMLFlagMigratable dumps XML suitable for migration. - DomainXMLFlagMigratable -) - -// scheduler parameters used as fields in TypedParam by the following functions: -// DomainGetSchedulerParameters -// DomainGetSchedulerParametersFlags -// DomainSetSchedulerParameters -// DomainSetSchedulerParametersFlags -const ( - // DomainSchedulerCPUShares represents the propportional weight - // of the scheduler used on the host cpu, when using the posix - // scheduler. (ullong) - DomainSchedulerCPUShares = "cpu_shares" - - // DomainSchedulerGlobalPeriod represents the enforcement period - // for a quota, in microseconds, for whole domain, when using the - // posix scheduler. (ullong) - DomainSchedulerGlobalPeriod = "global_period" - - // DomainSchedulerGlobalQuota represents the maximum bandwidth to be - // used within a period for whole domain, when using the posix - // scheduler. (llong) - DomainSchedulerGlobalQuota = "global_quota" - - // DomainSchedulerVCPUPeriod represents the enforcement period for a - // quota, in microseconds, for vcpus only, when using the posix - // scheduler. (ullong) - DomainSchedulerVCPUPeriod = "vcpu_period" - - // DomainSchedulerVCPUQuota represents the maximum bandwidth to be - // used within a period for vcpus only, when using the posix - // scheduler. (llong) - DomainSchedulerVCPUQuota = "vcpu_quota" - - // DomainSchedulerEmulatorPeriod represents the enforcement period - // for a quota in microseconds, when using the posix scheduler, for - // all emulator activity not tied to vcpus. (ullong) - DomainSchedulerEmulatorPeriod = "emulator_period" - - // DomainSchedulerEmulatorQuota represents the maximum bandwidth to be - // used within a period for all emulator activity not tied to vcpus, - // when using the posix scheduler. (llong) - DomainSchedulerEmulatorQuota = "emulator_quota" - - // DomainSchedulerIOThreadPeriod represents the enforcement period for - // a quota, in microseconds, for IOThreads only, when using the posix - // scheduler. (ullong) - DomainSchedulerIOThreadPeriod = "iothread_period" - - // DomainSchedulerIOThreadQuota represents the maximum bandwidth to be - // used within a period for IOThreads only, when using the posix - // scheduler. (llong) - DomainSchedulerIOThreadQuota = "iothread_quota" - - // DomainSchedulerWeight represents the relative weight, when using the - // credit scheduler. (uint) - DomainSchedulerWeight = "weight" - - // DomainSchedulerCap represents the maximum scheduler cap, when using - // the credit scheduler. (uint) - DomainSchedulerCap = "cap" - - // DomainSchedulerReservation represents the scheduler reservation - // value, when using the allocation scheduler. (llong) - DomainSchedulerReservation = "reservation" - - // DomainSchedulerLimit represents the scheduler limit value, when using - // the allocation scheduler. (llong) - DomainSchedulerLimit = "limit" - - // DomainSchedulerShares represents the scheduler shares value, when - // using the allocation scheduler. (int) - DomainSchedulerShares = "shares" -) - -// MigrateFlags specifies options when performing a migration. -type MigrateFlags uint32 - -const ( - // MigrateFlagLive performs a zero-downtime live migration. - MigrateFlagLive MigrateFlags = 1 << iota - - // MigrateFlagPeerToPeer creates a direct source to destination control channel. - MigrateFlagPeerToPeer - - // MigrateFlagTunneled tunnels migration data over the libvirtd connection. - MigrateFlagTunneled - - // MigrateFlagPersistDestination will persist the VM on the destination host. - MigrateFlagPersistDestination - - // MigrateFlagUndefineSource undefines the VM on the source host. - MigrateFlagUndefineSource - - // MigrateFlagPaused will pause the remote side VM. - MigrateFlagPaused - - // MigrateFlagNonSharedDisk migrate non-shared storage with full disk copy. - MigrateFlagNonSharedDisk - - // MigrateFlagNonSharedIncremental migrate non-shared storage with incremental copy. - MigrateFlagNonSharedIncremental - - // MigrateFlagChangeProtection prevents any changes to the domain configuration through the whole migration process. - MigrateFlagChangeProtection - - // MigrateFlagUnsafe will force a migration even when it is considered unsafe. - MigrateFlagUnsafe - - // MigrateFlagOffline is used to perform an offline migration. - MigrateFlagOffline - - // MigrateFlagCompressed compresses data during migration. - MigrateFlagCompressed - - // MigrateFlagAbortOnError will abort a migration on I/O errors encountered during migration. - MigrateFlagAbortOnError - - // MigrateFlagAutoConverge forces convergence. - MigrateFlagAutoConverge - - // MigrateFlagRDMAPinAll enables RDMA memory pinning. - MigrateFlagRDMAPinAll -) - -// UndefineFlags specifies options available when undefining a domain. -type UndefineFlags uint32 - -const ( - // UndefineFlagManagedSave removes all domain managed save data. - UndefineFlagManagedSave UndefineFlags = 1 << iota - - // UndefineFlagSnapshotsMetadata removes all domain snapshot metadata. - UndefineFlagSnapshotsMetadata - - // UndefineFlagNVRAM removes all domain NVRAM files. - UndefineFlagNVRAM -) - -// DomainDefineXMLFlags specifies options available when defining a domain. -type DomainDefineXMLFlags uint32 - -const ( - // DefineValidate validates the XML document against schema - DefineValidate DomainDefineXMLFlags = 1 -) - -// DestroyFlags specifies options available when destroying a domain. -type DestroyFlags uint32 - -const ( - // DestroyFlagDefault default behavior, forcefully terminate the domain. - DestroyFlagDefault DestroyFlags = 1 << iota - - // DestroyFlagGraceful only sends a SIGTERM no SIGKILL. - DestroyFlagGraceful -) - -// ShutdownFlags specifies options available when shutting down a domain. -type ShutdownFlags uint32 - -const ( - // ShutdownAcpiPowerBtn - send ACPI event - ShutdownAcpiPowerBtn ShutdownFlags = 1 << iota - - // ShutdownGuestAgent - use guest agent - ShutdownGuestAgent - - // ShutdownInitctl - use initctl - ShutdownInitctl - - // ShutdownSignal - use signal - ShutdownSignal - - // ShutdownParavirt - use paravirt guest control - ShutdownParavirt -) - -// DomainState specifies state of the domain -type DomainState uint32 - -const ( - // DomainStateNoState No state - DomainStateNoState DomainState = iota - // DomainStateRunning The domain is running - DomainStateRunning - // DomainStateBlocked The domain is blocked on resource - DomainStateBlocked - // DomainStatePaused The domain is paused by user - DomainStatePaused - // DomainStateShutdown The domain is being shut down - DomainStateShutdown - // DomainStateShutoff The domain is shut off - DomainStateShutoff - // DomainStateCrashed The domain is crashed - DomainStateCrashed - // DomainStatePMSuspended The domain is suspended by guest power management - DomainStatePMSuspended - // DomainStateLast This value will increase over time as new events are added to the libvirt - // API. It reflects the last state supported by this version of the libvirt API. - DomainStateLast -) - -// SecretUsageType specifies the usage for a libvirt secret. -type SecretUsageType uint32 - -const ( - // SecretUsageTypeNone specifies no usage. - SecretUsageTypeNone SecretUsageType = iota - // SecretUsageTypeVolume specifies a volume secret. - SecretUsageTypeVolume - // SecretUsageTypeCeph specifies secrets for ceph devices. - SecretUsageTypeCeph - // SecretUsageTypeISCSI specifies secrets for ISCSI devices. - SecretUsageTypeISCSI -) - -// StoragePoolsFlags specifies storage pools to list. -type StoragePoolsFlags uint32 - -// These flags come in groups; if all bits from a group are 0, -// then that group is not used to filter results. -const ( - StoragePoolsFlagInactive = 1 << iota - StoragePoolsFlagActive - - StoragePoolsFlagPersistent - StoragePoolsFlagTransient - - StoragePoolsFlagAutostart - StoragePoolsFlagNoAutostart - - // pools by type - StoragePoolsFlagDir - StoragePoolsFlagFS - StoragePoolsFlagNETFS - StoragePoolsFlagLogical - StoragePoolsFlagDisk - StoragePoolsFlagISCSI - StoragePoolsFlagSCSI - StoragePoolsFlagMPATH - StoragePoolsFlagRBD - StoragePoolsFlagSheepdog - StoragePoolsFlagGluster - StoragePoolsFlagZFS -) - -// DomainCreateFlags specify options for starting domains -type DomainCreateFlags uint32 - -const ( - // DomainCreateFlagPaused creates paused domain. - DomainCreateFlagPaused = 1 << iota - - // DomainCreateFlagAutoDestroy destoy domain after libvirt connection closed. - DomainCreateFlagAutoDestroy - - // DomainCreateFlagBypassCache avoid file system cache pollution. - DomainCreateFlagBypassCache - - // DomainCreateFlagStartForceBoot boot, discarding any managed save - DomainCreateFlagStartForceBoot - - // DomainCreateFlagStartValidate validate the XML document against schema - DomainCreateFlagStartValidate -) - -// RebootFlags specifies domain reboot methods -type RebootFlags uint32 - -const ( - // RebootAcpiPowerBtn - send ACPI event - RebootAcpiPowerBtn RebootFlags = 1 << iota - - // RebootGuestAgent - use guest agent - RebootGuestAgent - - // RebootInitctl - use initctl - RebootInitctl - - // RebootSignal - use signal - RebootSignal - - // RebootParavirt - use paravirt guest control - RebootParavirt -) - -// DomainMemoryStatTag specifies domain memory tags -type DomainMemoryStatTag uint32 - -const ( - // DomainMemoryStatTagSwapIn - The total amount of data read from swap space (in kB). - DomainMemoryStatTagSwapIn DomainMemoryStatTag = iota - - // DomainMemoryStatTagSwapOut - The total amount of memory written out to swap space (in kB). - DomainMemoryStatTagSwapOut - - // DomainMemoryStatTagMajorFault - Page faults occur when a process makes a valid access to virtual memory - // that is not available. When servicing the page fault, if disk IO is - // required, it is considered a major fault. - // These are expressed as the number of faults that have occurred. - DomainMemoryStatTagMajorFault - - // DomainMemoryStatTagMinorFault - If the page fault not require disk IO, it is a minor fault. - DomainMemoryStatTagMinorFault - - // DomainMemoryStatTagUnused - The amount of memory left completely unused by the system (in kB). - DomainMemoryStatTagUnused - - // DomainMemoryStatTagAvailable - The total amount of usable memory as seen by the domain (in kB). - DomainMemoryStatTagAvailable - - // DomainMemoryStatTagActualBalloon - Current balloon value (in KB). - DomainMemoryStatTagActualBalloon - - // DomainMemoryStatTagRss - Resident Set Size of the process running the domain (in KB). - DomainMemoryStatTagRss - - // DomainMemoryStatTagUsable - How much the balloon can be inflated without pushing the guest system - // to swap, corresponds to 'Available' in /proc/meminfo - DomainMemoryStatTagUsable - - // DomainMemoryStatTagLastUpdate - Timestamp of the last update of statistics, in seconds. - DomainMemoryStatTagLastUpdate - - // DomainMemoryStatTagNr - The number of statistics supported by this version of the interface. - DomainMemoryStatTagNr -) - // Capabilities returns an XML document describing the host's capabilties. func (l *Libvirt) Capabilities() ([]byte, error) { caps, err := l.ConnectGetCapabilities() @@ -479,7 +118,7 @@ func (l *Libvirt) Domains() ([]Domain, error) { func (l *Libvirt) DomainState(dom string) (DomainState, error) { d, err := l.lookup(dom) if err != nil { - return DomainStateNoState, err + return DomainNostate, err } state, _, err := l.DomainGetState(d, 0) @@ -553,7 +192,7 @@ func (l *Libvirt) Events(dom string) (<-chan DomainEvent, error) { // 'qemu+tcp://example.com/system'. The flags argument determines the // type of migration and how it will be performed. For more information // on available migration flags and their meaning, see MigrateFlag*. -func (l *Libvirt) Migrate(dom string, dest string, flags MigrateFlags) error { +func (l *Libvirt) Migrate(dom string, dest string, flags DomainMigrateFlags) error { _, err := url.Parse(dest) if err != nil { return err @@ -571,7 +210,7 @@ func (l *Libvirt) Migrate(dom string, dest string, flags MigrateFlags) error { destURI := []string{dest} remoteParams := []TypedParam{} cookieIn := []byte{} - _, err = l.DomainMigratePerform3Params(d, destURI, remoteParams, cookieIn, uint32(flags)) + _, err = l.DomainMigratePerform3Params(d, destURI, remoteParams, cookieIn, flags) return err } @@ -653,35 +292,35 @@ func (l *Libvirt) StoragePool(name string) (StoragePool, error) { // StoragePools returns a list of defined storage pools. Pools are filtered by // the provided flags. See StoragePools*. -func (l *Libvirt) StoragePools(flags StoragePoolsFlags) ([]StoragePool, error) { - pools, _, err := l.ConnectListAllStoragePools(1, uint32(flags)) +func (l *Libvirt) StoragePools(flags ConnectListAllStoragePoolsFlags) ([]StoragePool, error) { + pools, _, err := l.ConnectListAllStoragePools(1, flags) return pools, err } // Undefine undefines the domain specified by dom, e.g., 'prod-lb-01'. // The flags argument allows additional options to be specified such as // cleaning up snapshot metadata. For more information on available -// flags, see UndefineFlag*. -func (l *Libvirt) Undefine(dom string, flags UndefineFlags) error { +// flags, see DomainUndefine*. +func (l *Libvirt) Undefine(dom string, flags DomainUndefineFlagsValues) error { d, err := l.lookup(dom) if err != nil { return err } - return l.DomainUndefineFlags(d, uint32(flags)) + return l.DomainUndefineFlags(d, flags) } // Destroy destroys the domain specified by dom, e.g., 'prod-lb-01'. // The flags argument allows additional options to be specified such as // allowing a graceful shutdown with SIGTERM than SIGKILL. -// For more information on available flags, see DestroyFlag*. -func (l *Libvirt) Destroy(dom string, flags DestroyFlags) error { +// For more information on available flags, see DomainDestroy*. +func (l *Libvirt) Destroy(dom string, flags DomainDestroyFlagsValues) error { d, err := l.lookup(dom) if err != nil { return err } - return l.DomainDestroyFlags(d, uint32(flags)) + return l.DomainDestroyFlags(d, flags) } // XML returns a domain's raw XML definition, akin to `virsh dumpxml `. @@ -692,13 +331,13 @@ func (l *Libvirt) XML(dom string, flags DomainXMLFlags) ([]byte, error) { return nil, err } - xml, err := l.DomainGetXMLDesc(d, uint32(flags)) + xml, err := l.DomainGetXMLDesc(d, flags) return []byte(xml), err } // DefineXML defines a domain, but does not start it. -func (l *Libvirt) DefineXML(x []byte, flags DomainDefineXMLFlags) error { - _, err := l.DomainDefineXMLFlags(string(x), uint32(flags)) +func (l *Libvirt) DefineXML(x []byte, flags DomainDefineFlags) error { + _, err := l.DomainDefineXMLFlags(string(x), flags) return err } @@ -724,24 +363,24 @@ func (l *Libvirt) Version() (string, error) { // Shutdown shuts down a domain. Note that the guest OS may ignore the request. // If flags is set to 0 then the hypervisor will choose the method of shutdown it considers best. -func (l *Libvirt) Shutdown(dom string, flags ShutdownFlags) error { +func (l *Libvirt) Shutdown(dom string, flags DomainShutdownFlagValues) error { d, err := l.lookup(dom) if err != nil { return err } - return l.DomainShutdownFlags(d, uint32(flags)) + return l.DomainShutdownFlags(d, flags) } // Reboot reboots the domain. Note that the guest OS may ignore the request. // If flags is set to zero, then the hypervisor will choose the method of shutdown it considers best. -func (l *Libvirt) Reboot(dom string, flags RebootFlags) error { +func (l *Libvirt) Reboot(dom string, flags DomainRebootFlagValues) error { d, err := l.lookup(dom) if err != nil { return err } - return l.DomainReboot(d, uint32(flags)) + return l.DomainReboot(d, flags) } // Reset resets domain immediately without any guest OS shutdown @@ -764,33 +403,6 @@ type BlockLimit struct { Value uint64 } -// BlockIOTune-able values. These tunables are different for different -// hypervisors; currently only the tunables for QEMU are defined here. These are -// not necessarily the only possible values; different libvirt versions may add -// or remove parameters from this list. -const ( - QEMUBlockIOGroupName = "group_name" - QEMUBlockIOTotalBytesSec = "total_bytes_sec" - QEMUBlockIOReadBytesSec = "read_bytes_sec" - QEMUBlockIOWriteBytesSec = "write_bytes_sec" - QEMUBlockIOTotalIOPSSec = "total_iops_sec" - QEMUBlockIOReadIOPSSec = "read_iops_sec" - QEMUBlockIOWriteIOPSSec = "write_iops_sec" - QEMUBlockIOTotalBytesSecMax = "total_bytes_sec_max" - QEMUBlockIOReadBytesSecMax = "read_bytes_sec_max" - QEMUBlockIOWriteBytesSecMax = "write_bytes_sec_max" - QEMUBlockIOTotalIOPSSecMax = "total_iops_sec_max" - QEMUBlockIOReadIOPSSecMax = "read_iops_sec_max" - QEMUBlockIOWriteIOPSSecMax = "write_iops_sec_max" - QEMUBlockIOSizeIOPSSec = "size_iops_sec" - QEMUBlockIOTotalBytesSecMaxLength = "total_bytes_sec_max_length" - QEMUBlockIOReadBytesSecMaxLength = "read_bytes_sec_max_length" - QEMUBlockIOWriteBytesSecMaxLength = "write_bytes_sec_max_length" - QEMUBlockIOTotalIOPSSecMaxLength = "total_iops_sec_max_length" - QEMUBlockIOReadIOPSSecMaxLength = "read_iops_sec_max_length" - QEMUBlockIOWriteIOPSSecMaxLength = "write_iops_sec_max_length" -) - // SetBlockIOTune changes the per-device block I/O tunables within a guest. // Parameters are the name of the VM, the name of the disk device to which the // limits should be applied, and 1 or more BlockLimit structs containing the @@ -814,7 +426,7 @@ func (l *Libvirt) SetBlockIOTune(dom string, disk string, limits ...BlockLimit) params[ix] = TypedParam{Field: limit.Name, Value: tpval} } - return l.DomainSetBlockIOTune(d, disk, params, FlagDomainAffectLive) + return l.DomainSetBlockIOTune(d, disk, params, uint32(DomainAffectLive)) } // GetBlockIOTune returns a slice containing the current block I/O tunables for @@ -825,7 +437,7 @@ func (l *Libvirt) GetBlockIOTune(dom string, disk string) ([]BlockLimit, error) return nil, err } - lims, _, err := l.DomainGetBlockIOTune(d, []string{disk}, 32, FlagTypedParamStringOkay) + lims, _, err := l.DomainGetBlockIOTune(d, []string{disk}, 32, uint32(TypedParamStringOkay)) if err != nil { return nil, err } diff --git a/libvirt.yml b/libvirt.yml new file mode 100644 index 0000000..28c2532 --- /dev/null +++ b/libvirt.yml @@ -0,0 +1,59 @@ +# Configuration file for c-for-go, which go-libvirt uses to translate the const +# and type definitions from the C-language sources in the libvirt project into +# Go. This file is used by the c-for-go binary (github.com/xlab/c-for-go), which +# is called when 'go generate' is run. See libvirt.go for the command line used. +--- +GENERATOR: + PackageName: libvirt + PackageLicense: | + Copyright 2017 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. + Includes: [] + +PARSER: + # We can't use environment variables here, but we don't want to process the + # libvirt version installed in the system folders (if any). Instead we'll + # rely on our caller to link the libvirt source directory to lv_source/, and + # run on that code. This isn't ideal, but changes to c-for-go are needed to + # fix it. + IncludePaths: [./lv_source/include] + SourcesPaths: + - libvirt/libvirt.h + +TRANSLATOR: + ConstRules: + defines: eval + Rules: + global: + - {action: accept, from: "^vir"} + post-global: + - {action: replace, from: "^vir"} + - {load: snakecase} + # Follow golint's capitalization conventions. + - {action: replace, from: "Api([A-Z]|$)", to: "API$1"} + - {action: replace, from: "Cpu([A-Z]|$)", to: "CPU$1"} + - {action: replace, from: "Dns([A-Z]|$)", to: "DNS$1"} + - {action: replace, from: "Eof([A-Z]|$)", to: "EOF$1"} + - {action: replace, from: "Id([A-Z]|$)", to: "ID$1"} + - {action: replace, from: "Ip([A-Z]|$)", to: "IP$1"} + - {action: replace, from: "Tls([A-Z]|$)", to: "TLS$1"} + - {action: replace, from: "Uuid([A-Z]|$)", to: "UUID$1"} + - {action: replace, from: "Uri([A-Z]|$)", to: "URI$1"} + - {action: replace, from: "Vcpu([A-Z]|$)", to: "VCPU$1"} + - {action: replace, from: "Xml([A-Z]|$)", to: "XML$1"} + const: + - {action: accept, from: "^VIR_"} + # Special case to prevent a collision with a type: + - {action: replace, from: "^VIR_DOMAIN_JOB_OPERATION", to: "VIR_DOMAIN_JOB_OPERATION_STR"} + - {transform: lower} diff --git a/libvirt_integration_test.go b/libvirt_integration_test.go index e19998c..719108b 100644 --- a/libvirt_integration_test.go +++ b/libvirt_integration_test.go @@ -156,7 +156,7 @@ func TestStoragePoolsIntegration(t *testing.T) { t.Fatal(err) } - pools, err := l.StoragePools(StoragePoolsFlagActive) + pools, err := l.StoragePools(ConnectListStoragePoolsActive) if err != nil { t.Error(err) } @@ -182,7 +182,7 @@ func TestStoragePoolsAutostartIntegration(t *testing.T) { t.Fatal(err) } - pools, err := l.StoragePools(StoragePoolsFlagAutostart) + pools, err := l.StoragePools(ConnectListStoragePoolsAutostart) if err != nil { t.Error(err) } diff --git a/libvirt_test.go b/libvirt_test.go index 1f1f522..5f85cae 100644 --- a/libvirt_test.go +++ b/libvirt_test.go @@ -48,14 +48,14 @@ func TestMigrate(t *testing.T) { conn := libvirttest.New() l := New(conn) - var flags MigrateFlags - flags = MigrateFlagLive | - MigrateFlagPeerToPeer | - MigrateFlagPersistDestination | - MigrateFlagChangeProtection | - MigrateFlagAbortOnError | - MigrateFlagAutoConverge | - MigrateFlagNonSharedDisk + var flags DomainMigrateFlags + flags = MigrateLive | + MigratePeer2peer | + MigratePersistDest | + MigrateChangeProtection | + MigrateAbortOnError | + MigrateAutoConverge | + MigrateNonSharedDisk if err := l.Migrate("test", "qemu+tcp://foo/system", flags); err != nil { t.Fatalf("unexpected live migration error: %v", err) @@ -66,14 +66,14 @@ func TestMigrateInvalidDest(t *testing.T) { conn := libvirttest.New() l := New(conn) - var flags MigrateFlags - flags = MigrateFlagLive | - MigrateFlagPeerToPeer | - MigrateFlagPersistDestination | - MigrateFlagChangeProtection | - MigrateFlagAbortOnError | - MigrateFlagAutoConverge | - MigrateFlagNonSharedDisk + var flags DomainMigrateFlags + flags = MigrateLive | + MigratePeer2peer | + MigratePersistDest | + MigrateChangeProtection | + MigrateAbortOnError | + MigrateAutoConverge | + MigrateNonSharedDisk dest := ":$'" if err := l.Migrate("test", dest, flags); err == nil { @@ -122,7 +122,7 @@ func TestDomainState(t *testing.T) { conn := libvirttest.New() l := New(conn) - wantState := DomainState(DomainStateRunning) + wantState := DomainState(DomainRunning) gotState, err := l.DomainState("test") if err != nil { t.Error(err) @@ -325,7 +325,7 @@ func TestStoragePools(t *testing.T) { conn := libvirttest.New() l := New(conn) - pools, err := l.StoragePools(StoragePoolsFlagActive) + pools, err := l.StoragePools(ConnectListStoragePoolsTransient) if err != nil { t.Error(err) } @@ -371,7 +371,7 @@ func TestUndefine(t *testing.T) { conn := libvirttest.New() l := New(conn) - var flags UndefineFlags + var flags DomainUndefineFlagsValues if err := l.Undefine("test", flags); err != nil { t.Fatalf("unexpected undefine error: %v", err) } @@ -381,7 +381,7 @@ func TestDestroy(t *testing.T) { conn := libvirttest.New() l := New(conn) - var flags DestroyFlags + var flags DomainDestroyFlagsValues if err := l.Destroy("test", flags); err != nil { t.Fatalf("unexpected destroy error: %v", err) } @@ -406,7 +406,7 @@ func TestDefineXML(t *testing.T) { conn := libvirttest.New() l := New(conn) - var flags DomainDefineXMLFlags + var flags DomainDefineFlags var buf []byte if err := l.DefineXML(buf, flags); err != nil { t.Fatalf("unexpected define error: %v", err) @@ -431,7 +431,7 @@ func TestShutdown(t *testing.T) { conn := libvirttest.New() l := New(conn) - var flags ShutdownFlags + var flags DomainShutdownFlagValues if err := l.Shutdown("test", flags); err != nil { t.Fatalf("unexpected shutdown error: %v", err) } @@ -441,7 +441,7 @@ func TestReboot(t *testing.T) { conn := libvirttest.New() l := New(conn) - var flags RebootFlags + var flags DomainRebootFlagValues if err := l.Reboot("test", flags); err != nil { t.Fatalf("unexpected reboot error: %v", err) } diff --git a/scripts/gen-consts.sh b/scripts/gen-consts.sh new file mode 100755 index 0000000..a53f8ec --- /dev/null +++ b/scripts/gen-consts.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# +# This runs the first code generator used by go-libvirt: c-for-go. This script +# is run from the 'go generate ./...' command, and only needs to be run when +# changing to a different version of libvirt. +if [ -z "${LIBVIRT_SOURCE}" ]; then + echo "Set LIBVIRT_SOURCE to the root of the libvirt sources you want to use first." + exit 1 +fi + +# Make sure c-for-go is installed +if ! which c-for-go > /dev/null; then + echo "c-for-go not found. Attempting to install it..." + if ! go get github.com/xlab/c-for-go/...; then + echo "failed to install c-for-go. Please install it manually from https://github.com/xlab/c-for-go" + exit 1 + fi +fi + +# Make sure goyacc is installed (needed for the lvgen/ generator) +if ! which goyacc > /dev/null; then + echo "goyacc not found. Attempting to install it..." + if ! go get golang.org/x/tools/cmd/goyacc/...; then + echo "failed to install goyacc. Please install it manually from https://golang.org/x/tools/cmd/goyacc" + exit 1 + fi +fi + +# Temporarily symlink the libvirt sources to a subdirectory because c-for-go +# lacks a mechanism for us to pass it a search path for header files. +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +LVDIR=lv_source +ln -sF ${LIBVIRT_SOURCE} ${LVDIR} +if ! c-for-go -nostamp -nocgo -ccincl libvirt.yml; then + echo "c-for-go failed" + exit 1 +fi +mv libvirt/const.go ${DIR}/../const.gen.go +rm ${LVDIR} +rm -rf libvirt/ diff --git a/scripts/licensecheck.sh b/scripts/licensecheck.sh index 8f93171..61c4ac9 100755 --- a/scripts/licensecheck.sh +++ b/scripts/licensecheck.sh @@ -18,7 +18,6 @@ read -r -d '' EXPECTED <