diff --git a/.bazelrc b/.bazelrc deleted file mode 100644 index 921355917..000000000 --- a/.bazelrc +++ /dev/null @@ -1,36 +0,0 @@ -# Container Runtime -build --action_env=CONTAINER_CMD -build --action_env=XDG_RUNTIME_DIR -# Operator -## Default operator config -build --action_env=VERSION=2.7.0 -build --action_env=NAMESPACE=konveyor-forklift -build --action_env=CHANNELS=development -build --action_env=DEFAULT_CHANNEL=development -build --action_env=OPM_OPTS - -## Images which should be installed -build --action_env=CONTROLLER_IMAGE=quay.io/kubev2v/forklift-controller:latest -build --action_env=API_IMAGE=quay.io/kubev2v/forklift-api:latest -build --action_env=MUST_GATHER_IMAGE=quay.io/kubev2v/forklift-must-gather:latest -build --action_env=UI_PLUGIN_IMAGE=quay.io/kubev2v/forklift-console-plugin:latest -build --action_env=VALIDATION_IMAGE=quay.io/kubev2v/forklift-validation:latest -build --action_env=VIRT_V2V_IMAGE=quay.io/kubev2v/forklift-virt-v2v:latest -build --action_env=POPULATOR_CONTROLLER_IMAGE=quay.io/kubev2v/populator-controller:latest -build --action_env=OPENSTACK_POPULATOR_IMAGE=quay.io/kubev2v/openstack-populator:latest -build --action_env=OVIRT_POPULATOR_IMAGE=quay.io/kubev2v/ovirt-populator:latest -build --action_env=OPERATOR_IMAGE=quay.io/kubev2v/forklift-operator:latest -build --action_env=OVA_PROVIDER_SERVER_IMAGE=quay.io/kubev2v/forklift-ova-provider-server:latest - -# Appliance build -# container_run_and_extract() does not work inside Podman and Docker -# sandboxes. Use slightly less secure but working processwrapper sandbox. -# NOTE: Same configuration is in virt-v2v/.bazelrc. -build --strategy_regexp="Action appliance/libguestfs-appliance.tar"=processwrapper-sandbox -build --strategy_regexp="RunAndCommitLayer no-ems-in-fips-layer.tar"=processwrapper-sandbox -build --strategy_regexp="RunAndCommitLayer ca-certificate-from-secret-layer.tar"=processwrapper-sandbox - -# For populator images, we need to use processwrapper sandbox as well -build --strategy_regexp="RunAndCommitLayer cmd/ovirt-populator/ovirt-imageio-layer-run-layer.tar"=processwrapper-sandbox - -build --strategy_regexp="RunAndCommitLayer operator/forklift-operator-image-layer-run-layer.tar"=processwrapper-sandbox diff --git a/.dockerignore b/.dockerignore index 5d950caaa..7df04980a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -10,8 +10,6 @@ **/bin **/dist **/node_modules -WORKSPACE -**/BUILD.bazel # Ignore docs docs/ \ No newline at end of file diff --git a/.gitignore b/.gitignore index b6ee00f30..0e2fc085a 100644 --- a/.gitignore +++ b/.gitignore @@ -31,10 +31,6 @@ migsamples # tilt settings tools/tilt/tilt-settings.json -# bazel build artifacts -bazel-* -.bazeldnf - # deploy env hack/deploy/**/deploy.env diff --git a/BUILD.bazel b/BUILD.bazel deleted file mode 100644 index cc699bcb5..000000000 --- a/BUILD.bazel +++ /dev/null @@ -1,140 +0,0 @@ -load("@bazel_gazelle//:def.bzl", "gazelle") -load("@bazeldnf//:def.bzl", "bazeldnf") -load("@bazel_tools//tools/python:toolchain.bzl", "py_runtime_pair") - -bazeldnf(name = "bazeldnf") - -py_runtime( - name = "py2_runtime", - interpreter_path = "/usr/bin/python2", - python_version = "PY2", -) - -py_runtime( - name = "py3_runtime", - interpreter_path = "/usr/bin/python3", - python_version = "PY3", -) - -py_runtime_pair( - name = "py_runtime_pair", - py2_runtime = ":py2_runtime", - py3_runtime = ":py3_runtime", -) - -toolchain( - name = "py_toolchain", - toolchain = "py_runtime_pair", - toolchain_type = "@bazel_tools//tools/python:toolchain_type", -) - -# gazelle:prefix github.com/konveyor/forklift-controller -gazelle(name = "gazelle") - -# gazelle:proto disable_global - -genrule( - name = "build-controller", - srcs = [ - "//cmd/forklift-controller", - ], - outs = ["forklift-controller"], - cmd = "echo '#!/bin/sh\n\ncp -f $(SRCS) $$1' > \"$@\"", - executable = 1, -) - -load( - "@io_bazel_rules_docker//container:container.bzl", - "container_pull", - "container_push", -) - -container_push( - name = "push-ova-provider-server", - format = "Docker", - image = "//cmd/ova-provider-server:ova-provider-server-image", - registry = "$${REGISTRY:-quay.io}", - repository = "$${REGISTRY_ORG:-}$${REGISTRY_ORG:+/}forklift-ova-provider-server", - tag = "$${REGISTRY_TAG:-devel}", -) - -container_push( - name = "push-ovirt-populator", - format = "Docker", - image = "//cmd/ovirt-populator:ovirt-populator-image", - registry = "$${REGISTRY:-quay.io}", - repository = "$${REGISTRY_ORG:-}$${REGISTRY_ORG:+/}ovirt-populator", - tag = "$${REGISTRY_TAG:-devel}", -) - -container_push( - name = "push-openstack-populator", - format = "Docker", - image = "//cmd/openstack-populator:openstack-populator-image", - registry = "$${REGISTRY:-quay.io}", - repository = "$${REGISTRY_ORG:-}$${REGISTRY_ORG:+/}openstack-populator", - tag = "$${REGISTRY_TAG:-devel}", -) - -container_push( - name = "push-forklift-controller", - format = "Docker", - image = "//cmd/forklift-controller:forklift-controller-image", - registry = "$${REGISTRY:-quay.io}", - repository = "$${REGISTRY_ORG:-}$${REGISTRY_ORG:+/}forklift-controller", - tag = "$${REGISTRY_TAG:-devel}", -) - -container_push( - name = "push-forklift-api", - format = "Docker", - image = "//cmd/forklift-api:forklift-api-image", - registry = "$${REGISTRY:-quay.io}", - repository = "$${REGISTRY_ORG:-}$${REGISTRY_ORG:+/}forklift-api", - tag = "$${REGISTRY_TAG:-devel}", -) - -container_push( - name = "push-forklift-operator-index", - format = "Docker", - image = "//operator:forklift-operator-index-image", - registry = "$${REGISTRY:-quay.io}", - repository = "$${REGISTRY_ORG:-}$${REGISTRY_ORG:+/}forklift-operator-index", - tag = "$${REGISTRY_TAG:-devel}", -) - -container_push( - name = "push-forklift-operator-bundle", - format = "Docker", - image = "//operator:forklift-operator-bundle-image", - registry = "$${REGISTRY:-quay.io}", - repository = "$${REGISTRY_ORG:-}$${REGISTRY_ORG:+/}forklift-operator-bundle", - tag = "$${REGISTRY_TAG:-devel}", -) - -container_push( - name = "push-forklift-operator", - format = "Docker", - image = "//operator:forklift-operator-image", - registry = "$${REGISTRY:-quay.io}", - repository = "$${REGISTRY_ORG:-}$${REGISTRY_ORG:+/}forklift-operator", - tag = "$${REGISTRY_TAG:-devel}", -) - -container_push( - name = "push-forklift-validation", - format = "Docker", - image = "//validation:forklift-validation-image", - registry = "$${REGISTRY:-quay.io}", - repository = "$${REGISTRY_ORG:-}$${REGISTRY_ORG:+/}forklift-validation", - tag = "$${REGISTRY_TAG:-devel}", -) - -container_push( - name = "push-populator-controller", - format = "Docker", - image = "//cmd/populator-controller:populator-controller-image", - registry = "$${REGISTRY:-quay.io}", - repository = "$${REGISTRY_ORG:-}$${REGISTRY_ORG:+/}populator-controller", - tag = "$${REGISTRY_TAG:-devel}", -) diff --git a/Makefile b/Makefile index d03e2991a..f5c66c884 100644 --- a/Makefile +++ b/Makefile @@ -61,21 +61,7 @@ OVA_PROVIDER_SERVER_IMAGE ?= $(REGISTRY)/$(REGISTRY_ORG)/forklift-ova-provider-s MUST_GATHER_IMAGE ?= quay.io/kubev2v/forklift-must-gather:latest UI_PLUGIN_IMAGE ?= quay.io/kubev2v/forklift-console-plugin:latest -BAZEL_OPTS ?= --verbose_failures - -ifneq (,$(findstring /usr/lib64/ccache,$(PATH))) -CCACHE_DIR ?= $${HOME}/.ccache -BAZEL_OPTS += --sandbox_writable_path=$(CCACHE_DIR) -$(shell [ -d $(CCACHE_DIR) ] || mkdir -p $(CCACHE_DIR)) -endif - -XDG_RUNTIME_DIR ?= -ifneq (,$(XDG_RUNTIME_DIR)) -BAZEL_OPTS += --sandbox_writable_path=$${XDG_RUNTIME_DIR} -$(shell [ -d $(XDG_RUNTIME_DIR) ] || mkdir -p $(XDG_RUNTIME_DIR)) -endif - -ci: all tidy vendor bazel-generate generate-verify +ci: all tidy vendor generate-verify all: test forklift-controller @@ -180,135 +166,74 @@ generate-verify: generate ./hack/verify-generate.sh build-controller-image: check_container_runtime - export CONTAINER_CMD=$(CONTAINER_CMD); \ - bazel run cmd/forklift-controller:forklift-controller-image \ - $(BAZEL_OPTS) \ - --action_env CONTAINER_CMD=$(CONTAINER_CMD) + $(CONTAINER_CMD) build -t $(CONTROLLER_IMAGE) -f build/forklift-controller/Containerfile . push-controller-image: build-controller-image - $(CONTAINER_CMD) tag bazel/cmd/forklift-controller:forklift-controller-image $(CONTROLLER_IMAGE) $(CONTAINER_CMD) push $(CONTROLLER_IMAGE) build-api-image: check_container_runtime - export CONTAINER_CMD=$(CONTAINER_CMD); \ - bazel run cmd/forklift-api:forklift-api-image \ - $(BAZEL_OPTS) \ - --action_env CONTAINER_CMD=$(CONTAINER_CMD) + $(CONTAINER_CMD) build -t $(API_IMAGE) -f build/forklift-api/Containerfile . push-api-image: build-api-image - $(CONTAINER_CMD) tag bazel/cmd/forklift-api:forklift-api-image $(API_IMAGE) $(CONTAINER_CMD) push $(API_IMAGE) build-validation-image: check_container_runtime - export CONTAINER_CMD=$(CONTAINER_CMD); \ - bazel run validation:forklift-validation-image \ - $(BAZEL_OPTS) \ - --action_env CONTAINER_CMD=$(CONTAINER_CMD) + $(CONTAINER_CMD) build -t $(VALIDATION_IMAGE) -f build/validation/Containerfile . push-validation-image: build-validation-image - $(CONTAINER_CMD) tag bazel/validation:forklift-validation-image $(VALIDATION_IMAGE) $(CONTAINER_CMD) push $(VALIDATION_IMAGE) build-operator-image: check_container_runtime - export CONTAINER_CMD=$(CONTAINER_CMD); \ - bazel run operator:forklift-operator-image \ - $(BAZEL_OPTS) \ - --action_env CONTAINER_CMD=$(CONTAINER_CMD) + $(CONTAINER_CMD) build -t $(OPERATOR_IMAGE) -f build/forklift-operator/Containerfile . push-operator-image: build-operator-image - $(CONTAINER_CMD) tag bazel/operator:forklift-operator-image $(OPERATOR_IMAGE) $(CONTAINER_CMD) push $(OPERATOR_IMAGE) build-virt-v2v-image: check_container_runtime - export CONTAINER_CMD=$(CONTAINER_CMD); \ - bazel run --package_path=virt-v2v forklift-virt-v2v \ - $(BAZEL_OPTS) \ - --action_env CONTAINER_CMD=$(CONTAINER_CMD) + $(CONTAINER_CMD) build -t $(VIRT_V2V_IMAGE) -f build/virt-v2v/Containerfile-upstream . push-virt-v2v-image: build-virt-v2v-image - $(CONTAINER_CMD) tag bazel:forklift-virt-v2v $(VIRT_V2V_IMAGE) $(CONTAINER_CMD) push $(VIRT_V2V_IMAGE) build-operator-bundle-image: check_container_runtime - export CONTAINER_CMD=$(CONTAINER_CMD); \ - bazel run operator:forklift-operator-bundle-image \ - $(BAZEL_OPTS) \ - --action_env CONTAINER_CMD=$(CONTAINER_CMD) \ - --action_env VERSION=$(VERSION) \ - --action_env NAMESPACE=$(NAMESPACE) \ - --action_env CHANNELS=$(CHANNELS) \ - --action_env DEFAULT_CHANNEL=$(DEFAULT_CHANNEL) \ - --action_env OPERATOR_IMAGE=$(OPERATOR_IMAGE) \ - --action_env MUST_GATHER_IMAGE=$(MUST_GATHER_IMAGE) \ - --action_env UI_PLUGIN_IMAGE=$(UI_PLUGIN_IMAGE) \ - --action_env VALIDATION_IMAGE=$(VALIDATION_IMAGE) \ - --action_env VIRT_V2V_IMAGE=$(VIRT_V2V_IMAGE) \ - --action_env CONTROLLER_IMAGE=$(CONTROLLER_IMAGE) \ - --action_env API_IMAGE=$(API_IMAGE) \ - --action_env POPULATOR_CONTROLLER_IMAGE=$(POPULATOR_CONTROLLER_IMAGE) \ - --action_env OVIRT_POPULATOR_IMAGE=$(OVIRT_POPULATOR_IMAGE) \ - --action_env OPENSTACK_POPULATOR_IMAGE=$(OPENSTACK_POPULATOR_IMAGE)\ - --action_env OVA_PROVIDER_SERVER_IMAGE=$(OVA_PROVIDER_SERVER_IMAGE) + $(CONTAINER_CMD) build -t $(OPERATOR_BUNDLE_IMAGE) -f build/forklift-operator-bundle/Containerfile --build-arg-file build/forklift-operator-bundle/upstream-args . push-operator-bundle-image: build-operator-bundle-image - $(CONTAINER_CMD) tag bazel/operator:forklift-operator-bundle-image $(OPERATOR_BUNDLE_IMAGE) $(CONTAINER_CMD) push $(OPERATOR_BUNDLE_IMAGE) build-operator-index-image: check_container_runtime - export CONTAINER_CMD=$(CONTAINER_CMD); \ - bazel run operator:forklift-operator-index-image \ - $(BAZEL_OPTS) \ - --action_env CONTAINER_CMD=$(CONTAINER_CMD) \ - --action_env VERSION=$(VERSION) \ - --action_env CHANNELS=$(CHANNELS) \ - --action_env DEFAULT_CHANNEL=$(DEFAULT_CHANNEL) \ - --action_env OPM_OPTS=$(OPM_OPTS) \ - --action_env REGISTRY=$(REGISTRY) \ - --action_env REGISTRY_TAG=$(REGISTRY_TAG) \ - --action_env REGISTRY_ORG=$(REGISTRY_ORG) + $(CONTAINER_CMD) build -t $(OPERATOR_INDEX_IMAGE) -f build/forklift-operator-index/Containerfile . \ + --build-arg VERSION=$(VERSION) \ + --build-arg OPERATOR_BUNDLE_IMAGE=$(OPERATOR_BUNDLE_IMAGE) \ + --build-arg CHANNELS=$(CHANNELS) \ + --build-arg DEFAULT_CHANNEL=$(DEFAULT_CHANNEL) \ + --build-arg OPM_OPTS=$(OPM_OPTS) push-operator-index-image: build-operator-index-image - $(CONTAINER_CMD) tag bazel/operator:forklift-operator-index-image $(OPERATOR_INDEX_IMAGE) $(CONTAINER_CMD) push $(OPERATOR_INDEX_IMAGE) build-populator-controller-image: check_container_runtime - export CONTAINER_CMD=$(CONTAINER_CMD); \ - bazel run cmd/populator-controller:populator-controller-image \ - $(BAZEL_OPTS) \ - --action_env CONTAINER_CMD=$(CONTAINER_CMD) + $(CONTAINER_CMD) build -t $(POPULATOR_CONTROLLER_IMAGE) -f build/populator-controller/Containerfile . push-populator-controller-image: build-populator-controller-image - $(CONTAINER_CMD) tag bazel/cmd/populator-controller:populator-controller-image $(POPULATOR_CONTROLLER_IMAGE) $(CONTAINER_CMD) push $(POPULATOR_CONTROLLER_IMAGE) build-ovirt-populator-image: - export CONTAINER_CMD=$(CONTAINER_CMD); \ - bazel run cmd/ovirt-populator:ovirt-populator-image \ - $(BAZEL_OPTS) \ - --action_env CONTAINER_CMD=$(CONTAINER_CMD) + $(CONTAINER_CMD) build -t $(OVIRT_POPULATOR_IMAGE) -f build/ovirt-populator/Containerfile-upstream . push-ovirt-populator-image: build-ovirt-populator-image - $(CONTAINER_CMD) tag bazel/cmd/ovirt-populator:ovirt-populator-image $(OVIRT_POPULATOR_IMAGE) $(CONTAINER_CMD) push $(OVIRT_POPULATOR_IMAGE) build-openstack-populator-image: check_container_runtime - export CONTAINER_CMD=$(CONTAINER_CMD); \ - bazel run cmd/openstack-populator:openstack-populator-image \ - $(BAZEL_OPTS) \ - --action_env CONTAINER_CMD=$(CONTAINER_CMD) + $(CONTAINER_CMD) build -t $(OPENSTACK_POPULATOR_IMAGE) -f build/openstack-populator/Containerfile . push-openstack-populator-image: build-openstack-populator-image - $(CONTAINER_CMD) tag bazel/cmd/openstack-populator:openstack-populator-image $(OPENSTACK_POPULATOR_IMAGE) $(CONTAINER_CMD) push $(OPENSTACK_POPULATOR_IMAGE) build-ova-provider-server-image: check_container_runtime - export CONTAINER_CMD=$(CONTAINER_CMD); \ - bazel run cmd/ova-provider-server:ova-provider-server-image \ - $(BAZEL_OPTS) \ - --action_env CONTAINER_CMD=$(CONTAINER_CMD) + $(CONTAINER_CMD) build -t $(OVA_PROVIDER_SERVER_IMAGE) -f build/ova-provider-server/Containerfile . push-ova-provider-server-image: build-ova-provider-server-image - $(CONTAINER_CMD) tag bazel/cmd/ova-provider-server:ova-provider-server-image $(OVA_PROVIDER_SERVER_IMAGE) $(CONTAINER_CMD) push $(OVA_PROVIDER_SERVER_IMAGE) build-all-images: build-api-image \ @@ -317,12 +242,13 @@ build-all-images: build-api-image \ build-operator-image \ build-virt-v2v-image \ build-operator-bundle-image \ - build-operator-index-image \ build-populator-controller-image \ build-ovirt-populator-image \ build-openstack-populator-image\ build-ova-provider-server-image +# build-operator-index-image \ + push-all-images: push-api-image \ push-controller-image \ push-validation-image \ @@ -343,9 +269,6 @@ check_container_runtime: exit 1; \ fi -bazel-generate: - bazel run //:gazelle cmd operator pkg tests validation - .PHONY: controller-gen controller-gen: $(CONTROLLER_GEN) $(DEFAULT_CONTROLLER_GEN): diff --git a/WORKSPACE b/WORKSPACE deleted file mode 100644 index 7f9faf3c5..000000000 --- a/WORKSPACE +++ /dev/null @@ -1,4316 +0,0 @@ -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file") - -http_archive( - name = "io_bazel_rules_go", - sha256 = "91585017debb61982f7054c9688857a2ad1fd823fc3f9cb05048b0025c47d023", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.42.0/rules_go-v0.42.0.zip", - "https://github.com/bazelbuild/rules_go/releases/download/v0.42.0/rules_go-v0.42.0.zip", - ], -) - -http_archive( - name = "bazel_gazelle", - sha256 = "d3fa66a39028e97d76f9e2db8f1b0c11c099e8e01bf363a923074784e451f809", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.33.0/bazel-gazelle-v0.33.0.tar.gz", - "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.33.0/bazel-gazelle-v0.33.0.tar.gz", - ], -) - -http_archive( - name = "io_bazel_rules_docker", - sha256 = "b1e80761a8a8243d03ebca8845e9cc1ba6c82ce7c5179ce2b295cd36f7e394bf", - urls = [ - "https://github.com/bazelbuild/rules_docker/releases/download/v0.25.0/rules_docker-v0.25.0.tar.gz", - ], -) - -load( - "@io_bazel_rules_docker//toolchains/docker:toolchain.bzl", - docker_toolchain_configure = "toolchain_configure", -) - -docker_toolchain_configure( - name = "docker_config", - docker_flags = [ - "--log-level=info", - ], - docker_path = "${CONTAINER_CMD:-$(command -v podman||command -v docker)}", -) - -load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") -load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository") - -go_repository( - name = "co_honnef_go_tools", - importpath = "honnef.co/go/tools", - sum = "h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8=", - version = "v0.0.1-2020.1.4", -) - -go_repository( - name = "com_github_14rcole_gopopulate", - importpath = "github.com/14rcole/gopopulate", - sum = "h1:SCbEWT58NSt7d2mcFdvxC9uyrdcTfvBbPLThhkDmXzg=", - version = "v0.0.0-20180821133914-b175b219e774", -) - -go_repository( - name = "com_github_acarl005_stripansi", - importpath = "github.com/acarl005/stripansi", - sum = "h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8=", - version = "v0.0.0-20180116102854-5a71ef0e047d", -) - -go_repository( - name = "com_github_afex_hystrix_go", - importpath = "github.com/afex/hystrix-go", - sum = "h1:rFw4nCn9iMW+Vajsk51NtYIcwSTkXr+JGrMd36kTDJw=", - version = "v0.0.0-20180502004556-fa1af6a1f4f5", -) - -go_repository( - name = "com_github_agnivade_levenshtein", - importpath = "github.com/agnivade/levenshtein", - sum = "h1:3oJU7J3FGFmyhn8KHjmVaZCN5hxTr7GxgRue+sxIXdQ=", - version = "v1.0.1", -) - -go_repository( - name = "com_github_alecthomas_template", - importpath = "github.com/alecthomas/template", - sum = "h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM=", - version = "v0.0.0-20190718012654-fb15b899a751", -) - -go_repository( - name = "com_github_alecthomas_units", - importpath = "github.com/alecthomas/units", - sum = "h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E=", - version = "v0.0.0-20190924025748-f65c72e2690d", -) - -go_repository( - name = "com_github_andreyvit_diff", - importpath = "github.com/andreyvit/diff", - sum = "h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ=", - version = "v0.0.0-20170406064948-c7f18ee00883", -) - -go_repository( - name = "com_github_apache_thrift", - importpath = "github.com/apache/thrift", - sum = "h1:5hryIiq9gtn+MiLVn0wP37kb/uTeRZgN08WoCsAhIhI=", - version = "v0.13.0", -) - -go_repository( - name = "com_github_appscode_jsonpatch", - importpath = "github.com/appscode/jsonpatch", - sum = "h1:e82Bj+rsBSnpsmjiIGlc9NiKSBpJONZkamk/F8GrCR0=", - version = "v1.0.1", -) - -go_repository( - name = "com_github_armon_circbuf", - importpath = "github.com/armon/circbuf", - sum = "h1:QEF07wC0T1rKkctt1RINW/+RMTVmiwxETico2l3gxJA=", - version = "v0.0.0-20150827004946-bbbad097214e", -) - -go_repository( - name = "com_github_armon_consul_api", - importpath = "github.com/armon/consul-api", - sum = "h1:G1bPvciwNyF7IUmKXNt9Ak3m6u9DE1rF+RmtIkBpVdA=", - version = "v0.0.0-20180202201655-eb2c6b5be1b6", -) - -go_repository( - name = "com_github_armon_go_metrics", - importpath = "github.com/armon/go-metrics", - sum = "h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I=", - version = "v0.0.0-20180917152333-f0300d1749da", -) - -go_repository( - name = "com_github_armon_go_radix", - importpath = "github.com/armon/go-radix", - sum = "h1:BUAU3CGlLvorLI26FmByPp2eC2qla6E1Tw+scpcg/to=", - version = "v0.0.0-20180808171621-7fddfc383310", -) - -go_repository( - name = "com_github_aryann_difflib", - importpath = "github.com/aryann/difflib", - sum = "h1:pv34s756C4pEXnjgPfGYgdhg/ZdajGhyOvzx8k+23nw=", - version = "v0.0.0-20170710044230-e206f873d14a", -) - -go_repository( - name = "com_github_asaskevich_govalidator", - importpath = "github.com/asaskevich/govalidator", - sum = "h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=", - version = "v0.0.0-20190424111038-f61b66f89f4a", -) - -go_repository( - name = "com_github_aws_aws_lambda_go", - importpath = "github.com/aws/aws-lambda-go", - sum = "h1:SuCy7H3NLyp+1Mrfp+m80jcbi9KYWAs9/BXwppwRDzY=", - version = "v1.13.3", -) - -go_repository( - name = "com_github_aws_aws_sdk_go", - importpath = "github.com/aws/aws-sdk-go", - sum = "h1:0xphMHGMLBrPMfxR2AmVjZKcMEESEgWF8Kru94BNByk=", - version = "v1.27.0", -) - -go_repository( - name = "com_github_aws_aws_sdk_go_v2", - importpath = "github.com/aws/aws-sdk-go-v2", - sum = "h1:qZ+woO4SamnH/eEbjM2IDLhRNwIwND/RQyVlBLp3Jqg=", - version = "v0.18.0", -) - -go_repository( - name = "com_github_azure_go_ansiterm", - importpath = "github.com/Azure/go-ansiterm", - sum = "h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8=", - version = "v0.0.0-20170929234023-d6e3b3328b78", -) - -go_repository( - name = "com_github_azure_go_autorest_autorest", - importpath = "github.com/Azure/go-autorest/autorest", - sum = "h1:5YWtOnckcudzIw8lPPBcWOnmIFWMtHci1ZWAZulMSx0=", - version = "v0.9.6", -) - -go_repository( - name = "com_github_azure_go_autorest_autorest_adal", - importpath = "github.com/Azure/go-autorest/autorest/adal", - sum = "h1:O1X4oexUxnZCaEUGsvMnr8ZGj8HI37tNezwY4npRqA0=", - version = "v0.8.2", -) - -go_repository( - name = "com_github_azure_go_autorest_autorest_date", - importpath = "github.com/Azure/go-autorest/autorest/date", - sum = "h1:yW+Zlqf26583pE43KhfnhFcdmSWlm5Ew6bxipnr/tbM=", - version = "v0.2.0", -) - -go_repository( - name = "com_github_azure_go_autorest_autorest_mocks", - importpath = "github.com/Azure/go-autorest/autorest/mocks", - sum = "h1:qJumjCaCudz+OcqE9/XtEPfvtOjOmKaui4EOpFI6zZc=", - version = "v0.3.0", -) - -go_repository( - name = "com_github_azure_go_autorest_logger", - importpath = "github.com/Azure/go-autorest/logger", - sum = "h1:ruG4BSDXONFRrZZJ2GUXDiUyVpayPmb1GnWeHDdaNKY=", - version = "v0.1.0", -) - -go_repository( - name = "com_github_azure_go_autorest_tracing", - importpath = "github.com/Azure/go-autorest/tracing", - sum = "h1:TRn4WjSnkcSy5AEG3pnbtFSwNtwzjr4VYyQflFE619k=", - version = "v0.5.0", -) - -go_repository( - name = "com_github_beorn7_perks", - importpath = "github.com/beorn7/perks", - sum = "h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=", - version = "v1.0.1", -) - -go_repository( - name = "com_github_bgentry_speakeasy", - importpath = "github.com/bgentry/speakeasy", - sum = "h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY=", - version = "v0.1.0", -) - -go_repository( - name = "com_github_bketelsen_crypt", - importpath = "github.com/bketelsen/crypt", - sum = "h1:+0HFd5KSZ/mm3JmhmrDukiId5iR6w4+BdFtfSy4yWIc=", - version = "v0.0.3-0.20200106085610-5cbc8cc4026c", -) - -go_repository( - name = "com_github_blang_semver", - importpath = "github.com/blang/semver", - sum = "h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ=", - version = "v3.5.1+incompatible", -) - -go_repository( - name = "com_github_boltdb_bolt", - importpath = "github.com/boltdb/bolt", - sum = "h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4=", - version = "v1.3.1", -) - -go_repository( - name = "com_github_brancz_gojsontoyaml", - importpath = "github.com/brancz/gojsontoyaml", - sum = "h1:DMb8SuAL9+demT8equqMMzD8C/uxqWmj4cgV7ufrpQo=", - version = "v0.0.0-20190425155809-e8bd32d46b3d", -) - -go_repository( - name = "com_github_burntsushi_toml", - importpath = "github.com/BurntSushi/toml", - sum = "h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=", - version = "v0.3.1", -) - -go_repository( - name = "com_github_burntsushi_xgb", - importpath = "github.com/BurntSushi/xgb", - sum = "h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc=", - version = "v0.0.0-20160522181843-27f122750802", -) - -go_repository( - name = "com_github_campoy_embedmd", - importpath = "github.com/campoy/embedmd", - sum = "h1:V4kI2qTJJLf4J29RzI/MAt2c3Bl4dQSYPuflzwFH2hY=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_casbin_casbin_v2", - importpath = "github.com/casbin/casbin/v2", - sum = "h1:bTwon/ECRx9dwBy2ewRVr5OiqjeXSGiTUY74sDPQi/g=", - version = "v2.1.2", -) - -go_repository( - name = "com_github_cenkalti_backoff", - importpath = "github.com/cenkalti/backoff", - sum = "h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4=", - version = "v2.2.1+incompatible", -) - -go_repository( - name = "com_github_census_instrumentation_opencensus_proto", - importpath = "github.com/census-instrumentation/opencensus-proto", - sum = "h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk=", - version = "v0.2.1", -) - -go_repository( - name = "com_github_certifi_gocertifi", - importpath = "github.com/certifi/gocertifi", - sum = "h1:MmeatFT1pTPSVb4nkPmBFN/LRZ97vPjsFKsZrU3KKTs=", - version = "v0.0.0-20180905225744-ee1a9a0726d2", -) - -go_repository( - name = "com_github_cespare_xxhash", - importpath = "github.com/cespare/xxhash", - sum = "h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=", - version = "v1.1.0", -) - -go_repository( - name = "com_github_cespare_xxhash_v2", - importpath = "github.com/cespare/xxhash/v2", - sum = "h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY=", - version = "v2.1.1", -) - -go_repository( - name = "com_github_chzyer_logex", - importpath = "github.com/chzyer/logex", - sum = "h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE=", - version = "v1.1.10", -) - -go_repository( - name = "com_github_chzyer_readline", - importpath = "github.com/chzyer/readline", - sum = "h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8=", - version = "v0.0.0-20180603132655-2972be24d48e", -) - -go_repository( - name = "com_github_chzyer_test", - importpath = "github.com/chzyer/test", - sum = "h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8=", - version = "v0.0.0-20180213035817-a1ea475d72b1", -) - -go_repository( - name = "com_github_clbanning_x2j", - importpath = "github.com/clbanning/x2j", - sum = "h1:EdRZT3IeKQmfCSrgo8SZ8V3MEnskuJP0wCYNpe+aiXo=", - version = "v0.0.0-20191024224557-825249438eec", -) - -go_repository( - name = "com_github_client9_misspell", - importpath = "github.com/client9/misspell", - sum = "h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI=", - version = "v0.3.4", -) - -go_repository( - name = "com_github_cncf_udpa_go", - importpath = "github.com/cncf/udpa/go", - sum = "h1:WBZRG4aNOuI15bLRrCgN8fCq8E5Xuty6jGbmSNEvSsU=", - version = "v0.0.0-20191209042840-269d4d468f6f", -) - -go_repository( - name = "com_github_cockroachdb_datadriven", - importpath = "github.com/cockroachdb/datadriven", - sum = "h1:OaNxuTZr7kxeODyLWsRMC+OD03aFUH+mW6r2d+MWa5Y=", - version = "v0.0.0-20190809214429-80d97fb3cbaa", -) - -go_repository( - name = "com_github_codahale_hdrhistogram", - importpath = "github.com/codahale/hdrhistogram", - sum = "h1:qMd81Ts1T2OTKmB4acZcyKaMtRnY5Y44NuXGX2GFJ1w=", - version = "v0.0.0-20161010025455-3a0bb77429bd", -) - -go_repository( - name = "com_github_container_storage_interface_spec", - importpath = "github.com/container-storage-interface/spec", - sum = "h1:bD9KIVgaVKKkQ/UbVUY9kCaH/CJbhNxe0eeB4JeJV2s=", - version = "v1.2.0", -) - -go_repository( - name = "com_github_containernetworking_cni", - importpath = "github.com/containernetworking/cni", - sum = "h1:fE3r16wpSEyaqY4Z4oFrLMmIGfBYIKpPrHK31EJ9FzE=", - version = "v0.7.1", -) - -go_repository( - name = "com_github_containers_image_v5", - importpath = "github.com/containers/image/v5", - sum = "h1:h1FCOXH6Ux9/p/E4rndsQOC4yAdRU0msRTfLVeQ7FDQ=", - version = "v5.5.1", -) - -go_repository( - name = "com_github_containers_libtrust", - importpath = "github.com/containers/libtrust", - sum = "h1:Q8ePgVfHDplZ7U33NwHZkrVELsZP5fYj9pM5WBZB2GE=", - version = "v0.0.0-20190913040956-14b96171aa3b", -) - -go_repository( - name = "com_github_containers_ocicrypt", - importpath = "github.com/containers/ocicrypt", - sum = "h1:Q0/IPs8ohfbXNxEfyJ2pFVmvJu5BhqJUAmc6ES9NKbo=", - version = "v1.0.2", -) - -go_repository( - name = "com_github_containers_storage", - importpath = "github.com/containers/storage", - sum = "h1:tw/uKRPDnmVrluIzer3dawTFG/bTJLP8IEUyHFhltYk=", - version = "v1.20.2", -) - -go_repository( - name = "com_github_coreos_bbolt", - importpath = "github.com/coreos/bbolt", - sum = "h1:wZwiHHUieZCquLkDL0B8UhzreNWsPHooDAG3q34zk0s=", - version = "v1.3.2", -) - -go_repository( - name = "com_github_coreos_etcd", - importpath = "github.com/coreos/etcd", - sum = "h1:8F3hqu9fGYLBifCmRCJsicFqDx/D68Rt3q1JMazcgBQ=", - version = "v3.3.13+incompatible", -) - -go_repository( - name = "com_github_coreos_go_etcd", - importpath = "github.com/coreos/go-etcd", - sum = "h1:bXhRBIXoTm9BYHS3gE0TtQuyNZyeEMux2sDi4oo5YOo=", - version = "v2.0.0+incompatible", -) - -go_repository( - name = "com_github_coreos_go_oidc", - importpath = "github.com/coreos/go-oidc", - sum = "h1:sdJrfw8akMnCuUlaZU3tE/uYXFgfqom8DBE9so9EBsM=", - version = "v2.1.0+incompatible", -) - -go_repository( - name = "com_github_coreos_go_semver", - importpath = "github.com/coreos/go-semver", - sum = "h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=", - version = "v0.3.0", -) - -go_repository( - name = "com_github_coreos_go_systemd", - importpath = "github.com/coreos/go-systemd", - sum = "h1:W8b4lQ4tFF21aspRGoBuCNV6V2fFJBF+pm1J6OY8Lys=", - version = "v0.0.0-20190620071333-e64a0ec8b42a", -) - -go_repository( - name = "com_github_coreos_pkg", - importpath = "github.com/coreos/pkg", - sum = "h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg=", - version = "v0.0.0-20180928190104-399ea9e2e55f", -) - -go_repository( - name = "com_github_coreos_prometheus_operator", - importpath = "github.com/coreos/prometheus-operator", - sum = "h1:kd7mysk8mCdwquBcPLyuRoRFNJCpgezXu8yUvIYE2nc=", - version = "v0.35.0", -) - -go_repository( - name = "com_github_cpuguy83_go_md2man", - importpath = "github.com/cpuguy83/go-md2man", - sum = "h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk=", - version = "v1.0.10", -) - -go_repository( - name = "com_github_cpuguy83_go_md2man_v2", - importpath = "github.com/cpuguy83/go-md2man/v2", - sum = "h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM=", - version = "v2.0.0", -) - -go_repository( - name = "com_github_creack_pty", - importpath = "github.com/creack/pty", - sum = "h1:6pwm8kMQKCmgUg0ZHTm5+/YvRK0s3THD/28+T6/kk4A=", - version = "v1.1.7", -) - -go_repository( - name = "com_github_davecgh_go_spew", - importpath = "github.com/davecgh/go-spew", - sum = "h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=", - version = "v1.1.1", -) - -go_repository( - name = "com_github_davecgh_go_xdr", - importpath = "github.com/davecgh/go-xdr", - sum = "h1:qg9VbHo1TlL0KDM0vYvBG9EY0X0Yku5WYIPoFWt8f6o=", - version = "v0.0.0-20161123171359-e6a2ba005892", -) - -go_repository( - name = "com_github_dgrijalva_jwt_go", - importpath = "github.com/dgrijalva/jwt-go", - sum = "h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=", - version = "v3.2.0+incompatible", -) - -go_repository( - name = "com_github_dgryski_go_sip13", - importpath = "github.com/dgryski/go-sip13", - sum = "h1:RMLoZVzv4GliuWafOuPuQDKSm1SJph7uCRnnS61JAn4=", - version = "v0.0.0-20181026042036-e10d5fee7954", -) - -go_repository( - name = "com_github_docker_distribution", - importpath = "github.com/docker/distribution", - sum = "h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug=", - version = "v2.7.1+incompatible", -) - -go_repository( - name = "com_github_docker_docker", - importpath = "github.com/docker/docker", - sum = "h1:Sm8iD2lifO31DwXfkGzq8VgA7rwxPjRsYmeo0K/dF9Y=", - version = "v1.4.2-0.20191219165747-a9416c67da9f", -) - -go_repository( - name = "com_github_docker_docker_credential_helpers", - importpath = "github.com/docker/docker-credential-helpers", - sum = "h1:zI2p9+1NQYdnG6sMU26EX4aVGlqbInSQxQXLvzJ4RPQ=", - version = "v0.6.3", -) - -go_repository( - name = "com_github_docker_go_connections", - importpath = "github.com/docker/go-connections", - sum = "h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=", - version = "v0.4.0", -) - -go_repository( - name = "com_github_docker_go_metrics", - importpath = "github.com/docker/go-metrics", - sum = "h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8=", - version = "v0.0.1", -) - -go_repository( - name = "com_github_docker_go_units", - importpath = "github.com/docker/go-units", - sum = "h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw=", - version = "v0.4.0", -) - -go_repository( - name = "com_github_docker_libnetwork", - importpath = "github.com/docker/libnetwork", - sum = "h1:rACxqwRsHD075Vb7qTimAgMSKWoM5zER0Dhws/SgCVo=", - version = "v0.0.0-20190731215715-7f13a5c99f4b", -) - -go_repository( - name = "com_github_docker_libtrust", - importpath = "github.com/docker/libtrust", - sum = "h1:UhxFibDNY/bfvqU5CAUmr9zpesgbU6SWc8/B4mflAE4=", - version = "v0.0.0-20160708172513-aabc10ec26b7", -) - -go_repository( - name = "com_github_docker_spdystream", - importpath = "github.com/docker/spdystream", - sum = "h1:ZfSZ3P3BedhKGUhzj7BQlPSU4OvT6tfOKe3DVHzOA7s=", - version = "v0.0.0-20181023171402-6480d4af844c", -) - -go_repository( - name = "com_github_docopt_docopt_go", - importpath = "github.com/docopt/docopt-go", - sum = "h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ=", - version = "v0.0.0-20180111231733-ee0de3bc6815", -) - -go_repository( - name = "com_github_dustin_go_humanize", - importpath = "github.com/dustin/go-humanize", - sum = "h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_eapache_go_resiliency", - importpath = "github.com/eapache/go-resiliency", - sum = "h1:1NtRmCAqadE2FN4ZcN6g90TP3uk8cg9rn9eNK2197aU=", - version = "v1.1.0", -) - -go_repository( - name = "com_github_eapache_go_xerial_snappy", - importpath = "github.com/eapache/go-xerial-snappy", - sum = "h1:YEetp8/yCZMuEPMUDHG0CW/brkkEp8mzqk2+ODEitlw=", - version = "v0.0.0-20180814174437-776d5712da21", -) - -go_repository( - name = "com_github_eapache_queue", - importpath = "github.com/eapache/queue", - sum = "h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc=", - version = "v1.1.0", -) - -go_repository( - name = "com_github_edsrzf_mmap_go", - importpath = "github.com/edsrzf/mmap-go", - sum = "h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_elazarl_go_bindata_assetfs", - importpath = "github.com/elazarl/go-bindata-assetfs", - sum = "h1:G/bYguwHIzWq9ZoyUQqrjTmJbbYn3j3CKKpKinvZLFk=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_emicklei_go_restful", - importpath = "github.com/emicklei/go-restful", - sum = "h1:l6Soi8WCOOVAeCo4W98iBFC6Og7/X8bpRt51oNLZ2C8=", - version = "v2.10.0+incompatible", -) - -go_repository( - name = "com_github_emicklei_go_restful_openapi", - importpath = "github.com/emicklei/go-restful-openapi", - sum = "h1:ohRZ1yEZERGzqaozBgxa3A0lt6c6KF14xhs3IL9ECwg=", - version = "v1.2.0", -) - -go_repository( - name = "com_github_emicklei_go_restful_swagger12", - importpath = "github.com/emicklei/go-restful-swagger12", - sum = "h1:V94anc0ZG3Pa/cAMwP2m1aQW3+/FF8Qmw/GsFyTJAp4=", - version = "v0.0.0-20170926063155-7524189396c6", -) - -go_repository( - name = "com_github_envoyproxy_go_control_plane", - importpath = "github.com/envoyproxy/go-control-plane", - sum = "h1:rEvIZUSZ3fx39WIi3JkQqQBitGwpELBIYWeBVh6wn+E=", - version = "v0.9.4", -) - -go_repository( - name = "com_github_envoyproxy_protoc_gen_validate", - importpath = "github.com/envoyproxy/protoc-gen-validate", - sum = "h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A=", - version = "v0.1.0", -) - -go_repository( - name = "com_github_evanphx_json_patch", - importpath = "github.com/evanphx/json-patch", - sum = "h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses=", - version = "v4.9.0+incompatible", -) - -go_repository( - name = "com_github_fatih_color", - importpath = "github.com/fatih/color", - sum = "h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s=", - version = "v1.9.0", -) - -go_repository( - name = "com_github_fortytw2_leaktest", - importpath = "github.com/fortytw2/leaktest", - sum = "h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=", - version = "v1.3.0", -) - -go_repository( - name = "com_github_franela_goblin", - importpath = "github.com/franela/goblin", - sum = "h1:gb2Z18BhTPJPpLQWj4T+rfKHYCHxRHCtRxhKKjRidVw=", - version = "v0.0.0-20200105215937-c9ffbefa60db", -) - -go_repository( - name = "com_github_franela_goreq", - importpath = "github.com/franela/goreq", - sum = "h1:a9ENSRDFBUPkJ5lCgVZh26+ZbGyoVJG7yb5SSzF5H54=", - version = "v0.0.0-20171204163338-bcd34c9993f8", -) - -go_repository( - name = "com_github_fsnotify_fsnotify", - importpath = "github.com/fsnotify/fsnotify", - sum = "h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=", - version = "v1.4.9", -) - -go_repository( - name = "com_github_fsouza_go_dockerclient", - importpath = "github.com/fsouza/go-dockerclient", - sum = "h1:B94x7idrPK5yFSMWliAvakUQlTDLgO7iJyHtpbYxGGM=", - version = "v0.0.0-20171004212419-da3951ba2e9e", -) - -go_repository( - name = "com_github_fullsailor_pkcs7", - importpath = "github.com/fullsailor/pkcs7", - sum = "h1:RDBNVkRviHZtvDvId8XSGPu3rmpmSe+wKRcEWNgsfWU=", - version = "v0.0.0-20190404230743-d7302db945fa", -) - -go_repository( - name = "com_github_getsentry_raven_go", - importpath = "github.com/getsentry/raven-go", - sum = "h1:F2m41rgyxoveZKD+Z6xwyAbtdNeVvhpi9BpQLvt5oRU=", - version = "v0.0.0-20190513200303-c977f96e1095", -) - -go_repository( - name = "com_github_ghodss_yaml", - importpath = "github.com/ghodss/yaml", - sum = "h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_gin_contrib_cors", - importpath = "github.com/gin-contrib/cors", - sum = "h1:doAsuITavI4IOcd0Y19U4B+O0dNWihRyX//nn4sEmgA=", - version = "v1.3.1", -) - -go_repository( - name = "com_github_gin_contrib_sse", - importpath = "github.com/gin-contrib/sse", - sum = "h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=", - version = "v0.1.0", -) - -go_repository( - name = "com_github_gin_gonic_gin", - importpath = "github.com/gin-gonic/gin", - sum = "h1:Tg03T9yM2xa8j6I3Z3oqLaQRSmKvxPd6g/2HJ6zICFA=", - version = "v1.7.2", -) - -go_repository( - name = "com_github_globalsign_mgo", - importpath = "github.com/globalsign/mgo", - sum = "h1:DujepqpGd1hyOd7aW59XpK7Qymp8iy83xq74fLr21is=", - version = "v0.0.0-20181015135952-eeefdecb41b8", -) - -go_repository( - name = "com_github_go_bindata_go_bindata", - importpath = "github.com/go-bindata/go-bindata", - sum = "h1:5vjJMVhowQdPzjE1LdxyFF7YFTXg5IgGVW4gBr5IbvE=", - version = "v3.1.2+incompatible", -) - -go_repository( - name = "com_github_go_gl_glfw", - importpath = "github.com/go-gl/glfw", - sum = "h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0=", - version = "v0.0.0-20190409004039-e6da0acd62b1", -) - -go_repository( - name = "com_github_go_gl_glfw_v3_3_glfw", - importpath = "github.com/go-gl/glfw/v3.3/glfw", - sum = "h1:WtGNWLvXpe6ZudgnXrq0barxBImvnnJoMEhXAzcbM0I=", - version = "v0.0.0-20200222043503-6f7a984d4dc4", -) - -go_repository( - name = "com_github_go_kit_kit", - importpath = "github.com/go-kit/kit", - sum = "h1:dXFJfIHVvUcpSgDOV+Ne6t7jXri8Tfv2uOLHUZ2XNuo=", - version = "v0.10.0", -) - -go_repository( - name = "com_github_go_kit_log", - importpath = "github.com/go-kit/log", - sum = "h1:DGJh0Sm43HbOeYDNnVZFl8BvcYVvjD5bqYJvp0REbwQ=", - version = "v0.1.0", -) - -go_repository( - name = "com_github_go_logfmt_logfmt", - importpath = "github.com/go-logfmt/logfmt", - sum = "h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih4=", - version = "v0.5.0", -) - -go_repository( - name = "com_github_go_logr_logr", - importpath = "github.com/go-logr/logr", - sum = "h1:q4c+kbcR0d5rSurhBR8dIgieOaYpXtsdTYfx22Cu6rs=", - version = "v0.3.0", -) - -go_repository( - name = "com_github_go_logr_zapr", - importpath = "github.com/go-logr/zapr", - sum = "h1:iyiCRZ29uPmbO7mWIjOEiYMXrTxZWTyK4tCatLyGpUY=", - version = "v0.3.0", -) - -go_repository( - name = "com_github_go_openapi_analysis", - importpath = "github.com/go-openapi/analysis", - sum = "h1:8b2ZgKfKIUTVQpTb77MoRDIMEIwvDVw40o3aOXdfYzI=", - version = "v0.19.5", -) - -go_repository( - name = "com_github_go_openapi_errors", - importpath = "github.com/go-openapi/errors", - sum = "h1:a2kIyV3w+OS3S97zxUndRVD46+FhGOUBDFY7nmu4CsY=", - version = "v0.19.2", -) - -go_repository( - name = "com_github_go_openapi_jsonpointer", - importpath = "github.com/go-openapi/jsonpointer", - sum = "h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w=", - version = "v0.19.3", -) - -go_repository( - name = "com_github_go_openapi_jsonreference", - importpath = "github.com/go-openapi/jsonreference", - sum = "h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o=", - version = "v0.19.3", -) - -go_repository( - name = "com_github_go_openapi_loads", - importpath = "github.com/go-openapi/loads", - sum = "h1:5I4CCSqoWzT+82bBkNIvmLc0UOsoKKQ4Fz+3VxOB7SY=", - version = "v0.19.4", -) - -go_repository( - name = "com_github_go_openapi_runtime", - importpath = "github.com/go-openapi/runtime", - sum = "h1:csnOgcgAiuGoM/Po7PEpKDoNulCcF3FGbSnbHfxgjMI=", - version = "v0.19.4", -) - -go_repository( - name = "com_github_go_openapi_spec", - importpath = "github.com/go-openapi/spec", - sum = "h1:ixzUSnHTd6hCemgtAJgluaTSGYpLNpJY4mA2DIkdOAo=", - version = "v0.19.4", -) - -go_repository( - name = "com_github_go_openapi_strfmt", - importpath = "github.com/go-openapi/strfmt", - sum = "h1:eRfyY5SkaNJCAwmmMcADjY31ow9+N7MCLW7oRkbsINA=", - version = "v0.19.3", -) - -go_repository( - name = "com_github_go_openapi_swag", - importpath = "github.com/go-openapi/swag", - sum = "h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY=", - version = "v0.19.5", -) - -go_repository( - name = "com_github_go_openapi_validate", - importpath = "github.com/go-openapi/validate", - sum = "h1:QhCBKRYqZR+SKo4gl1lPhPahope8/RLt6EVgY8X80w0=", - version = "v0.19.5", -) - -go_repository( - name = "com_github_go_playground_assert_v2", - importpath = "github.com/go-playground/assert/v2", - sum = "h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A=", - version = "v2.0.1", -) - -go_repository( - name = "com_github_go_playground_locales", - importpath = "github.com/go-playground/locales", - sum = "h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q=", - version = "v0.13.0", -) - -go_repository( - name = "com_github_go_playground_universal_translator", - importpath = "github.com/go-playground/universal-translator", - sum = "h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no=", - version = "v0.17.0", -) - -go_repository( - name = "com_github_go_playground_validator_v10", - importpath = "github.com/go-playground/validator/v10", - sum = "h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE=", - version = "v10.4.1", -) - -go_repository( - name = "com_github_go_sql_driver_mysql", - importpath = "github.com/go-sql-driver/mysql", - sum = "h1:7LxgVwFb2hIQtMm87NdgAVfXjnt4OePseqT1tKx+opk=", - version = "v1.4.0", -) - -go_repository( - name = "com_github_go_stack_stack", - importpath = "github.com/go-stack/stack", - sum = "h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=", - version = "v1.8.0", -) - -go_repository( - name = "com_github_gobuffalo_flect", - importpath = "github.com/gobuffalo/flect", - sum = "h1:PAVD7sp0KOdfswjAw9BpLCU9hXo7wFSzgpQ+zNeks/A=", - version = "v0.2.2", -) - -go_repository( - name = "com_github_godbus_dbus", - importpath = "github.com/godbus/dbus", - sum = "h1:BWhy2j3IXJhjCbC68FptL43tDKIq8FladmaTs3Xs7Z8=", - version = "v0.0.0-20190422162347-ade71ed3457e", -) - -go_repository( - name = "com_github_gogo_googleapis", - importpath = "github.com/gogo/googleapis", - sum = "h1:kFkMAZBNAn4j7K0GiZr8cRYzejq68VbheufiV3YuyFI=", - version = "v1.1.0", -) - -go_repository( - name = "com_github_gogo_protobuf", - importpath = "github.com/gogo/protobuf", - sum = "h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=", - version = "v1.3.2", -) - -go_repository( - name = "com_github_golang_glog", - importpath = "github.com/golang/glog", - sum = "h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=", - version = "v0.0.0-20160126235308-23def4e6c14b", -) - -go_repository( - name = "com_github_golang_groupcache", - importpath = "github.com/golang/groupcache", - sum = "h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY=", - version = "v0.0.0-20200121045136-8c9f03a8e57e", -) - -go_repository( - name = "com_github_golang_lint", - importpath = "github.com/golang/lint", - sum = "h1:2hRPrmiwPrp3fQX967rNJIhQPtiGXdlQWAxKbKw3VHA=", - version = "v0.0.0-20180702182130-06c8688daad7", -) - -go_repository( - name = "com_github_golang_mock", - importpath = "github.com/golang/mock", - sum = "h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc=", - version = "v1.4.4", -) - -go_repository( - name = "com_github_golang_protobuf", - importpath = "github.com/golang/protobuf", - sum = "h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM=", - version = "v1.4.3", -) - -go_repository( - name = "com_github_golang_snappy", - importpath = "github.com/golang/snappy", - sum = "h1:aeE13tS0IiQgFjYdoL8qN3K1N2bXXtI6Vi51/y7BpMw=", - version = "v0.0.2", -) - -go_repository( - name = "com_github_gonum_blas", - importpath = "github.com/gonum/blas", - sum = "h1:Q0Jsdxl5jbxouNs1TQYt0gxesYMU4VXRbsTlgDloZ50=", - version = "v0.0.0-20181208220705-f22b278b28ac", -) - -go_repository( - name = "com_github_gonum_floats", - importpath = "github.com/gonum/floats", - sum = "h1:EvokxLQsaaQjcWVWSV38221VAK7qc2zhaO17bKys/18=", - version = "v0.0.0-20181209220543-c233463c7e82", -) - -go_repository( - name = "com_github_gonum_graph", - importpath = "github.com/gonum/graph", - sum = "h1:NcVXNHJrvrcAv8SVYKzKT2zwtEXU1DK2J+azsK7oz2A=", - version = "v0.0.0-20170401004347-50b27dea7ebb", -) - -go_repository( - name = "com_github_gonum_internal", - importpath = "github.com/gonum/internal", - sum = "h1:8jtTdc+Nfj9AR+0soOeia9UZSvYBvETVHZrugUowJ7M=", - version = "v0.0.0-20181124074243-f884aa714029", -) - -go_repository( - name = "com_github_gonum_lapack", - importpath = "github.com/gonum/lapack", - sum = "h1:7qnwS9+oeSiOIsiUMajT+0R7HR6hw5NegnKPmn/94oI=", - version = "v0.0.0-20181123203213-e4cdc5a0bff9", -) - -go_repository( - name = "com_github_gonum_matrix", - importpath = "github.com/gonum/matrix", - sum = "h1:V2IgdyerlBa/MxaEFRbV5juy/C3MGdj4ePi+g6ePIp4=", - version = "v0.0.0-20181209220409-c518dec07be9", -) - -go_repository( - name = "com_github_google_btree", - importpath = "github.com/google/btree", - sum = "h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_google_go_cmp", - importpath = "github.com/google/go-cmp", - sum = "h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=", - version = "v0.5.5", -) - -go_repository( - name = "com_github_google_gofuzz", - importpath = "github.com/google/gofuzz", - sum = "h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g=", - version = "v1.1.0", -) - -go_repository( - name = "com_github_google_martian", - importpath = "github.com/google/martian", - sum = "h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no=", - version = "v2.1.0+incompatible", -) - -go_repository( - name = "com_github_google_martian_v3", - importpath = "github.com/google/martian/v3", - sum = "h1:pMen7vLs8nvgEYhywH3KDWJIJTeEr2ULsVWHWYHQyBs=", - version = "v3.0.0", -) - -go_repository( - name = "com_github_google_pprof", - importpath = "github.com/google/pprof", - sum = "h1:Ak8CrdlwwXwAZxzS66vgPt4U8yUZX7JwLvVR58FN5jM=", - version = "v0.0.0-20200708004538-1a94d8640e99", -) - -go_repository( - name = "com_github_google_renameio", - importpath = "github.com/google/renameio", - sum = "h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA=", - version = "v0.1.0", -) - -go_repository( - name = "com_github_google_uuid", - importpath = "github.com/google/uuid", - sum = "h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y=", - version = "v1.1.2", -) - -go_repository( - name = "com_github_googleapis_gax_go_v2", - importpath = "github.com/googleapis/gax-go/v2", - sum = "h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM=", - version = "v2.0.5", -) - -go_repository( - name = "com_github_googleapis_gnostic", - importpath = "github.com/googleapis/gnostic", - sum = "h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I=", - version = "v0.4.1", -) - -go_repository( - name = "com_github_gopherjs_gopherjs", - importpath = "github.com/gopherjs/gopherjs", - sum = "h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=", - version = "v0.0.0-20181017120253-0766667cb4d1", -) - -go_repository( - name = "com_github_gorilla_context", - importpath = "github.com/gorilla/context", - sum = "h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8=", - version = "v1.1.1", -) - -go_repository( - name = "com_github_gorilla_mux", - importpath = "github.com/gorilla/mux", - sum = "h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc=", - version = "v1.7.4", -) - -go_repository( - name = "com_github_gorilla_websocket", - importpath = "github.com/gorilla/websocket", - sum = "h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=", - version = "v1.4.2", -) - -go_repository( - name = "com_github_gregjones_httpcache", - importpath = "github.com/gregjones/httpcache", - sum = "h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA=", - version = "v0.0.0-20190611155906-901d90724c79", -) - -go_repository( - name = "com_github_grpc_ecosystem_go_grpc_middleware", - importpath = "github.com/grpc-ecosystem/go-grpc-middleware", - sum = "h1:z53tR0945TRRQO/fLEVPI6SMv7ZflF0TEaTAoU7tOzg=", - version = "v1.0.1-0.20190118093823-f849b5445de4", -) - -go_repository( - name = "com_github_grpc_ecosystem_go_grpc_prometheus", - importpath = "github.com/grpc-ecosystem/go-grpc-prometheus", - sum = "h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=", - version = "v1.2.0", -) - -go_repository( - name = "com_github_grpc_ecosystem_grpc_gateway", - importpath = "github.com/grpc-ecosystem/grpc-gateway", - sum = "h1:UImYN5qQ8tuGpGE16ZmjvcTtTw24zw1QAp/SlnNrZhI=", - version = "v1.9.5", -) - -go_repository( - name = "com_github_grpc_ecosystem_grpc_health_probe", - importpath = "github.com/grpc-ecosystem/grpc-health-probe", - sum = "h1:UxmGBzaBcWDQuQh9E1iT1dWKQFbizZ+SpTd1EL4MSqs=", - version = "v0.2.1-0.20181220223928-2bf0a5b182db", -) - -go_repository( - name = "com_github_hashicorp_consul_api", - importpath = "github.com/hashicorp/consul/api", - sum = "h1:HXNYlRkkM/t+Y/Yhxtwcy02dlYwIaoxzvxPnS+cqy78=", - version = "v1.3.0", -) - -go_repository( - name = "com_github_hashicorp_consul_sdk", - importpath = "github.com/hashicorp/consul/sdk", - sum = "h1:UOxjlb4xVNF93jak1mzzoBatyFju9nrkxpVwIp/QqxQ=", - version = "v0.3.0", -) - -go_repository( - name = "com_github_hashicorp_errwrap", - importpath = "github.com/hashicorp/errwrap", - sum = "h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_hashicorp_go_cleanhttp", - importpath = "github.com/hashicorp/go-cleanhttp", - sum = "h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM=", - version = "v0.5.1", -) - -go_repository( - name = "com_github_hashicorp_go_immutable_radix", - importpath = "github.com/hashicorp/go-immutable-radix", - sum = "h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_hashicorp_go_msgpack", - importpath = "github.com/hashicorp/go-msgpack", - sum = "h1:zKjpN5BK/P5lMYrLmBHdBULWbJ0XpYR+7NGzqkZzoD4=", - version = "v0.5.3", -) - -go_repository( - name = "com_github_hashicorp_go_multierror", - importpath = "github.com/hashicorp/go-multierror", - sum = "h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_hashicorp_go_net", - importpath = "github.com/hashicorp/go.net", - sum = "h1:sNCoNyDEvN1xa+X0baata4RdcpKwcMS6DH+xwfqPgjw=", - version = "v0.0.1", -) - -go_repository( - name = "com_github_hashicorp_go_rootcerts", - importpath = "github.com/hashicorp/go-rootcerts", - sum = "h1:Rqb66Oo1X/eSV1x66xbDccZjhJigjg0+e82kpwzSwCI=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_hashicorp_go_sockaddr", - importpath = "github.com/hashicorp/go-sockaddr", - sum = "h1:GeH6tui99pF4NJgfnhp+L6+FfobzVW3Ah46sLo0ICXs=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_hashicorp_go_syslog", - importpath = "github.com/hashicorp/go-syslog", - sum = "h1:KaodqZuhUoZereWVIYmpUgZysurB1kBLX2j0MwMrUAE=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_hashicorp_go_uuid", - importpath = "github.com/hashicorp/go-uuid", - sum = "h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE=", - version = "v1.0.1", -) - -go_repository( - name = "com_github_hashicorp_go_version", - importpath = "github.com/hashicorp/go-version", - sum = "h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+dIzX/E=", - version = "v1.2.0", -) - -go_repository( - name = "com_github_hashicorp_golang_lru", - importpath = "github.com/hashicorp/golang-lru", - sum = "h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=", - version = "v0.5.4", -) - -go_repository( - name = "com_github_hashicorp_hcl", - importpath = "github.com/hashicorp/hcl", - sum = "h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_hashicorp_logutils", - importpath = "github.com/hashicorp/logutils", - sum = "h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_hashicorp_mdns", - importpath = "github.com/hashicorp/mdns", - sum = "h1:WhIgCr5a7AaVH6jPUwjtRuuE7/RDufnUvzIr48smyxs=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_hashicorp_memberlist", - importpath = "github.com/hashicorp/memberlist", - sum = "h1:EmmoJme1matNzb+hMpDuR/0sbJSUisxyqBGG676r31M=", - version = "v0.1.3", -) - -go_repository( - name = "com_github_hashicorp_serf", - importpath = "github.com/hashicorp/serf", - sum = "h1:YZ7UKsJv+hKjqGVUUbtE3HNj79Eln2oQ75tniF6iPt0=", - version = "v0.8.2", -) - -go_repository( - name = "com_github_hpcloud_tail", - importpath = "github.com/hpcloud/tail", - sum = "h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_hudl_fargo", - importpath = "github.com/hudl/fargo", - sum = "h1:0U6+BtN6LhaYuTnIJq4Wyq5cpn6O2kWrxAtcqBmYY6w=", - version = "v1.3.0", -) - -go_repository( - name = "com_github_ianlancetaylor_demangle", - importpath = "github.com/ianlancetaylor/demangle", - sum = "h1:UDMh68UUwekSh5iP2OMhRRZJiiBccgV7axzUG8vi56c=", - version = "v0.0.0-20181102032728-5e5cf60278f6", -) - -go_repository( - name = "com_github_imdario_mergo", - importpath = "github.com/imdario/mergo", - sum = "h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA=", - version = "v0.3.11", -) - -go_repository( - name = "com_github_improbable_eng_thanos", - importpath = "github.com/improbable-eng/thanos", - sum = "h1:iZfU7exq+RD5Lnb8n3Eh9MNYoRLeyeGO/85AvEkLg+8=", - version = "v0.3.2", -) - -go_repository( - name = "com_github_inconshreveable_mousetrap", - importpath = "github.com/inconshreveable/mousetrap", - sum = "h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_influxdata_influxdb1_client", - importpath = "github.com/influxdata/influxdb1-client", - sum = "h1:/WZQPMZNsjZ7IlCpsLGdQBINg5bxKQ1K1sh6awxLtkA=", - version = "v0.0.0-20191209144304-8bf82d3c094d", -) - -go_repository( - name = "com_github_jmespath_go_jmespath", - importpath = "github.com/jmespath/go-jmespath", - sum = "h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM=", - version = "v0.0.0-20180206201540-c2b33e8439af", -) - -go_repository( - name = "com_github_joefitzgerald_rainbow_reporter", - importpath = "github.com/joefitzgerald/rainbow-reporter", - sum = "h1:AuMG652zjdzI0YCCnXAqATtRBpGXMcAnrajcaTrSeuo=", - version = "v0.1.0", -) - -go_repository( - name = "com_github_jonboulle_clockwork", - importpath = "github.com/jonboulle/clockwork", - sum = "h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo=", - version = "v0.1.0", -) - -go_repository( - name = "com_github_jpillora_backoff", - importpath = "github.com/jpillora/backoff", - sum = "h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_json_iterator_go", - importpath = "github.com/json-iterator/go", - sum = "h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ=", - version = "v1.1.11", -) - -go_repository( - name = "com_github_jsonnet_bundler_jsonnet_bundler", - importpath = "github.com/jsonnet-bundler/jsonnet-bundler", - sum = "h1:T/HtHFr+mYCRULrH1x/RnoB0prIs0rMkolJhFMXNC9A=", - version = "v0.1.0", -) - -go_repository( - name = "com_github_jstemmer_go_junit_report", - importpath = "github.com/jstemmer/go-junit-report", - sum = "h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o=", - version = "v0.9.1", -) - -go_repository( - name = "com_github_jtolds_gls", - importpath = "github.com/jtolds/gls", - sum = "h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=", - version = "v4.20.0+incompatible", -) - -go_repository( - name = "com_github_julienschmidt_httprouter", - importpath = "github.com/julienschmidt/httprouter", - sum = "h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=", - version = "v1.3.0", -) - -go_repository( - name = "com_github_k8snetworkplumbingwg_network_attachment_definition_client", - importpath = "github.com/k8snetworkplumbingwg/network-attachment-definition-client", - sum = "h1:IwEFm6n6dvFAqpi3BtcTgnjwM/oj9hA30ZV7d4I0FGU=", - version = "v1.1.0", -) - -go_repository( - name = "com_github_kelseyhightower_envconfig", - importpath = "github.com/kelseyhightower/envconfig", - sum = "h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8=", - version = "v1.4.0", -) - -go_repository( - name = "com_github_kisielk_errcheck", - importpath = "github.com/kisielk/errcheck", - sum = "h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHzY=", - version = "v1.5.0", -) - -go_repository( - name = "com_github_kisielk_gotool", - importpath = "github.com/kisielk/gotool", - sum = "h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_klauspost_compress", - importpath = "github.com/klauspost/compress", - sum = "h1:eLeJ3dr/Y9+XRfJT4l+8ZjmtB5RPJhucH2HeCV5+IZY=", - version = "v1.10.8", -) - -go_repository( - name = "com_github_klauspost_pgzip", - importpath = "github.com/klauspost/pgzip", - sum = "h1:TQ7CNpYKovDOmqzRHKxJh0BeaBI7UdQZYc6p7pMQh1A=", - version = "v1.2.4", -) - -go_repository( - name = "com_github_knetic_govaluate", - importpath = "github.com/Knetic/govaluate", - sum = "h1:1G1pk05UrOh0NlF1oeaaix1x8XzrfjIDK47TY0Zehcw=", - version = "v3.0.1-0.20171022003610-9aa49832a739+incompatible", -) - -go_repository( - name = "com_github_konsorten_go_windows_terminal_sequences", - importpath = "github.com/konsorten/go-windows-terminal-sequences", - sum = "h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8=", - version = "v1.0.3", -) - -go_repository( - name = "com_github_konveyor_controller", - importpath = "github.com/konveyor/controller", - sum = "h1:It0jfQEyth6AC5z8f4oTmd4RaRsTlKubKfLh/TlLYqk=", - version = "v0.10.0", -) - -go_repository( - name = "com_github_kr_logfmt", - importpath = "github.com/kr/logfmt", - sum = "h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY=", - version = "v0.0.0-20140226030751-b84e30acd515", -) - -go_repository( - name = "com_github_kr_pretty", - importpath = "github.com/kr/pretty", - sum = "h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs=", - version = "v0.2.0", -) - -go_repository( - name = "com_github_kr_pty", - importpath = "github.com/kr/pty", - sum = "h1:hyz3dwM5QLc1Rfoz4FuWJQG5BN7tc6K1MndAUnGpQr4=", - version = "v1.1.5", -) - -go_repository( - name = "com_github_kr_text", - importpath = "github.com/kr/text", - sum = "h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=", - version = "v0.1.0", -) - -go_repository( - name = "com_github_kubernetes_csi_csi_lib_utils", - importpath = "github.com/kubernetes-csi/csi-lib-utils", - sum = "h1:t1cS7HTD7z5D7h9iAdjWuHtMxJPb9s1fIv34rxytzqs=", - version = "v0.7.0", -) - -go_repository( - name = "com_github_kubernetes_csi_csi_test", - importpath = "github.com/kubernetes-csi/csi-test", - sum = "h1:ia04uVFUM/J9n/v3LEMn3rEG6FmKV5BH9QLw7H68h44=", - version = "v2.0.0+incompatible", -) - -go_repository( - name = "com_github_kubernetes_csi_external_snapshotter_v2", - importpath = "github.com/kubernetes-csi/external-snapshotter/v2", - sum = "h1:t5bmB3Y8nCaLA4aFrIpX0zjHEF/HUkJp6f5rm7BsVzM=", - version = "v2.1.1", -) - -go_repository( - name = "com_github_kubernetes_sigs_kube_storage_version_migrator", - importpath = "github.com/kubernetes-sigs/kube-storage-version-migrator", - sum = "h1:XZfEWaxPMR/cRvQ/SFWOjok7YEnURVYrCiIltx/0HGY=", - version = "v0.0.0-20191127225502-51849bc15f17", -) - -go_repository( - name = "com_github_kylelemons_godebug", - importpath = "github.com/kylelemons/godebug", - sum = "h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4=", - version = "v0.0.0-20170820004349-d65d576e9348", -) - -go_repository( - name = "com_github_leodido_go_urn", - importpath = "github.com/leodido/go-urn", - sum = "h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=", - version = "v1.2.0", -) - -go_repository( - name = "com_github_liggitt_tabwriter", - importpath = "github.com/liggitt/tabwriter", - sum = "h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0=", - version = "v0.0.0-20181228230101-89fcab3d43de", -) - -go_repository( - name = "com_github_lightstep_lightstep_tracer_common_golang_gogo", - importpath = "github.com/lightstep/lightstep-tracer-common/golang/gogo", - sum = "h1:143Bb8f8DuGWck/xpNUOckBVYfFbBTnLevfRZ1aVVqo=", - version = "v0.0.0-20190605223551-bc2310a04743", -) - -go_repository( - name = "com_github_lightstep_lightstep_tracer_go", - importpath = "github.com/lightstep/lightstep-tracer-go", - sum = "h1:vi1F1IQ8N7hNWytK9DpJsUfQhGuNSc19z330K6vl4zk=", - version = "v0.18.1", -) - -go_repository( - name = "com_github_lyft_protoc_gen_validate", - importpath = "github.com/lyft/protoc-gen-validate", - sum = "h1:KNt/RhmQTOLr7Aj8PsJ7mTronaFyx80mRTT9qF261dA=", - version = "v0.0.13", -) - -go_repository( - name = "com_github_magiconair_properties", - importpath = "github.com/magiconair/properties", - sum = "h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=", - version = "v1.8.1", -) - -go_repository( - name = "com_github_mailru_easyjson", - importpath = "github.com/mailru/easyjson", - sum = "h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM=", - version = "v0.7.0", -) - -go_repository( - name = "com_github_mattn_go_colorable", - importpath = "github.com/mattn/go-colorable", - sum = "h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8=", - version = "v0.1.8", -) - -go_repository( - name = "com_github_mattn_go_isatty", - importpath = "github.com/mattn/go-isatty", - sum = "h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=", - version = "v0.0.12", -) - -go_repository( - name = "com_github_mattn_go_runewidth", - importpath = "github.com/mattn/go-runewidth", - sum = "h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=", - version = "v0.0.9", -) - -go_repository( - name = "com_github_mattn_go_shellwords", - importpath = "github.com/mattn/go-shellwords", - sum = "h1:Y7Xqm8piKOO3v10Thp7Z36h4FYFjt5xB//6XvOrs2Gw=", - version = "v1.0.10", -) - -go_repository( - name = "com_github_mattn_go_sqlite3", - importpath = "github.com/mattn/go-sqlite3", - sum = "h1:4rQjbDxdu9fSgI/r3KN72G3c2goxknAqHHgPWWs8UlI=", - version = "v1.14.4", -) - -go_repository( - name = "com_github_matttproud_golang_protobuf_extensions", - importpath = "github.com/matttproud/golang_protobuf_extensions", - sum = "h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI=", - version = "v1.0.2-0.20181231171920-c182affec369", -) - -go_repository( - name = "com_github_maxbrunsfeld_counterfeiter", - importpath = "github.com/maxbrunsfeld/counterfeiter", - sum = "h1:fJasMUaV/LYZvzK4bUOj13rNXc4fhVzU0Vu1OlcGUd4=", - version = "v0.0.0-20181017030959-1aadac120687", -) - -go_repository( - name = "com_github_maxbrunsfeld_counterfeiter_v6", - importpath = "github.com/maxbrunsfeld/counterfeiter/v6", - sum = "h1:s0HwWQiNYF+YpoOncE8OxHVYG3YShNiRG8iuPDiSDWM=", - version = "v6.2.1", -) - -go_repository( - name = "com_github_microsoft_go_winio", - importpath = "github.com/Microsoft/go-winio", - sum = "h1:ygIc8M6trr62pF5DucadTWGdEB4mEyvzi0e2nbcmcyA=", - version = "v0.4.15-0.20190919025122-fc70bd9a86b5", -) - -go_repository( - name = "com_github_microsoft_hcsshim", - importpath = "github.com/Microsoft/hcsshim", - sum = "h1:VrfodqvztU8YSOvygU+DN1BGaSGxmrNfqOv5oOuX2Bk=", - version = "v0.8.9", -) - -go_repository( - name = "com_github_miekg_dns", - importpath = "github.com/miekg/dns", - sum = "h1:9jZdLNd/P4+SfEJ0TNyxYpsK8N4GtfylBLqtbYN1sbA=", - version = "v1.0.14", -) - -go_repository( - name = "com_github_mistifyio_go_zfs", - importpath = "github.com/mistifyio/go-zfs", - sum = "h1:gAMO1HM9xBRONLHHYnu5iFsOJUiJdNZo6oqSENd4eW8=", - version = "v2.1.1+incompatible", -) - -go_repository( - name = "com_github_mitchellh_cli", - importpath = "github.com/mitchellh/cli", - sum = "h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_mitchellh_go_homedir", - importpath = "github.com/mitchellh/go-homedir", - sum = "h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=", - version = "v1.1.0", -) - -go_repository( - name = "com_github_mitchellh_go_testing_interface", - importpath = "github.com/mitchellh/go-testing-interface", - sum = "h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_mitchellh_gox", - importpath = "github.com/mitchellh/gox", - sum = "h1:lfGJxY7ToLJQjHHwi0EX6uYBdK78egf954SQl13PQJc=", - version = "v0.4.0", -) - -go_repository( - name = "com_github_mitchellh_hashstructure", - importpath = "github.com/mitchellh/hashstructure", - sum = "h1:ZkRJX1CyOoTkar7p/mLS5TZU4nJ1Rn/F8u9dGS02Q3Y=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_mitchellh_iochan", - importpath = "github.com/mitchellh/iochan", - sum = "h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_mitchellh_mapstructure", - importpath = "github.com/mitchellh/mapstructure", - sum = "h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=", - version = "v1.1.2", -) - -go_repository( - name = "com_github_moby_term", - importpath = "github.com/moby/term", - sum = "h1:aY7OQNf2XqY/JQ6qREWamhI/81os/agb2BAGpcx5yWI=", - version = "v0.0.0-20200312100748-672ec06f55cd", -) - -go_repository( - name = "com_github_modern_go_concurrent", - importpath = "github.com/modern-go/concurrent", - sum = "h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=", - version = "v0.0.0-20180306012644-bacd9c7ef1dd", -) - -go_repository( - name = "com_github_modern_go_reflect2", - importpath = "github.com/modern-go/reflect2", - sum = "h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=", - version = "v1.0.1", -) - -go_repository( - name = "com_github_morikuni_aec", - importpath = "github.com/morikuni/aec", - sum = "h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_mrnold_go_libnbd", - importpath = "github.com/mrnold/go-libnbd", - sum = "h1:bIszEpQZKre4DMqEIO5HCv/MA44ujD2w7BIQg/cOFts=", - version = "v1.4.1-cdi", -) - -go_repository( - name = "com_github_mtrmac_gpgme", - importpath = "github.com/mtrmac/gpgme", - sum = "h1:dNOmvYmsrakgW7LcgiprD0yfRuQQe8/C8F6Z+zogO3s=", - version = "v0.1.2", -) - -go_repository( - name = "com_github_munnerz_goautoneg", - importpath = "github.com/munnerz/goautoneg", - sum = "h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=", - version = "v0.0.0-20191010083416-a7dc8b61c822", -) - -go_repository( - name = "com_github_mwitkow_go_conntrack", - importpath = "github.com/mwitkow/go-conntrack", - sum = "h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU=", - version = "v0.0.0-20190716064945-2f068394615f", -) - -go_repository( - name = "com_github_mxk_go_flowrate", - importpath = "github.com/mxk/go-flowrate", - sum = "h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus=", - version = "v0.0.0-20140419014527-cca7078d478f", -) - -go_repository( - name = "com_github_nats_io_jwt", - importpath = "github.com/nats-io/jwt", - sum = "h1:+RB5hMpXUUA2dfxuhBTEkMOrYmM+gKIZYS1KjSostMI=", - version = "v0.3.2", -) - -go_repository( - name = "com_github_nats_io_nats_go", - importpath = "github.com/nats-io/nats.go", - sum = "h1:ik3HbLhZ0YABLto7iX80pZLPw/6dx3T+++MZJwLnMrQ=", - version = "v1.9.1", -) - -go_repository( - name = "com_github_nats_io_nats_server_v2", - importpath = "github.com/nats-io/nats-server/v2", - sum = "h1:i2Ly0B+1+rzNZHHWtD4ZwKi+OU5l+uQo1iDHZ2PmiIc=", - version = "v2.1.2", -) - -go_repository( - name = "com_github_nats_io_nkeys", - importpath = "github.com/nats-io/nkeys", - sum = "h1:6JrEfig+HzTH85yxzhSVbjHRJv9cn0p6n3IngIcM5/k=", - version = "v0.1.3", -) - -go_repository( - name = "com_github_nats_io_nuid", - importpath = "github.com/nats-io/nuid", - sum = "h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=", - version = "v1.0.1", -) - -go_repository( - name = "com_github_nxadm_tail", - importpath = "github.com/nxadm/tail", - sum = "h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78=", - version = "v1.4.4", -) - -go_repository( - name = "com_github_nytimes_gziphandler", - importpath = "github.com/NYTimes/gziphandler", - sum = "h1:iLrQrdwjDd52kHDA5op2UBJFjmOb9g+7scBan4RN8F0=", - version = "v1.0.1", -) - -go_repository( - name = "com_github_oklog_oklog", - importpath = "github.com/oklog/oklog", - sum = "h1:wVfs8F+in6nTBMkA7CbRw+zZMIB7nNM825cM1wuzoTk=", - version = "v0.3.2", -) - -go_repository( - name = "com_github_oklog_run", - importpath = "github.com/oklog/run", - sum = "h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_oklog_ulid", - importpath = "github.com/oklog/ulid", - sum = "h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4=", - version = "v1.3.1", -) - -go_repository( - name = "com_github_olekukonko_tablewriter", - importpath = "github.com/olekukonko/tablewriter", - sum = "h1:58+kh9C6jJVXYjt8IE48G2eWl6BjwU5Gj0gqY84fy78=", - version = "v0.0.0-20170122224234-a0225b3f23b5", -) - -go_repository( - name = "com_github_oneofone_xxhash", - importpath = "github.com/OneOfOne/xxhash", - sum = "h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE=", - version = "v1.2.2", -) - -go_repository( - name = "com_github_onsi_ginkgo", - importpath = "github.com/onsi/ginkgo", - sum = "h1:jMU0WaQrP0a/YAEq8eJmJKjBoMs+pClEr1vDMlM/Do4=", - version = "v1.14.1", -) - -go_repository( - name = "com_github_onsi_gomega", - importpath = "github.com/onsi/gomega", - sum = "h1:gph6h/qe9GSUw1NhH1gp+qb+h8rXD8Cy60Z32Qw3ELA=", - version = "v1.10.3", -) - -go_repository( - name = "com_github_op_go_logging", - importpath = "github.com/op/go-logging", - sum = "h1:lDH9UUVJtmYCjyT0CI4q8xvlXPxeZ0gYCVvWbmPlp88=", - version = "v0.0.0-20160315200505-970db520ece7", -) - -go_repository( - name = "com_github_opencontainers_go_digest", - importpath = "github.com/opencontainers/go-digest", - sum = "h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_opencontainers_image_spec", - importpath = "github.com/opencontainers/image-spec", - replace = "github.com/opencontainers/image-spec", - sum = "h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM=", - version = "v1.0.2", -) - -go_repository( - name = "com_github_opencontainers_runc", - importpath = "github.com/opencontainers/runc", - sum = "h1:4+xo8mtWixbHoEm451+WJNUrq12o2/tDsyK9Vgc/NcA=", - version = "v1.0.0-rc90", -) - -go_repository( - name = "com_github_opencontainers_runtime_spec", - importpath = "github.com/opencontainers/runtime-spec", - sum = "h1:eNUVfm/RFLIi1G7flU5/ZRTHvd4kcVuzfRnL6OFlzCI=", - version = "v0.1.2-0.20190507144316-5b71a03e2700", -) - -go_repository( - name = "com_github_opencontainers_selinux", - importpath = "github.com/opencontainers/selinux", - sum = "h1:F6DgIsjgBIcDksLW4D5RG9bXok6oqZ3nvMwj4ZoFu/Q=", - version = "v1.5.2", -) - -go_repository( - name = "com_github_openshift_api", - importpath = "github.com/openshift/api", - replace = "github.com/openshift/api", - sum = "h1:/h7PRJsGBUyre9lQQwmpjuap/x1K2bKgMmyRnCMsUEw=", - version = "v0.0.0-20190716152234-9ea19f9dd578", -) - -go_repository( - name = "com_github_openshift_build_machinery_go", - importpath = "github.com/openshift/build-machinery-go", - sum = "h1:iP7TOaN+tEVNUQ0ODEbN1ukjLz918lsIt7Czf8giWlM=", - version = "v0.0.0-20200713135615-1f43d26dccc7", -) - -go_repository( - name = "com_github_openshift_client_go", - importpath = "github.com/openshift/client-go", - replace = "github.com/openshift/client-go", - sum = "h1:Otk3CuCAEHiMUr4Er6b+csq4Ar6qilAs9h93tbea+qM=", - version = "v0.0.0-20191125132246-f6563a70e19a", -) - -go_repository( - name = "com_github_openshift_custom_resource_status", - importpath = "github.com/openshift/custom-resource-status", - sum = "h1:F1MEnOMwSrTA0YAkO0he9ip9w0JhYzI/iCB2mXmaSPg=", - version = "v0.0.0-20200602122900-c002fd1547ca", -) - -go_repository( - name = "com_github_openshift_library_go", - importpath = "github.com/openshift/library-go", - sum = "h1:qzTuJSAJX5UMDW5oTb+RQTG6c2eP02bIjFgeQLL/W8o=", - version = "v0.0.0-20200821154433-215f00df72cc", -) - -go_repository( - name = "com_github_openshift_prom_label_proxy", - importpath = "github.com/openshift/prom-label-proxy", - sum = "h1:GW8OxGwBbI2kCqjb5PQfVXRAuCJbYyX1RYs9R3ISjck=", - version = "v0.1.1-0.20191016113035-b8153a7f39f1", -) - -go_repository( - name = "com_github_opentracing_basictracer_go", - importpath = "github.com/opentracing/basictracer-go", - sum = "h1:YyUAhaEfjoWXclZVJ9sGoNct7j4TVk7lZWlQw5UXuoo=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_opentracing_contrib_go_observer", - importpath = "github.com/opentracing-contrib/go-observer", - sum = "h1:lM6RxxfUMrYL/f8bWEUqdXrANWtrL7Nndbm9iFN0DlU=", - version = "v0.0.0-20170622124052-a52f23424492", -) - -go_repository( - name = "com_github_opentracing_opentracing_go", - importpath = "github.com/opentracing/opentracing-go", - sum = "h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU=", - version = "v1.1.0", -) - -go_repository( - name = "com_github_openzipkin_contrib_zipkin_go_opentracing", - importpath = "github.com/openzipkin-contrib/zipkin-go-opentracing", - sum = "h1:ZCnq+JUrvXcDVhX/xRolRBZifmabN1HcS1wrPSvxhrU=", - version = "v0.4.5", -) - -go_repository( - name = "com_github_openzipkin_zipkin_go", - importpath = "github.com/openzipkin/zipkin-go", - sum = "h1:nY8Hti+WKaP0cRsSeQ026wU03QsM762XBeCXBb9NAWI=", - version = "v0.2.2", -) - -go_repository( - name = "com_github_operator_framework_go_appr", - importpath = "github.com/operator-framework/go-appr", - sum = "h1:c7gnBIMtxxenMKXZjeCuQaDfn7IGGmgh9laEGsOEeU4=", - version = "v0.0.0-20180917210448-f2aef88446f2", -) - -go_repository( - name = "com_github_operator_framework_operator_lifecycle_manager", - importpath = "github.com/operator-framework/operator-lifecycle-manager", - sum = "h1:500FBy57oogxOEDRQpDtVD1E5ZzmWh2n2iliXZv169s=", - version = "v0.0.0-20190725173916-b56e63a643cc", -) - -go_repository( - name = "com_github_operator_framework_operator_marketplace", - importpath = "github.com/operator-framework/operator-marketplace", - sum = "h1:47MQUQRBZqwyTPLEHoFlbGRv63p0OvxpPp5g6FUQXQs=", - version = "v0.0.0-20190216021216-57300a3ef3ba", -) - -go_repository( - name = "com_github_operator_framework_operator_registry", - importpath = "github.com/operator-framework/operator-registry", - sum = "h1:oDIevJvKXFsp7BEb7iJHuLvuhPZYBtIx5oZQ7iSISAs=", - version = "v1.1.1", -) - -go_repository( - name = "com_github_ostreedev_ostree_go", - importpath = "github.com/ostreedev/ostree-go", - sum = "h1:TnbXhKzrTOyuvWrjI8W6pcoI9XPbLHFXCdN2dtUw7Rw=", - version = "v0.0.0-20190702140239-759a8c1ac913", -) - -go_repository( - name = "com_github_ovirt_go_ovirt", - importpath = "github.com/ovirt/go-ovirt", - replace = "github.com/ovirt/go-ovirt", - sum = "h1:jwvYN2BLH2JoOqX5ueldlcgwHsPdt2wx+crJSrYQ84A=", - version = "v0.0.0-20210423075620-0fe653f1c0cd", -) - -go_repository( - name = "com_github_pact_foundation_pact_go", - importpath = "github.com/pact-foundation/pact-go", - sum = "h1:OYkFijGHoZAYbOIb1LWXrwKQbMMRUv1oQ89blD2Mh2Q=", - version = "v1.0.4", -) - -go_repository( - name = "com_github_pascaldekloe_goe", - importpath = "github.com/pascaldekloe/goe", - sum = "h1:Lgl0gzECD8GnQ5QCWA8o6BtfL6mDH5rQgM4/fX3avOs=", - version = "v0.0.0-20180627143212-57f6aae5913c", -) - -go_repository( - name = "com_github_pborman_uuid", - importpath = "github.com/pborman/uuid", - sum = "h1:+ZZIw58t/ozdjRaXh/3awHfmWRbzYxJoAdNJxe/3pvw=", - version = "v1.2.1", -) - -go_repository( - name = "com_github_pelletier_go_toml", - importpath = "github.com/pelletier/go-toml", - sum = "h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc=", - version = "v1.2.0", -) - -go_repository( - name = "com_github_performancecopilot_speed", - importpath = "github.com/performancecopilot/speed", - sum = "h1:2WnRzIquHa5QxaJKShDkLM+sc0JPuwhXzK8OYOyt3Vg=", - version = "v3.0.0+incompatible", -) - -go_repository( - name = "com_github_petar_gollrb", - importpath = "github.com/petar/GoLLRB", - sum = "h1:AwcgVYzW1T+QuJ2fc55ceOSCiVaOpdYUNpFj9t7+n9U=", - version = "v0.0.0-20130427215148-53be0d36a84c", -) - -go_repository( - name = "com_github_peterbourgon_diskv", - importpath = "github.com/peterbourgon/diskv", - sum = "h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=", - version = "v2.0.1+incompatible", -) - -go_repository( - name = "com_github_pierrec_lz4", - importpath = "github.com/pierrec/lz4", - sum = "h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I=", - version = "v2.0.5+incompatible", -) - -go_repository( - name = "com_github_pkg_errors", - importpath = "github.com/pkg/errors", - sum = "h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=", - version = "v0.9.1", -) - -go_repository( - name = "com_github_pkg_profile", - importpath = "github.com/pkg/profile", - sum = "h1:OQIvuDgm00gWVWGTf4m4mCt6W1/0YqU7Ntg0mySWgaI=", - version = "v1.3.0", -) - -go_repository( - name = "com_github_pmezard_go_difflib", - importpath = "github.com/pmezard/go-difflib", - sum = "h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_posener_complete", - importpath = "github.com/posener/complete", - sum = "h1:ccV59UEOTzVDnDUEFdT95ZzHVZ+5+158q8+SJb2QV5w=", - version = "v1.1.1", -) - -go_repository( - name = "com_github_pquerna_cachecontrol", - importpath = "github.com/pquerna/cachecontrol", - sum = "h1:0XM1XL/OFFJjXsYXlG30spTkV/E9+gmd5GD1w2HE8xM=", - version = "v0.0.0-20171018203845-0dec1b30a021", -) - -go_repository( - name = "com_github_pquerna_ffjson", - importpath = "github.com/pquerna/ffjson", - sum = "h1:kyf9snWXHvQc+yxE9imhdI8YAm4oKeZISlaAR+x73zs=", - version = "v0.0.0-20190813045741-dac163c6c0a9", -) - -go_repository( - name = "com_github_prometheus_client_golang", - importpath = "github.com/prometheus/client_golang", - sum = "h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ=", - version = "v1.11.0", -) - -go_repository( - name = "com_github_prometheus_client_model", - importpath = "github.com/prometheus/client_model", - sum = "h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=", - version = "v0.2.0", -) - -go_repository( - name = "com_github_prometheus_common", - importpath = "github.com/prometheus/common", - sum = "h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzzhMQ=", - version = "v0.26.0", -) - -go_repository( - name = "com_github_prometheus_procfs", - importpath = "github.com/prometheus/procfs", - sum = "h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4=", - version = "v0.6.0", -) - -go_repository( - name = "com_github_prometheus_prometheus", - importpath = "github.com/prometheus/prometheus", - sum = "h1:EekL1S9WPoPtJL2NZvL+xo38iMpraOnyEHOiyZygMDY=", - version = "v2.3.2+incompatible", -) - -go_repository( - name = "com_github_prometheus_tsdb", - importpath = "github.com/prometheus/tsdb", - sum = "h1:w1tAGxsBMLkuGrFMhqgcCeBkM5d1YI24udArs+aASuQ=", - version = "v0.8.0", -) - -go_repository( - name = "com_github_puerkitobio_purell", - importpath = "github.com/PuerkitoBio/purell", - sum = "h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=", - version = "v1.1.1", -) - -go_repository( - name = "com_github_puerkitobio_urlesc", - importpath = "github.com/PuerkitoBio/urlesc", - sum = "h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=", - version = "v0.0.0-20170810143723-de5bf2ad4578", -) - -go_repository( - name = "com_github_rcrowley_go_metrics", - importpath = "github.com/rcrowley/go-metrics", - sum = "h1:9ZKAASQSHhDYGoxY8uLVpewe1GDZ2vu2Tr/vTdVAkFQ=", - version = "v0.0.0-20181016184325-3113b8401b8a", -) - -go_repository( - name = "com_github_robfig_cron", - importpath = "github.com/robfig/cron", - sum = "h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ=", - version = "v1.2.0", -) - -go_repository( - name = "com_github_rogpeppe_fastuuid", - importpath = "github.com/rogpeppe/fastuuid", - sum = "h1:gu+uRPtBe88sKxUCEXRoeCvVG90TJmwhiqRpvdhQFng=", - version = "v0.0.0-20150106093220-6724a57986af", -) - -go_repository( - name = "com_github_rogpeppe_go_charset", - importpath = "github.com/rogpeppe/go-charset", - sum = "h1:BN/Nyn2nWMoqGRA7G7paDNDqTXE30mXGqzzybrfo05w=", - version = "v0.0.0-20180617210344-2471d30d28b4", -) - -go_repository( - name = "com_github_rogpeppe_go_internal", - importpath = "github.com/rogpeppe/go-internal", - sum = "h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk=", - version = "v1.3.0", -) - -go_repository( - name = "com_github_rs_cors", - importpath = "github.com/rs/cors", - sum = "h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik=", - version = "v1.7.0", -) - -go_repository( - name = "com_github_russross_blackfriday", - importpath = "github.com/russross/blackfriday", - sum = "h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo=", - version = "v1.5.2", -) - -go_repository( - name = "com_github_russross_blackfriday_v2", - importpath = "github.com/russross/blackfriday/v2", - sum = "h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=", - version = "v2.0.1", -) - -go_repository( - name = "com_github_ryanuber_columnize", - importpath = "github.com/ryanuber/columnize", - sum = "h1:UFr9zpz4xgTnIE5yIMtWAMngCdZ9p/+q6lTbgelo80M=", - version = "v0.0.0-20160712163229-9b3edd62028f", -) - -go_repository( - name = "com_github_samuel_go_zookeeper", - importpath = "github.com/samuel/go-zookeeper", - sum = "h1:p3Vo3i64TCLY7gIfzeQaUJ+kppEO5WQG3cL8iE8tGHU=", - version = "v0.0.0-20190923202752-2cc03de413da", -) - -go_repository( - name = "com_github_sclevine_spec", - importpath = "github.com/sclevine/spec", - sum = "h1:1Jwdf9jSfDl9NVmt8ndHqbTZ7XCCPbh1jI3hkDBHVYA=", - version = "v1.2.0", -) - -go_repository( - name = "com_github_sean_seed", - importpath = "github.com/sean-/seed", - sum = "h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I=", - version = "v0.0.0-20170313163322-e2103e2c3529", -) - -go_repository( - name = "com_github_sergi_go_diff", - importpath = "github.com/sergi/go-diff", - sum = "h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_shopify_sarama", - importpath = "github.com/Shopify/sarama", - sum = "h1:9oksLxC6uxVPHPVYUmq6xhr1BOF/hHobWH2UzO67z1s=", - version = "v1.19.0", -) - -go_repository( - name = "com_github_shopify_toxiproxy", - importpath = "github.com/Shopify/toxiproxy", - sum = "h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc=", - version = "v2.1.4+incompatible", -) - -go_repository( - name = "com_github_shurcool_sanitized_anchor_name", - importpath = "github.com/shurcooL/sanitized_anchor_name", - sum = "h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_sirupsen_logrus", - importpath = "github.com/sirupsen/logrus", - sum = "h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I=", - version = "v1.6.0", -) - -go_repository( - name = "com_github_smartystreets_assertions", - importpath = "github.com/smartystreets/assertions", - sum = "h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=", - version = "v0.0.0-20180927180507-b2de0cb4f26d", -) - -go_repository( - name = "com_github_smartystreets_goconvey", - importpath = "github.com/smartystreets/goconvey", - sum = "h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=", - version = "v1.6.4", -) - -go_repository( - name = "com_github_soheilhy_cmux", - importpath = "github.com/soheilhy/cmux", - sum = "h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E=", - version = "v0.1.4", -) - -go_repository( - name = "com_github_sony_gobreaker", - importpath = "github.com/sony/gobreaker", - sum = "h1:oMnRNZXX5j85zso6xCPRNPtmAycat+WcoKbklScLDgQ=", - version = "v0.4.1", -) - -go_repository( - name = "com_github_spaolacci_murmur3", - importpath = "github.com/spaolacci/murmur3", - sum = "h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ=", - version = "v0.0.0-20180118202830-f09979ecbc72", -) - -go_repository( - name = "com_github_spf13_afero", - importpath = "github.com/spf13/afero", - sum = "h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc=", - version = "v1.2.2", -) - -go_repository( - name = "com_github_spf13_cast", - importpath = "github.com/spf13/cast", - sum = "h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=", - version = "v1.3.0", -) - -go_repository( - name = "com_github_spf13_cobra", - importpath = "github.com/spf13/cobra", - sum = "h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4=", - version = "v1.1.1", -) - -go_repository( - name = "com_github_spf13_jwalterweatherman", - importpath = "github.com/spf13/jwalterweatherman", - sum = "h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_spf13_pflag", - importpath = "github.com/spf13/pflag", - sum = "h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=", - version = "v1.0.5", -) - -go_repository( - name = "com_github_spf13_viper", - importpath = "github.com/spf13/viper", - sum = "h1:xVKxvI7ouOI5I+U9s2eeiUfMaWBVoXA3AWskkrqK0VM=", - version = "v1.7.0", -) - -go_repository( - name = "com_github_stevvooe_resumable", - importpath = "github.com/stevvooe/resumable", - sum = "h1:4bT0pPowCpQImewr+BjzfUKcuFW+KVyB8d1OF3b6oTI=", - version = "v0.0.0-20180830230917-22b14a53ba50", -) - -go_repository( - name = "com_github_streadway_amqp", - importpath = "github.com/streadway/amqp", - sum = "h1:WhxRHzgeVGETMlmVfqhRn8RIeeNoPr2Czh33I4Zdccw=", - version = "v0.0.0-20190827072141-edfb9018d271", -) - -go_repository( - name = "com_github_streadway_handy", - importpath = "github.com/streadway/handy", - sum = "h1:AhmOdSHeswKHBjhsLs/7+1voOxT+LLrSk/Nxvk35fug=", - version = "v0.0.0-20190108123426-d5acb3125c2a", -) - -go_repository( - name = "com_github_stretchr_objx", - importpath = "github.com/stretchr/objx", - sum = "h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48=", - version = "v0.2.0", -) - -go_repository( - name = "com_github_stretchr_testify", - importpath = "github.com/stretchr/testify", - sum = "h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=", - version = "v1.6.1", -) - -go_repository( - name = "com_github_subosito_gotenv", - importpath = "github.com/subosito/gotenv", - sum = "h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=", - version = "v1.2.0", -) - -go_repository( - name = "com_github_syndtr_gocapability", - importpath = "github.com/syndtr/gocapability", - sum = "h1:b6uOv7YOFK0TYG7HtkIgExQo+2RdLuwRft63jn2HWj8=", - version = "v0.0.0-20180916011248-d98352740cb2", -) - -go_repository( - name = "com_github_tchap_go_patricia", - importpath = "github.com/tchap/go-patricia", - sum = "h1:GkY4dP3cEfEASBPPkWd+AmjYxhmDkqO9/zg7R0lSQRs=", - version = "v2.3.0+incompatible", -) - -go_repository( - name = "com_github_tidwall_pretty", - importpath = "github.com/tidwall/pretty", - sum = "h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_tmc_grpc_websocket_proxy", - importpath = "github.com/tmc/grpc-websocket-proxy", - sum = "h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ=", - version = "v0.0.0-20190109142713-0ad062ec5ee5", -) - -go_repository( - name = "com_github_ugorji_go", - importpath = "github.com/ugorji/go", - sum = "h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo=", - version = "v1.1.7", -) - -go_repository( - name = "com_github_ugorji_go_codec", - importpath = "github.com/ugorji/go/codec", - sum = "h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs=", - version = "v1.1.7", -) - -go_repository( - name = "com_github_ulikunitz_xz", - importpath = "github.com/ulikunitz/xz", - sum = "h1:YvTNdFzX6+W5m9msiYg/zpkSURPPtOlzbqYjrFn7Yt4=", - version = "v0.5.7", -) - -go_repository( - name = "com_github_xi2_xz", - importpath = "github.com/xi2/xz", - sum = "h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo=", - version = "v0.0.0-20171230120015-48954b6210f8", -) - -go_repository( - name = "com_github_urfave_cli", - importpath = "github.com/urfave/cli", - sum = "h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY=", - version = "v1.22.1", -) - -go_repository( - name = "com_github_vbatts_tar_split", - importpath = "github.com/vbatts/tar-split", - sum = "h1:0Odu65rhcZ3JZaPHxl7tCI3V/C/Q9Zf82UFravl02dE=", - version = "v0.11.1", -) - -go_repository( - name = "com_github_vbauerster_mpb_v5", - importpath = "github.com/vbauerster/mpb/v5", - sum = "h1:zIICVOm+XD+uV6crpSORaL6I0Q1WqOdvxZTp+r3L9cw=", - version = "v5.2.2", -) - -go_repository( - name = "com_github_vektah_gqlparser", - importpath = "github.com/vektah/gqlparser", - sum = "h1:ZsyLGn7/7jDNI+y4SEhI4yAxRChlv15pUHMjijT+e68=", - version = "v1.1.2", -) - -go_repository( - name = "com_github_vishvananda_netlink", - importpath = "github.com/vishvananda/netlink", - sum = "h1:bqNY2lgheFIu1meHUFSH3d7vG93AFyqg3oGbJCOJgSM=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_vishvananda_netns", - importpath = "github.com/vishvananda/netns", - sum = "h1:OviZH7qLw/7ZovXvuNyL3XQl8UFofeikI1NW1Gypu7k=", - version = "v0.0.0-20191106174202-0a2b9b5464df", -) - -go_repository( - name = "com_github_vividcortex_ewma", - importpath = "github.com/VividCortex/ewma", - sum = "h1:MnEK4VOv6n0RSY4vtRe3h11qjxL3+t0B8yOL8iMXdcM=", - version = "v1.1.1", -) - -go_repository( - name = "com_github_vividcortex_gohistogram", - importpath = "github.com/VividCortex/gohistogram", - sum = "h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_vmware_govmomi", - importpath = "github.com/vmware/govmomi", - sum = "h1:vU09hxnNR/I7e+4zCJvW+5vHu5dO64Aoe2Lw7Yi/KRg=", - version = "v0.23.1", -) - -go_repository( - name = "com_github_vmware_vmw_guestinfo", - importpath = "github.com/vmware/vmw-guestinfo", - sum = "h1:sH9mEk+flyDxiUa5BuPiuhDETMbzrt9A20I2wktMvRQ=", - version = "v0.0.0-20170707015358-25eff159a728", -) - -go_repository( - name = "com_github_xeipuuv_gojsonpointer", - importpath = "github.com/xeipuuv/gojsonpointer", - sum = "h1:6cLsL+2FW6dRAdl5iMtHgRogVCff0QpRi9653YmdcJA=", - version = "v0.0.0-20190809123943-df4f5c81cb3b", -) - -go_repository( - name = "com_github_xeipuuv_gojsonreference", - importpath = "github.com/xeipuuv/gojsonreference", - sum = "h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=", - version = "v0.0.0-20180127040603-bd5ef7bd5415", -) - -go_repository( - name = "com_github_xeipuuv_gojsonschema", - importpath = "github.com/xeipuuv/gojsonschema", - sum = "h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=", - version = "v1.2.0", -) - -go_repository( - name = "com_github_xiang90_probing", - importpath = "github.com/xiang90/probing", - sum = "h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8=", - version = "v0.0.0-20190116061207-43a291ad63a2", -) - -go_repository( - name = "com_github_xlab_handysort", - importpath = "github.com/xlab/handysort", - sum = "h1:j2hhcujLRHAg872RWAV5yaUrEjHEObwDv3aImCaNLek=", - version = "v0.0.0-20150421192137-fb3537ed64a1", -) - -go_repository( - name = "com_github_xordataexchange_crypt", - importpath = "github.com/xordataexchange/crypt", - sum = "h1:ESFSdwYZvkeru3RtdrYueztKhOBCSAAzS4Gf+k0tEow=", - version = "v0.0.3-0.20170626215501-b2862e3d0a77", -) - -go_repository( - name = "com_github_yuin_goldmark", - importpath = "github.com/yuin/goldmark", - sum = "h1:ruQGxdhGHe7FWOJPT0mKs5+pD2Xs1Bm/kdGlHO04FmM=", - version = "v1.2.1", -) - -go_repository( - name = "com_google_cloud_go", - importpath = "cloud.google.com/go", - sum = "h1:Dg9iHVQfrhq82rUNu9ZxUDrJLaxFUe/HlCVaLyRruq8=", - version = "v0.65.0", -) - -go_repository( - name = "com_google_cloud_go_bigquery", - importpath = "cloud.google.com/go/bigquery", - sum = "h1:PQcPefKFdaIzjQFbiyOgAqyx8q5djaE7x9Sqe712DPA=", - version = "v1.8.0", -) - -go_repository( - name = "com_google_cloud_go_datastore", - importpath = "cloud.google.com/go/datastore", - sum = "h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ=", - version = "v1.1.0", -) - -go_repository( - name = "com_google_cloud_go_firestore", - importpath = "cloud.google.com/go/firestore", - sum = "h1:9x7Bx0A9R5/M9jibeJeZWqjeVEIxYW9fZYqB9a70/bY=", - version = "v1.1.0", -) - -go_repository( - name = "com_google_cloud_go_pubsub", - importpath = "cloud.google.com/go/pubsub", - sum = "h1:ukjixP1wl0LpnZ6LWtZJ0mX5tBmjp1f8Sqer8Z2OMUU=", - version = "v1.3.1", -) - -go_repository( - name = "com_google_cloud_go_storage", - importpath = "cloud.google.com/go/storage", - sum = "h1:STgFzyU5/8miMl0//zKh2aQeTyeaUH3WN9bSUiJ09bA=", - version = "v1.10.0", -) - -go_repository( - name = "com_shuralyov_dmitri_gpu_mtl", - importpath = "dmitri.shuralyov.com/gpu/mtl", - sum = "h1:VpgP7xuJadIUuKccphEpTJnWhS2jkQyMt6Y7pJCD7fY=", - version = "v0.0.0-20190408044501-666a987793e9", -) - -go_repository( - name = "com_sourcegraph_sourcegraph_appdash", - importpath = "sourcegraph.com/sourcegraph/appdash", - sum = "h1:ucqkfpjg9WzSUubAO62csmucvxl4/JeW3F4I4909XkM=", - version = "v0.0.0-20190731080439-ebfcffb1b5c0", -) - -go_repository( - name = "in_gopkg_alecthomas_kingpin_v2", - importpath = "gopkg.in/alecthomas/kingpin.v2", - sum = "h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc=", - version = "v2.2.6", -) - -go_repository( - name = "in_gopkg_asn1_ber_v1", - importpath = "gopkg.in/asn1-ber.v1", - sum = "h1:TxyelI5cVkbREznMhfzycHdkp5cLA7DpE+GKjSslYhM=", - version = "v1.0.0-20181015200546-f715ec2f112d", -) - -go_repository( - name = "in_gopkg_check_v1", - importpath = "gopkg.in/check.v1", - sum = "h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=", - version = "v1.0.0-20190902080502-41f04d3bba15", -) - -go_repository( - name = "in_gopkg_cheggaaa_pb_v1", - importpath = "gopkg.in/cheggaaa/pb.v1", - sum = "h1:Ev7yu1/f6+d+b3pi5vPdRPc6nNtP1umSfcWiEfRqv6I=", - version = "v1.0.25", -) - -go_repository( - name = "in_gopkg_errgo_v2", - importpath = "gopkg.in/errgo.v2", - sum = "h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8=", - version = "v2.1.0", -) - -go_repository( - name = "in_gopkg_fsnotify_v1", - importpath = "gopkg.in/fsnotify.v1", - sum = "h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=", - version = "v1.4.7", -) - -go_repository( - name = "in_gopkg_gcfg_v1", - importpath = "gopkg.in/gcfg.v1", - sum = "h1:m8OOJ4ccYHnx2f4gQwpno8nAX5OGOh7RLaaz0pj3Ogs=", - version = "v1.2.3", -) - -go_repository( - name = "in_gopkg_go_playground_assert_v1", - importpath = "gopkg.in/go-playground/assert.v1", - sum = "h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM=", - version = "v1.2.1", -) - -go_repository( - name = "in_gopkg_go_playground_validator_v9", - importpath = "gopkg.in/go-playground/validator.v9", - sum = "h1:SvGtYmN60a5CVKTOzMSyfzWDeZRxRuGvRQyEAKbw1xc=", - version = "v9.29.1", -) - -go_repository( - name = "in_gopkg_inf_v0", - importpath = "gopkg.in/inf.v0", - sum = "h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=", - version = "v0.9.1", -) - -go_repository( - name = "in_gopkg_ini_v1", - importpath = "gopkg.in/ini.v1", - sum = "h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno=", - version = "v1.51.0", -) - -go_repository( - name = "in_gopkg_ldap_v2", - importpath = "gopkg.in/ldap.v2", - sum = "h1:wiu0okdNfjlBzg6UWvd1Hn8Y+Ux17/u/4nlk4CQr6tU=", - version = "v2.5.1", -) - -go_repository( - name = "in_gopkg_natefinch_lumberjack_v2", - importpath = "gopkg.in/natefinch/lumberjack.v2", - sum = "h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8=", - version = "v2.0.0", -) - -go_repository( - name = "in_gopkg_resty_v1", - importpath = "gopkg.in/resty.v1", - sum = "h1:CuXP0Pjfw9rOuY6EP+UvtNvt5DSqHpIxILZKT/quCZI=", - version = "v1.12.0", -) - -go_repository( - name = "in_gopkg_square_go_jose_v2", - importpath = "gopkg.in/square/go-jose.v2", - sum = "h1:SK5KegNXmKmqE342YYN2qPHEnUYeoMiXXl1poUlI+o4=", - version = "v2.3.1", -) - -go_repository( - name = "in_gopkg_tomb_v1", - importpath = "gopkg.in/tomb.v1", - sum = "h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=", - version = "v1.0.0-20141024135613-dd632973f1e7", -) - -go_repository( - name = "in_gopkg_warnings_v0", - importpath = "gopkg.in/warnings.v0", - sum = "h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=", - version = "v0.1.2", -) - -go_repository( - name = "in_gopkg_yaml_v2", - importpath = "gopkg.in/yaml.v2", - sum = "h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=", - version = "v2.3.0", -) - -go_repository( - name = "in_gopkg_yaml_v3", - importpath = "gopkg.in/yaml.v3", - sum = "h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ=", - version = "v3.0.0-20200615113413-eeeca48fe776", -) - -go_repository( - name = "io_etcd_go_bbolt", - importpath = "go.etcd.io/bbolt", - sum = "h1:XAzx9gjCb0Rxj7EoqcClPD1d5ZBxZJk0jbuoPHenBt0=", - version = "v1.3.5", -) - -go_repository( - name = "io_etcd_go_etcd", - importpath = "go.etcd.io/etcd", - sum = "h1:Gqga3zA9tdAcfqobUGjSoCob5L3f8Dt5EuOp3ihNZko=", - version = "v0.5.0-alpha.5.0.20200819165624-17cef6e3e9d5", -) - -go_repository( - name = "io_k8s_api", - importpath = "k8s.io/api", - replace = "k8s.io/api", - sum = "h1:GN6ntFnv44Vptj/b+OnMW7FmzkpDoIDLZRvKX3XH9aU=", - version = "v0.19.3", -) - -go_repository( - name = "io_k8s_apiextensions_apiserver", - importpath = "k8s.io/apiextensions-apiserver", - replace = "k8s.io/apiextensions-apiserver", - sum = "h1:WZxBypSHW4SdXHbdPTS/Jy7L2la6Niggs8BuU5o+avo=", - version = "v0.19.3", -) - -go_repository( - name = "io_k8s_apimachinery", - importpath = "k8s.io/apimachinery", - replace = "k8s.io/apimachinery", - sum = "h1:bpIQXlKjB4cB/oNpnNnV+BybGPR7iP5oYpsOTEJ4hgc=", - version = "v0.19.3", -) - -go_repository( - name = "io_k8s_apiserver", - importpath = "k8s.io/apiserver", - replace = "k8s.io/apiserver", - sum = "h1:H7KUbLD74rh8NOPMLBJPSEG3Djqcv6Zxn5Ud0AL5u/k=", - version = "v0.19.3", -) - -go_repository( - name = "io_k8s_client_go", - importpath = "k8s.io/client-go", - replace = "k8s.io/client-go", - sum = "h1:ctqR1nQ52NUs6LpI0w+a5U+xjYwflFwA13OJKcicMxg=", - version = "v0.19.3", -) - -go_repository( - name = "io_k8s_cluster_bootstrap", - importpath = "k8s.io/cluster-bootstrap", - replace = "k8s.io/cluster-bootstrap", - sum = "h1:QY1qpB83m+mNlDcXLT+EpTGiUNVSNV0ybmgd/yZR5mA=", - version = "v0.16.4", -) - -go_repository( - name = "io_k8s_code_generator", - importpath = "k8s.io/code-generator", - replace = "k8s.io/code-generator", - sum = "h1:fTrTpJ8PZog5oo6MmeZtveo89emjQZHiw0ieybz1RSs=", - version = "v0.19.3", -) - -go_repository( - name = "io_k8s_component_base", - importpath = "k8s.io/component-base", - replace = "k8s.io/component-base", - sum = "h1:c+DzDNAQFlaoyX+yv8YuWi8xmlQvvY5DnJGbaz5U74o=", - version = "v0.19.3", -) - -go_repository( - name = "io_k8s_gengo", - importpath = "k8s.io/gengo", - sum = "h1:t4L10Qfx/p7ASH3gXCdIUtPbbIuegCoUJf3TMSFekjw=", - version = "v0.0.0-20200428234225-8167cfdcfc14", -) - -go_repository( - name = "io_k8s_klog", - importpath = "k8s.io/klog", - sum = "h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8=", - version = "v1.0.0", -) - -go_repository( - name = "io_k8s_klog_v2", - importpath = "k8s.io/klog/v2", - sum = "h1:XRvcwJozkgZ1UQJmfMGpvRthQHOvihEhYtDfAaxMz/A=", - version = "v2.2.0", -) - -go_repository( - name = "io_k8s_kube_aggregator", - importpath = "k8s.io/kube-aggregator", - replace = "k8s.io/kube-aggregator", - sum = "h1:neDqyJ0tiP1RNhrS9Vk9o2Id/u5+TJX7BH0QBSkLYxc=", - version = "v0.19.3", -) - -go_repository( - name = "io_k8s_kube_openapi", - importpath = "k8s.io/kube-openapi", - sum = "h1:sOHNzJIkytDF6qadMNKhhDRpc6ODik8lVC6nOur7B2c=", - version = "v0.0.0-20201113171705-d219536bb9fd", -) - -go_repository( - name = "io_k8s_kubernetes", - importpath = "k8s.io/kubernetes", - replace = "k8s.io/kubernetes", - sum = "h1:x6Q6M9nNBm9thoKj+PJr3HDPfHlz7FR35Ri61xpNfgg=", - version = "v0.19.3", -) - -go_repository( - name = "io_k8s_sigs_apiserver_network_proxy_konnectivity_client", - importpath = "sigs.k8s.io/apiserver-network-proxy/konnectivity-client", - sum = "h1:rusRLrDhjBp6aYtl9sGEvQJr6faoHoDLd0YcUBTZguI=", - version = "v0.0.9", -) - -go_repository( - name = "io_k8s_sigs_controller_runtime", - importpath = "sigs.k8s.io/controller-runtime", - replace = "sigs.k8s.io/controller-runtime", - sum = "h1:4013CKsBs5bEqo+LevzDett+LLxag/FjQWG94nVZ/9g=", - version = "v0.6.4", -) - -go_repository( - name = "io_k8s_sigs_controller_tools", - importpath = "sigs.k8s.io/controller-tools", - sum = "h1:3u2RCwOlp0cjCALAigpOcbAf50pE+kHSdueUosrC/AE=", - version = "v0.5.0", -) - -go_repository( - name = "io_k8s_sigs_structured_merge_diff", - importpath = "sigs.k8s.io/structured-merge-diff", - replace = "sigs.k8s.io/structured-merge-diff", - sum = "h1:zD2IemQ4LmOcAumeiyDWXKUI2SO0NYDe3H6QGvPOVgU=", - version = "v1.0.1-0.20191108220359-b1b620dd3f06", -) - -go_repository( - name = "io_k8s_sigs_structured_merge_diff_v3", - importpath = "sigs.k8s.io/structured-merge-diff/v3", - sum = "h1:0KsuGbLhWdIxv5DA1OnbFz5hI/Co9kuxMfMUa5YsAHY=", - version = "v3.0.0-20200116222232-67a7b8c61874", -) - -go_repository( - name = "io_k8s_sigs_structured_merge_diff_v4", - importpath = "sigs.k8s.io/structured-merge-diff/v4", - sum = "h1:YHQV7Dajm86OuqnIR6zAelnDWBRjo+YhYV9PmGrh1s8=", - version = "v4.0.2", -) - -go_repository( - name = "io_k8s_sigs_testing_frameworks", - importpath = "sigs.k8s.io/testing_frameworks", - sum = "h1:vK0+tvjF0BZ/RYFeZ1E6BYBwHJJXhjuZ3TdsEKH+UQM=", - version = "v0.1.2", -) - -go_repository( - name = "io_k8s_sigs_yaml", - importpath = "sigs.k8s.io/yaml", - sum = "h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=", - version = "v1.2.0", -) - -go_repository( - name = "io_k8s_utils", - importpath = "k8s.io/utils", - sum = "h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw=", - version = "v0.0.0-20201110183641-67b214c5f920", -) - -go_repository( - name = "io_kubevirt_client_go", - importpath = "kubevirt.io/client-go", - sum = "h1:Twh3JdWUptj1TIs5sI+jwDvcUXaCL2lsfF9PLZoCw7s=", - version = "v0.42.1", -) - -go_repository( - name = "io_kubevirt_containerized_data_importer", - importpath = "kubevirt.io/containerized-data-importer", - sum = "h1:BrvtyeHdRWINSi+dQM46hxduUr4UwdEdwdYdX6okR14=", - version = "v1.34.0", -) - -go_repository( - name = "io_kubevirt_containerized_data_importer_api", - importpath = "kubevirt.io/containerized-data-importer-api", - sum = "h1:SkqNC3Ccb3rv8vVvrwu/DPYK59cKOp7agC3WfSjwzPU=", - version = "v1.44.0", -) - -go_repository( - name = "io_kubevirt_controller_lifecycle_operator_sdk", - importpath = "kubevirt.io/controller-lifecycle-operator-sdk", - sum = "h1:auv8LrA7gnLfQREnlGVPwgJpTxOEgnw4+mzXlUqKTxY=", - version = "v0.2.3", -) - -go_repository( - name = "io_kubevirt_qe_tools", - importpath = "kubevirt.io/qe-tools", - sum = "h1:S6z9CATmgV2/z9CWetij++Rhu7l/Z4ObZqerLdNMo0Y=", - version = "v0.1.6", -) - -go_repository( - name = "io_opencensus_go", - importpath = "go.opencensus.io", - sum = "h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto=", - version = "v0.22.4", -) - -go_repository( - name = "io_rsc_binaryregexp", - importpath = "rsc.io/binaryregexp", - sum = "h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE=", - version = "v0.2.0", -) - -go_repository( - name = "io_rsc_quote_v3", - importpath = "rsc.io/quote/v3", - sum = "h1:9JKUTTIUgS6kzR9mK1YuGKv6Nl+DijDNIc0ghT58FaY=", - version = "v3.1.0", -) - -go_repository( - name = "io_rsc_sampler", - importpath = "rsc.io/sampler", - sum = "h1:7uVkIFmeBqHfdjD+gZwtXXI+RODJ2Wc4O7MPEh/QiW4=", - version = "v1.3.0", -) - -go_repository( - name = "ml_vbom_util", - importpath = "vbom.ml/util", - sum = "h1:O69FD9pJA4WUZlEwYatBEEkRWKQ5cKodWpdKTrCS/iQ=", - version = "v0.0.0-20180919145318-efcd4e0f9787", -) - -go_repository( - name = "org_bitbucket_ww_goautoneg", - importpath = "bitbucket.org/ww/goautoneg", - replace = "github.com/markusthoemmes/goautoneg", - sum = "h1:Qhv4Ni88zV+8TY65yr2ak8xU4sblgs6aRT9RuGM5SNU=", - version = "v0.0.0-20190713162725-c6008fefa5b1", -) - -go_repository( - name = "org_golang_google_api", - importpath = "google.golang.org/api", - sum = "h1:yfrXXP61wVuLb0vBcG6qaOoIoqYEzOQS8jum51jkv2w=", - version = "v0.30.0", -) - -go_repository( - name = "org_golang_google_appengine", - importpath = "google.golang.org/appengine", - sum = "h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc=", - version = "v1.6.6", -) - -go_repository( - name = "org_golang_google_genproto", - importpath = "google.golang.org/genproto", - sum = "h1:PDIOdWxZ8eRizhKa1AAvY53xsvLB1cWorMjslvY3VA8=", - version = "v0.0.0-20200825200019-8632dd797987", -) - -go_repository( - name = "org_golang_google_grpc", - importpath = "google.golang.org/grpc", - sum = "h1:T7P4R73V3SSDPhH7WW7ATbfViLtmamH0DKrP3f9AuDI=", - version = "v1.31.0", -) - -go_repository( - name = "org_golang_google_protobuf", - importpath = "google.golang.org/protobuf", - sum = "h1:7QnIQpGRHE5RnLKnESfDoxm2dTapTZua5a0kS0A+VXQ=", - version = "v1.26.0-rc.1", -) - -go_repository( - name = "org_golang_x_crypto", - importpath = "golang.org/x/crypto", - sum = "h1:hb9wdF1z5waM+dSIICn1l0DkLVDT3hqhhQsDNUmHPRE=", - version = "v0.0.0-20201002170205-7f63de1d35b0", -) - -go_repository( - name = "org_golang_x_exp", - importpath = "golang.org/x/exp", - sum = "h1:QE6XYQK6naiK1EPAe1g/ILLxN5RBoH5xkJk3CqlMI/Y=", - version = "v0.0.0-20200224162631-6cc2880d07d6", -) - -go_repository( - name = "org_golang_x_image", - importpath = "golang.org/x/image", - sum = "h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4=", - version = "v0.0.0-20190802002840-cff245a6509b", -) - -go_repository( - name = "org_golang_x_lint", - importpath = "golang.org/x/lint", - sum = "h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k=", - version = "v0.0.0-20200302205851-738671d3881b", -) - -go_repository( - name = "org_golang_x_mobile", - importpath = "golang.org/x/mobile", - sum = "h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs=", - version = "v0.0.0-20190719004257-d2bd2a29d028", -) - -go_repository( - name = "org_golang_x_mod", - importpath = "golang.org/x/mod", - sum = "h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=", - version = "v0.3.0", -) - -go_repository( - name = "org_golang_x_net", - importpath = "golang.org/x/net", - sum = "h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME=", - version = "v0.0.0-20201110031124-69a78807bb2b", -) - -go_repository( - name = "org_golang_x_oauth2", - importpath = "golang.org/x/oauth2", - sum = "h1:ld7aEMNHoBnnDAX15v1T6z31v8HwR2A9FYOuAhWqkwc=", - version = "v0.0.0-20200902213428-5d25da1a8d43", -) - -go_repository( - name = "org_golang_x_sync", - importpath = "golang.org/x/sync", - sum = "h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=", - version = "v0.0.0-20201207232520-09787c993a3a", -) - -go_repository( - name = "org_golang_x_sys", - importpath = "golang.org/x/sys", - sum = "h1:JWgyZ1qgdTaF3N3oxC+MdTV7qvEEgHo3otj+HB5CM7Q=", - version = "v0.0.0-20210603081109-ebe580a85c40", -) - -go_repository( - name = "org_golang_x_text", - importpath = "golang.org/x/text", - sum = "h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=", - version = "v0.3.3", -) - -go_repository( - name = "org_golang_x_time", - importpath = "golang.org/x/time", - sum = "h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs=", - version = "v0.0.0-20191024005414-555d28b269f0", -) - -go_repository( - name = "org_golang_x_tools", - importpath = "golang.org/x/tools", - sum = "h1:CB3a9Nez8M13wwlr/E2YtwoU+qYHKfC+JrDa45RXXoQ=", - version = "v0.0.0-20210106214847-113979e3529a", -) - -go_repository( - name = "org_golang_x_xerrors", - importpath = "golang.org/x/xerrors", - sum = "h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=", - version = "v0.0.0-20200804184101-5ec99f83aff1", -) - -go_repository( - name = "org_gonum_v1_gonum", - importpath = "gonum.org/v1/gonum", - sum = "h1:2qZ38BsejXrhuetzb8UxucqrWDZKjypFSZA82hLCpZ4=", - version = "v0.0.0-20190710053202-4340aa3071a0", -) - -go_repository( - name = "org_gonum_v1_netlib", - importpath = "gonum.org/v1/netlib", - sum = "h1:OE9mWmgKkjJyEmDAAtGMPjXu+YNeGvK9VTSHY6+Qihc=", - version = "v0.0.0-20190313105609-8cb42192e0e0", -) - -go_repository( - name = "org_libvirt_libvirt_go_xml", - importpath = "libvirt.org/libvirt-go-xml", - sum = "h1:OjqCuSgsfv+Ig3x8Xt7P8rBM2lNCA69eMaID45LeH48=", - version = "v6.6.0+incompatible", -) - -go_repository( - name = "org_uber_go_atomic", - importpath = "go.uber.org/atomic", - sum = "h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk=", - version = "v1.6.0", -) - -go_repository( - name = "org_uber_go_multierr", - importpath = "go.uber.org/multierr", - sum = "h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A=", - version = "v1.5.0", -) - -go_repository( - name = "org_uber_go_tools", - importpath = "go.uber.org/tools", - sum = "h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4=", - version = "v0.0.0-20190618225709-2cfd321de3ee", -) - -go_repository( - name = "org_uber_go_zap", - importpath = "go.uber.org/zap", - sum = "h1:nYDKopTbvAPq/NrUVZwT15y2lpROBiLLyoRTbXOYWOo=", - version = "v1.14.1", -) - -go_repository( - name = "tools_gotest", - importpath = "gotest.tools", - sum = "h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=", - version = "v2.2.0+incompatible", -) - -go_repository( - name = "tools_gotest_v3", - importpath = "gotest.tools/v3", - sum = "h1:kG1BFyqVHuQoVQiR1bWGnfz/fmHvvuiSPIV7rvl360E=", - version = "v3.0.2", -) - -go_repository( - name = "xyz_gomodules_jsonpatch_v2", - importpath = "gomodules.xyz/jsonpatch/v2", - sum = "h1:xyiBuvkD2g5n7cYzx6u2sxQvsAy4QJsZFCzGVdzOXZ0=", - version = "v2.0.1", -) - -go_rules_dependencies() - -# NOTE: Keep the version in sync with Go toolchain in GitHub action. -go_register_toolchains(version = "1.21.9") - -# override rules_docker issue with this dependency -# rules_docker 0.16 uses 0.1.4, bit since there the checksum changed, which is very weird, going with 0.1.4.1 to -go_repository( - name = "com_github_google_go_containerregistry", - importpath = "github.com/google/go-containerregistry", - sha256 = "bc0136a33f9c1e4578a700f7afcdaa1241cfff997d6bba695c710d24c5ae26bd", - strip_prefix = "google-go-containerregistry-efb2d62", - type = "tar.gz", - urls = ["https://api.github.com/repos/google/go-containerregistry/tarball/efb2d62d93a7705315b841d0544cb5b13565ff2a"], # v0.1.4.1 -) - -# All dependencies defined with go_repository should be above -# gazelle_dependencies. Otherwise dependencies defined by Gazelle would be used -# because the first definitions of external repository wins. -gazelle_dependencies() - -load( - "@io_bazel_rules_docker//container:container.bzl", - "container_pull", -) -load( - "@io_bazel_rules_docker//repositories:repositories.bzl", - container_repositories = "repositories", -) - -container_repositories() - -container_pull( - name = "centos-stream-9", - registry = "quay.io", - repository = "centos/centos", - tag = "stream9", -) - -container_pull( - name = "ubi9-minimal", - registry = "registry.access.redhat.com", - repository = "ubi9/ubi-minimal", - tag = "latest", -) - -container_pull( - name = "ansible-operator", - registry = "quay.io", - repository = "operator-framework/ansible-operator", - tag = "main", -) - -container_pull( - name = "opm-image", - # v1.43.1 - digest = "sha256:dbeedc2489e6a971bcc2640b582482059938f6c1e14446db5fdb6f6c02aa01d5", - registry = "quay.io", - repository = "operator-framework/opm", -) - -http_file( - name = "opa", - downloaded_file_path = "opa", - executable = True, - sha256 = "cd6b0b2d762571a746f0261890b155e6dd71cca90dad6b42b6fcf6dd7f619f08", - urls = ["https://openpolicyagent.org/downloads/v0.65.0/opa_linux_amd64_static"], -) - -http_file( - name = "kustomize", - downloaded_file_path = "kustomize.tar.gz", - sha256 = "3ab32f92360d752a2a53e56be073b649abc1e7351b912c0fb32b960d1def854c", - urls = [ - "https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v5.3.0/kustomize_v5.3.0_linux_amd64.tar.gz", - ], -) - -http_file( - name = "operator-sdk", - downloaded_file_path = "operator-sdk", - executable = True, - sha256 = "90ac1ed961585f16ff60d5187fd29592e5af6db8d074e1db3fde02d4145ff3fd", - urls = ["https://github.com/operator-framework/operator-sdk/releases/download/v1.34.2/operator-sdk_linux_amd64"], -) - -http_file( - name = "opm", - downloaded_file_path = "opm", - executable = True, - sha256 = "2afbcd0728f61d07502c67b0bd36ff6f7521f1a629ff4e23ff13a59dec93eeb0", - urls = ["https://github.com/operator-framework/operator-registry/releases/download/v1.43.1/linux-amd64-opm"], -) - -http_archive( - name = "bazeldnf", - sha256 = "de8ac0519db6c02bed2a976885379d97dc52f46d52b0338e03963def5c2b65fb", - urls = [ - "https://github.com/rmohr/bazeldnf/releases/download/v0.5.7-rc1/bazeldnf-v0.5.7-rc1.tar.gz", - ], -) - -load( - "@io_bazel_rules_go//go:deps.bzl", - "go_register_toolchains", - "go_rules_dependencies", -) -load("@bazeldnf//:deps.bzl", "bazeldnf_dependencies", "rpm") - -bazeldnf_dependencies() - -http_archive( - name = "rules_proto", - sha256 = "dc3fb206a2cb3441b485eb1e423165b231235a1ea9b031b4433cf7bc1fa460dd", - strip_prefix = "rules_proto-5.3.0-21.7", - urls = [ - "https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz", - ], -) - -load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") - -rules_proto_dependencies() - -rules_proto_toolchains() - -rpm( - name = "alternatives-0__1.24-2.el9.x86_64", - sha256 = "520c418f670fdd1735f2f605c6b62d2fb801501b5b5653a39d45a3dfd4411d45", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/alternatives-1.24-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "audit-libs-0__3.1.5-1.el9.x86_64", - sha256 = "c152e73767630f4781480c2866935dfc0991bd3da475e9507d016cc7f26da85c", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/audit-libs-3.1.5-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "basesystem-0__11-13.el9.x86_64", - sha256 = "2ea5b1c117cf96a8f0cdba2cf67776c2934c286e2107f8e6ba0357a63f947a03", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/basesystem-11-13.el9.noarch.rpm", - ], -) - -rpm( - name = "bash-0__5.1.8-9.el9.x86_64", - sha256 = "ef7898e1ad43e638d3cb336bb2fbfc4160203568c30a7e955a0317b9a35406a6", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/bash-5.1.8-9.el9.x86_64.rpm", - ], -) - -rpm( - name = "binutils-0__2.35.2-59.el9.x86_64", - sha256 = "1535bb31ef6b02ae628f82e05de480be4c3765ee0770a932a30d4da0e718ce5d", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/binutils-2.35.2-59.el9.x86_64.rpm", - ], -) - -rpm( - name = "binutils-gold-0__2.35.2-59.el9.x86_64", - sha256 = "21e709f93c9cea79bb357c8a845aa1e7b5b713ee8100e363a543da71dad9ef98", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/binutils-gold-2.35.2-59.el9.x86_64.rpm", - ], -) - -rpm( - name = "bzip2-libs-0__1.0.8-8.el9.x86_64", - sha256 = "339ff9bae82e635de5039bc6ff8be3130514d711f9b8e5a162e8e870fbfdfae2", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/bzip2-libs-1.0.8-8.el9.x86_64.rpm", - ], -) - -rpm( - name = "ca-certificates-0__2024.2.69_v8.0.303-91.4.el9.x86_64", - sha256 = "345cfd71983f45555db1f5c23e155f8f6720d640b68f54538c512cdc7b791432", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/ca-certificates-2024.2.69_v8.0.303-91.4.el9.noarch.rpm", - ], -) - -rpm( - name = "centos-gpg-keys-0__9.0-11.el9.x86_64", - sha256 = "72cba4981776b788dde10451dfd538df1651311ea30281108f6ac290f1d78ea5", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/centos-gpg-keys-9.0-11.el9.noarch.rpm", - ], -) - -rpm( - name = "centos-stream-release-0__9.0-11.el9.x86_64", - sha256 = "997fecdc6da163649356bdff0f33e4f00c114e09609d1d4288fc72d10bc188bf", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/centos-stream-release-9.0-11.el9.noarch.rpm", - ], -) - -rpm( - name = "centos-stream-repos-0__9.0-11.el9.x86_64", - sha256 = "bf73192c94f403df472a26c69ae20a27a5320df2e487ab38c207036cac536205", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/centos-stream-repos-9.0-11.el9.noarch.rpm", - ], -) - -rpm( - name = "cmake-filesystem-0__3.26.5-2.el9.x86_64", - sha256 = "8e398dd9ccda66f1b64951593600553a753dd554295869c6bcc9b42a5d9ca5a3", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/cmake-filesystem-3.26.5-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "coreutils-0__8.32-39.el9.x86_64", - sha256 = "65bf4800b76553a41df2a9fd56e55713bcbc3420202a859b7a14495f62fb8bbb", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/coreutils-8.32-39.el9.x86_64.rpm", - ], -) - -rpm( - name = "coreutils-common-0__8.32-39.el9.x86_64", - sha256 = "f2c46b1da2b96e60dc4c110324d6e7db298a1abad9b9021c41f2c16848f297de", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/coreutils-common-8.32-39.el9.x86_64.rpm", - ], -) - -rpm( - name = "cpp-0__11.5.0-2.el9.x86_64", - sha256 = "6d19aff72241ceefe83a3d029321b380b80f7d0267e1f8d28291b94b1daf7880", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/cpp-11.5.0-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "crypto-policies-0__20240828-2.git626aa59.el9.x86_64", - sha256 = "56dbf9c5d48f5b46ce4e39b4f2eff1d7e93901dea3b00cb9b62ebf84d905dba7", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/crypto-policies-20240828-2.git626aa59.el9.noarch.rpm", - ], -) - -rpm( - name = "cyrus-sasl-lib-0__2.1.27-21.el9.x86_64", - sha256 = "54c23bdba8e22e5dec8a9dc63036940c0fd41e31e12d54331e66ef65e2abe1ad", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/cyrus-sasl-lib-2.1.27-21.el9.x86_64.rpm", - ], -) - -rpm( - name = "elfutils-debuginfod-client-0__0.192-2.el9.x86_64", - sha256 = "cfb1bd0e86db824a1e6fdc7ac8d5e71838a4ac0ba6b1d98c3f3cafb3e08055f5", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/elfutils-debuginfod-client-0.192-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "elfutils-default-yama-scope-0__0.192-2.el9.x86_64", - sha256 = "cd3cff180d364bc84e17c84a969360fea7e62eb9aeacf7d7908b9321f530caf8", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/elfutils-default-yama-scope-0.192-2.el9.noarch.rpm", - ], -) - -rpm( - name = "elfutils-libelf-0__0.192-2.el9.x86_64", - sha256 = "027b982d474e68dc637c185afbbe313b4856fac8474ee0eade18f7a567f492b1", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/elfutils-libelf-0.192-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "elfutils-libs-0__0.192-2.el9.x86_64", - sha256 = "fbed57566983d09aed94a78e1f92b904f0f56a60c2086ffff26f079baac3c975", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/elfutils-libs-0.192-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "expat-0__2.5.0-4.el9.x86_64", - sha256 = "8fb6eed4945d4b10173031bb14a20083256259ad358ba0009f8c2dc4cd37536a", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/expat-2.5.0-4.el9.x86_64.rpm", - ], -) - -rpm( - name = "filesystem-0__3.16-5.el9.x86_64", - sha256 = "e3389fe64db8e7527873791f3d57b7ba5db47bc0a9661f187667c43e8dbb7b7d", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/filesystem-3.16-5.el9.x86_64.rpm", - ], -) - -rpm( - name = "gawk-0__5.1.0-6.el9.x86_64", - sha256 = "0119e036237ba549b66404b6107c02023896eaae4e08fda4b296dbe9fb59c8f3", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/gawk-5.1.0-6.el9.x86_64.rpm", - ], -) - -rpm( - name = "gcc-0__11.5.0-2.el9.x86_64", - sha256 = "ce12a9ca76e71fb4eecf4f5dd6b8f16528887b92e75405159cc7a0e93b6787c7", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/gcc-11.5.0-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "gdbm-libs-1__1.23-1.el9.x86_64", - sha256 = "adbdf6d81052d0cdc95fbdd5e5d456fe9a268cf1a35edf347ffea1271b11c86f", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/gdbm-libs-1.23-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "glib2-0__2.68.4-16.el9.x86_64", - sha256 = "8b7662306f8e4dad2083e2a5c684818aafe498052ca6f0c978d84b91a3dfb523", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/glib2-2.68.4-16.el9.x86_64.rpm", - ], -) - -rpm( - name = "glibc-0__2.34-148.el9.x86_64", - sha256 = "b96a9c1f5b320d5480074dda01a881229e1edde0d7af02267f8b8d3c4c9665c0", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/glibc-2.34-148.el9.x86_64.rpm", - ], -) - -rpm( - name = "glibc-common-0__2.34-148.el9.x86_64", - sha256 = "6ca6ea312e24a25bffc72aa9c958600e305f81b426748947b2d37a2d6a049f34", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/glibc-common-2.34-148.el9.x86_64.rpm", - ], -) - -rpm( - name = "glibc-devel-0__2.34-148.el9.x86_64", - sha256 = "33d280899990698025791cd28bf5e7715fdeb75b81d273f120e93d0e8fbc734b", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/glibc-devel-2.34-148.el9.x86_64.rpm", - ], -) - -rpm( - name = "glibc-headers-0__2.34-148.el9.x86_64", - sha256 = "016bf8f07cc66e59192ce865e2d7ec58b91c849486e23a4717c7c1aa35bf33f5", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/glibc-headers-2.34-148.el9.x86_64.rpm", - ], -) - -rpm( - name = "glibc-langpack-ayc-0__2.34-148.el9.x86_64", - sha256 = "294e296a6ff4d6fea44a639ae4421f97359e873b4024cbe83e06dedb7c1071ad", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/glibc-langpack-ayc-2.34-148.el9.x86_64.rpm", - ], -) - -rpm( - name = "gmp-1__6.2.0-13.el9.x86_64", - sha256 = "932d8eb40b6b66bf6f54d95b8aa70c9f749951f719591f0b242753a60aef4b2b", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/gmp-6.2.0-13.el9.x86_64.rpm", - ], -) - -rpm( - name = "gnutls-0__3.8.3-4.el9.x86_64", - sha256 = "feaaa4dcb80f6433fedb61c5fc3870134faaf40656e028006731ea421b754328", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/gnutls-3.8.3-4.el9.x86_64.rpm", - ], -) - -rpm( - name = "grep-0__3.6-5.el9.x86_64", - sha256 = "1b77e1fc2072e009f6d2eb6216192e487cdae4d18dcd7063882319dbcc03861e", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/grep-3.6-5.el9.x86_64.rpm", - ], -) - -rpm( - name = "json-c-0__0.14-11.el9.x86_64", - sha256 = "1a0049dbf91fd27841da0b26187943baec0a5b3ec11cec415b715c03e4c13d72", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/json-c-0.14-11.el9.x86_64.rpm", - ], -) - -rpm( - name = "kernel-headers-0__5.14.0-547.el9.x86_64", - sha256 = "8f02a20bf391f0dedb9c5954cff4339db749dd9a3cd67c5286854c8e8bd09299", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/kernel-headers-5.14.0-547.el9.x86_64.rpm", - ], -) - -rpm( - name = "keyutils-libs-0__1.6.3-3.el9.x86_64", - sha256 = "82917d32c6595cb27364003c481425dbba510b22be28a9f532afe8581ae0d615", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/keyutils-libs-1.6.3-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "krb5-libs-0__1.21.1-4.el9.x86_64", - sha256 = "5e97e752a5968684bf32eef3ff6f0f6eb9af83c177403a37dc5869a8674b1799", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/krb5-libs-1.21.1-4.el9.x86_64.rpm", - ], -) - -rpm( - name = "libacl-0__2.3.1-4.el9.x86_64", - sha256 = "e00201fc534d05ad3d3243ab400e6c15983aa5c0a3996d344dc016f7ec937abc", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libacl-2.3.1-4.el9.x86_64.rpm", - ], -) - -rpm( - name = "libaio-0__0.3.111-13.el9.x86_64", - sha256 = "96b8c1b764cc383db3661f1a9544bab7e59ee914da400857054f0ad1f6eb1742", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libaio-0.3.111-13.el9.x86_64.rpm", - ], -) - -rpm( - name = "libattr-0__2.5.1-3.el9.x86_64", - sha256 = "b51006462a9feccf792430bab9dbc5e5933638bc91af7c0ac35c6529c9ea4a55", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libattr-2.5.1-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "libblkid-0__2.37.4-20.el9.x86_64", - sha256 = "b980b5b7115f03d7fca51a87084911afba3af759e3caa77838a813ea4813ad35", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libblkid-2.37.4-20.el9.x86_64.rpm", - ], -) - -rpm( - name = "libbrotli-0__1.0.9-7.el9.x86_64", - sha256 = "feb64b4ee0b6c70e2df46555629e3399b602f7c6740c3012b6dce86fded2ede9", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libbrotli-1.0.9-7.el9.x86_64.rpm", - ], -) - -rpm( - name = "libcap-0__2.48-9.el9.x86_64", - sha256 = "efb63957e8566a66e2b8b0b9b37e9d6e339b586887c16d878113613d6e3c792b", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libcap-2.48-9.el9.x86_64.rpm", - ], -) - -rpm( - name = "libcap-ng-0__0.8.2-7.el9.x86_64", - sha256 = "84a21c19d507bbbb6049f771b5a11e28522c9522e414e6323cd92c1f6c12cbf5", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libcap-ng-0.8.2-7.el9.x86_64.rpm", - ], -) - -rpm( - name = "libcom_err-0__1.46.5-6.el9.x86_64", - sha256 = "74117bc5982f730c0e02c67af2a02e59fdffbfed4c8b08474ce87438cfaa7f47", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libcom_err-1.46.5-6.el9.x86_64.rpm", - ], -) - -rpm( - name = "libcurl-0__7.76.1-31.el9.x86_64", - sha256 = "555b75b749d4feaf74b0e6d8e754353ac2feb99888d622705a90aa0448f070b3", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libcurl-7.76.1-31.el9.x86_64.rpm", - ], -) - -rpm( - name = "libcurl-devel-0__7.76.1-31.el9.x86_64", - sha256 = "801b52f1a69bab444ff53cab2f5694768f0eef8bb2ba1e5615057e4637dc2b2b", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/libcurl-devel-7.76.1-31.el9.x86_64.rpm", - ], -) - -rpm( - name = "libevent-0__2.1.12-8.el9.x86_64", - sha256 = "990a9418915ea2ad3e2602e57d16c8cd3018dbd3872ee10f3ac6d8596c2291f0", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libevent-2.1.12-8.el9.x86_64.rpm", - ], -) - -rpm( - name = "libffi-0__3.4.2-8.el9.x86_64", - sha256 = "7107f69df5163e58e1c3757f6c7229bb68bafe50ea9a5d0bc3e84506190c4794", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libffi-3.4.2-8.el9.x86_64.rpm", - ], -) - -rpm( - name = "libgcc-0__11.5.0-2.el9.x86_64", - sha256 = "72c142d95964627ba7d9119341b3764a71249da644e62fe6070798dc72c6b27e", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libgcc-11.5.0-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "libgomp-0__11.5.0-2.el9.x86_64", - sha256 = "bb7423f44ec4cd27b9d76105a426146c988caf22b62cfdf2b3f18597e8f6233b", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libgomp-11.5.0-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "libidn2-0__2.3.0-7.el9.x86_64", - sha256 = "e2183f1db43a2d9cb6c4b350d7e488da09c823d33177ab9f94464e9685b684d6", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libidn2-2.3.0-7.el9.x86_64.rpm", - ], -) - -rpm( - name = "libmount-0__2.37.4-20.el9.x86_64", - sha256 = "562bb6596fc1558cc5d2a8143b9fca71728f0a728f402842981d6a6c4e19846b", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libmount-2.37.4-20.el9.x86_64.rpm", - ], -) - -rpm( - name = "libmpc-0__1.2.1-4.el9.x86_64", - sha256 = "39e1496f4b848437043224fa9bc223a03733a7be3f4c7c9cc74eb1d8b81d9b06", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/libmpc-1.2.1-4.el9.x86_64.rpm", - ], -) - -rpm( - name = "libnghttp2-0__1.43.0-6.el9.x86_64", - sha256 = "f081b41a0063262e4f05e63c4dbc317c63abc8c5dc8c568ad13dfb3c3d24f140", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libnghttp2-1.43.0-6.el9.x86_64.rpm", - ], -) - -rpm( - name = "libpkgconf-0__1.7.3-10.el9.x86_64", - sha256 = "482e1e6f3bb6765c83ff8c813c3cc7fc06ae40d58759f52b2a4b1d41f63011cc", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libpkgconf-1.7.3-10.el9.x86_64.rpm", - ], -) - -rpm( - name = "libpsl-0__0.21.1-5.el9.x86_64", - sha256 = "d907915a6f01f78919e385ce4e3f4ddc3a644f48049a35721d864954d5eb9680", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libpsl-0.21.1-5.el9.x86_64.rpm", - ], -) - -rpm( - name = "libselinux-0__3.6-1.el9.x86_64", - sha256 = "f81fcfdf9c30fcf8dfd54c1906976c0390e6472b6cb37fe95d80d63a1b0ab7e3", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libselinux-3.6-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "libsemanage-0__3.6-3.el9.x86_64", - sha256 = "802bcae31f9a8c7ced42c6c71d60ffd870e5b0e8d4ccf77583dd8cb3a7f9e960", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libsemanage-3.6-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "libsepol-0__3.6-2.el9.x86_64", - sha256 = "e34f37b9627571e18307776138a208a451f48643ec20279cc09fd94abc7a9ec3", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libsepol-3.6-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "libsigsegv-0__2.13-4.el9.x86_64", - sha256 = "f3ee877e3dd76f61587d2e4687a033bc7b0d7138b2f84cf0f1af62efb748777b", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libsigsegv-2.13-4.el9.x86_64.rpm", - ], -) - -rpm( - name = "libssh-0__0.10.4-13.el9.x86_64", - sha256 = "9b6e56105ea9077d005d400dab609b5eb866521d76bb8d1b240c08a50a23e0ce", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libssh-0.10.4-13.el9.x86_64.rpm", - ], -) - -rpm( - name = "libssh-config-0__0.10.4-13.el9.x86_64", - sha256 = "8164abb5201d80698301d48e9c284c8ed01c6599b6f37c59faadb6482f6db76f", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libssh-config-0.10.4-13.el9.noarch.rpm", - ], -) - -rpm( - name = "libstdc__plus____plus__-0__11.5.0-2.el9.x86_64", - sha256 = "65e3a8674b62fade64c6d293caef93d694bace34d9e3e50014a1a11ce813dc00", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libstdc++-11.5.0-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "libtasn1-0__4.16.0-8.el9.x86_64", - sha256 = "926cb611745095f3c1a75acb7b090ab906d4c5e22d2d8e8c34fc15398f177e55", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libtasn1-4.16.0-8.el9.x86_64.rpm", - ], -) - -rpm( - name = "libtool-ltdl-0__2.4.6-46.el9.x86_64", - sha256 = "c195e9981376059479ecb8864a400e7eb5c9b70446b46d0ba39a473ae476a793", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libtool-ltdl-2.4.6-46.el9.x86_64.rpm", - ], -) - -rpm( - name = "libunistring-0__0.9.10-15.el9.x86_64", - sha256 = "42f4771c9226b8c14f83801deb383f41b3675174026ca66e14b0502d5b4ac949", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libunistring-0.9.10-15.el9.x86_64.rpm", - ], -) - -rpm( - name = "liburing-0__2.5-1.el9.x86_64", - sha256 = "dbeb30f4333754b3d7f16a984a3e663c3e20f2c2fc34717037aa9b875a4f2de6", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/liburing-2.5-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "libuuid-0__2.37.4-20.el9.x86_64", - sha256 = "880975f7b3ab5244889357ee328e7befd0b9f8231c60f277039346ccc54c99ce", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libuuid-2.37.4-20.el9.x86_64.rpm", - ], -) - -rpm( - name = "libverto-0__0.3.2-3.el9.x86_64", - sha256 = "83d6e258d8d4e021e339ad8b7a03c68e136285f740939446ec2795edbdc5e922", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libverto-0.3.2-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "libxcrypt-0__4.4.18-3.el9.x86_64", - sha256 = "b07e135ce7cea03dd1ba3205606e0d4d42a51d1249a708b804521cfe3bc3454d", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libxcrypt-4.4.18-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "libxcrypt-devel-0__4.4.18-3.el9.x86_64", - sha256 = "4289873ed55d6a000381ce1c904fdb0d4a0c7566d6119d950ed299c2626e1893", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/libxcrypt-devel-4.4.18-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "libxml2-0__2.9.13-6.el9.x86_64", - sha256 = "f7c7e3a76a247f4106fc1cbbb5d170d993ad6fe7b1d27c7cee30d4048c3cb2d2", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libxml2-2.9.13-6.el9.x86_64.rpm", - ], -) - -rpm( - name = "libxml2-devel-0__2.9.13-6.el9.x86_64", - sha256 = "e29caaa4ab1851eb05739895fa9706fa7d33dee3bae2dd03781257f7ffb98b74", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/libxml2-devel-2.9.13-6.el9.x86_64.rpm", - ], -) - -rpm( - name = "libzstd-0__1.5.5-1.el9.x86_64", - sha256 = "e3f52d56336121674b4a6ae7e0b935d73ce88063322576504872a787e81acbdb", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libzstd-1.5.5-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "make-1__4.3-8.el9.x86_64", - sha256 = "cf9c9f6912190a2849ed7a3474ef06e20b572a2180ec3176c46d256a81bc5bb3", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/make-4.3-8.el9.x86_64.rpm", - ], -) - -rpm( - name = "mpfr-0__4.1.0-7.el9.x86_64", - sha256 = "ad4526486c80739698dee8604a62c4d3953a6c030c23e30b368f44674a257dfb", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/mpfr-4.1.0-7.el9.x86_64.rpm", - ], -) - -rpm( - name = "ncurses-base-0__6.2-10.20210508.el9.x86_64", - sha256 = "3ccbaa39db3cc8ae78f9da42cab3859d0cdb302dd947cdebdb83a702e89074cf", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/ncurses-base-6.2-10.20210508.el9.noarch.rpm", - ], -) - -rpm( - name = "ncurses-libs-0__6.2-10.20210508.el9.x86_64", - sha256 = "c130660ede7c78b7b759d9752a68c5a1ebab8cc16b361450f8b3ab2003d63320", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/ncurses-libs-6.2-10.20210508.el9.x86_64.rpm", - ], -) - -rpm( - name = "nettle-0__3.9.1-1.el9.x86_64", - sha256 = "ecde91b76480ddcf0e617f99d41865e80ff91d345bb051a92dcd1fe9fb373ba9", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/nettle-3.9.1-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "numactl-libs-0__2.0.19-1.el9.x86_64", - sha256 = "d751f16b33606f36b2b03df28cacffda69c3419fe7579dbffbf23c363c7051db", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/numactl-libs-2.0.19-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "openldap-0__2.6.8-3.el9.x86_64", - sha256 = "045f7ccfe4a0eb79e5cdfcea1c303489e29752424fa202d5534dbb6c46e18d84", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/openldap-2.6.8-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "openssl-devel-1__3.2.2-6.el9.x86_64", - sha256 = "20d466d1e8e98c5dcaf8f298e49fb22f7982c04cdbe8dc0608343f1c10de9efe", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/openssl-devel-3.2.2-6.el9.x86_64.rpm", - ], -) - -rpm( - name = "openssl-libs-1__3.2.2-6.el9.x86_64", - sha256 = "41e49b8db457814f4935a92b874b3a379126bad665516335485c9477a41ebf8b", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/openssl-libs-3.2.2-6.el9.x86_64.rpm", - ], -) - -rpm( - name = "p11-kit-0__0.25.3-3.el9.x86_64", - sha256 = "7d8718bc957160706c8c55c476f8725bfc12718c489623fadf858b6af21acd78", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/p11-kit-0.25.3-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "p11-kit-trust-0__0.25.3-3.el9.x86_64", - sha256 = "048514ec9a196d4e0189e6dc27184e3ee8cc86591da27a9abf443d2b89ffe27d", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/p11-kit-trust-0.25.3-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "pcre-0__8.44-4.el9.x86_64", - sha256 = "8de7ca63e65ae5b063c37e5a1de1e7024e5b74024df170362e807b05f505eadc", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/pcre-8.44-4.el9.x86_64.rpm", - ], -) - -rpm( - name = "pcre2-0__10.40-6.el9.x86_64", - sha256 = "89ddfdc4ef6df4e623ae20be1d9d3407ac56ba77aaf590e211d5790ce307fe66", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/pcre2-10.40-6.el9.x86_64.rpm", - ], -) - -rpm( - name = "pcre2-syntax-0__10.40-6.el9.x86_64", - sha256 = "63813c993604e0625dede1c0f6dce0ac49e68a2f0c229c5492dd6cb8e059a9df", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/pcre2-syntax-10.40-6.el9.noarch.rpm", - ], -) - -rpm( - name = "pkgconf-0__1.7.3-10.el9.x86_64", - sha256 = "14c0ce0c3c7be16732e16ea0122a2f5eed652a9ec915f739d83fd5c76872cb60", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/pkgconf-1.7.3-10.el9.x86_64.rpm", - ], -) - -rpm( - name = "pkgconf-m4-0__1.7.3-10.el9.x86_64", - sha256 = "f670513f9304c282c08672407a80874b15307e5d1f23dfbd344fddd462e1b3b8", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/pkgconf-m4-1.7.3-10.el9.noarch.rpm", - ], -) - -rpm( - name = "pkgconf-pkg-config-0__1.7.3-10.el9.x86_64", - sha256 = "4cbc37f3776574da72a96d836bcdc7974b92ea3705d920ab1d976074d5b689af", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/pkgconf-pkg-config-1.7.3-10.el9.x86_64.rpm", - ], -) - -rpm( - name = "publicsuffix-list-dafsa-0__20210518-3.el9.x86_64", - sha256 = "cf13c91ecf9f734a7d2d3ae757c041ebdb7c4e2c7298733d74d4d87c3fd995a6", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/publicsuffix-list-dafsa-20210518-3.el9.noarch.rpm", - ], -) - -rpm( - name = "python3-0__3.9.21-1.el9.x86_64", - sha256 = "b6738dbf4f75a355efbb527fe83c3614410d7261496bfc52d547de874e218380", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/python3-3.9.21-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "python3-devel-0__3.9.21-1.el9.x86_64", - sha256 = "2dad694985c921d05fc07eb8dc779c59d9f6fe6196642255f0a0307dc1b1ca7f", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/python3-devel-3.9.21-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "python3-libs-0__3.9.21-1.el9.x86_64", - sha256 = "db543f4739f27ad3dce37e1e7ee613dd7ca9abb0ab7439506c87dbcf5a3cad11", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/python3-libs-3.9.21-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "python3-pip-0__21.3.1-1.el9.x86_64", - sha256 = "5c552404c6812cf6a2cdb130da36231a91b3924d5771d854f2489d429b1d04f9", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/python3-pip-21.3.1-1.el9.noarch.rpm", - ], -) - -rpm( - name = "python3-pip-wheel-0__21.3.1-1.el9.x86_64", - sha256 = "51c88553dff297396e6bf3494474cc88af1bceebc0e78fb45f02a4167777319e", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/python3-pip-wheel-21.3.1-1.el9.noarch.rpm", - ], -) - -rpm( - name = "python3-setuptools-wheel-0__53.0.0-13.el9.x86_64", - sha256 = "ec13fb51bd6b970771abdd5d3cd11c55e64f9cf7a55f8e158d1e2157ecd04ffa", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/python3-setuptools-wheel-53.0.0-13.el9.noarch.rpm", - ], -) - -rpm( - name = "qemu-img-17__9.1.0-8.el9.x86_64", - sha256 = "221a5b734315e500d054ee4ace26e936dec4dc4bf8ff1cd3595f59773c220056", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/qemu-img-9.1.0-8.el9.x86_64.rpm", - ], -) - -rpm( - name = "readline-0__8.1-4.el9.x86_64", - sha256 = "7e43f8266c9bd4fe4df2798d23d5c6e529f93030b7ef27c0dfbb35fe1bf55f06", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/readline-8.1-4.el9.x86_64.rpm", - ], -) - -rpm( - name = "sed-0__4.8-9.el9.x86_64", - sha256 = "110db587738ad9dbf8aa5a9dd2f442b12d6e760697e0f94c0b7de57741cbbc0d", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/sed-4.8-9.el9.x86_64.rpm", - ], -) - -rpm( - name = "setup-0__2.13.7-10.el9.x86_64", - sha256 = "1afafe063300e6bbe84c953faf0082ac89c54cf95cf622b4db0b2ef68d013f02", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/setup-2.13.7-10.el9.noarch.rpm", - ], -) - -rpm( - name = "shadow-utils-2__4.9-12.el9.x86_64", - sha256 = "1ea6f8a4cfba1a7030c8f51137022bf71a0bd8585174cf6276bc62bb74abb09e", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/shadow-utils-4.9-12.el9.x86_64.rpm", - ], -) - -rpm( - name = "sqlite-libs-0__3.34.1-7.el9.x86_64", - sha256 = "5d1f3688c827ce01e84c06892a325b31a76de65613d7c0e867e321b7dcc45c68", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/sqlite-libs-3.34.1-7.el9.x86_64.rpm", - ], -) - -rpm( - name = "tzdata-0__2024b-3.el9.x86_64", - sha256 = "a8c85e9a3405997bc9a94e6458ae181b7a592b7f0e5561e90aca8e24c8b7b2f8", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/tzdata-2024b-3.el9.noarch.rpm", - ], -) - -rpm( - name = "xz-devel-0__5.2.5-8.el9.x86_64", - sha256 = "c9ba742f76b51daab90eb581de4c2a01623686fbbaaf87e59644b622d7e10fd7", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/xz-devel-5.2.5-8.el9.x86_64.rpm", - ], -) - -rpm( - name = "xz-libs-0__5.2.5-8.el9.x86_64", - sha256 = "2ad419ac36ffe4ba7ebc55372621db5a3ee497a96801a06ba8f7f020270ae851", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/xz-libs-5.2.5-8.el9.x86_64.rpm", - ], -) - -rpm( - name = "zlib-0__1.2.11-40.el9.x86_64", - sha256 = "4ed20865bc82692e597f350bb0cacfdcc3ebd347df5117ad3afcf8fdc5c43d79", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/zlib-1.2.11-40.el9.x86_64.rpm", - ], -) - -rpm( - name = "zlib-devel-0__1.2.11-40.el9.x86_64", - sha256 = "862c0a619524e03926ae6778dfc06f802327035ad72a2dc2b58517d009f5b234", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/zlib-devel-1.2.11-40.el9.x86_64.rpm", - ], -) diff --git a/build/forklift-api/Containerfile b/build/forklift-api/Containerfile index 058baf299..4c39c158b 100644 --- a/build/forklift-api/Containerfile +++ b/build/forklift-api/Containerfile @@ -3,13 +3,13 @@ WORKDIR /app COPY --chown=1001:0 ./ ./ ENV GOFLAGS "-mod=vendor -tags=strictfipsruntime" ENV GOEXPERIMENT strictfipsruntime -RUN GOOS=linux GOARCH=amd64 go build -buildvcs=false -ldflags="-w -s" -o forklift-api github.com/konveyor/forklift-controller/pkg/forklift-api +RUN GOOS=linux GOARCH=amd64 go build -buildvcs=false -ldflags="-w -s" -o forklift-api github.com/konveyor/forklift-controller/cmd/forklift-api FROM registry.access.redhat.com/ubi9-minimal:9.5-1733767867 # Required to be able to get files from within the pod RUN microdnf -y install tar && microdnf clean all - COPY --from=builder /app/forklift-api /usr/local/bin/forklift-api +RUN chmod +x /usr/local/bin/forklift-api ENTRYPOINT ["/usr/local/bin/forklift-api"] LABEL \ com.redhat.component="mtv-api-container" \ diff --git a/build/forklift-operator-bundle/Containerfile b/build/forklift-operator-bundle/Containerfile index 05456f07a..55876bb9c 100644 --- a/build/forklift-operator-bundle/Containerfile +++ b/build/forklift-operator-bundle/Containerfile @@ -1,25 +1,28 @@ FROM quay.io/konflux-ci/operator-sdk-builder@sha256:9f75516848faf6549f74213258f963869189283f47d1e0290ba5b170064a88a6 as builder ARG STREAM=downstream +ARG VERSION="2.7.0" -COPY ./. /repo -WORKDIR /repo/operator +COPY ./operator /repo +WORKDIR /repo RUN source ./export-vars-${STREAM}.sh && \ kustomize build config/manifests/ \ | envsubst \ | operator-sdk generate bundle \ -q \ --overwrite \ - --extra-service-accounts forklift-controller,forklift-api,forklift-populator-controller \ - --version 2.7.0 \ + --extra-service-accounts forklift-controller,forklift-api,forklift-populator-controller \ + --version $VERSION \ --channels development \ --default-channel development \ --output-dir build FROM scratch -COPY --from=builder /repo/operator/build/manifests /manifests/ -COPY --from=builder /repo/operator/build/metadata /metadata/ +ARG VERSION="2.7.0" + +COPY --from=builder /repo/build/manifests /manifests/ +COPY --from=builder /repo/build/metadata /metadata/ # These are three labels needed to control how the pipeline should handle this container image # This first label tells the pipeline that this is a bundle image and should be @@ -28,7 +31,6 @@ LABEL com.redhat.delivery.operator.bundle=true # This second label tells the pipeline which versions of OpenShift the operator supports. # This is used to control which index images should include this operator. -# TODO: move to 4.7 once available! LABEL com.redhat.openshift.versions="v4.14-v4.16" # This third label tells the pipeline that this operator should *also* be supported on OCP 4.4 and @@ -55,7 +57,6 @@ LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1 # Main labels LABEL \ com.redhat.component="mtv-operator-bundle-container" \ - version="2.7.0" \ name="migration-toolkit-virtualization/mtv-operator-bundle" \ License="Apache License 2.0" \ io.k8s.display-name="Migration Toolkit for Virtualization" \ @@ -68,4 +69,4 @@ LABEL \ distribution-scope="public" \ release="v2.7" \ url="https://github.com/kubev2v/forklift" \ - version="v2.7.1" + version="v$VERSION" diff --git a/build/forklift-operator-index/Containerfile b/build/forklift-operator-index/Containerfile new file mode 100644 index 000000000..50ae3e2ed --- /dev/null +++ b/build/forklift-operator-index/Containerfile @@ -0,0 +1,39 @@ +FROM quay.io/operator-framework/opm:latest AS +FROM registry.access.redhat.com/ubi9-minimal:9.5-1733767867 AS builder +ARG CHANNELS="development" +ARG DEFAULT_CHANNEL="development" +ARG VERSION="2.7.0" +ARG OPERATOR_BUNDLE_IMAGE +ARG OPM_OPTS + +RUN microdnf install gettext -y + +COPY --from=opm /bin/opm /bin/opm +COPY operator /app +WORKDIR /app + +RUN cat catalog/operator.yml | envsubst > operator.yaml +RUN opm render ${OPERATOR_BUNDLE_IMAGE} ${OPM_OPTS} -o yaml >> operator.yaml + + +FROM quay.io/operator-framework/opm:latest + +COPY --from=builder /app/operator.yaml /configs/operator.yaml + +CMD ["serve", "/configs"] +ENTRYPOINT ["/bin/opm"] + +# Main labels +LABEL \ + com.redhat.component="mtv-operator-index-container" \ + name="migration-toolkit-virtualization/mtv-operator-index" \ + License="Apache License 2.0" \ + io.k8s.display-name="Migration Toolkit for Virtualization" \ + io.openshift.tags="migration" \ + io.k8s.description="Migration Toolkit for Virtualization - Operator Index" \ + summary="Migration Toolkit for Virtualization - Operator Index" \ + maintainer="Migration Toolkit for Virtualization Team " \ + description="Migration Toolkit for Virtualization - Operator Index" \ + vendor="Red Hat, Inc." \ + distribution-scope="public" \ + url="https://github.com/kubev2v/forklift" \ diff --git a/build/forklift-operator/Containerfile b/build/forklift-operator/Containerfile index 9a45a3275..df182b097 100644 --- a/build/forklift-operator/Containerfile +++ b/build/forklift-operator/Containerfile @@ -8,8 +8,11 @@ USER root # RUN sed -i "s/resource, name = subresource\['name'\]\.split('\/')/resource, name = subresource['name']\.split('\/', 1)/" /usr/lib/python3.6/site-packages/openshift/dynamic/discovery.py USER 1001 +WORKDIR /app +COPY operator/requirements.yml requirements.yml COPY operator/watches.yaml watches.yaml COPY operator/roles roles +RUN ansible-galaxy collection install -r /app/requirements.yml LABEL \ com.redhat.component="mtv-operator-container" \ diff --git a/build/ovirt-populator/Containerfile-upstream b/build/ovirt-populator/Containerfile-upstream new file mode 100644 index 000000000..d7ef89bd3 --- /dev/null +++ b/build/ovirt-populator/Containerfile-upstream @@ -0,0 +1,27 @@ +FROM registry.access.redhat.com/ubi8/go-toolset:1.21.11-8.1724662611 AS builder +ENV GOPATH=$APP_ROOT +WORKDIR /app +COPY --chown=1001:0 ./ ./ +ENV GOFLAGS "-mod=vendor -tags=strictfipsruntime" +ENV GOEXPERIMENT strictfipsruntime + +RUN GOOS=linux GOARCH=amd64 go build -o ovirt-populator github.com/konveyor/forklift-controller/cmd/ovirt-populator + +FROM quay.io/centos/centos:stream9 +COPY --from=builder /app/ovirt-populator /usr/local/bin/ovirt-populator +RUN dnf install -y centos-release-ovirt45 +RUN dnf install -y python3-ovirt-engine-sdk4 ovirt-imageio-client && dnf clean all + +ENTRYPOINT ["/usr/local/bin/ovirt-populator"] +LABEL \ + com.redhat.component="forklift-ovirt-populator-container" \ + name="migration-toolkit-virtualization/forklift-ovirt-populator-rhel8" \ + license="Apache License 2.0" \ + io.k8s.display-name="Migration Toolkit for Virtualization" \ + io.k8s.description="Migration Toolkit for Virtualization - oVirt Populator" \ + io.openshift.tags="migration,mtv,forklift" \ + summary="Migration Toolkit for Virtualization - oVirt Populator" \ + description="Migration Toolkit for Virtualization - oVirt Populator" \ + vendor="Red Hat, Inc." \ + maintainer="Migration Toolkit for Virtualization Team " + diff --git a/build/validation/Containerfile b/build/validation/Containerfile index 7f948c7a4..c6648f8db 100644 --- a/build/validation/Containerfile +++ b/build/validation/Containerfile @@ -1,5 +1,6 @@ FROM registry.access.redhat.com/ubi9-minimal:9.5-1733767867 -RUN curl https://github.com/open-policy-agent/opa/releases/download/v0.62.1/opa_linux_amd64 -o /usr/bin/opa +RUN curl -L https://github.com/open-policy-agent/opa/releases/download/v0.62.1/opa_linux_amd64 > /usr/bin/opa +RUN chmod +x /usr/bin/opa COPY validation/policies /usr/share/opa/policies/ COPY validation/entrypoint.sh /usr/bin/ diff --git a/build/virt-v2v/Containerfile b/build/virt-v2v/Containerfile index 50b618084..d710e7402 100644 --- a/build/virt-v2v/Containerfile +++ b/build/virt-v2v/Containerfile @@ -67,6 +67,4 @@ LABEL \ vendor="Red Hat, Inc." \ maintainer="Migration Toolkit for Virtualization Team " \ distribution-scope="public" \ - release="v2.7" \ - url="https://github.com/kubev2v/forklift" \ - version="v2.7.1" + url="https://github.com/kubev2v/forklift" diff --git a/cmd/forklift-api/BUILD.bazel b/cmd/forklift-api/BUILD.bazel deleted file mode 100644 index 1d4da20b0..000000000 --- a/cmd/forklift-api/BUILD.bazel +++ /dev/null @@ -1,45 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") - -go_library( - name = "forklift-api-lib", - srcs = ["forklift-api.go"], - importpath = "github.com/konveyor/forklift-controller/cmd/forklift-api", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis", - "//pkg/forklift-api", - "//pkg/lib/logging", - "//vendor/github.com/go-logr/logr", - "//vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1:k8s_cni_cncf_io", - "//vendor/k8s.io/client-go/kubernetes/scheme", - "//vendor/k8s.io/client-go/rest", - "//vendor/k8s.io/client-go/tools/clientcmd/api", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/log", - ], -) - -go_binary( - name = "forklift-api", - embed = [":forklift-api-lib"], - visibility = ["//visibility:public"], -) - -load( - "@io_bazel_rules_docker//container:container.bzl", - "container_image", -) - -container_image( - name = "forklift-api-image", - #architecture = select({ - # "@io_bazel_rules_go//go/platform:linux_arm64": "arm64", - # "//conditions:default": "amd64", - #}), - base = "@ubi9-minimal//image", - directory = "/usr/local/bin/", - entrypoint = ["/usr/local/bin/forklift-api"], - files = [":forklift-api"], - #user = "1001", - visibility = ["//visibility:public"], -) diff --git a/cmd/forklift-controller/BUILD.bazel b/cmd/forklift-controller/BUILD.bazel deleted file mode 100644 index a426dcb66..000000000 --- a/cmd/forklift-controller/BUILD.bazel +++ /dev/null @@ -1,54 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") - -go_binary( - name = "forklift-controller", - embed = [":forklift-controller_lib"], - #gotags = ["netgo"], - visibility = ["//visibility:public"], -) - -load( - "@io_bazel_rules_docker//container:container.bzl", - "container_image", -) - -container_image( - name = "forklift-controller-image", - base = "@ubi9-minimal//image", - directory = "/usr/local/bin/", - entrypoint = ["/usr/local/bin/forklift-controller"], - # workaround for github.com/bazelbuild/rules_go/issues/1706 - env = {"GODEBUG": "netdns=go"}, - files = [":forklift-controller"], - #user = "1001", - visibility = ["//visibility:public"], -) - -go_library( - name = "forklift-controller_lib", - srcs = ["main.go"], - importpath = "github.com/konveyor/forklift-controller/cmd/forklift-controller", - visibility = ["//visibility:private"], - deps = [ - "//pkg/apis", - "//pkg/controller", - "//pkg/lib/logging", - "//pkg/settings", - "//pkg/webhook", - "//vendor/github.com/go-logr/logr", - "//vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1:k8s_cni_cncf_io", - "//vendor/github.com/openshift/api/template/v1:template", - "//vendor/github.com/pkg/profile", - "//vendor/github.com/prometheus/client_golang/prometheus/promhttp", - "//vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp", - "//vendor/kubevirt.io/api/core/v1:core", - "//vendor/kubevirt.io/api/export/v1alpha1", - "//vendor/kubevirt.io/api/instancetype/v1beta1", - "//vendor/kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client/config", - "//vendor/sigs.k8s.io/controller-runtime/pkg/log", - "//vendor/sigs.k8s.io/controller-runtime/pkg/manager", - "//vendor/sigs.k8s.io/controller-runtime/pkg/manager/signals", - "//vendor/sigs.k8s.io/controller-runtime/pkg/metrics/server", - ], -) diff --git a/cmd/image-converter/BUILD.bazel b/cmd/image-converter/BUILD.bazel deleted file mode 100644 index bc837014b..000000000 --- a/cmd/image-converter/BUILD.bazel +++ /dev/null @@ -1,15 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") - -go_library( - name = "image-converter_lib", - srcs = ["image-converter.go"], - importpath = "github.com/konveyor/forklift-controller/cmd/image-converter", - visibility = ["//visibility:private"], - deps = ["//vendor/k8s.io/klog/v2:klog"], -) - -go_binary( - name = "image-converter", - embed = [":image-converter_lib"], - visibility = ["//visibility:public"], -) diff --git a/cmd/openstack-populator/BUILD.bazel b/cmd/openstack-populator/BUILD.bazel deleted file mode 100644 index a02fd9aec..000000000 --- a/cmd/openstack-populator/BUILD.bazel +++ /dev/null @@ -1,40 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") -load( - "@io_bazel_rules_docker//container:container.bzl", - "container_image", -) - -go_library( - name = "openstack-populator_lib", - srcs = ["openstack-populator.go"], - importpath = "github.com/konveyor/forklift-controller/cmd/openstack-populator", - visibility = ["//visibility:private"], - deps = [ - "//pkg/lib/client/openstack", - "//pkg/metrics", - "//vendor/github.com/prometheus/client_golang/prometheus", - "//vendor/github.com/prometheus/client_model/go", - "//vendor/k8s.io/klog/v2:klog", - ], -) - -go_binary( - name = "openstack-populator", - embed = [":openstack-populator_lib"], - visibility = ["//visibility:public"], -) - -container_image( - name = "openstack-populator-image", - base = "@ubi9-minimal//image", - directory = "/usr/local/bin/", - entrypoint = ["/usr/local/bin/openstack-populator"], - files = [":openstack-populator"], - visibility = ["//visibility:public"], -) - -go_test( - name = "openstack-populator_test", - srcs = ["openstack-populator_test.go"], - embed = [":openstack-populator_lib"], -) diff --git a/cmd/ova-provider-server/BUILD.bazel b/cmd/ova-provider-server/BUILD.bazel deleted file mode 100644 index c9e47148c..000000000 --- a/cmd/ova-provider-server/BUILD.bazel +++ /dev/null @@ -1,39 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") - -go_library( - name = "ova-provider-server_lib", - srcs = ["ova-provider-server.go"], - importpath = "github.com/konveyor/forklift-controller/cmd/ova-provider-server", - visibility = ["//visibility:private"], - deps = [ - "//pkg/lib/gob", - "//vendor/github.com/google/uuid", - ], -) - -go_binary( - name = "ova-provider-server", - embed = [":ova-provider-server_lib"], - visibility = ["//visibility:public"], -) - -load( - "@io_bazel_rules_docker//container:container.bzl", - "container_image", -) - -go_test( - name = "ova-provider-server_test", - srcs = ["nfs_test.go"], - embed = [":ova-provider-server_lib"], - deps = ["//vendor/github.com/onsi/gomega"], -) - -container_image( - name = "ova-provider-server-image", - base = "@ubi9-minimal//image", - directory = "/usr/local/bin/", - entrypoint = ["/usr/local/bin/ova-provider-server"], - files = [":ova-provider-server"], - visibility = ["//visibility:public"], -) diff --git a/cmd/ovirt-populator/BUILD.bazel b/cmd/ovirt-populator/BUILD.bazel deleted file mode 100644 index fa08b1f7a..000000000 --- a/cmd/ovirt-populator/BUILD.bazel +++ /dev/null @@ -1,194 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") -load( - "@io_bazel_rules_docker//container:container.bzl", - "container_image", - "container_layer", -) -load("@bazeldnf//:deps.bzl", "rpmtree") -load("@io_bazel_rules_docker//docker/util:run.bzl", "container_run_and_commit_layer") - -go_library( - name = "ovirt-populator_lib", - srcs = ["ovirt-populator.go"], - importpath = "github.com/konveyor/forklift-controller/cmd/ovirt-populator", - visibility = ["//visibility:private"], - deps = [ - "//pkg/metrics", - "//vendor/github.com/prometheus/client_golang/prometheus", - "//vendor/github.com/prometheus/client_model/go", - "//vendor/k8s.io/klog/v2:klog", - ], -) - -go_binary( - name = "ovirt-populator", - embed = [":ovirt-populator_lib"], - visibility = ["//visibility:public"], -) - -container_layer( - name = "base-layer", - tars = [ - ":deps", - ], -) - -container_image( - name = "base-image", - base = "@ubi9-minimal//image", - layers = [ - ":base-layer", - ], - visibility = ["//visibility:public"], -) - -container_run_and_commit_layer( - name = "ovirt-imageio-layer-run", - commands = [ - "update-ca-trust", - "pip install setuptools wheel", - "pip install ovirt-engine-sdk-python ovirt-imageio", - ], - image = ":base-image.tar", -) - -container_image( - name = "ovirt-imageio-layer", - base = ":base-image", - layers = [ - ":ovirt-imageio-layer-run", - ], - visibility = ["//visibility:public"], -) - -container_image( - name = "ovirt-populator-image", - base = ":ovirt-imageio-layer", - directory = "/usr/local/bin/", - entrypoint = ["/usr/local/bin/ovirt-populator"], - files = [":ovirt-populator"], - visibility = ["//visibility:public"], -) - -rpmtree( - name = "deps", - rpms = [ - "@alternatives-0__1.24-2.el9.x86_64//rpm", - "@audit-libs-0__3.1.5-1.el9.x86_64//rpm", - "@basesystem-0__11-13.el9.x86_64//rpm", - "@bash-0__5.1.8-9.el9.x86_64//rpm", - "@binutils-0__2.35.2-59.el9.x86_64//rpm", - "@binutils-gold-0__2.35.2-59.el9.x86_64//rpm", - "@bzip2-libs-0__1.0.8-8.el9.x86_64//rpm", - "@ca-certificates-0__2024.2.69_v8.0.303-91.4.el9.x86_64//rpm", - "@centos-gpg-keys-0__9.0-11.el9.x86_64//rpm", - "@centos-stream-release-0__9.0-11.el9.x86_64//rpm", - "@centos-stream-repos-0__9.0-11.el9.x86_64//rpm", - "@cmake-filesystem-0__3.26.5-2.el9.x86_64//rpm", - "@coreutils-0__8.32-39.el9.x86_64//rpm", - "@coreutils-common-0__8.32-39.el9.x86_64//rpm", - "@cpp-0__11.5.0-2.el9.x86_64//rpm", - "@crypto-policies-0__20240828-2.git626aa59.el9.x86_64//rpm", - "@cyrus-sasl-lib-0__2.1.27-21.el9.x86_64//rpm", - "@elfutils-debuginfod-client-0__0.192-2.el9.x86_64//rpm", - "@elfutils-default-yama-scope-0__0.192-2.el9.x86_64//rpm", - "@elfutils-libelf-0__0.192-2.el9.x86_64//rpm", - "@elfutils-libs-0__0.192-2.el9.x86_64//rpm", - "@expat-0__2.5.0-4.el9.x86_64//rpm", - "@filesystem-0__3.16-5.el9.x86_64//rpm", - "@gawk-0__5.1.0-6.el9.x86_64//rpm", - "@gcc-0__11.5.0-2.el9.x86_64//rpm", - "@gdbm-libs-1__1.23-1.el9.x86_64//rpm", - "@glib2-0__2.68.4-16.el9.x86_64//rpm", - "@glibc-0__2.34-148.el9.x86_64//rpm", - "@glibc-common-0__2.34-148.el9.x86_64//rpm", - "@glibc-devel-0__2.34-148.el9.x86_64//rpm", - "@glibc-headers-0__2.34-148.el9.x86_64//rpm", - "@glibc-langpack-ayc-0__2.34-148.el9.x86_64//rpm", - "@gmp-1__6.2.0-13.el9.x86_64//rpm", - "@gnutls-0__3.8.3-4.el9.x86_64//rpm", - "@grep-0__3.6-5.el9.x86_64//rpm", - "@json-c-0__0.14-11.el9.x86_64//rpm", - "@kernel-headers-0__5.14.0-547.el9.x86_64//rpm", - "@keyutils-libs-0__1.6.3-3.el9.x86_64//rpm", - "@krb5-libs-0__1.21.1-4.el9.x86_64//rpm", - "@libacl-0__2.3.1-4.el9.x86_64//rpm", - "@libaio-0__0.3.111-13.el9.x86_64//rpm", - "@libattr-0__2.5.1-3.el9.x86_64//rpm", - "@libblkid-0__2.37.4-20.el9.x86_64//rpm", - "@libbrotli-0__1.0.9-7.el9.x86_64//rpm", - "@libcap-0__2.48-9.el9.x86_64//rpm", - "@libcap-ng-0__0.8.2-7.el9.x86_64//rpm", - "@libcom_err-0__1.46.5-6.el9.x86_64//rpm", - "@libcurl-0__7.76.1-31.el9.x86_64//rpm", - "@libcurl-devel-0__7.76.1-31.el9.x86_64//rpm", - "@libevent-0__2.1.12-8.el9.x86_64//rpm", - "@libffi-0__3.4.2-8.el9.x86_64//rpm", - "@libgcc-0__11.5.0-2.el9.x86_64//rpm", - "@libgomp-0__11.5.0-2.el9.x86_64//rpm", - "@libidn2-0__2.3.0-7.el9.x86_64//rpm", - "@libmount-0__2.37.4-20.el9.x86_64//rpm", - "@libmpc-0__1.2.1-4.el9.x86_64//rpm", - "@libnghttp2-0__1.43.0-6.el9.x86_64//rpm", - "@libpkgconf-0__1.7.3-10.el9.x86_64//rpm", - "@libpsl-0__0.21.1-5.el9.x86_64//rpm", - "@libselinux-0__3.6-1.el9.x86_64//rpm", - "@libsemanage-0__3.6-3.el9.x86_64//rpm", - "@libsepol-0__3.6-2.el9.x86_64//rpm", - "@libsigsegv-0__2.13-4.el9.x86_64//rpm", - "@libssh-0__0.10.4-13.el9.x86_64//rpm", - "@libssh-config-0__0.10.4-13.el9.x86_64//rpm", - "@libstdc__plus____plus__-0__11.5.0-2.el9.x86_64//rpm", - "@libtasn1-0__4.16.0-8.el9.x86_64//rpm", - "@libtool-ltdl-0__2.4.6-46.el9.x86_64//rpm", - "@libunistring-0__0.9.10-15.el9.x86_64//rpm", - "@liburing-0__2.5-1.el9.x86_64//rpm", - "@libuuid-0__2.37.4-20.el9.x86_64//rpm", - "@libverto-0__0.3.2-3.el9.x86_64//rpm", - "@libxcrypt-0__4.4.18-3.el9.x86_64//rpm", - "@libxcrypt-devel-0__4.4.18-3.el9.x86_64//rpm", - "@libxml2-0__2.9.13-6.el9.x86_64//rpm", - "@libxml2-devel-0__2.9.13-6.el9.x86_64//rpm", - "@libzstd-0__1.5.5-1.el9.x86_64//rpm", - "@make-1__4.3-8.el9.x86_64//rpm", - "@mpfr-0__4.1.0-7.el9.x86_64//rpm", - "@ncurses-base-0__6.2-10.20210508.el9.x86_64//rpm", - "@ncurses-libs-0__6.2-10.20210508.el9.x86_64//rpm", - "@nettle-0__3.9.1-1.el9.x86_64//rpm", - "@numactl-libs-0__2.0.19-1.el9.x86_64//rpm", - "@openldap-0__2.6.8-3.el9.x86_64//rpm", - "@openssl-devel-1__3.2.2-6.el9.x86_64//rpm", - "@openssl-libs-1__3.2.2-6.el9.x86_64//rpm", - "@p11-kit-0__0.25.3-3.el9.x86_64//rpm", - "@p11-kit-trust-0__0.25.3-3.el9.x86_64//rpm", - "@pcre-0__8.44-4.el9.x86_64//rpm", - "@pcre2-0__10.40-6.el9.x86_64//rpm", - "@pcre2-syntax-0__10.40-6.el9.x86_64//rpm", - "@pkgconf-0__1.7.3-10.el9.x86_64//rpm", - "@pkgconf-m4-0__1.7.3-10.el9.x86_64//rpm", - "@pkgconf-pkg-config-0__1.7.3-10.el9.x86_64//rpm", - "@publicsuffix-list-dafsa-0__20210518-3.el9.x86_64//rpm", - "@python3-0__3.9.21-1.el9.x86_64//rpm", - "@python3-devel-0__3.9.21-1.el9.x86_64//rpm", - "@python3-libs-0__3.9.21-1.el9.x86_64//rpm", - "@python3-pip-0__21.3.1-1.el9.x86_64//rpm", - "@python3-pip-wheel-0__21.3.1-1.el9.x86_64//rpm", - "@python3-setuptools-wheel-0__53.0.0-13.el9.x86_64//rpm", - "@qemu-img-17__9.1.0-8.el9.x86_64//rpm", - "@readline-0__8.1-4.el9.x86_64//rpm", - "@sed-0__4.8-9.el9.x86_64//rpm", - "@setup-0__2.13.7-10.el9.x86_64//rpm", - "@shadow-utils-2__4.9-12.el9.x86_64//rpm", - "@sqlite-libs-0__3.34.1-7.el9.x86_64//rpm", - "@tzdata-0__2024b-3.el9.x86_64//rpm", - "@xz-devel-0__5.2.5-8.el9.x86_64//rpm", - "@xz-libs-0__5.2.5-8.el9.x86_64//rpm", - "@zlib-0__1.2.11-40.el9.x86_64//rpm", - "@zlib-devel-0__1.2.11-40.el9.x86_64//rpm", - ], - symlinks = { - "/usr/bin/python": "/usr/bin/python3.9", - "/usr/bin/ld": "/usr/bin/ld.bfd", - }, - visibility = ["//visibility:public"], -) diff --git a/cmd/populator-controller/BUILD.bazel b/cmd/populator-controller/BUILD.bazel deleted file mode 100644 index e2a6de153..000000000 --- a/cmd/populator-controller/BUILD.bazel +++ /dev/null @@ -1,38 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") - -go_binary( - name = "populator-controller", - embed = [":populator-controller_lib"], - visibility = ["//visibility:public"], -) - -go_library( - name = "populator-controller_lib", - srcs = ["populator-controller.go"], - importpath = "github.com/konveyor/forklift-controller/cmd/populator-controller", - visibility = ["//visibility:private"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/lib-volume-populator/populator-machinery", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", - "//vendor/k8s.io/apimachinery/pkg/runtime", - "//vendor/k8s.io/apimachinery/pkg/runtime/schema", - "//vendor/k8s.io/klog/v2:klog", - ], -) - -load( - "@io_bazel_rules_docker//container:container.bzl", - "container_image", -) - -container_image( - name = "populator-controller-image", - base = "@ubi9-minimal//image", - directory = "/usr/local/bin/", - entrypoint = ["/usr/local/bin/populator-controller"], - # workaround for github.com/bazelbuild/rules_go/issues/1706 - env = {"GODEBUG": "netdns=go"}, - files = [":populator-controller"], - visibility = ["//visibility:public"], -) diff --git a/cmd/virt-v2v-monitor/BUILD.bazel b/cmd/virt-v2v-monitor/BUILD.bazel deleted file mode 100644 index f5ab459f1..000000000 --- a/cmd/virt-v2v-monitor/BUILD.bazel +++ /dev/null @@ -1,19 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") - -go_binary( - name = "virt-v2v-monitor", - embed = [":virt-v2v-monitor_lib"], - visibility = ["//visibility:public"], -) - -go_library( - name = "virt-v2v-monitor_lib", - srcs = ["virt-v2v-monitor.go"], - importpath = "github.com/konveyor/forklift-controller/cmd/virt-v2v-monitor", - visibility = ["//visibility:private"], - deps = [ - "//vendor/github.com/prometheus/client_golang/prometheus", - "//vendor/github.com/prometheus/client_golang/prometheus/promhttp", - "//vendor/github.com/prometheus/client_model/go", - ], -) diff --git a/hack/ovirt-populator-rpm-deps.sh b/hack/ovirt-populator-rpm-deps.sh deleted file mode 100755 index 4b1e54abb..000000000 --- a/hack/ovirt-populator-rpm-deps.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -set -e - -bazeldnf_repos="--repofile rpm/stream9-repo.yaml" -if [ "${CUSTOM_REPO}" ]; then - bazeldnf_repos="--repofile ${CUSTOM_REPO} ${bazeldnf_repos}" -fi - -bazel run \ - //:bazeldnf -- fetch \ - ${bazeldnf_repos} - -imageio_deps=" -gcc -python3-pip -python3-devel -libxml2-devel -openssl-devel -libcurl-devel -qemu-img -" - -bazel run \ - //:bazeldnf -- rpmtree \ - --public \ - --nobest \ - --buildfile cmd/ovirt-populator/BUILD.bazel \ - --name deps \ - --basesystem centos-stream-release \ - ${bazeldnf_repos} \ - $imageio_deps - diff --git a/hack/release-images.sh b/hack/release-images.sh deleted file mode 100755 index 73249afbf..000000000 --- a/hack/release-images.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bash - -set -e - -if [[ -z "${REGISTRY}" || -z "${REGISTRY_TAG}" || -z "${REGISTRY_ORG}" ]]; then - echo "Please set all REGISTRY, REGISTRY_TAG and REGISTRY_ORG environment variables!" - exit 1 -fi - -CONTROLLER_IMAGE=${REGISTRY}/${REGISTRY_ORG}/forklift-controller:${REGISTRY_TAG} -OPERATOR_IMAGE=${REGISTRY}/${REGISTRY_ORG}/forklift-operator:${REGISTRY_TAG} -MUST_GATHER_IMAGE=${REGISTRY}/${REGISTRY_ORG}/forklift-must-gather:${REGISTRY_TAG} -UI_PLUGIN_IMAGE=${REGISTRY}/${REGISTRY_ORG}/forklift-console-plugin:${REGISTRY_TAG} -VALIDATION_IMAGE=${REGISTRY}/${REGISTRY_ORG}/forklift-validation:${REGISTRY_TAG} -VIRT_V2V_IMAGE=${REGISTRY}/${REGISTRY_ORG}/forklift-virt-v2v:${REGISTRY_TAG} -API_IMAGE=${REGISTRY}/${REGISTRY_ORG}/forklift-api:${REGISTRY_TAG} -POPULATOR_CONTROLLER_IMAGE=${REGISTRY}/${REGISTRY_ORG}/populator-controller:${REGISTRY_TAG} -OVA_PROVIDER_SERVER=${REGISTRY}/${REGISTRY_ORG}/forklift-ova-provider-server:${REGISTRY_TAG} - -bazel run push-forklift-api -bazel run push-ovirt-populator -bazel run push-openstack-populator -bazel run --package_path=virt-v2v push-forklift-virt-v2v -bazel run push-populator-controller -bazel run push-forklift-controller -bazel run push-forklift-validation -bazel run push-ova-provider-server -bazel run push-forklift-operator -bazel run push-forklift-operator-bundle \ - --action_env OPERATOR_IMAGE=${OPERATOR_IMAGE} \ - --action_env MUST_GATHER_IMAGE=${MUST_GATHER_IMAGE} \ - --action_env UI_PLUGIN_IMAGE=${UI_PLUGIN_IMAGE} \ - --action_env VALIDATION_IMAGE=${VALIDATION_IMAGE} \ - --action_env VIRT_V2V_IMAGE=${VIRT_V2V_IMAGE} \ - --action_env CONTROLLER_IMAGE=${CONTROLLER_IMAGE} \ - --action_env API_IMAGE=${API_IMAGE} \ - --action_env POPULATOR_CONTROLLER_IMAGE=${POPULATOR_CONTROLLER_IMAGE} \ - --action_env OVA_PROVIDER_SERVER=${OVA_PROVIDER_SERVER=} -bazel run push-forklift-operator-index \ - --action_env REGISTRY=${REGISTRY} \ - --action_env REGISTRY_TAG=${REGISTRY_TAG} \ - --action_env REGISTRY_ORG=${REGISTRY_ORG} diff --git a/hack/virt-v2v-rpm-deps.sh b/hack/virt-v2v-rpm-deps.sh deleted file mode 100755 index 3cd9fc9f6..000000000 --- a/hack/virt-v2v-rpm-deps.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env bash - -set -e - -bazeldnf_repos="--repofile rpm/stream9-repo.yaml" -if [ "${CUSTOM_REPO}" ]; then - bazeldnf_repos="--repofile ${CUSTOM_REPO} ${bazeldnf_repos}" -fi - -# get latest repo data from repo.yaml -bazel run \ - //:bazeldnf -- fetch \ - ${bazeldnf_repos} - -# These are the packages we really depend on. -virt_v2v=" - tar - virt-v2v - virtio-win -" - -# Here are the dependencies that virt-v2v requires but does not specify as -# dependency (either directly or indirectly). -v2v_missing=" - file -" - -# bazeldnf cannot handle properly alternative packages and keeps swapping e.g. -# libcurl and libcurl-minimal, language alternatives or kernel core on each -# run. To make the list of packages stable we pick our preferred alternatives -# here. We don't really have a strong preference for either of those and the -# choice is mostly arbitrary with package size taken into consideration. -alternative_picks=" - coreutils-single - curl-minimal - glibc-langpack-en - kernel-core - libcurl-minimal - libverto-libev - selinux-policy-targeted -" -bazel run \ - //:bazeldnf -- rpmtree \ - --public \ - --workspace virt-v2v/WORKSPACE \ - --buildfile virt-v2v/BUILD.bazel \ - --name virt-v2v \ - --basesystem centos-stream-release \ - --force-ignore-with-dependencies 'python' \ - ${bazeldnf_repos} \ - $virt_v2v $v2v_missing $alternative_picks - diff --git a/operator/BUILD.bazel b/operator/BUILD.bazel deleted file mode 100644 index 4bbd7565c..000000000 --- a/operator/BUILD.bazel +++ /dev/null @@ -1,201 +0,0 @@ -load( - "@io_bazel_rules_docker//container:container.bzl", - "container_image", -) -load("@io_bazel_rules_docker//docker/util:run.bzl", "container_run_and_commit_layer") - -genrule( - name = "kustomize_bin", - srcs = ["@kustomize//file"], - outs = ["kustomize"], - cmd = "tar -C $(@D) -xf $(location @kustomize//file)", -) - -# OPERATOR -# 1. Build the oprator image with ansible dependencies and with roles. - -container_image( - name = "forklift-operator-base-image", - base = "@ansible-operator//image", - directory = "/opt/ansible", - files = [ - "requirements.yml", - "roles", - "watches.yaml", - ], -) - -container_run_and_commit_layer( - name = "forklift-operator-image-layer-run", - commands = [ - "ansible-galaxy collection install -r /opt/ansible/requirements.yml && chmod -R ug+rwx /opt/ansible/.ansible", - ], - docker_run_flags = ["--entrypoint=''"], - image = ":forklift-operator-base-image.tar", -) - -container_image( - name = "forklift-operator-image", - base = ":forklift-operator-base-image", - directory = "/opt/ansible", - layers = [ - ":forklift-operator-image-layer-run", - ], - user = "1001", - visibility = ["//visibility:public"], -) - -# BUNDLE -# 1. Change to the operator dir -# 2. Get the current date with which the operator will be built -# 3. Build the config files with kustomize -# 4. Substitute env variables in the generated config -# 5. Generate the bundle from the config -# 6. Build the image with the bundle - -genrule( - name = "bundle", - srcs = [ - ":kustomize_bin", - "@operator-sdk//file", - ] + glob(["**/*"]), - outs = [ - # Can be replaced with just dir 'bundle' - "bundle/manifests/forklift.konveyor.io_forkliftcontrollers.yaml", - "bundle/manifests/forklift.konveyor.io_hooks.yaml", - "bundle/manifests/forklift.konveyor.io_hosts.yaml", - "bundle/manifests/forklift.konveyor.io_migrations.yaml", - "bundle/manifests/forklift.konveyor.io_networkmaps.yaml", - "bundle/manifests/forklift.konveyor.io_plans.yaml", - "bundle/manifests/forklift.konveyor.io_providers.yaml", - "bundle/manifests/forklift.konveyor.io_storagemaps.yaml", - "bundle/manifests/forklift.konveyor.io_ovirtvolumepopulators.yaml", - "bundle/manifests/forklift.konveyor.io_openstackvolumepopulators.yaml", - "bundle/manifests/forklift-operator.clusterserviceversion.yaml", - "bundle/metadata/annotations.yaml", - "bundle/tests/scorecard/config.yaml", - ], - # The `operator-sdk` needs to work in the operator dir - - # The bazel is running the build in sandbox and linkes all the sources to it. - # The kustomize has restrictions for symlinks outside of the project scope, for this we use the ignore of LoadRestrictionsNone. - cmd = """ - cd operator; - export DATE=$$(date +%Y-%m-%dT%H:%M:%SZ); - ../$(location :kustomize_bin) build config/manifests --load-restrictor LoadRestrictionsNone | envsubst | ../$(location @operator-sdk//file) generate bundle -q --overwrite --extra-service-accounts forklift-controller,forklift-api,forklift-populator-controller --version $${VERSION} --output-dir ../$(RULEDIR)/bundle --channels=$${CHANNELS} --default-channel=$${DEFAULT_CHANNEL} - """, -) - -container_image( - name = "forklift-operator-bundle-manifests", - base = "@ubi9-minimal//image", - directory = "/manifests/", - files = [ - ":bundle/manifests/forklift.konveyor.io_forkliftcontrollers.yaml", - ":bundle/manifests/forklift.konveyor.io_hooks.yaml", - ":bundle/manifests/forklift.konveyor.io_hosts.yaml", - ":bundle/manifests/forklift.konveyor.io_migrations.yaml", - ":bundle/manifests/forklift.konveyor.io_networkmaps.yaml", - ":bundle/manifests/forklift.konveyor.io_openstackvolumepopulators.yaml", - ":bundle/manifests/forklift.konveyor.io_ovirtvolumepopulators.yaml", - ":bundle/manifests/forklift.konveyor.io_plans.yaml", - ":bundle/manifests/forklift.konveyor.io_providers.yaml", - ":bundle/manifests/forklift.konveyor.io_storagemaps.yaml", - ":bundle/manifests/forklift-operator.clusterserviceversion.yaml", - ], -) - -container_image( - name = "forklift-operator-bundle-metadata", - base = ":forklift-operator-bundle-manifests", - directory = "/metadata/", - files = ["bundle/metadata/annotations.yaml"], -) - -container_image( - name = "forklift-operator-bundle-tests", - base = ":forklift-operator-bundle-metadata", - directory = "/tests/scorecard/", - files = [":bundle/tests/scorecard/config.yaml"], -) - -container_image( - name = "forklift-operator-bundle-image", - base = ":forklift-operator-bundle-tests", - labels = { - # Core bundle labels. - "operators.operatorframework.io.bundle.mediatype.v1": "registry+v1", - "operators.operatorframework.io.bundle.manifests.v1": "manifests/", - "operators.operatorframework.io.bundle.metadata.v1": "metadata/", - "operators.operatorframework.io.bundle.package.v1": "forklift-operator", - # The channels need to be changed during release - "operators.operatorframework.io.bundle.channels.v1": "development", - "operators.operatorframework.io.bundle.channel.default.v1": "development", - "operators.operatorframework.io.metrics.builder": "operator-sdk-v1.43.1", - "operators.operatorframework.io.metrics.mediatype.v1": "metrics+v1", - "operators.operatorframework.io.metrics.project_layout": "ansible.sdk.operatorframework.io/v1", - # Labels for testing. - "operators.operatorframework.io.test.mediatype.v1": "scorecard+v1", - "operators.operatorframework.io.test.config.v1": "tests/scorecard/", - }, - user = "1001", - visibility = ["//visibility:public"], -) - -# INDEX -# 1. Substitute env variables in catalog/operator.yml -# 2. Append the bundle render to the catalog/operator.yml -# 3. Build the opm image which serves generated catalog - -genrule( - name = "opm_render", - srcs = [ - "@opm//file", - "catalog/operator.yml", - ], - outs = ["operator.yaml"], - cmd = """ - CONTAINER_RUNTIME="$$(basename $${CONTAINER_CMD:-$$(command -v podman || command -v docker)})" - if [ ! -z "$${XDG_RUNTIME_DIR}" ]; then - PODMAN_AUTH_FILE="$${XDG_RUNTIME_DIR}/containers/auth.json" - if [ "$${CONTAINER_RUNTIME}" == "podman" ]; then - if [ -e "$${PODMAN_AUTH_FILE}" ]; then - DOCKER_CONFIG="$$(mktemp -d)" - DOCKER_AUTH_FILE="$${DOCKER_CONFIG}/config.json" - cp "$${PODMAN_AUTH_FILE}" "$${DOCKER_AUTH_FILE}" - export DOCKER_CONFIG - else - unset DOCKER_CONFIG - fi - fi - fi - OPERATOR_BUNDLE_IMAGE="$${REGISTRY:-quay.io}/$${REGISTRY_ORG:-}$${REGISTRY_ORG:+/}forklift-operator-bundle:$${REGISTRY_TAG:-devel}" - cat $(location catalog/operator.yml) | envsubst > $@ - $(location @opm//file) render "$${OPERATOR_BUNDLE_IMAGE}" -o yaml $${OPM_OPTS:-} >> $@ - if [ "$${CONTAINER_RUNTIME}" == "podman" && ! -z "$${DOCKER_CONFIG}" ]; then - rm -rf "$${DOCKER_CONFIG}" - fi - """, -) - -container_image( - name = "forklift-operator-index-database", - base = "@opm-image//image", - directory = "/configs", - files = [":operator.yaml"], -) - -container_image( - name = "forklift-operator-index-image", - base = ":forklift-operator-index-database", - cmd = [ - "serve", - "/configs", - ], - entrypoint = ["/bin/opm"], - labels = { - "operators.operatorframework.io.index.configs.v1": "/configs", - }, - user = "1001", - visibility = ["//visibility:public"], -) diff --git a/operator/export-vars-downstream.sh b/operator/export-vars-downstream.sh index ef96a0168..c134288d8 100755 --- a/operator/export-vars-downstream.sh +++ b/operator/export-vars-downstream.sh @@ -51,5 +51,3 @@ for k in "${!images[@]}"; do new_image="${new_image/quay.io\/redhat-user-workloads\/rh-mtv-1-tenant\/forklift-operator/registry.redhat.io\/migration-toolkit-virtualization}" export "$k=$new_image" done - -export VERSION="v2.7.0" diff --git a/operator/export-vars-upstream.sh b/operator/export-vars-upstream.sh index 217eb9a40..4304e38bd 100755 --- a/operator/export-vars-upstream.sh +++ b/operator/export-vars-upstream.sh @@ -34,5 +34,3 @@ for k in "${!images[@]}"; do new_image="${image/redhat-user-workloads\/rh-mtv-1-tenant\/forklift-operator/kubev2v}" export "$k=$new_image" done - -export VERSION="v2.7.0" diff --git a/pkg/apis/BUILD.bazel b/pkg/apis/BUILD.bazel deleted file mode 100644 index e516551f3..000000000 --- a/pkg/apis/BUILD.bazel +++ /dev/null @@ -1,12 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "apis", - srcs = ["apis.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/apis", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//vendor/k8s.io/apimachinery/pkg/runtime", - ], -) diff --git a/pkg/apis/forklift/BUILD.bazel b/pkg/apis/forklift/BUILD.bazel deleted file mode 100644 index 7732e0c49..000000000 --- a/pkg/apis/forklift/BUILD.bazel +++ /dev/null @@ -1,8 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "forklift", - srcs = ["group.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/apis/forklift", - visibility = ["//visibility:public"], -) diff --git a/pkg/apis/forklift/v1beta1/BUILD.bazel b/pkg/apis/forklift/v1beta1/BUILD.bazel deleted file mode 100644 index 82b3bbad3..000000000 --- a/pkg/apis/forklift/v1beta1/BUILD.bazel +++ /dev/null @@ -1,33 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "v1beta1", - srcs = [ - "doc.go", - "hook.go", - "host.go", - "mapping.go", - "migration.go", - "openstackpopulator.go", - "ovirtpopulator.go", - "plan.go", - "provider.go", - "referenced.go", - "register.go", - "zz_generated.deepcopy.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/apis/forklift/v1beta1", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1/plan", - "//pkg/apis/forklift/v1beta1/provider", - "//pkg/apis/forklift/v1beta1/ref", - "//pkg/lib/condition", - "//pkg/lib/error", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - "//vendor/k8s.io/apimachinery/pkg/runtime", - "//vendor/k8s.io/apimachinery/pkg/runtime/schema", - "//vendor/sigs.k8s.io/controller-runtime/pkg/scheme", - ], -) diff --git a/pkg/apis/forklift/v1beta1/plan/BUILD.bazel b/pkg/apis/forklift/v1beta1/plan/BUILD.bazel deleted file mode 100644 index bdd55743b..000000000 --- a/pkg/apis/forklift/v1beta1/plan/BUILD.bazel +++ /dev/null @@ -1,24 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "plan", - srcs = [ - "doc.go", - "mapping.go", - "migration.go", - "snapshot.go", - "timed.go", - "vm.go", - "zz_generated.deepcopy.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/apis/forklift/v1beta1/plan", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1/ref", - "//pkg/lib/condition", - "//pkg/lib/itinerary", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - "//vendor/k8s.io/apimachinery/pkg/types", - ], -) diff --git a/pkg/apis/forklift/v1beta1/provider/BUILD.bazel b/pkg/apis/forklift/v1beta1/provider/BUILD.bazel deleted file mode 100644 index 1547803b2..000000000 --- a/pkg/apis/forklift/v1beta1/provider/BUILD.bazel +++ /dev/null @@ -1,13 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "provider", - srcs = [ - "doc.go", - "pair.go", - "zz_generated.deepcopy.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/apis/forklift/v1beta1/provider", - visibility = ["//visibility:public"], - deps = ["//vendor/k8s.io/api/core/v1:core"], -) diff --git a/pkg/apis/forklift/v1beta1/ref/BUILD.bazel b/pkg/apis/forklift/v1beta1/ref/BUILD.bazel deleted file mode 100644 index 82c92af55..000000000 --- a/pkg/apis/forklift/v1beta1/ref/BUILD.bazel +++ /dev/null @@ -1,12 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "ref", - srcs = [ - "doc.go", - "ref.go", - "zz_generated.deepcopy.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/apis/forklift/v1beta1/ref", - visibility = ["//visibility:public"], -) diff --git a/pkg/controller/BUILD.bazel b/pkg/controller/BUILD.bazel deleted file mode 100644 index 67afd5de9..000000000 --- a/pkg/controller/BUILD.bazel +++ /dev/null @@ -1,19 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "controller", - srcs = ["controller.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/controller", - visibility = ["//visibility:public"], - deps = [ - "//pkg/controller/hook", - "//pkg/controller/host", - "//pkg/controller/map/network", - "//pkg/controller/map/storage", - "//pkg/controller/migration", - "//pkg/controller/plan", - "//pkg/controller/provider", - "//pkg/settings", - "//vendor/sigs.k8s.io/controller-runtime/pkg/manager", - ], -) diff --git a/pkg/controller/base/BUILD.bazel b/pkg/controller/base/BUILD.bazel deleted file mode 100644 index cc228bf63..000000000 --- a/pkg/controller/base/BUILD.bazel +++ /dev/null @@ -1,18 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "base", - srcs = ["controller.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/base", - visibility = ["//visibility:public"], - deps = [ - "//pkg/controller/provider/web", - "//pkg/lib/condition", - "//pkg/lib/logging", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/api/errors", - "//vendor/k8s.io/apimachinery/pkg/runtime", - "//vendor/k8s.io/client-go/tools/record", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - ], -) diff --git a/pkg/controller/hook/BUILD.bazel b/pkg/controller/hook/BUILD.bazel deleted file mode 100644 index b02e5eb94..000000000 --- a/pkg/controller/hook/BUILD.bazel +++ /dev/null @@ -1,30 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "hook", - srcs = [ - "controller.go", - "predicate.go", - "regexp.go", - "validation.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/hook", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/base", - "//pkg/lib/condition", - "//pkg/lib/logging", - "//pkg/lib/ref", - "//pkg/settings", - "//vendor/k8s.io/apimachinery/pkg/api/errors", - "//vendor/k8s.io/apiserver/pkg/storage/names", - "//vendor/sigs.k8s.io/controller-runtime/pkg/controller", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - "//vendor/sigs.k8s.io/controller-runtime/pkg/handler", - "//vendor/sigs.k8s.io/controller-runtime/pkg/manager", - "//vendor/sigs.k8s.io/controller-runtime/pkg/predicate", - "//vendor/sigs.k8s.io/controller-runtime/pkg/reconcile", - "//vendor/sigs.k8s.io/controller-runtime/pkg/source", - ], -) diff --git a/pkg/controller/host/BUILD.bazel b/pkg/controller/host/BUILD.bazel deleted file mode 100644 index 3d8bd3942..000000000 --- a/pkg/controller/host/BUILD.bazel +++ /dev/null @@ -1,37 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "host", - srcs = [ - "controller.go", - "predicate.go", - "validation.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/host", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/base", - "//pkg/controller/host/handler", - "//pkg/controller/plan/adapter/vsphere", - "//pkg/controller/provider/web", - "//pkg/controller/provider/web/vsphere", - "//pkg/controller/validation", - "//pkg/lib/condition", - "//pkg/lib/error", - "//pkg/lib/logging", - "//pkg/lib/ref", - "//pkg/settings", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/api/errors", - "//vendor/k8s.io/apiserver/pkg/storage/names", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/controller", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - "//vendor/sigs.k8s.io/controller-runtime/pkg/handler", - "//vendor/sigs.k8s.io/controller-runtime/pkg/manager", - "//vendor/sigs.k8s.io/controller-runtime/pkg/predicate", - "//vendor/sigs.k8s.io/controller-runtime/pkg/reconcile", - "//vendor/sigs.k8s.io/controller-runtime/pkg/source", - ], -) diff --git a/pkg/controller/host/handler/BUILD.bazel b/pkg/controller/host/handler/BUILD.bazel deleted file mode 100644 index 89c6ae4e2..000000000 --- a/pkg/controller/host/handler/BUILD.bazel +++ /dev/null @@ -1,20 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "handler", - srcs = ["doc.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/host/handler", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/host/handler/ocp", - "//pkg/controller/host/handler/openstack", - "//pkg/controller/host/handler/ova", - "//pkg/controller/host/handler/ovirt", - "//pkg/controller/host/handler/vsphere", - "//pkg/controller/watch/handler", - "//pkg/lib/error", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - ], -) diff --git a/pkg/controller/host/handler/ocp/BUILD.bazel b/pkg/controller/host/handler/ocp/BUILD.bazel deleted file mode 100644 index 932742f13..000000000 --- a/pkg/controller/host/handler/ocp/BUILD.bazel +++ /dev/null @@ -1,17 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "ocp", - srcs = [ - "doc.go", - "handler.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/host/handler/ocp", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/watch/handler", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - ], -) diff --git a/pkg/controller/host/handler/openstack/BUILD.bazel b/pkg/controller/host/handler/openstack/BUILD.bazel deleted file mode 100644 index 8892e6679..000000000 --- a/pkg/controller/host/handler/openstack/BUILD.bazel +++ /dev/null @@ -1,17 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "openstack", - srcs = [ - "doc.go", - "handler.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/host/handler/openstack", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/watch/handler", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - ], -) diff --git a/pkg/controller/host/handler/ova/BUILD.bazel b/pkg/controller/host/handler/ova/BUILD.bazel deleted file mode 100644 index a725992ea..000000000 --- a/pkg/controller/host/handler/ova/BUILD.bazel +++ /dev/null @@ -1,17 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "ova", - srcs = [ - "doc.go", - "handler.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/host/handler/ova", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/watch/handler", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - ], -) diff --git a/pkg/controller/host/handler/ovirt/BUILD.bazel b/pkg/controller/host/handler/ovirt/BUILD.bazel deleted file mode 100644 index a2b850b98..000000000 --- a/pkg/controller/host/handler/ovirt/BUILD.bazel +++ /dev/null @@ -1,17 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "ovirt", - srcs = [ - "doc.go", - "handler.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/host/handler/ovirt", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/watch/handler", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - ], -) diff --git a/pkg/controller/host/handler/vsphere/BUILD.bazel b/pkg/controller/host/handler/vsphere/BUILD.bazel deleted file mode 100644 index f06421c5c..000000000 --- a/pkg/controller/host/handler/vsphere/BUILD.bazel +++ /dev/null @@ -1,22 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "vsphere", - srcs = [ - "doc.go", - "handler.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/host/handler/vsphere", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/provider/web/vsphere", - "//pkg/controller/watch/handler", - "//pkg/lib/error", - "//pkg/lib/inventory/web", - "//pkg/lib/logging", - "//vendor/golang.org/x/net/context", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - ], -) diff --git a/pkg/controller/map/network/BUILD.bazel b/pkg/controller/map/network/BUILD.bazel deleted file mode 100644 index 37ea42da1..000000000 --- a/pkg/controller/map/network/BUILD.bazel +++ /dev/null @@ -1,34 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "network", - srcs = [ - "controller.go", - "predicate.go", - "validation.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/map/network", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/ref", - "//pkg/controller/base", - "//pkg/controller/map/network/handler", - "//pkg/controller/provider/web", - "//pkg/controller/validation", - "//pkg/lib/condition", - "//pkg/lib/logging", - "//pkg/lib/ref", - "//pkg/settings", - "//vendor/k8s.io/apimachinery/pkg/api/errors", - "//vendor/k8s.io/apiserver/pkg/storage/names", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/controller", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - "//vendor/sigs.k8s.io/controller-runtime/pkg/handler", - "//vendor/sigs.k8s.io/controller-runtime/pkg/manager", - "//vendor/sigs.k8s.io/controller-runtime/pkg/predicate", - "//vendor/sigs.k8s.io/controller-runtime/pkg/reconcile", - "//vendor/sigs.k8s.io/controller-runtime/pkg/source", - ], -) diff --git a/pkg/controller/map/network/handler/BUILD.bazel b/pkg/controller/map/network/handler/BUILD.bazel deleted file mode 100644 index a3f94bb28..000000000 --- a/pkg/controller/map/network/handler/BUILD.bazel +++ /dev/null @@ -1,20 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "handler", - srcs = ["doc.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/map/network/handler", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/map/network/handler/ocp", - "//pkg/controller/map/network/handler/openstack", - "//pkg/controller/map/network/handler/ova", - "//pkg/controller/map/network/handler/ovirt", - "//pkg/controller/map/network/handler/vsphere", - "//pkg/controller/watch/handler", - "//pkg/lib/error", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - ], -) diff --git a/pkg/controller/map/network/handler/ocp/BUILD.bazel b/pkg/controller/map/network/handler/ocp/BUILD.bazel deleted file mode 100644 index ee972b8bc..000000000 --- a/pkg/controller/map/network/handler/ocp/BUILD.bazel +++ /dev/null @@ -1,22 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "ocp", - srcs = [ - "doc.go", - "handler.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/map/network/handler/ocp", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/provider/web/ocp", - "//pkg/controller/watch/handler", - "//pkg/lib/error", - "//pkg/lib/inventory/web", - "//pkg/lib/logging", - "//vendor/golang.org/x/net/context", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - ], -) diff --git a/pkg/controller/map/network/handler/openstack/BUILD.bazel b/pkg/controller/map/network/handler/openstack/BUILD.bazel deleted file mode 100644 index 731218523..000000000 --- a/pkg/controller/map/network/handler/openstack/BUILD.bazel +++ /dev/null @@ -1,22 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "openstack", - srcs = [ - "doc.go", - "handler.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/map/network/handler/openstack", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/provider/web/openstack", - "//pkg/controller/watch/handler", - "//pkg/lib/error", - "//pkg/lib/inventory/web", - "//pkg/lib/logging", - "//vendor/golang.org/x/net/context", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - ], -) diff --git a/pkg/controller/map/network/handler/ova/BUILD.bazel b/pkg/controller/map/network/handler/ova/BUILD.bazel deleted file mode 100644 index 63cd1b0e1..000000000 --- a/pkg/controller/map/network/handler/ova/BUILD.bazel +++ /dev/null @@ -1,22 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "ova", - srcs = [ - "doc.go", - "handler.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/map/network/handler/ova", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/provider/web/ova", - "//pkg/controller/watch/handler", - "//pkg/lib/error", - "//pkg/lib/inventory/web", - "//pkg/lib/logging", - "//vendor/golang.org/x/net/context", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - ], -) diff --git a/pkg/controller/map/network/handler/ovirt/BUILD.bazel b/pkg/controller/map/network/handler/ovirt/BUILD.bazel deleted file mode 100644 index 33324642c..000000000 --- a/pkg/controller/map/network/handler/ovirt/BUILD.bazel +++ /dev/null @@ -1,22 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "ovirt", - srcs = [ - "doc.go", - "handler.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/map/network/handler/ovirt", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/provider/web/ovirt", - "//pkg/controller/watch/handler", - "//pkg/lib/error", - "//pkg/lib/inventory/web", - "//pkg/lib/logging", - "//vendor/golang.org/x/net/context", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - ], -) diff --git a/pkg/controller/map/network/handler/vsphere/BUILD.bazel b/pkg/controller/map/network/handler/vsphere/BUILD.bazel deleted file mode 100644 index e7ed1ab88..000000000 --- a/pkg/controller/map/network/handler/vsphere/BUILD.bazel +++ /dev/null @@ -1,22 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "vsphere", - srcs = [ - "doc.go", - "handler.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/map/network/handler/vsphere", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/provider/web/vsphere", - "//pkg/controller/watch/handler", - "//pkg/lib/error", - "//pkg/lib/inventory/web", - "//pkg/lib/logging", - "//vendor/golang.org/x/net/context", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - ], -) diff --git a/pkg/controller/map/storage/BUILD.bazel b/pkg/controller/map/storage/BUILD.bazel deleted file mode 100644 index d20074e82..000000000 --- a/pkg/controller/map/storage/BUILD.bazel +++ /dev/null @@ -1,34 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "storage", - srcs = [ - "controller.go", - "predicate.go", - "validation.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/map/storage", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/ref", - "//pkg/controller/base", - "//pkg/controller/map/storage/handler", - "//pkg/controller/provider/web", - "//pkg/controller/validation", - "//pkg/lib/condition", - "//pkg/lib/logging", - "//pkg/lib/ref", - "//pkg/settings", - "//vendor/k8s.io/apimachinery/pkg/api/errors", - "//vendor/k8s.io/apiserver/pkg/storage/names", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/controller", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - "//vendor/sigs.k8s.io/controller-runtime/pkg/handler", - "//vendor/sigs.k8s.io/controller-runtime/pkg/manager", - "//vendor/sigs.k8s.io/controller-runtime/pkg/predicate", - "//vendor/sigs.k8s.io/controller-runtime/pkg/reconcile", - "//vendor/sigs.k8s.io/controller-runtime/pkg/source", - ], -) diff --git a/pkg/controller/map/storage/handler/BUILD.bazel b/pkg/controller/map/storage/handler/BUILD.bazel deleted file mode 100644 index 29a4c4bd9..000000000 --- a/pkg/controller/map/storage/handler/BUILD.bazel +++ /dev/null @@ -1,20 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "handler", - srcs = ["doc.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/map/storage/handler", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/map/storage/handler/ocp", - "//pkg/controller/map/storage/handler/openstack", - "//pkg/controller/map/storage/handler/ova", - "//pkg/controller/map/storage/handler/ovirt", - "//pkg/controller/map/storage/handler/vsphere", - "//pkg/controller/watch/handler", - "//pkg/lib/error", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - ], -) diff --git a/pkg/controller/map/storage/handler/ocp/BUILD.bazel b/pkg/controller/map/storage/handler/ocp/BUILD.bazel deleted file mode 100644 index b97878e2f..000000000 --- a/pkg/controller/map/storage/handler/ocp/BUILD.bazel +++ /dev/null @@ -1,22 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "ocp", - srcs = [ - "doc.go", - "handler.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/map/storage/handler/ocp", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/provider/web/ocp", - "//pkg/controller/watch/handler", - "//pkg/lib/error", - "//pkg/lib/inventory/web", - "//pkg/lib/logging", - "//vendor/golang.org/x/net/context", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - ], -) diff --git a/pkg/controller/map/storage/handler/openstack/BUILD.bazel b/pkg/controller/map/storage/handler/openstack/BUILD.bazel deleted file mode 100644 index 61626e651..000000000 --- a/pkg/controller/map/storage/handler/openstack/BUILD.bazel +++ /dev/null @@ -1,22 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "openstack", - srcs = [ - "doc.go", - "handler.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/map/storage/handler/openstack", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/provider/web/openstack", - "//pkg/controller/watch/handler", - "//pkg/lib/error", - "//pkg/lib/inventory/web", - "//pkg/lib/logging", - "//vendor/golang.org/x/net/context", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - ], -) diff --git a/pkg/controller/map/storage/handler/ova/BUILD.bazel b/pkg/controller/map/storage/handler/ova/BUILD.bazel deleted file mode 100644 index 99e087e4c..000000000 --- a/pkg/controller/map/storage/handler/ova/BUILD.bazel +++ /dev/null @@ -1,22 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "ova", - srcs = [ - "doc.go", - "handler.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/map/storage/handler/ova", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/provider/web/ova", - "//pkg/controller/watch/handler", - "//pkg/lib/error", - "//pkg/lib/inventory/web", - "//pkg/lib/logging", - "//vendor/golang.org/x/net/context", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - ], -) diff --git a/pkg/controller/map/storage/handler/ovirt/BUILD.bazel b/pkg/controller/map/storage/handler/ovirt/BUILD.bazel deleted file mode 100644 index 0acd91a59..000000000 --- a/pkg/controller/map/storage/handler/ovirt/BUILD.bazel +++ /dev/null @@ -1,22 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "ovirt", - srcs = [ - "doc.go", - "handler.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/map/storage/handler/ovirt", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/provider/web/ovirt", - "//pkg/controller/watch/handler", - "//pkg/lib/error", - "//pkg/lib/inventory/web", - "//pkg/lib/logging", - "//vendor/golang.org/x/net/context", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - ], -) diff --git a/pkg/controller/map/storage/handler/vsphere/BUILD.bazel b/pkg/controller/map/storage/handler/vsphere/BUILD.bazel deleted file mode 100644 index b2db23777..000000000 --- a/pkg/controller/map/storage/handler/vsphere/BUILD.bazel +++ /dev/null @@ -1,22 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "vsphere", - srcs = [ - "doc.go", - "handler.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/map/storage/handler/vsphere", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/provider/web/vsphere", - "//pkg/controller/watch/handler", - "//pkg/lib/error", - "//pkg/lib/inventory/web", - "//pkg/lib/logging", - "//vendor/golang.org/x/net/context", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - ], -) diff --git a/pkg/controller/migration/BUILD.bazel b/pkg/controller/migration/BUILD.bazel deleted file mode 100644 index 34119146d..000000000 --- a/pkg/controller/migration/BUILD.bazel +++ /dev/null @@ -1,35 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "migration", - srcs = [ - "controller.go", - "doc.go", - "predicate.go", - "validation.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/migration", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/base", - "//pkg/controller/plan", - "//pkg/controller/provider/web", - "//pkg/lib/condition", - "//pkg/lib/error", - "//pkg/lib/logging", - "//pkg/lib/ref", - "//pkg/monitoring/metrics/forklift-controller", - "//pkg/settings", - "//vendor/k8s.io/apimachinery/pkg/api/errors", - "//vendor/k8s.io/apiserver/pkg/storage/names", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/controller", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - "//vendor/sigs.k8s.io/controller-runtime/pkg/handler", - "//vendor/sigs.k8s.io/controller-runtime/pkg/manager", - "//vendor/sigs.k8s.io/controller-runtime/pkg/predicate", - "//vendor/sigs.k8s.io/controller-runtime/pkg/reconcile", - "//vendor/sigs.k8s.io/controller-runtime/pkg/source", - ], -) diff --git a/pkg/controller/plan/BUILD.bazel b/pkg/controller/plan/BUILD.bazel deleted file mode 100644 index ce4fc4458..000000000 --- a/pkg/controller/plan/BUILD.bazel +++ /dev/null @@ -1,106 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "plan", - srcs = [ - "controller.go", - "doc.go", - "hook.go", - "kubevirt.go", - "migration.go", - "predicate.go", - "util.go", - "validation.go", - "vm_name_handler.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/plan", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/plan", - "//pkg/apis/forklift/v1beta1/ref", - "//pkg/controller/base", - "//pkg/controller/plan/adapter", - "//pkg/controller/plan/adapter/base", - "//pkg/controller/plan/adapter/vsphere", - "//pkg/controller/plan/context", - "//pkg/controller/plan/handler", - "//pkg/controller/plan/scheduler", - "//pkg/controller/plan/util", - "//pkg/controller/provider/web", - "//pkg/controller/provider/web/vsphere", - "//pkg/controller/validation", - "//pkg/lib/client/openshift", - "//pkg/lib/condition", - "//pkg/lib/error", - "//pkg/lib/itinerary", - "//pkg/lib/logging", - "//pkg/lib/ref", - "//pkg/monitoring/metrics/forklift-controller", - "//pkg/settings", - "//vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1:k8s_cni_cncf_io", - "//vendor/github.com/openshift/api/template/v1:template", - "//vendor/github.com/openshift/library-go/pkg/template/generator", - "//vendor/github.com/openshift/library-go/pkg/template/templateprocessing", - "//vendor/gopkg.in/yaml.v2:yaml_v2", - "//vendor/k8s.io/api/batch/v1:batch", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/api/errors", - "//vendor/k8s.io/apimachinery/pkg/api/resource", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - "//vendor/k8s.io/apimachinery/pkg/conversion", - "//vendor/k8s.io/apimachinery/pkg/fields", - "//vendor/k8s.io/apimachinery/pkg/labels", - "//vendor/k8s.io/apimachinery/pkg/runtime", - "//vendor/k8s.io/apimachinery/pkg/types", - "//vendor/k8s.io/apimachinery/pkg/util/validation", - "//vendor/k8s.io/apiserver/pkg/storage/names", - "//vendor/k8s.io/client-go/kubernetes", - "//vendor/k8s.io/client-go/kubernetes/scheme", - "//vendor/k8s.io/utils/ptr", - "//vendor/kubevirt.io/api/core/v1:core", - "//vendor/kubevirt.io/api/instancetype", - "//vendor/kubevirt.io/api/instancetype/v1beta1", - "//vendor/kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1", - "//vendor/libvirt.org/libvirt-go-xml", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/controller", - "//vendor/sigs.k8s.io/controller-runtime/pkg/controller/controllerutil", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - "//vendor/sigs.k8s.io/controller-runtime/pkg/handler", - "//vendor/sigs.k8s.io/controller-runtime/pkg/manager", - "//vendor/sigs.k8s.io/controller-runtime/pkg/predicate", - "//vendor/sigs.k8s.io/controller-runtime/pkg/reconcile", - "//vendor/sigs.k8s.io/controller-runtime/pkg/source", - ], -) - -go_test( - name = "plan_test", - srcs = [ - "kubevirt_test.go", - "plan_suite_test.go", - "validation_test.go", - "vm_name_handler_test.go", - ], - embed = [":plan"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/provider", - "//pkg/apis/forklift/v1beta1/ref", - "//pkg/controller/base", - "//pkg/controller/plan/context", - "//pkg/lib/condition", - "//pkg/lib/logging", - "//vendor/github.com/onsi/ginkgo/v2:ginkgo", - "//vendor/github.com/onsi/gomega", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - "//vendor/k8s.io/apimachinery/pkg/runtime", - "//vendor/k8s.io/apimachinery/pkg/version", - "//vendor/k8s.io/client-go/discovery/fake", - "//vendor/k8s.io/client-go/kubernetes/fake", - "//vendor/k8s.io/utils/ptr", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client/fake", - ], -) diff --git a/pkg/controller/plan/adapter/BUILD.bazel b/pkg/controller/plan/adapter/BUILD.bazel deleted file mode 100644 index 879faea7d..000000000 --- a/pkg/controller/plan/adapter/BUILD.bazel +++ /dev/null @@ -1,53 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "adapter", - srcs = [ - "converter.go", - "doc.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/plan/adapter", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/plan/adapter/base", - "//pkg/controller/plan/adapter/ocp", - "//pkg/controller/plan/adapter/openstack", - "//pkg/controller/plan/adapter/ova", - "//pkg/controller/plan/adapter/ovirt", - "//pkg/controller/plan/adapter/vsphere", - "//pkg/controller/plan/context", - "//pkg/controller/provider/web/base", - "//pkg/lib/error", - "//pkg/lib/logging", - "//vendor/k8s.io/api/batch/v1:batch", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - "//vendor/k8s.io/utils/ptr", - "//vendor/kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - ], -) - -go_test( - name = "adapter_test", - srcs = [ - "adapter_suite_test.go", - "converter_test.go", - ], - embed = [":adapter"], - deps = [ - "//pkg/controller/plan/adapter/base", - "//pkg/controller/plan/context", - "//pkg/lib/logging", - "//vendor/github.com/onsi/ginkgo/v2:ginkgo", - "//vendor/github.com/onsi/gomega", - "//vendor/k8s.io/api/batch/v1:batch", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - "//vendor/k8s.io/apimachinery/pkg/runtime", - "//vendor/k8s.io/apimachinery/pkg/types", - "//vendor/kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client/fake", - ], -) diff --git a/pkg/controller/plan/adapter/base/BUILD.bazel b/pkg/controller/plan/adapter/base/BUILD.bazel deleted file mode 100644 index 1b82caa96..000000000 --- a/pkg/controller/plan/adapter/base/BUILD.bazel +++ /dev/null @@ -1,19 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "base", - srcs = ["doc.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/plan/adapter/base", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/plan", - "//pkg/apis/forklift/v1beta1/ref", - "//pkg/controller/plan/context", - "//pkg/controller/plan/util", - "//pkg/lib/error", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/kubevirt.io/api/core/v1:core", - "//vendor/kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1", - ], -) diff --git a/pkg/controller/plan/adapter/ocp/BUILD.bazel b/pkg/controller/plan/adapter/ocp/BUILD.bazel deleted file mode 100644 index 87ff7d9d5..000000000 --- a/pkg/controller/plan/adapter/ocp/BUILD.bazel +++ /dev/null @@ -1,39 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "ocp", - srcs = [ - "adapter.go", - "builder.go", - "client.go", - "destinationclient.go", - "validator.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/plan/adapter/ocp", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/plan", - "//pkg/apis/forklift/v1beta1/ref", - "//pkg/controller/plan/adapter/base", - "//pkg/controller/plan/context", - "//pkg/controller/plan/util", - "//pkg/controller/provider/web", - "//pkg/lib/client/openshift", - "//pkg/lib/error", - "//pkg/lib/itinerary", - "//pkg/lib/logging", - "//pkg/settings", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/api/errors", - "//vendor/k8s.io/apimachinery/pkg/api/resource", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - "//vendor/k8s.io/apimachinery/pkg/runtime/serializer", - "//vendor/k8s.io/client-go/kubernetes/scheme", - "//vendor/kubevirt.io/api/core/v1:core", - "//vendor/kubevirt.io/api/export/v1alpha1", - "//vendor/kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client/config", - ], -) diff --git a/pkg/controller/plan/adapter/openstack/BUILD.bazel b/pkg/controller/plan/adapter/openstack/BUILD.bazel deleted file mode 100644 index c901f0d26..000000000 --- a/pkg/controller/plan/adapter/openstack/BUILD.bazel +++ /dev/null @@ -1,66 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "openstack", - srcs = [ - "adapter.go", - "builder.go", - "client.go", - "common.go", - "destinationclient.go", - "validator.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/plan/adapter/openstack", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/plan", - "//pkg/apis/forklift/v1beta1/ref", - "//pkg/controller/plan/adapter/base", - "//pkg/controller/plan/context", - "//pkg/controller/plan/util", - "//pkg/controller/provider/web", - "//pkg/controller/provider/web/base", - "//pkg/controller/provider/web/ocp", - "//pkg/controller/provider/web/openstack", - "//pkg/lib/client/openstack", - "//pkg/lib/error", - "//pkg/lib/itinerary", - "//pkg/settings", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/api/errors", - "//vendor/k8s.io/apimachinery/pkg/api/resource", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - "//vendor/k8s.io/apimachinery/pkg/labels", - "//vendor/k8s.io/apimachinery/pkg/types", - "//vendor/k8s.io/apimachinery/pkg/util/wait", - "//vendor/k8s.io/utils/ptr", - "//vendor/kubevirt.io/api/core/v1:core", - "//vendor/kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/controller/controllerutil", - ], -) - -go_test( - name = "openstack_test", - srcs = [ - "adapter_suite_test.go", - "builder_test.go", - "destionationclient_test.go", - ], - embed = [":openstack"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/plan", - "//pkg/controller/plan/context", - "//pkg/lib/logging", - "//vendor/github.com/onsi/ginkgo/v2:ginkgo", - "//vendor/github.com/onsi/gomega", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - "//vendor/k8s.io/apimachinery/pkg/runtime", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client/fake", - ], -) diff --git a/pkg/controller/plan/adapter/ova/BUILD.bazel b/pkg/controller/plan/adapter/ova/BUILD.bazel deleted file mode 100644 index 7e226422e..000000000 --- a/pkg/controller/plan/adapter/ova/BUILD.bazel +++ /dev/null @@ -1,45 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "ova", - srcs = [ - "adapter.go", - "builder.go", - "client.go", - "destinationclient.go", - "ovfparser.go", - "validator.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/plan/adapter/ova", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/plan", - "//pkg/apis/forklift/v1beta1/ref", - "//pkg/controller/plan/adapter/base", - "//pkg/controller/plan/context", - "//pkg/controller/plan/util", - "//pkg/controller/provider/model/ova", - "//pkg/controller/provider/web", - "//pkg/controller/provider/web/base", - "//pkg/controller/provider/web/ocp", - "//pkg/controller/provider/web/ova", - "//pkg/lib/error", - "//pkg/lib/inventory/web", - "//pkg/lib/itinerary", - "//pkg/lib/logging", - "//vendor/github.com/go-logr/logr", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/api/resource", - "//vendor/k8s.io/utils/ptr", - "//vendor/kubevirt.io/api/core/v1:core", - "//vendor/kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1", - ], -) - -go_test( - name = "ova_test", - srcs = ["ova_capacity_test.go"], - embed = [":ova"], - deps = ["//vendor/github.com/onsi/gomega"], -) diff --git a/pkg/controller/plan/adapter/ovirt/BUILD.bazel b/pkg/controller/plan/adapter/ovirt/BUILD.bazel deleted file mode 100644 index 1be7f18d0..000000000 --- a/pkg/controller/plan/adapter/ovirt/BUILD.bazel +++ /dev/null @@ -1,64 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "ovirt", - srcs = [ - "adapter.go", - "builder.go", - "client.go", - "destinationclient.go", - "validator.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/plan/adapter/ovirt", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/plan", - "//pkg/apis/forklift/v1beta1/ref", - "//pkg/controller/plan/adapter/base", - "//pkg/controller/plan/context", - "//pkg/controller/plan/util", - "//pkg/controller/provider/container", - "//pkg/controller/provider/container/ovirt", - "//pkg/controller/provider/web", - "//pkg/controller/provider/web/base", - "//pkg/controller/provider/web/ocp", - "//pkg/controller/provider/web/ovirt", - "//pkg/lib/error", - "//pkg/lib/itinerary", - "//pkg/settings", - "//vendor/github.com/ovirt/go-ovirt", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/api/errors", - "//vendor/k8s.io/apimachinery/pkg/api/resource", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - "//vendor/k8s.io/apimachinery/pkg/labels", - "//vendor/k8s.io/apimachinery/pkg/types", - "//vendor/kubevirt.io/api/core/v1:core", - "//vendor/kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/controller/controllerutil", - ], -) - -go_test( - name = "ovirt_test", - srcs = [ - "destinationclient_test.go", - "ovirt_suite_test.go", - ], - embed = [":ovirt"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/plan", - "//pkg/controller/plan/context", - "//pkg/lib/logging", - "//vendor/github.com/onsi/ginkgo/v2:ginkgo", - "//vendor/github.com/onsi/gomega", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - "//vendor/k8s.io/apimachinery/pkg/runtime", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client/fake", - ], -) diff --git a/pkg/controller/plan/adapter/vsphere/BUILD.bazel b/pkg/controller/plan/adapter/vsphere/BUILD.bazel deleted file mode 100644 index cd15868d9..000000000 --- a/pkg/controller/plan/adapter/vsphere/BUILD.bazel +++ /dev/null @@ -1,79 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "vsphere", - srcs = [ - "adapter.go", - "builder.go", - "client.go", - "destinationclient.go", - "host.go", - "inspectionparser.go", - "validator.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/plan/adapter/vsphere", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/plan", - "//pkg/apis/forklift/v1beta1/ref", - "//pkg/controller/plan/adapter/base", - "//pkg/controller/plan/context", - "//pkg/controller/plan/util", - "//pkg/controller/provider/container/vsphere", - "//pkg/controller/provider/model/vsphere", - "//pkg/controller/provider/web", - "//pkg/controller/provider/web/base", - "//pkg/controller/provider/web/ocp", - "//pkg/controller/provider/web/vsphere", - "//pkg/lib/condition", - "//pkg/lib/error", - "//pkg/lib/itinerary", - "//pkg/lib/logging", - "//pkg/lib/ref", - "//pkg/settings", - "//vendor/github.com/vmware/govmomi", - "//vendor/github.com/vmware/govmomi/find", - "//vendor/github.com/vmware/govmomi/object", - "//vendor/github.com/vmware/govmomi/property", - "//vendor/github.com/vmware/govmomi/session", - "//vendor/github.com/vmware/govmomi/vim25", - "//vendor/github.com/vmware/govmomi/vim25/mo", - "//vendor/github.com/vmware/govmomi/vim25/soap", - "//vendor/github.com/vmware/govmomi/vim25/types", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/api/resource", - "//vendor/k8s.io/utils/ptr", - "//vendor/kubevirt.io/api/core/v1:core", - "//vendor/kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - ], -) - -go_test( - name = "vsphere_test", - srcs = [ - "builder_test.go", - "validator_test.go", - "vsphere_suite_test.go", - ], - embed = [":vsphere"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/plan", - "//pkg/apis/forklift/v1beta1/ref", - "//pkg/controller/plan/context", - "//pkg/controller/provider/model/vsphere", - "//pkg/controller/provider/web", - "//pkg/controller/provider/web/base", - "//pkg/controller/provider/web/vsphere", - "//pkg/lib/logging", - "//vendor/github.com/onsi/ginkgo/v2:ginkgo", - "//vendor/github.com/onsi/gomega", - "//vendor/github.com/vmware/govmomi/vim25/types", - "//vendor/k8s.io/api/apps/v1:apps", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - "//vendor/k8s.io/apimachinery/pkg/runtime", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client/fake", - ], -) diff --git a/pkg/controller/plan/context/BUILD.bazel b/pkg/controller/plan/context/BUILD.bazel deleted file mode 100644 index ff6477c1d..000000000 --- a/pkg/controller/plan/context/BUILD.bazel +++ /dev/null @@ -1,20 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "context", - srcs = [ - "doc.go", - "migration.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/plan/context", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/provider/web", - "//pkg/lib/client/openshift", - "//pkg/lib/error", - "//pkg/lib/logging", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - ], -) diff --git a/pkg/controller/plan/handler/BUILD.bazel b/pkg/controller/plan/handler/BUILD.bazel deleted file mode 100644 index f246f17f9..000000000 --- a/pkg/controller/plan/handler/BUILD.bazel +++ /dev/null @@ -1,20 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "handler", - srcs = ["doc.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/plan/handler", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/plan/handler/ocp", - "//pkg/controller/plan/handler/openstack", - "//pkg/controller/plan/handler/ova", - "//pkg/controller/plan/handler/ovirt", - "//pkg/controller/plan/handler/vsphere", - "//pkg/controller/watch/handler", - "//pkg/lib/error", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - ], -) diff --git a/pkg/controller/plan/handler/ocp/BUILD.bazel b/pkg/controller/plan/handler/ocp/BUILD.bazel deleted file mode 100644 index 8da547988..000000000 --- a/pkg/controller/plan/handler/ocp/BUILD.bazel +++ /dev/null @@ -1,22 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "ocp", - srcs = [ - "doc.go", - "handler.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/plan/handler/ocp", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/provider/web/ocp", - "//pkg/controller/watch/handler", - "//pkg/lib/error", - "//pkg/lib/inventory/web", - "//pkg/lib/logging", - "//vendor/golang.org/x/net/context", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - ], -) diff --git a/pkg/controller/plan/handler/openstack/BUILD.bazel b/pkg/controller/plan/handler/openstack/BUILD.bazel deleted file mode 100644 index 38c5a23d0..000000000 --- a/pkg/controller/plan/handler/openstack/BUILD.bazel +++ /dev/null @@ -1,22 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "openstack", - srcs = [ - "doc.go", - "handler.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/plan/handler/openstack", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/provider/web/openstack", - "//pkg/controller/watch/handler", - "//pkg/lib/error", - "//pkg/lib/inventory/web", - "//pkg/lib/logging", - "//vendor/golang.org/x/net/context", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - ], -) diff --git a/pkg/controller/plan/handler/ova/BUILD.bazel b/pkg/controller/plan/handler/ova/BUILD.bazel deleted file mode 100644 index 855c23f9b..000000000 --- a/pkg/controller/plan/handler/ova/BUILD.bazel +++ /dev/null @@ -1,22 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "ova", - srcs = [ - "doc.go", - "handler.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/plan/handler/ova", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/provider/web/ova", - "//pkg/controller/watch/handler", - "//pkg/lib/error", - "//pkg/lib/inventory/web", - "//pkg/lib/logging", - "//vendor/golang.org/x/net/context", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - ], -) diff --git a/pkg/controller/plan/handler/ovirt/BUILD.bazel b/pkg/controller/plan/handler/ovirt/BUILD.bazel deleted file mode 100644 index 10e72f2c7..000000000 --- a/pkg/controller/plan/handler/ovirt/BUILD.bazel +++ /dev/null @@ -1,22 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "ovirt", - srcs = [ - "doc.go", - "handler.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/plan/handler/ovirt", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/provider/web/ovirt", - "//pkg/controller/watch/handler", - "//pkg/lib/error", - "//pkg/lib/inventory/web", - "//pkg/lib/logging", - "//vendor/golang.org/x/net/context", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - ], -) diff --git a/pkg/controller/plan/handler/vsphere/BUILD.bazel b/pkg/controller/plan/handler/vsphere/BUILD.bazel deleted file mode 100644 index 1dced0670..000000000 --- a/pkg/controller/plan/handler/vsphere/BUILD.bazel +++ /dev/null @@ -1,22 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "vsphere", - srcs = [ - "doc.go", - "handler.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/plan/handler/vsphere", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/provider/web/vsphere", - "//pkg/controller/watch/handler", - "//pkg/lib/error", - "//pkg/lib/inventory/web", - "//pkg/lib/logging", - "//vendor/golang.org/x/net/context", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - ], -) diff --git a/pkg/controller/plan/scheduler/BUILD.bazel b/pkg/controller/plan/scheduler/BUILD.bazel deleted file mode 100644 index 334051db2..000000000 --- a/pkg/controller/plan/scheduler/BUILD.bazel +++ /dev/null @@ -1,20 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "scheduler", - srcs = ["doc.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/plan/scheduler", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/plan", - "//pkg/controller/plan/context", - "//pkg/controller/plan/scheduler/ocp", - "//pkg/controller/plan/scheduler/openstack", - "//pkg/controller/plan/scheduler/ova", - "//pkg/controller/plan/scheduler/ovirt", - "//pkg/controller/plan/scheduler/vsphere", - "//pkg/lib/error", - "//pkg/settings", - ], -) diff --git a/pkg/controller/plan/scheduler/ocp/BUILD.bazel b/pkg/controller/plan/scheduler/ocp/BUILD.bazel deleted file mode 100644 index 29e103a21..000000000 --- a/pkg/controller/plan/scheduler/ocp/BUILD.bazel +++ /dev/null @@ -1,14 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "ocp", - srcs = ["scheduler.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/plan/scheduler/ocp", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/plan", - "//pkg/controller/plan/context", - "//pkg/lib/error", - ], -) diff --git a/pkg/controller/plan/scheduler/openstack/BUILD.bazel b/pkg/controller/plan/scheduler/openstack/BUILD.bazel deleted file mode 100644 index f59b4a86a..000000000 --- a/pkg/controller/plan/scheduler/openstack/BUILD.bazel +++ /dev/null @@ -1,14 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "openstack", - srcs = ["scheduler.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/plan/scheduler/openstack", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/plan", - "//pkg/controller/plan/context", - "//pkg/lib/error", - ], -) diff --git a/pkg/controller/plan/scheduler/ova/BUILD.bazel b/pkg/controller/plan/scheduler/ova/BUILD.bazel deleted file mode 100644 index 05a9adca4..000000000 --- a/pkg/controller/plan/scheduler/ova/BUILD.bazel +++ /dev/null @@ -1,14 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "ova", - srcs = ["scheduler.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/plan/scheduler/ova", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/plan", - "//pkg/controller/plan/context", - "//pkg/lib/error", - ], -) diff --git a/pkg/controller/plan/scheduler/ovirt/BUILD.bazel b/pkg/controller/plan/scheduler/ovirt/BUILD.bazel deleted file mode 100644 index 97fb6db7d..000000000 --- a/pkg/controller/plan/scheduler/ovirt/BUILD.bazel +++ /dev/null @@ -1,14 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "ovirt", - srcs = ["scheduler.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/plan/scheduler/ovirt", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/plan", - "//pkg/controller/plan/context", - "//pkg/lib/error", - ], -) diff --git a/pkg/controller/plan/scheduler/vsphere/BUILD.bazel b/pkg/controller/plan/scheduler/vsphere/BUILD.bazel deleted file mode 100644 index 0b95d6051..000000000 --- a/pkg/controller/plan/scheduler/vsphere/BUILD.bazel +++ /dev/null @@ -1,23 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "vsphere", - srcs = ["scheduler.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/plan/scheduler/vsphere", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/plan", - "//pkg/controller/plan/context", - "//pkg/controller/provider/web", - "//pkg/controller/provider/web/vsphere", - "//pkg/lib/error", - ], -) - -go_test( - name = "vsphere_test", - srcs = ["scheduler_test.go"], - embed = [":vsphere"], - deps = ["//vendor/github.com/onsi/gomega"], -) diff --git a/pkg/controller/plan/util/BUILD.bazel b/pkg/controller/plan/util/BUILD.bazel deleted file mode 100644 index ca7e8f33e..000000000 --- a/pkg/controller/plan/util/BUILD.bazel +++ /dev/null @@ -1,39 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "util", - srcs = [ - "kubevirtvmparser.go", - "openstack.go", - "ovirt.go", - "utils.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/plan/util", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/provider/web/openstack", - "//pkg/controller/provider/web/ovirt", - "//pkg/lib/logging", - "//pkg/settings", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - "//vendor/kubevirt.io/api/core/v1:core", - "//vendor/sigs.k8s.io/yaml", - ], -) - -go_test( - name = "util_test", - srcs = [ - "kubevirtvmparser_test.go", - "util_suite_test.go", - "utils_test.go", - ], - data = glob(["testdata/**"]), - embed = [":util"], - deps = [ - "//vendor/github.com/onsi/ginkgo/v2:ginkgo", - "//vendor/github.com/onsi/gomega", - ], -) diff --git a/pkg/controller/provider/BUILD.bazel b/pkg/controller/provider/BUILD.bazel deleted file mode 100644 index d0596c75e..000000000 --- a/pkg/controller/provider/BUILD.bazel +++ /dev/null @@ -1,50 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "provider", - srcs = [ - "controller.go", - "ova-setup.go", - "predicate.go", - "validation.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/provider", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/base", - "//pkg/controller/provider/container", - "//pkg/controller/provider/container/ovirt", - "//pkg/controller/provider/container/vsphere", - "//pkg/controller/provider/model", - "//pkg/controller/provider/web", - "//pkg/controller/validation/policy", - "//pkg/lib/condition", - "//pkg/lib/error", - "//pkg/lib/filebacked", - "//pkg/lib/inventory/container", - "//pkg/lib/inventory/model", - "//pkg/lib/inventory/web", - "//pkg/lib/logging", - "//pkg/lib/ref", - "//pkg/lib/util", - "//pkg/settings", - "//vendor/k8s.io/api/apps/v1:apps", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/api/errors", - "//vendor/k8s.io/apimachinery/pkg/api/resource", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - "//vendor/k8s.io/apimachinery/pkg/labels", - "//vendor/k8s.io/apimachinery/pkg/util/intstr", - "//vendor/k8s.io/apiserver/pkg/storage/names", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/controller", - "//vendor/sigs.k8s.io/controller-runtime/pkg/controller/controllerutil", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - "//vendor/sigs.k8s.io/controller-runtime/pkg/handler", - "//vendor/sigs.k8s.io/controller-runtime/pkg/manager", - "//vendor/sigs.k8s.io/controller-runtime/pkg/predicate", - "//vendor/sigs.k8s.io/controller-runtime/pkg/reconcile", - "//vendor/sigs.k8s.io/controller-runtime/pkg/source", - ], -) diff --git a/pkg/controller/provider/container/BUILD.bazel b/pkg/controller/provider/container/BUILD.bazel deleted file mode 100644 index c612bdefa..000000000 --- a/pkg/controller/provider/container/BUILD.bazel +++ /dev/null @@ -1,19 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "container", - srcs = ["doc.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/provider/container", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/provider/container/ocp", - "//pkg/controller/provider/container/openstack", - "//pkg/controller/provider/container/ova", - "//pkg/controller/provider/container/ovirt", - "//pkg/controller/provider/container/vsphere", - "//pkg/lib/inventory/container", - "//pkg/lib/inventory/model", - "//vendor/k8s.io/api/core/v1:core", - ], -) diff --git a/pkg/controller/provider/container/ocp/BUILD.bazel b/pkg/controller/provider/container/ocp/BUILD.bazel deleted file mode 100644 index 7e178a54a..000000000 --- a/pkg/controller/provider/container/ocp/BUILD.bazel +++ /dev/null @@ -1,29 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "ocp", - srcs = [ - "collection.go", - "collector.go", - "doc.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/provider/container/ocp", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/provider/model/ocp", - "//pkg/lib/error", - "//pkg/lib/inventory/container", - "//pkg/lib/inventory/container/ocp", - "//pkg/lib/inventory/model", - "//pkg/lib/logging", - "//pkg/lib/ref", - "//vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1:k8s_cni_cncf_io", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/api/storage/v1:storage", - "//vendor/kubevirt.io/api/core/v1:core", - "//vendor/kubevirt.io/api/instancetype/v1beta1", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - ], -) diff --git a/pkg/controller/provider/container/openstack/BUILD.bazel b/pkg/controller/provider/container/openstack/BUILD.bazel deleted file mode 100644 index 060e2dd12..000000000 --- a/pkg/controller/provider/container/openstack/BUILD.bazel +++ /dev/null @@ -1,30 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "openstack", - srcs = [ - "client.go", - "collector.go", - "doc.go", - "model.go", - "resource.go", - "watch.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/provider/container/openstack", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/ref", - "//pkg/controller/provider/model/openstack", - "//pkg/controller/provider/web/openstack", - "//pkg/controller/validation/policy", - "//pkg/lib/client/openstack", - "//pkg/lib/error", - "//pkg/lib/filebacked", - "//pkg/lib/inventory/model", - "//pkg/lib/logging", - "//pkg/settings", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - ], -) diff --git a/pkg/controller/provider/container/ova/BUILD.bazel b/pkg/controller/provider/container/ova/BUILD.bazel deleted file mode 100644 index 1dd6ed665..000000000 --- a/pkg/controller/provider/container/ova/BUILD.bazel +++ /dev/null @@ -1,30 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "ova", - srcs = [ - "client.go", - "collector.go", - "doc.go", - "model.go", - "resource.go", - "watch.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/provider/container/ova", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/ref", - "//pkg/controller/provider/model/ova", - "//pkg/controller/provider/web/ova", - "//pkg/controller/validation/policy", - "//pkg/lib/error", - "//pkg/lib/filebacked", - "//pkg/lib/inventory/model", - "//pkg/lib/inventory/web", - "//pkg/lib/logging", - "//pkg/settings", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - ], -) diff --git a/pkg/controller/provider/container/ovirt/BUILD.bazel b/pkg/controller/provider/container/ovirt/BUILD.bazel deleted file mode 100644 index 592934ffe..000000000 --- a/pkg/controller/provider/container/ovirt/BUILD.bazel +++ /dev/null @@ -1,46 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "ovirt", - srcs = [ - "client.go", - "collector.go", - "doc.go", - "model.go", - "resource.go", - "watch.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/provider/container/ovirt", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/ref", - "//pkg/controller/provider/model/ovirt", - "//pkg/controller/provider/web/ovirt", - "//pkg/controller/validation/policy", - "//pkg/lib/error", - "//pkg/lib/filebacked", - "//pkg/lib/inventory/container", - "//pkg/lib/inventory/model", - "//pkg/lib/inventory/web", - "//pkg/lib/logging", - "//pkg/settings", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - ], -) - -go_test( - name = "ovirt_test", - srcs = [ - "collector_suite_test.go", - "collector_test.go", - ], - embed = [":ovirt"], - deps = [ - "//vendor/github.com/onsi/ginkgo", - "//vendor/github.com/onsi/ginkgo/extensions/table", - "//vendor/github.com/onsi/gomega", - "//vendor/github.com/onsi/gomega/types", - ], -) diff --git a/pkg/controller/provider/container/vsphere/BUILD.bazel b/pkg/controller/provider/container/vsphere/BUILD.bazel deleted file mode 100644 index e6de53c8b..000000000 --- a/pkg/controller/provider/container/vsphere/BUILD.bazel +++ /dev/null @@ -1,55 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "vsphere", - srcs = [ - "collector.go", - "doc.go", - "model.go", - "utils.go", - "watch.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/provider/container/vsphere", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/ref", - "//pkg/controller/provider/model/vsphere", - "//pkg/controller/provider/web/vsphere", - "//pkg/controller/validation/policy", - "//pkg/lib/error", - "//pkg/lib/inventory/model", - "//pkg/lib/logging", - "//pkg/lib/ref", - "//pkg/settings", - "//vendor/github.com/vmware/govmomi", - "//vendor/github.com/vmware/govmomi/property", - "//vendor/github.com/vmware/govmomi/session", - "//vendor/github.com/vmware/govmomi/vim25", - "//vendor/github.com/vmware/govmomi/vim25/methods", - "//vendor/github.com/vmware/govmomi/vim25/soap", - "//vendor/github.com/vmware/govmomi/vim25/types", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - ], -) - -go_test( - name = "vsphere_test", - srcs = [ - "collector_suite_test.go", - "collector_test.go", - ], - embed = [":vsphere"], - deps = [ - "//vendor/github.com/onsi/ginkgo", - "//vendor/github.com/onsi/ginkgo/extensions/table", - "//vendor/github.com/onsi/gomega", - "//vendor/github.com/onsi/gomega/types", - "//vendor/github.com/vmware/govmomi", - "//vendor/github.com/vmware/govmomi/session", - "//vendor/github.com/vmware/govmomi/vim25", - "//vendor/github.com/vmware/govmomi/vim25/soap", - "//vendor/github.com/vmware/govmomi/vim25/types", - ], -) diff --git a/pkg/controller/provider/model/BUILD.bazel b/pkg/controller/provider/model/BUILD.bazel deleted file mode 100644 index 386aa5054..000000000 --- a/pkg/controller/provider/model/BUILD.bazel +++ /dev/null @@ -1,16 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "model", - srcs = ["doc.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/provider/model", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/provider/model/ocp", - "//pkg/controller/provider/model/openstack", - "//pkg/controller/provider/model/ova", - "//pkg/controller/provider/model/ovirt", - "//pkg/controller/provider/model/vsphere", - ], -) diff --git a/pkg/controller/provider/model/base/BUILD.bazel b/pkg/controller/provider/model/base/BUILD.bazel deleted file mode 100644 index 6dd64623c..000000000 --- a/pkg/controller/provider/model/base/BUILD.bazel +++ /dev/null @@ -1,15 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "base", - srcs = [ - "model.go", - "tree.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/provider/model/base", - visibility = ["//visibility:public"], - deps = [ - "//pkg/lib/inventory/model", - "//pkg/lib/ref", - ], -) diff --git a/pkg/controller/provider/model/ocp/BUILD.bazel b/pkg/controller/provider/model/ocp/BUILD.bazel deleted file mode 100644 index 7c7402090..000000000 --- a/pkg/controller/provider/model/ocp/BUILD.bazel +++ /dev/null @@ -1,25 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "ocp", - srcs = [ - "doc.go", - "model.go", - "tree.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/provider/model/ocp", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/provider/model/base", - "//pkg/lib/inventory/model", - "//pkg/lib/ref", - "//vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1:k8s_cni_cncf_io", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/api/storage/v1:storage", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - "//vendor/k8s.io/apimachinery/pkg/runtime", - "//vendor/kubevirt.io/api/core/v1:core", - "//vendor/kubevirt.io/api/instancetype/v1beta1", - ], -) diff --git a/pkg/controller/provider/model/openstack/BUILD.bazel b/pkg/controller/provider/model/openstack/BUILD.bazel deleted file mode 100644 index e53d9abdf..000000000 --- a/pkg/controller/provider/model/openstack/BUILD.bazel +++ /dev/null @@ -1,18 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "openstack", - srcs = [ - "doc.go", - "model.go", - "tree.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/provider/model/openstack", - visibility = ["//visibility:public"], - deps = [ - "//pkg/controller/provider/model/base", - "//pkg/controller/provider/model/ocp", - "//pkg/lib/inventory/model", - "//pkg/lib/ref", - ], -) diff --git a/pkg/controller/provider/model/ova/BUILD.bazel b/pkg/controller/provider/model/ova/BUILD.bazel deleted file mode 100644 index 5b6908db8..000000000 --- a/pkg/controller/provider/model/ova/BUILD.bazel +++ /dev/null @@ -1,18 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "ova", - srcs = [ - "doc.go", - "model.go", - "tree.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/provider/model/ova", - visibility = ["//visibility:public"], - deps = [ - "//pkg/controller/provider/model/base", - "//pkg/controller/provider/model/ocp", - "//pkg/lib/inventory/model", - "//pkg/lib/ref", - ], -) diff --git a/pkg/controller/provider/model/ovirt/BUILD.bazel b/pkg/controller/provider/model/ovirt/BUILD.bazel deleted file mode 100644 index 78a37dc49..000000000 --- a/pkg/controller/provider/model/ovirt/BUILD.bazel +++ /dev/null @@ -1,18 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "ovirt", - srcs = [ - "doc.go", - "model.go", - "tree.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/provider/model/ovirt", - visibility = ["//visibility:public"], - deps = [ - "//pkg/controller/provider/model/base", - "//pkg/controller/provider/model/ocp", - "//pkg/lib/inventory/model", - "//pkg/lib/ref", - ], -) diff --git a/pkg/controller/provider/model/vsphere/BUILD.bazel b/pkg/controller/provider/model/vsphere/BUILD.bazel deleted file mode 100644 index 06e8394bf..000000000 --- a/pkg/controller/provider/model/vsphere/BUILD.bazel +++ /dev/null @@ -1,18 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "vsphere", - srcs = [ - "doc.go", - "model.go", - "tree.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/provider/model/vsphere", - visibility = ["//visibility:public"], - deps = [ - "//pkg/controller/provider/model/base", - "//pkg/controller/provider/model/ocp", - "//pkg/lib/inventory/model", - "//pkg/lib/ref", - ], -) diff --git a/pkg/controller/provider/web/BUILD.bazel b/pkg/controller/provider/web/BUILD.bazel deleted file mode 100644 index d3076c3df..000000000 --- a/pkg/controller/provider/web/BUILD.bazel +++ /dev/null @@ -1,26 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "web", - srcs = [ - "client.go", - "doc.go", - "provider.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/provider/web", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/provider/web/base", - "//pkg/controller/provider/web/ocp", - "//pkg/controller/provider/web/openstack", - "//pkg/controller/provider/web/ova", - "//pkg/controller/provider/web/ovirt", - "//pkg/controller/provider/web/vsphere", - "//pkg/lib/error", - "//pkg/lib/inventory/container", - "//pkg/lib/inventory/web", - "//pkg/lib/logging", - "//vendor/github.com/gin-gonic/gin", - ], -) diff --git a/pkg/controller/provider/web/base/BUILD.bazel b/pkg/controller/provider/web/base/BUILD.bazel deleted file mode 100644 index 0d1d0bb20..000000000 --- a/pkg/controller/provider/web/base/BUILD.bazel +++ /dev/null @@ -1,49 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "base", - srcs = [ - "auth.go", - "client.go", - "handler.go", - "tree.go", - "utils.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/provider/web/base", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/ref", - "//pkg/controller/provider/model/base", - "//pkg/lib/error", - "//pkg/lib/inventory/container", - "//pkg/lib/inventory/model", - "//pkg/lib/inventory/web", - "//pkg/lib/logging", - "//pkg/settings", - "//vendor/github.com/gin-gonic/gin", - "//vendor/k8s.io/api/authentication/v1:authentication", - "//vendor/k8s.io/api/authorization/v1:authorization", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - "//vendor/k8s.io/apimachinery/pkg/runtime/schema", - "//vendor/k8s.io/apimachinery/pkg/types", - "//vendor/k8s.io/client-go/kubernetes/scheme", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client/config", - ], -) - -go_test( - name = "base_test", - srcs = ["auth_test.go"], - embed = [":base"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//vendor/github.com/gin-gonic/gin", - "//vendor/github.com/onsi/gomega", - "//vendor/k8s.io/api/authentication/v1:authentication", - "//vendor/k8s.io/api/authorization/v1:authorization", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - ], -) diff --git a/pkg/controller/provider/web/ocp/BUILD.bazel b/pkg/controller/provider/web/ocp/BUILD.bazel deleted file mode 100644 index 0a4c9967c..000000000 --- a/pkg/controller/provider/web/ocp/BUILD.bazel +++ /dev/null @@ -1,38 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "ocp", - srcs = [ - "base.go", - "client.go", - "clusterinstancetype.go", - "doc.go", - "instancetype.go", - "namespace.go", - "netattachdefinition.go", - "provider.go", - "resource.go", - "storageclass.go", - "tree.go", - "vm.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/provider/web/ocp", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/provider/model/ocp", - "//pkg/controller/provider/web/base", - "//pkg/lib/error", - "//pkg/lib/inventory/container", - "//pkg/lib/inventory/model", - "//pkg/lib/inventory/web", - "//pkg/lib/logging", - "//pkg/lib/ref", - "//vendor/github.com/gin-gonic/gin", - "//vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1:k8s_cni_cncf_io", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/api/storage/v1:storage", - "//vendor/kubevirt.io/api/core/v1:core", - "//vendor/kubevirt.io/api/instancetype/v1beta1", - ], -) diff --git a/pkg/controller/provider/web/openstack/BUILD.bazel b/pkg/controller/provider/web/openstack/BUILD.bazel deleted file mode 100644 index f68823b9a..000000000 --- a/pkg/controller/provider/web/openstack/BUILD.bazel +++ /dev/null @@ -1,40 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "openstack", - srcs = [ - "base.go", - "client.go", - "doc.go", - "flavor.go", - "image.go", - "network.go", - "project.go", - "provider.go", - "region.go", - "resource.go", - "snapshot.go", - "subnet.go", - "tree.go", - "vm.go", - "volume.go", - "volumetype.go", - "workload.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/provider/web/openstack", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/provider/model/ocp", - "//pkg/controller/provider/model/openstack", - "//pkg/controller/provider/web/base", - "//pkg/controller/provider/web/ocp", - "//pkg/lib/error", - "//pkg/lib/inventory/container", - "//pkg/lib/inventory/model", - "//pkg/lib/inventory/web", - "//pkg/lib/logging", - "//pkg/lib/ref", - "//vendor/github.com/gin-gonic/gin", - ], -) diff --git a/pkg/controller/provider/web/ova/BUILD.bazel b/pkg/controller/provider/web/ova/BUILD.bazel deleted file mode 100644 index 4dbdea5fc..000000000 --- a/pkg/controller/provider/web/ova/BUILD.bazel +++ /dev/null @@ -1,34 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "ova", - srcs = [ - "base.go", - "client.go", - "disk.go", - "doc.go", - "network.go", - "provider.go", - "resource.go", - "storage.go", - "tree.go", - "vm.go", - "workload.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/provider/web/ova", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/provider/model/ocp", - "//pkg/controller/provider/model/ova", - "//pkg/controller/provider/web/base", - "//pkg/controller/provider/web/ocp", - "//pkg/lib/error", - "//pkg/lib/inventory/container", - "//pkg/lib/inventory/model", - "//pkg/lib/inventory/web", - "//pkg/lib/logging", - "//pkg/lib/ref", - "//vendor/github.com/gin-gonic/gin", - ], -) diff --git a/pkg/controller/provider/web/ovirt/BUILD.bazel b/pkg/controller/provider/web/ovirt/BUILD.bazel deleted file mode 100644 index 7d7392f04..000000000 --- a/pkg/controller/provider/web/ovirt/BUILD.bazel +++ /dev/null @@ -1,40 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "ovirt", - srcs = [ - "base.go", - "client.go", - "cluster.go", - "datacenter.go", - "disk.go", - "diskprofile.go", - "doc.go", - "host.go", - "network.go", - "nicprofile.go", - "provider.go", - "resource.go", - "servercpu.go", - "storage.go", - "tree.go", - "vm.go", - "workload.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/provider/web/ovirt", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/provider/model/ocp", - "//pkg/controller/provider/model/ovirt", - "//pkg/controller/provider/web/base", - "//pkg/controller/provider/web/ocp", - "//pkg/lib/error", - "//pkg/lib/inventory/container", - "//pkg/lib/inventory/model", - "//pkg/lib/inventory/web", - "//pkg/lib/logging", - "//pkg/lib/ref", - "//vendor/github.com/gin-gonic/gin", - ], -) diff --git a/pkg/controller/provider/web/vsphere/BUILD.bazel b/pkg/controller/provider/web/vsphere/BUILD.bazel deleted file mode 100644 index 9ea04481b..000000000 --- a/pkg/controller/provider/web/vsphere/BUILD.bazel +++ /dev/null @@ -1,47 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "vsphere", - srcs = [ - "base.go", - "client.go", - "cluster.go", - "datacenter.go", - "datastore.go", - "doc.go", - "folder.go", - "host.go", - "network.go", - "provider.go", - "resource.go", - "tree.go", - "vm.go", - "workload.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/provider/web/vsphere", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/provider/model/ocp", - "//pkg/controller/provider/model/vsphere", - "//pkg/controller/provider/web/base", - "//pkg/controller/provider/web/ocp", - "//pkg/lib/error", - "//pkg/lib/inventory/container", - "//pkg/lib/inventory/model", - "//pkg/lib/inventory/web", - "//pkg/lib/logging", - "//pkg/lib/ref", - "//vendor/github.com/gin-gonic/gin", - ], -) - -go_test( - name = "vsphere_test", - srcs = ["base_test.go"], - embed = [":vsphere"], - deps = [ - "//pkg/controller/provider/model/vsphere", - "//vendor/github.com/onsi/gomega", - ], -) diff --git a/pkg/controller/validation/BUILD.bazel b/pkg/controller/validation/BUILD.bazel deleted file mode 100644 index 06d555e4f..000000000 --- a/pkg/controller/validation/BUILD.bazel +++ /dev/null @@ -1,18 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "validation", - srcs = ["provider.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/validation", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/provider", - "//pkg/lib/condition", - "//pkg/lib/error", - "//pkg/lib/ref", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/api/errors", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - ], -) diff --git a/pkg/controller/validation/policy/BUILD.bazel b/pkg/controller/validation/policy/BUILD.bazel deleted file mode 100644 index ebbc6961c..000000000 --- a/pkg/controller/validation/policy/BUILD.bazel +++ /dev/null @@ -1,16 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "policy", - srcs = ["client.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/validation/policy", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1/ref", - "//pkg/controller/provider/model/vsphere", - "//pkg/lib/error", - "//pkg/lib/inventory/web", - "//pkg/lib/logging", - "//pkg/settings", - ], -) diff --git a/pkg/controller/watch/BUILD.bazel b/pkg/controller/watch/BUILD.bazel deleted file mode 100644 index 6fc2e5391..000000000 --- a/pkg/controller/watch/BUILD.bazel +++ /dev/null @@ -1,8 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "watch", - srcs = ["doc.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/watch", - visibility = ["//visibility:public"], -) diff --git a/pkg/controller/watch/handler/BUILD.bazel b/pkg/controller/watch/handler/BUILD.bazel deleted file mode 100644 index 347b566b9..000000000 --- a/pkg/controller/watch/handler/BUILD.bazel +++ /dev/null @@ -1,24 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "handler", - srcs = [ - "doc.go", - "handler.go", - "watch.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/controller/watch/handler", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/provider/web", - "//pkg/lib/inventory/web", - "//pkg/lib/logging", - "//pkg/lib/ref", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - "//vendor/k8s.io/apimachinery/pkg/types", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - ], -) diff --git a/pkg/forklift-api/BUILD.bazel b/pkg/forklift-api/BUILD.bazel deleted file mode 100644 index ba2d52122..000000000 --- a/pkg/forklift-api/BUILD.bazel +++ /dev/null @@ -1,14 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "forklift-api", - srcs = ["api.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/forklift-api", - visibility = ["//visibility:public"], - deps = [ - "//pkg/forklift-api/services", - "//pkg/forklift-api/webhooks", - "//pkg/lib/logging", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - ], -) diff --git a/pkg/forklift-api/services/BUILD.bazel b/pkg/forklift-api/services/BUILD.bazel deleted file mode 100644 index 97eb734c0..000000000 --- a/pkg/forklift-api/services/BUILD.bazel +++ /dev/null @@ -1,17 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "services", - srcs = [ - "services.go", - "tls-certificate.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/forklift-api/services", - visibility = ["//visibility:public"], - deps = [ - "//pkg/lib/logging", - "//pkg/lib/util", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - ], -) diff --git a/pkg/forklift-api/webhooks/BUILD.bazel b/pkg/forklift-api/webhooks/BUILD.bazel deleted file mode 100644 index 039464145..000000000 --- a/pkg/forklift-api/webhooks/BUILD.bazel +++ /dev/null @@ -1,21 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "webhooks", - srcs = [ - "mutating-webhook.go", - "validating-webhook.go", - "webhooks.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/forklift-api/webhooks", - visibility = ["//visibility:public"], - deps = [ - "//pkg/forklift-api/webhooks/mutating-webhook", - "//pkg/forklift-api/webhooks/mutating-webhook/mutators", - "//pkg/forklift-api/webhooks/validating-webhook", - "//pkg/forklift-api/webhooks/validating-webhook/admitters", - "//pkg/lib/logging", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/manager", - ], -) diff --git a/pkg/forklift-api/webhooks/mutating-webhook/BUILD.bazel b/pkg/forklift-api/webhooks/mutating-webhook/BUILD.bazel deleted file mode 100644 index fb510447c..000000000 --- a/pkg/forklift-api/webhooks/mutating-webhook/BUILD.bazel +++ /dev/null @@ -1,15 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "mutating-webhook", - srcs = ["mutating-webhook.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/forklift-api/webhooks/mutating-webhook", - visibility = ["//visibility:public"], - deps = [ - "//pkg/forklift-api/webhooks/util", - "//pkg/lib/logging", - "//vendor/k8s.io/api/admission/v1beta1", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - "//vendor/k8s.io/apimachinery/pkg/runtime", - ], -) diff --git a/pkg/forklift-api/webhooks/mutating-webhook/mutators/BUILD.bazel b/pkg/forklift-api/webhooks/mutating-webhook/mutators/BUILD.bazel deleted file mode 100644 index 792bb324c..000000000 --- a/pkg/forklift-api/webhooks/mutating-webhook/mutators/BUILD.bazel +++ /dev/null @@ -1,34 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "mutators", - srcs = [ - "plan-mutator.go", - "provider-mutator.go", - "secret-mutator.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/forklift-api/webhooks/mutating-webhook/mutators", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/ref", - "//pkg/forklift-api/webhooks/util", - "//pkg/lib/client/openshift", - "//pkg/lib/error", - "//pkg/lib/logging", - "//vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1:k8s_cni_cncf_io", - "//vendor/k8s.io/api/admission/v1beta1", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/api/errors", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/controller/controllerutil", - ], -) - -go_test( - name = "mutators_test", - srcs = ["secret-mutator_test.go"], - embed = [":mutators"], - deps = ["//vendor/github.com/onsi/gomega"], -) diff --git a/pkg/forklift-api/webhooks/util/BUILD.bazel b/pkg/forklift-api/webhooks/util/BUILD.bazel deleted file mode 100644 index bed25f463..000000000 --- a/pkg/forklift-api/webhooks/util/BUILD.bazel +++ /dev/null @@ -1,13 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "util", - srcs = ["util.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/forklift-api/webhooks/util", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//vendor/k8s.io/api/admission/v1beta1", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - ], -) diff --git a/pkg/forklift-api/webhooks/validating-webhook/BUILD.bazel b/pkg/forklift-api/webhooks/validating-webhook/BUILD.bazel deleted file mode 100644 index dc17d5010..000000000 --- a/pkg/forklift-api/webhooks/validating-webhook/BUILD.bazel +++ /dev/null @@ -1,14 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "validating-webhook", - srcs = ["validating-webhook.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/forklift-api/webhooks/validating-webhook", - visibility = ["//visibility:public"], - deps = [ - "//pkg/forklift-api/webhooks/util", - "//vendor/k8s.io/api/admission/v1beta1", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - "//vendor/k8s.io/apimachinery/pkg/runtime", - ], -) diff --git a/pkg/forklift-api/webhooks/validating-webhook/admitters/BUILD.bazel b/pkg/forklift-api/webhooks/validating-webhook/admitters/BUILD.bazel deleted file mode 100644 index 61d3de84a..000000000 --- a/pkg/forklift-api/webhooks/validating-webhook/admitters/BUILD.bazel +++ /dev/null @@ -1,30 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "admitters", - srcs = [ - "plan-admitter.go", - "provider-admitter.go", - "secret-admitter.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/forklift-api/webhooks/validating-webhook/admitters", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/controller/plan/adapter/vsphere", - "//pkg/controller/provider/container", - "//pkg/controller/provider/web", - "//pkg/controller/provider/web/vsphere", - "//pkg/forklift-api/webhooks/util", - "//pkg/lib/error", - "//pkg/lib/inventory/container", - "//pkg/lib/logging", - "//pkg/settings", - "//vendor/k8s.io/api/admission/v1beta1", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/api/storage/v1:storage", - "//vendor/k8s.io/apimachinery/pkg/api/errors", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - ], -) diff --git a/pkg/lib-volume-populator/populator-machinery/BUILD.bazel b/pkg/lib-volume-populator/populator-machinery/BUILD.bazel deleted file mode 100644 index aa3ad26c8..000000000 --- a/pkg/lib-volume-populator/populator-machinery/BUILD.bazel +++ /dev/null @@ -1,51 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "populator-machinery", - srcs = [ - "controller.go", - "metrics.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/lib-volume-populator/populator-machinery", - visibility = ["//visibility:public"], - deps = [ - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/api/storage/v1:storage", - "//vendor/k8s.io/apimachinery/pkg/api/errors", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", - "//vendor/k8s.io/apimachinery/pkg/runtime/schema", - "//vendor/k8s.io/apimachinery/pkg/types", - "//vendor/k8s.io/apimachinery/pkg/util/json", - "//vendor/k8s.io/apimachinery/pkg/util/runtime", - "//vendor/k8s.io/apimachinery/pkg/util/wait", - "//vendor/k8s.io/client-go/dynamic", - "//vendor/k8s.io/client-go/dynamic/dynamicinformer", - "//vendor/k8s.io/client-go/dynamic/dynamiclister", - "//vendor/k8s.io/client-go/informers", - "//vendor/k8s.io/client-go/kubernetes", - "//vendor/k8s.io/client-go/kubernetes/scheme", - "//vendor/k8s.io/client-go/kubernetes/typed/core/v1:core", - "//vendor/k8s.io/client-go/listers/core/v1:core", - "//vendor/k8s.io/client-go/listers/storage/v1:storage", - "//vendor/k8s.io/client-go/tools/cache", - "//vendor/k8s.io/client-go/tools/clientcmd", - "//vendor/k8s.io/client-go/tools/record", - "//vendor/k8s.io/client-go/util/workqueue", - "//vendor/k8s.io/component-base/metrics", - "//vendor/k8s.io/component-helpers/storage/volume", - "//vendor/k8s.io/klog/v2:klog", - "//vendor/k8s.io/utils/ptr", - ], -) - -go_test( - name = "populator-machinery_test", - srcs = ["metrics_test.go"], - embed = [":populator-machinery"], - deps = [ - "//vendor/github.com/prometheus/client_model/go", - "//vendor/github.com/prometheus/common/expfmt", - "//vendor/k8s.io/apimachinery/pkg/types", - ], -) diff --git a/pkg/lib/BUILD.bazel b/pkg/lib/BUILD.bazel deleted file mode 100644 index 1365cdb78..000000000 --- a/pkg/lib/BUILD.bazel +++ /dev/null @@ -1,8 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "lib", - srcs = ["doc.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/lib", - visibility = ["//visibility:public"], -) diff --git a/pkg/lib/client/openshift/BUILD.bazel b/pkg/lib/client/openshift/BUILD.bazel deleted file mode 100644 index 586c04f58..000000000 --- a/pkg/lib/client/openshift/BUILD.bazel +++ /dev/null @@ -1,37 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "openshift", - srcs = [ - "client.go", - "util.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/lib/client/openshift", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/ref", - "//pkg/lib/error", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/client-go/kubernetes/scheme", - "//vendor/k8s.io/client-go/rest", - "//vendor/k8s.io/klog/v2:klog", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client/config", - ], -) - -go_test( - name = "openshift_test", - srcs = [ - "client_test.go", - "util_test.go", - ], - embed = [":openshift"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/ref", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - ], -) diff --git a/pkg/lib/client/openstack/BUILD.bazel b/pkg/lib/client/openstack/BUILD.bazel deleted file mode 100644 index 67464bd91..000000000 --- a/pkg/lib/client/openstack/BUILD.bazel +++ /dev/null @@ -1,36 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "openstack", - srcs = [ - "client.go", - "model.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/lib/client/openstack", - visibility = ["//visibility:public"], - deps = [ - "//pkg/lib/error", - "//pkg/lib/logging", - "//vendor/github.com/gophercloud/gophercloud", - "//vendor/github.com/gophercloud/gophercloud/openstack", - "//vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/extensions/volumeactions", - "//vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v3/snapshots", - "//vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v3/volumes", - "//vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v3/volumetypes", - "//vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/startstop", - "//vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/flavors", - "//vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/servers", - "//vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/applicationcredentials", - "//vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/projects", - "//vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/regions", - "//vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/tokens", - "//vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/users", - "//vendor/github.com/gophercloud/gophercloud/openstack/imageservice/v2/imagedata", - "//vendor/github.com/gophercloud/gophercloud/openstack/imageservice/v2/images", - "//vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/networks", - "//vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/subnets", - "//vendor/github.com/gophercloud/gophercloud/pagination", - "//vendor/github.com/gophercloud/utils/openstack/clientconfig", - "//vendor/k8s.io/api/core/v1:core", - ], -) diff --git a/pkg/lib/cmd/BUILD.bazel b/pkg/lib/cmd/BUILD.bazel deleted file mode 100644 index 6664254ca..000000000 --- a/pkg/lib/cmd/BUILD.bazel +++ /dev/null @@ -1,8 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "cmd", - srcs = ["doc.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/lib/cmd", - visibility = ["//visibility:public"], -) diff --git a/pkg/lib/cmd/inventory/BUILD.bazel b/pkg/lib/cmd/inventory/BUILD.bazel deleted file mode 100644 index e5f6ce2c9..000000000 --- a/pkg/lib/cmd/inventory/BUILD.bazel +++ /dev/null @@ -1,23 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") - -go_library( - name = "inventory_lib", - srcs = ["main.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/lib/cmd/inventory", - visibility = ["//visibility:private"], - deps = [ - "//pkg/lib/error", - "//pkg/lib/inventory/container", - "//pkg/lib/inventory/model", - "//pkg/lib/inventory/web", - "//pkg/lib/logging", - "//vendor/github.com/gin-gonic/gin", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - ], -) - -go_binary( - name = "inventory", - embed = [":inventory_lib"], - visibility = ["//visibility:public"], -) diff --git a/pkg/lib/condition/BUILD.bazel b/pkg/lib/condition/BUILD.bazel deleted file mode 100644 index a8ddbbb9b..000000000 --- a/pkg/lib/condition/BUILD.bazel +++ /dev/null @@ -1,23 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "condition", - srcs = [ - "condition.go", - "doc.go", - "zz_generated.deepcopy.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/lib/condition", - visibility = ["//visibility:public"], - deps = ["//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta"], -) - -go_test( - name = "condition_test", - srcs = ["condition_test.go"], - embed = [":condition"], - deps = [ - "//vendor/github.com/onsi/gomega", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - ], -) diff --git a/pkg/lib/error/BUILD.bazel b/pkg/lib/error/BUILD.bazel deleted file mode 100644 index 143f5bcce..000000000 --- a/pkg/lib/error/BUILD.bazel +++ /dev/null @@ -1,21 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "error", - srcs = [ - "doc.go", - "wrap.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/lib/error", - visibility = ["//visibility:public"], -) - -go_test( - name = "error_test", - srcs = ["error_test.go"], - embed = [":error"], - deps = [ - "//vendor/github.com/onsi/gomega", - "//vendor/github.com/pkg/errors", - ], -) diff --git a/pkg/lib/filebacked/BUILD.bazel b/pkg/lib/filebacked/BUILD.bazel deleted file mode 100644 index e6eb740ef..000000000 --- a/pkg/lib/filebacked/BUILD.bazel +++ /dev/null @@ -1,26 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "filebacked", - srcs = [ - "catalog.go", - "doc.go", - "file.go", - "iterator.go", - "list.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/lib/filebacked", - visibility = ["//visibility:public"], - deps = [ - "//pkg/lib/error", - "//pkg/lib/logging", - "//vendor/github.com/google/uuid", - ], -) - -go_test( - name = "filebacked_test", - srcs = ["list_test.go"], - embed = [":filebacked"], - deps = ["//vendor/github.com/onsi/gomega"], -) diff --git a/pkg/lib/gob/BUILD.bazel b/pkg/lib/gob/BUILD.bazel deleted file mode 100644 index 96a35575c..000000000 --- a/pkg/lib/gob/BUILD.bazel +++ /dev/null @@ -1,15 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "gob", - srcs = [ - "decoder.go", - "enc_helpers.go", - "encode.go", - "encoder.go", - "error.go", - "type.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/lib/gob", - visibility = ["//visibility:public"], -) diff --git a/pkg/lib/inventory/container/BUILD.bazel b/pkg/lib/inventory/container/BUILD.bazel deleted file mode 100644 index ce5600feb..000000000 --- a/pkg/lib/inventory/container/BUILD.bazel +++ /dev/null @@ -1,32 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "container", - srcs = [ - "collection.go", - "container.go", - "doc.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/lib/inventory/container", - visibility = ["//visibility:public"], - deps = [ - "//pkg/lib/error", - "//pkg/lib/filebacked", - "//pkg/lib/inventory/model", - "//pkg/lib/logging", - "//pkg/lib/ref", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - ], -) - -go_test( - name = "container_test", - srcs = ["collection_test.go"], - embed = [":container"], - deps = [ - "//pkg/lib/filebacked", - "//pkg/lib/inventory/model", - "//vendor/github.com/onsi/gomega", - ], -) diff --git a/pkg/lib/inventory/container/ocp/BUILD.bazel b/pkg/lib/inventory/container/ocp/BUILD.bazel deleted file mode 100644 index 907a91881..000000000 --- a/pkg/lib/inventory/container/ocp/BUILD.bazel +++ /dev/null @@ -1,31 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "ocp", - srcs = [ - "collection.go", - "collector.go", - "doc.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/lib/inventory/container/ocp", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/lib/client/openshift", - "//pkg/lib/error", - "//pkg/lib/inventory/model", - "//pkg/lib/logging", - "//pkg/lib/ref", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - "//vendor/k8s.io/client-go/kubernetes/scheme", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/controller", - "//vendor/sigs.k8s.io/controller-runtime/pkg/handler", - "//vendor/sigs.k8s.io/controller-runtime/pkg/manager", - "//vendor/sigs.k8s.io/controller-runtime/pkg/metrics/server", - "//vendor/sigs.k8s.io/controller-runtime/pkg/predicate", - "//vendor/sigs.k8s.io/controller-runtime/pkg/reconcile", - "//vendor/sigs.k8s.io/controller-runtime/pkg/source", - ], -) diff --git a/pkg/lib/inventory/model/BUILD.bazel b/pkg/lib/inventory/model/BUILD.bazel deleted file mode 100644 index fdaa05cfd..000000000 --- a/pkg/lib/inventory/model/BUILD.bazel +++ /dev/null @@ -1,39 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "model", - srcs = [ - "client.go", - "doc.go", - "field.go", - "inspect.go", - "journal.go", - "label.go", - "model.go", - "predicate.go", - "relation.go", - "session.go", - "table.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/lib/inventory/model", - visibility = ["//visibility:public"], - deps = [ - "//pkg/lib/error", - "//pkg/lib/filebacked", - "//pkg/lib/logging", - "//pkg/lib/ref", - "//vendor/github.com/mattn/go-sqlite3", - "//vendor/github.com/pkg/errors", - ], -) - -go_test( - name = "model_test", - srcs = ["model_test.go"], - embed = [":model"], - deps = [ - "//pkg/lib/error", - "//pkg/lib/ref", - "//vendor/github.com/onsi/gomega", - ], -) diff --git a/pkg/lib/inventory/web/BUILD.bazel b/pkg/lib/inventory/web/BUILD.bazel deleted file mode 100644 index 6600c3518..000000000 --- a/pkg/lib/inventory/web/BUILD.bazel +++ /dev/null @@ -1,23 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "web", - srcs = [ - "client.go", - "doc.go", - "handler.go", - "web.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/lib/inventory/web", - visibility = ["//visibility:public"], - deps = [ - "//pkg/lib/error", - "//pkg/lib/inventory/container", - "//pkg/lib/inventory/model", - "//pkg/lib/logging", - "//pkg/lib/ref", - "//vendor/github.com/gin-contrib/cors", - "//vendor/github.com/gin-gonic/gin", - "//vendor/github.com/gorilla/websocket", - ], -) diff --git a/pkg/lib/itinerary/BUILD.bazel b/pkg/lib/itinerary/BUILD.bazel deleted file mode 100644 index c5fbd9876..000000000 --- a/pkg/lib/itinerary/BUILD.bazel +++ /dev/null @@ -1,19 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "itinerary", - srcs = [ - "doc.go", - "simple.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/lib/itinerary", - visibility = ["//visibility:public"], - deps = ["//pkg/lib/error"], -) - -go_test( - name = "itinerary_test", - srcs = ["simple_test.go"], - embed = [":itinerary"], - deps = ["//vendor/github.com/onsi/gomega"], -) diff --git a/pkg/lib/logging/BUILD.bazel b/pkg/lib/logging/BUILD.bazel deleted file mode 100644 index 103261e48..000000000 --- a/pkg/lib/logging/BUILD.bazel +++ /dev/null @@ -1,18 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "logging", - srcs = [ - "factory.go", - "logger.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/lib/logging", - visibility = ["//visibility:public"], - deps = [ - "//pkg/lib/error", - "//vendor/github.com/go-logr/logr", - "//vendor/github.com/go-logr/zapr", - "//vendor/go.uber.org/zap", - "//vendor/go.uber.org/zap/zapcore", - ], -) diff --git a/pkg/lib/ref/BUILD.bazel b/pkg/lib/ref/BUILD.bazel deleted file mode 100644 index d40871b33..000000000 --- a/pkg/lib/ref/BUILD.bazel +++ /dev/null @@ -1,38 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "ref", - srcs = [ - "handler.go", - "labels.go", - "mapping.go", - "predicate.go", - "ref.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/lib/ref", - visibility = ["//visibility:public"], - deps = [ - "//pkg/lib/logging", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - "//vendor/k8s.io/apimachinery/pkg/types", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - "//vendor/sigs.k8s.io/controller-runtime/pkg/handler", - "//vendor/sigs.k8s.io/controller-runtime/pkg/reconcile", - ], -) - -go_test( - name = "ref_test", - srcs = ["ref_test.go"], - embed = [":ref"], - deps = [ - "//vendor/github.com/onsi/gomega", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - "//vendor/k8s.io/apimachinery/pkg/runtime", - "//vendor/k8s.io/apimachinery/pkg/runtime/schema", - "//vendor/sigs.k8s.io/controller-runtime/pkg/event", - ], -) diff --git a/pkg/lib/util/BUILD.bazel b/pkg/lib/util/BUILD.bazel deleted file mode 100644 index 49fd71dbd..000000000 --- a/pkg/lib/util/BUILD.bazel +++ /dev/null @@ -1,13 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "util", - srcs = ["util.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/lib/util", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/lib/error", - "//vendor/k8s.io/api/core/v1:core", - ], -) diff --git a/pkg/metrics/BUILD.bazel b/pkg/metrics/BUILD.bazel deleted file mode 100644 index ed063db10..000000000 --- a/pkg/metrics/BUILD.bazel +++ /dev/null @@ -1,13 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "metrics", - srcs = ["promethousutil.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/metrics", - visibility = ["//visibility:public"], - deps = [ - "//vendor/github.com/prometheus/client_golang/prometheus/promhttp", - "//vendor/k8s.io/client-go/util/cert", - "//vendor/k8s.io/klog/v2:klog", - ], -) diff --git a/pkg/monitoring/metrics/forklift-controller/BUILD.bazel b/pkg/monitoring/metrics/forklift-controller/BUILD.bazel deleted file mode 100644 index cdddd80b5..000000000 --- a/pkg/monitoring/metrics/forklift-controller/BUILD.bazel +++ /dev/null @@ -1,18 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "forklift-controller", - srcs = [ - "metrics.go", - "migration_metrics.go", - "plan_metrics.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/monitoring/metrics/forklift-controller", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//vendor/github.com/prometheus/client_golang/prometheus", - "//vendor/github.com/prometheus/client_golang/prometheus/promauto", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - ], -) diff --git a/pkg/settings/BUILD.bazel b/pkg/settings/BUILD.bazel deleted file mode 100644 index 3d0779ed1..000000000 --- a/pkg/settings/BUILD.bazel +++ /dev/null @@ -1,23 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "settings", - srcs = [ - "features.go", - "inventory.go", - "logging.go", - "metrics.go", - "migration.go", - "policy.go", - "profiler.go", - "role.go", - "settings.go", - ], - importpath = "github.com/konveyor/forklift-controller/pkg/settings", - visibility = ["//visibility:public"], - deps = [ - "//pkg/lib/error", - "//pkg/lib/logging", - "//vendor/k8s.io/apimachinery/pkg/api/resource", - ], -) diff --git a/pkg/webhook/BUILD.bazel b/pkg/webhook/BUILD.bazel deleted file mode 100644 index 5f0d55498..000000000 --- a/pkg/webhook/BUILD.bazel +++ /dev/null @@ -1,9 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "webhook", - srcs = ["webhook.go"], - importpath = "github.com/konveyor/forklift-controller/pkg/webhook", - visibility = ["//visibility:public"], - deps = ["//vendor/sigs.k8s.io/controller-runtime/pkg/manager"], -) diff --git a/tests/suit/BUILD.bazel b/tests/suit/BUILD.bazel deleted file mode 100644 index aa9099595..000000000 --- a/tests/suit/BUILD.bazel +++ /dev/null @@ -1,82 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "go_default_library", - srcs = [ - "exec_util.go", - "framework.go", - "kubectl.go", - "nfs-utils.go", - "nodeplacement.go", - "pod.go", - "prometheus.go", - "pv.go", - "pvc.go", - "vddk.go", - ], - importpath = "kubevirt.io/containerized-data-importer/tests/framework", - visibility = ["//visibility:public"], - deps = [ - "//pkg/client/clientset/versioned:go_default_library", - "//pkg/common:go_default_library", - "//pkg/controller:go_default_library", - "//pkg/feature-gates:go_default_library", - "//pkg/image:go_default_library", - "//pkg/util/naming:go_default_library", - "//staging/src/kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1:go_default_library", - "//tests/utils:go_default_library", - "//vendor/github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1:go_default_library", - "//vendor/github.com/docker/go-units:go_default_library", - "//vendor/github.com/google/uuid:go_default_library", - "//vendor/github.com/kubernetes-csi/external-snapshotter/client/v4/apis/volumesnapshot/v1:go_default_library", - "//vendor/github.com/onsi/ginkgo:go_default_library", - "//vendor/github.com/onsi/gomega:go_default_library", - "//vendor/github.com/pkg/errors:go_default_library", - "//vendor/k8s.io/api/authentication/v1:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/api/storage/v1:go_default_library", - "//vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/intstr:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", - "//vendor/k8s.io/client-go/dynamic:go_default_library", - "//vendor/k8s.io/client-go/kubernetes:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/scheme:go_default_library", - "//vendor/k8s.io/client-go/rest:go_default_library", - "//vendor/k8s.io/client-go/tools/clientcmd:go_default_library", - "//vendor/k8s.io/client-go/tools/remotecommand:go_default_library", - "//vendor/k8s.io/klog/v2:go_default_library", - "//vendor/kubevirt.io/controller-lifecycle-operator-sdk/api:go_default_library", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client:go_default_library", - ], -) - -go_test( - name = "suit_test", - srcs = [ - "forklift_test.go", - "openstack_extended_test.go", - "openstack_test.go", - "ova_test.go", - "ovirt_test.go", - "tests_suite_test.go", - "vsphere_test.go", - ], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/ref", - "//pkg/lib/client/openstack", - "//pkg/lib/logging", - "//tests/suit/framework", - "//tests/suit/utils", - "//vendor/github.com/onsi/ginkgo", - "//vendor/github.com/onsi/gomega", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - "//vendor/k8s.io/apimachinery/pkg/types", - "//vendor/kubevirt.io/api/core/v1:core", - ], -) diff --git a/tests/suit/framework/BUILD.bazel b/tests/suit/framework/BUILD.bazel deleted file mode 100644 index 89323b9a8..000000000 --- a/tests/suit/framework/BUILD.bazel +++ /dev/null @@ -1,42 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "framework", - srcs = [ - "exec_util.go", - "framework.go", - "openstack.go", - "ova.go", - "ovirt.go", - ], - importpath = "github.com/konveyor/forklift-controller/tests/suit/framework", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis", - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/ref", - "//tests/suit/utils", - "//vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1:k8s_cni_cncf_io", - "//vendor/github.com/onsi/ginkgo", - "//vendor/github.com/onsi/gomega", - "//vendor/github.com/ovirt/go-ovirt", - "//vendor/k8s.io/api/authentication/v1:authentication", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/api/storage/v1:storage", - "//vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset", - "//vendor/k8s.io/apimachinery/pkg/api/errors", - "//vendor/k8s.io/apimachinery/pkg/api/resource", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - "//vendor/k8s.io/apimachinery/pkg/runtime", - "//vendor/k8s.io/apimachinery/pkg/util/wait", - "//vendor/k8s.io/client-go/dynamic", - "//vendor/k8s.io/client-go/kubernetes", - "//vendor/k8s.io/client-go/kubernetes/scheme", - "//vendor/k8s.io/client-go/rest", - "//vendor/k8s.io/client-go/tools/clientcmd", - "//vendor/k8s.io/client-go/tools/remotecommand", - "//vendor/k8s.io/klog/v2:klog", - "//vendor/kubevirt.io/api/core/v1:core", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - ], -) diff --git a/tests/suit/utils/BUILD.bazel b/tests/suit/utils/BUILD.bazel deleted file mode 100644 index 7349e8956..000000000 --- a/tests/suit/utils/BUILD.bazel +++ /dev/null @@ -1,38 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "utils", - srcs = [ - "common.go", - "http.go", - "migration.go", - "networkmap.go", - "plan.go", - "pod.go", - "provider.go", - "secrets.go", - "storagemap.go", - ], - importpath = "github.com/konveyor/forklift-controller/tests/suit/utils", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/forklift/v1beta1", - "//pkg/apis/forklift/v1beta1/plan", - "//pkg/apis/forklift/v1beta1/provider", - "//pkg/apis/forklift/v1beta1/ref", - "//pkg/lib/error", - "//vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1:k8s_cni_cncf_io", - "//vendor/github.com/onsi/ginkgo", - "//vendor/github.com/pkg/errors", - "//vendor/k8s.io/api/core/v1:core", - "//vendor/k8s.io/api/storage/v1:storage", - "//vendor/k8s.io/apimachinery/pkg/api/errors", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", - "//vendor/k8s.io/apimachinery/pkg/types", - "//vendor/k8s.io/apimachinery/pkg/util/wait", - "//vendor/k8s.io/client-go/kubernetes", - "//vendor/k8s.io/klog/v2:klog", - "//vendor/kubevirt.io/api/core/v1:core", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client", - ], -) diff --git a/validation/BUILD.bazel b/validation/BUILD.bazel deleted file mode 100644 index 04d17ede4..000000000 --- a/validation/BUILD.bazel +++ /dev/null @@ -1,28 +0,0 @@ -load( - "@io_bazel_rules_docker//container:container.bzl", - "container_image", -) - -container_image( - name = "validation-policies", - base = "@ubi9-minimal//image", - directory = "/usr/share/opa/", - files = ["policies"], -) - -container_image( - name = "opa", - base = ":validation-policies", - directory = "/usr/bin/", - files = ["@opa//file"], -) - -container_image( - name = "forklift-validation-image", - base = ":opa", - directory = "/", - entrypoint = ["/entrypoint.sh"], - files = ["entrypoint.sh"], - user = "1001", - visibility = ["//visibility:public"], -) diff --git a/vendor/libvirt.org/go/libvirt/.gitignore b/vendor/libvirt.org/go/libvirt/.gitignore new file mode 100644 index 000000000..122d3fb3a --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/.gitignore @@ -0,0 +1,7 @@ +generator +*.sublime-workspace +*.sublime-project +.vagrant +*~ +.#* +\#* diff --git a/vendor/libvirt.org/go/libvirt/.gitlab-ci.yml b/vendor/libvirt.org/go/libvirt/.gitlab-ci.yml new file mode 100644 index 000000000..4785da28a --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/.gitlab-ci.yml @@ -0,0 +1,102 @@ + +stages: + - containers + - builds + - sanity_checks + +.git_build_vars: &git_build_vars | + export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)" + export SCRATCH_DIR="$PWD/scratch" + export VROOT="$SCRATCH_DIR/vroot" + export LIBDIR="$VROOT/lib" + export LD_LIBRARY_PATH="$LIBDIR" + export PATH="$VROOT/bin:$PATH" + export PKG_CONFIG_PATH="$LIBDIR/pkgconfig" + +.native_git_build_job: + extends: + - .gitlab_native_build_job + script: + - *git_build_vars + - pushd "$PWD" + - mkdir -p "$SCRATCH_DIR" + - cd "$SCRATCH_DIR" + - git clone --depth 1 https://gitlab.com/libvirt/libvirt.git + - cd libvirt + - meson build -Ddriver_libvirtd=disabled "--prefix=$VROOT" "--libdir=$LIBDIR" + - ninja -C build install + - popd + - go build + - go test + - go test -tags libvirt_without_qemu + - go test -tags libvirt_without_lxc + +.native_build_job: + extends: + - .gitlab_native_build_job + script: + - go build -x + - go test + - go build -x -tags libvirt_without_qemu + - go test -tags libvirt_without_qemu + - go build -x -tags libvirt_without_lxc + - go test -tags libvirt_without_lxc + +include: '/ci/gitlab.yml' + +.api_coverage_job: + extents: + - .gitlab_native_build_job + stage: sanity_checks + script: + - *git_build_vars + - go test -tags api + allow_failure: true + needs: + - job: x86_64-almalinux-9-git + artifacts: true + variables: + NAME: almalinux-9 + TARGET_BASE_IMAGE: docker.io/library/almalinux:9 + +.go_build: &go_build + stage: builds + script: + - go build -v -tags libvirt_dlopen + - go build -v -tags "libvirt_dlopen libvirt_without_qemu" + - go build -v -tags "libvirt_dlopen libvirt_without_lxc" + - apt-get update + - apt-get install -y libvirt0 + - go test -timeout 10m -v -tags libvirt_dlopen + - go test -timeout 10m -v -tags "libvirt_dlopen libvirt_without_qemu" + - go test -timeout 10m -v -tags "libvirt_dlopen libvirt_without_lxc" + rules: + # upstream: pushes to a branch + - if: '$CI_PROJECT_NAMESPACE == $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push"' + when: on_success + + # forks: pushes to a branch + - if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE' + when: on_success + + # upstream+forks: other web/api/scheduled pipelines + - if: '$CI_PIPELINE_SOURCE =~ /(web|api|schedule|merge_request_event)/' + when: on_success + + # upstream+forks: that's all folks + - when: never + +# first version declared in go.mod +go_1_11: + <<: *go_build + image: golang:1.11 + +# very fussy about +go:build tags having a blank line +go_1_16: + <<: *go_build + image: golang:1.16 + +# a quite new version +go_1_20: + <<: *go_build + image: golang:1.20 diff --git a/vendor/libvirt.org/go/libvirt/CONTRIBUTING.rst b/vendor/libvirt.org/go/libvirt/CONTRIBUTING.rst new file mode 100644 index 000000000..1e5cfa402 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/CONTRIBUTING.rst @@ -0,0 +1,28 @@ +================================= +Contributing to libvirt-go-module +================================= + +The libvirt Go API binding accepts code contributions via merge requests +on the GitLab project: + +https://gitlab.com/libvirt/libvirt-go-module/-/merge_requests + +It is required that automated CI pipelines succeed before a merge request +will be accepted. The global pipeline status for the ``master`` branch is +visible at: + +https://gitlab.com/libvirt/libvirt-go-module/pipelines + +CI pipeline results for merge requests will be visible via the contributors' +own private repository fork: + +https://gitlab.com/yourusername/libvirt-go-module/pipelines + +Contributions submitted to the project must be in compliance with the +Developer Certificate of Origin Version 1.1. This is documented at: + +https://developercertificate.org/ + +To indicate compliance, each commit in a series must have a "Signed-off-by" +tag with the submitter's name and email address. This can be added by passing +the ``-s`` flag to ``git commit`` when creating the patches. diff --git a/vendor/libvirt.org/go/libvirt/LICENSE b/vendor/libvirt.org/go/libvirt/LICENSE new file mode 100644 index 000000000..202f5fcef --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2013 Alex Zorin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/vendor/libvirt.org/go/libvirt/README.rst b/vendor/libvirt.org/go/libvirt/README.rst new file mode 100644 index 000000000..c2220f4f2 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/README.rst @@ -0,0 +1,133 @@ +================= +libvirt-go-module +================= + +.. image:: https://gitlab.com/libvirt/libvirt-go-module/badges/master/pipeline.svg + :target: https://gitlab.com/libvirt/libvirt-go-module/pipelines + :alt: Build Status +.. image:: https://img.shields.io/static/v1?label=godev&message=reference&color=00add8 + :target: https://pkg.go.dev/libvirt.org/go/libvirt + :alt: API Documentation + +Go bindings for libvirt. + +Make sure to have ``libvirt-dev`` package (or the development files +otherwise somewhere in your include path) + + +Version Support +=============== + +The libvirt go package provides API coverage for libvirt versions +from 1.2.0 onwards, through conditional compilation of newer APIs. + +By default the binding will support APIs in libvirt.so, libvirt-qemu.so +and libvirt-lxc.so. Coverage for the latter two libraries can be dropped +from the build using build tags 'libvirt_without_qemu' or 'libvirt_without_lxc' +respectively. + +The library expects to be used with Go >= 1.11 with Go modules active. +Older versions are no longer tested, nor is usage without Go modules. + +Development status +================== + +The Go API is considered to be production ready and aims to be kept +stable across future versions. Note, however, that the following +changes may apply to future versions: + +* Existing structs can be augmented with new fields, but no existing + fields will be changed / removed. New fields are needed when libvirt + defines new typed parameters for various methods + +* Any method with an 'flags uint32' parameter will have its parameter + type changed to a specific typedef, if & when the libvirt API defines + constants for the flags. To avoid breakage, always pass a literal + '0' to any 'flags uint32' parameter, since this will auto-cast to + any future typedef that is introduced. + +Please see the `VERSIONING `_ file for information +about release schedule and versioning scheme. + + +Documentation +============= + +* `API documentation for the bindings `_ +* `API documentation for libvirt `_ + + +Contributing +============ + +The libvirt project aims to add support for new APIs to libvirt-go-module +as soon as they are added to the main libvirt C library. If you +are submitting changes to the libvirt C library API, please submit +a libvirt-go-module change at the same time. Bug fixes and other +improvements to the libvirt-go-module library are welcome at any time. + +For more information, see the `CONTRIBUTING `_ +file. + + +Testing +======= + +The core API unit tests are all written to use the built-in +test driver (test:///default), so they have no interaction +with the host OS environment. + +Coverage of libvirt C library APIs / constants is verified +using automated tests. These can be run by passing the 'api' +build tag. eg go test -tags api + +For areas where the test driver lacks functionality, it is +possible to use the QEMU or LXC drivers to exercise code. +Such tests must be part of the 'integration_test.go' file +though, which is only run when passing the 'integration' +build tag. eg go test -tags integration + +In order to run the unit tests, libvirtd should be configured +to allow your user account read-write access with no passwords. +This can be easily done using polkit config files + +:: + + # cat > /etc/polkit-1/localauthority/50-local.d/50-libvirt.pkla < +#include "connect_helper.h" +*/ +import "C" + +const ( + VERSION_NUMBER = uint32(C.LIBVIR_VERSION_NUMBER) +) + +type ConnectCloseReason int + +const ( + CONNECT_CLOSE_REASON_ERROR = ConnectCloseReason(C.VIR_CONNECT_CLOSE_REASON_ERROR) + CONNECT_CLOSE_REASON_EOF = ConnectCloseReason(C.VIR_CONNECT_CLOSE_REASON_EOF) + CONNECT_CLOSE_REASON_KEEPALIVE = ConnectCloseReason(C.VIR_CONNECT_CLOSE_REASON_KEEPALIVE) + CONNECT_CLOSE_REASON_CLIENT = ConnectCloseReason(C.VIR_CONNECT_CLOSE_REASON_CLIENT) +) + +type ConnectListAllDomainsFlags uint + +const ( + CONNECT_LIST_DOMAINS_ACTIVE = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_ACTIVE) + CONNECT_LIST_DOMAINS_INACTIVE = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_INACTIVE) + CONNECT_LIST_DOMAINS_PERSISTENT = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_PERSISTENT) + CONNECT_LIST_DOMAINS_TRANSIENT = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_TRANSIENT) + CONNECT_LIST_DOMAINS_RUNNING = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_RUNNING) + CONNECT_LIST_DOMAINS_PAUSED = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_PAUSED) + CONNECT_LIST_DOMAINS_SHUTOFF = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_SHUTOFF) + CONNECT_LIST_DOMAINS_OTHER = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_OTHER) + CONNECT_LIST_DOMAINS_MANAGEDSAVE = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_MANAGEDSAVE) + CONNECT_LIST_DOMAINS_NO_MANAGEDSAVE = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_NO_MANAGEDSAVE) + CONNECT_LIST_DOMAINS_AUTOSTART = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_AUTOSTART) + CONNECT_LIST_DOMAINS_NO_AUTOSTART = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_NO_AUTOSTART) + CONNECT_LIST_DOMAINS_HAS_SNAPSHOT = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT) + CONNECT_LIST_DOMAINS_NO_SNAPSHOT = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_NO_SNAPSHOT) + CONNECT_LIST_DOMAINS_HAS_CHECKPOINT = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_HAS_CHECKPOINT) + CONNECT_LIST_DOMAINS_NO_CHECKPOINT = ConnectListAllDomainsFlags(C.VIR_CONNECT_LIST_DOMAINS_NO_CHECKPOINT) +) + +type ConnectListAllNetworksFlags uint + +const ( + CONNECT_LIST_NETWORKS_INACTIVE = ConnectListAllNetworksFlags(C.VIR_CONNECT_LIST_NETWORKS_INACTIVE) + CONNECT_LIST_NETWORKS_ACTIVE = ConnectListAllNetworksFlags(C.VIR_CONNECT_LIST_NETWORKS_ACTIVE) + CONNECT_LIST_NETWORKS_PERSISTENT = ConnectListAllNetworksFlags(C.VIR_CONNECT_LIST_NETWORKS_PERSISTENT) + CONNECT_LIST_NETWORKS_TRANSIENT = ConnectListAllNetworksFlags(C.VIR_CONNECT_LIST_NETWORKS_TRANSIENT) + CONNECT_LIST_NETWORKS_AUTOSTART = ConnectListAllNetworksFlags(C.VIR_CONNECT_LIST_NETWORKS_AUTOSTART) + CONNECT_LIST_NETWORKS_NO_AUTOSTART = ConnectListAllNetworksFlags(C.VIR_CONNECT_LIST_NETWORKS_NO_AUTOSTART) +) + +type ConnectListAllStoragePoolsFlags uint + +const ( + CONNECT_LIST_STORAGE_POOLS_INACTIVE = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_INACTIVE) + CONNECT_LIST_STORAGE_POOLS_ACTIVE = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_ACTIVE) + CONNECT_LIST_STORAGE_POOLS_PERSISTENT = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_PERSISTENT) + CONNECT_LIST_STORAGE_POOLS_TRANSIENT = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_TRANSIENT) + CONNECT_LIST_STORAGE_POOLS_AUTOSTART = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_AUTOSTART) + CONNECT_LIST_STORAGE_POOLS_NO_AUTOSTART = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_NO_AUTOSTART) + CONNECT_LIST_STORAGE_POOLS_DIR = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_DIR) + CONNECT_LIST_STORAGE_POOLS_FS = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_FS) + CONNECT_LIST_STORAGE_POOLS_NETFS = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_NETFS) + CONNECT_LIST_STORAGE_POOLS_LOGICAL = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_LOGICAL) + CONNECT_LIST_STORAGE_POOLS_DISK = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_DISK) + CONNECT_LIST_STORAGE_POOLS_ISCSI = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_ISCSI) + CONNECT_LIST_STORAGE_POOLS_SCSI = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_SCSI) + CONNECT_LIST_STORAGE_POOLS_MPATH = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_MPATH) + CONNECT_LIST_STORAGE_POOLS_RBD = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_RBD) + CONNECT_LIST_STORAGE_POOLS_SHEEPDOG = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_SHEEPDOG) + CONNECT_LIST_STORAGE_POOLS_GLUSTER = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_GLUSTER) + CONNECT_LIST_STORAGE_POOLS_ZFS = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_ZFS) + CONNECT_LIST_STORAGE_POOLS_VSTORAGE = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_VSTORAGE) + CONNECT_LIST_STORAGE_POOLS_ISCSI_DIRECT = ConnectListAllStoragePoolsFlags(C.VIR_CONNECT_LIST_STORAGE_POOLS_ISCSI_DIRECT) +) + +type ConnectBaselineCPUFlags uint + +const ( + CONNECT_BASELINE_CPU_EXPAND_FEATURES = ConnectBaselineCPUFlags(C.VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES) + CONNECT_BASELINE_CPU_MIGRATABLE = ConnectBaselineCPUFlags(C.VIR_CONNECT_BASELINE_CPU_MIGRATABLE) +) + +type ConnectCompareCPUFlags uint + +const ( + CONNECT_COMPARE_CPU_FAIL_INCOMPATIBLE = ConnectCompareCPUFlags(C.VIR_CONNECT_COMPARE_CPU_FAIL_INCOMPATIBLE) + CONNECT_COMPARE_CPU_VALIDATE_XML = ConnectCompareCPUFlags(C.VIR_CONNECT_COMPARE_CPU_VALIDATE_XML) +) + +type ConnectListAllInterfacesFlags uint + +const ( + CONNECT_LIST_INTERFACES_INACTIVE = ConnectListAllInterfacesFlags(C.VIR_CONNECT_LIST_INTERFACES_INACTIVE) + CONNECT_LIST_INTERFACES_ACTIVE = ConnectListAllInterfacesFlags(C.VIR_CONNECT_LIST_INTERFACES_ACTIVE) +) + +type ConnectListAllNodeDeviceFlags uint + +const ( + CONNECT_LIST_NODE_DEVICES_CAP_SYSTEM = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_SYSTEM) + CONNECT_LIST_NODE_DEVICES_CAP_PCI_DEV = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_PCI_DEV) + CONNECT_LIST_NODE_DEVICES_CAP_USB_DEV = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_USB_DEV) + CONNECT_LIST_NODE_DEVICES_CAP_USB_INTERFACE = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_USB_INTERFACE) + CONNECT_LIST_NODE_DEVICES_CAP_NET = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_NET) + CONNECT_LIST_NODE_DEVICES_CAP_SCSI_HOST = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_HOST) + CONNECT_LIST_NODE_DEVICES_CAP_SCSI_TARGET = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_TARGET) + CONNECT_LIST_NODE_DEVICES_CAP_SCSI = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI) + CONNECT_LIST_NODE_DEVICES_CAP_STORAGE = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_STORAGE) + CONNECT_LIST_NODE_DEVICES_CAP_FC_HOST = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_FC_HOST) + CONNECT_LIST_NODE_DEVICES_CAP_VPORTS = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPORTS) + CONNECT_LIST_NODE_DEVICES_CAP_SCSI_GENERIC = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_GENERIC) + CONNECT_LIST_NODE_DEVICES_CAP_DRM = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_DRM) + CONNECT_LIST_NODE_DEVICES_CAP_MDEV = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV) + CONNECT_LIST_NODE_DEVICES_CAP_MDEV_TYPES = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV_TYPES) + CONNECT_LIST_NODE_DEVICES_CAP_CCW_DEV = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_CCW_DEV) + CONNECT_LIST_NODE_DEVICES_CAP_CSS_DEV = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_CSS_DEV) + CONNECT_LIST_NODE_DEVICES_CAP_VDPA = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_VDPA) + CONNECT_LIST_NODE_DEVICES_CAP_AP_CARD = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_CARD) + CONNECT_LIST_NODE_DEVICES_CAP_AP_QUEUE = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_QUEUE) + CONNECT_LIST_NODE_DEVICES_CAP_AP_MATRIX = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_MATRIX) + CONNECT_LIST_NODE_DEVICES_CAP_VPD = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPD) + CONNECT_LIST_NODE_DEVICES_INACTIVE = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_INACTIVE) + CONNECT_LIST_NODE_DEVICES_ACTIVE = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_ACTIVE) + CONNECT_LIST_NODE_DEVICES_PERSISTENT = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_PERSISTENT) + CONNECT_LIST_NODE_DEVICES_TRANSIENT = ConnectListAllNodeDeviceFlags(C.VIR_CONNECT_LIST_NODE_DEVICES_TRANSIENT) +) + +type ConnectListAllSecretsFlags uint + +const ( + CONNECT_LIST_SECRETS_EPHEMERAL = ConnectListAllSecretsFlags(C.VIR_CONNECT_LIST_SECRETS_EPHEMERAL) + CONNECT_LIST_SECRETS_NO_EPHEMERAL = ConnectListAllSecretsFlags(C.VIR_CONNECT_LIST_SECRETS_NO_EPHEMERAL) + CONNECT_LIST_SECRETS_PRIVATE = ConnectListAllSecretsFlags(C.VIR_CONNECT_LIST_SECRETS_PRIVATE) + CONNECT_LIST_SECRETS_NO_PRIVATE = ConnectListAllSecretsFlags(C.VIR_CONNECT_LIST_SECRETS_NO_PRIVATE) +) + +type ConnectGetAllDomainStatsFlags uint + +const ( + CONNECT_GET_ALL_DOMAINS_STATS_ACTIVE = ConnectGetAllDomainStatsFlags(C.VIR_CONNECT_GET_ALL_DOMAINS_STATS_ACTIVE) + CONNECT_GET_ALL_DOMAINS_STATS_INACTIVE = ConnectGetAllDomainStatsFlags(C.VIR_CONNECT_GET_ALL_DOMAINS_STATS_INACTIVE) + CONNECT_GET_ALL_DOMAINS_STATS_PERSISTENT = ConnectGetAllDomainStatsFlags(C.VIR_CONNECT_GET_ALL_DOMAINS_STATS_PERSISTENT) + CONNECT_GET_ALL_DOMAINS_STATS_TRANSIENT = ConnectGetAllDomainStatsFlags(C.VIR_CONNECT_GET_ALL_DOMAINS_STATS_TRANSIENT) + CONNECT_GET_ALL_DOMAINS_STATS_RUNNING = ConnectGetAllDomainStatsFlags(C.VIR_CONNECT_GET_ALL_DOMAINS_STATS_RUNNING) + CONNECT_GET_ALL_DOMAINS_STATS_PAUSED = ConnectGetAllDomainStatsFlags(C.VIR_CONNECT_GET_ALL_DOMAINS_STATS_PAUSED) + CONNECT_GET_ALL_DOMAINS_STATS_SHUTOFF = ConnectGetAllDomainStatsFlags(C.VIR_CONNECT_GET_ALL_DOMAINS_STATS_SHUTOFF) + CONNECT_GET_ALL_DOMAINS_STATS_OTHER = ConnectGetAllDomainStatsFlags(C.VIR_CONNECT_GET_ALL_DOMAINS_STATS_OTHER) + CONNECT_GET_ALL_DOMAINS_STATS_NOWAIT = ConnectGetAllDomainStatsFlags(C.VIR_CONNECT_GET_ALL_DOMAINS_STATS_NOWAIT) + CONNECT_GET_ALL_DOMAINS_STATS_BACKING = ConnectGetAllDomainStatsFlags(C.VIR_CONNECT_GET_ALL_DOMAINS_STATS_BACKING) + CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS = ConnectGetAllDomainStatsFlags(C.VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS) +) + +type ConnectFlags uint + +const ( + CONNECT_RO = ConnectFlags(C.VIR_CONNECT_RO) + CONNECT_NO_ALIASES = ConnectFlags(C.VIR_CONNECT_NO_ALIASES) +) + +type ConnectDomainEventAgentLifecycleState int + +const ( + CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_CONNECTED = ConnectDomainEventAgentLifecycleState(C.VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_CONNECTED) + CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_DISCONNECTED = ConnectDomainEventAgentLifecycleState(C.VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_DISCONNECTED) +) + +type ConnectDomainEventAgentLifecycleReason int + +const ( + CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_UNKNOWN = ConnectDomainEventAgentLifecycleReason(C.VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_UNKNOWN) + CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_DOMAIN_STARTED = ConnectDomainEventAgentLifecycleReason(C.VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_DOMAIN_STARTED) + CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_CHANNEL = ConnectDomainEventAgentLifecycleReason(C.VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_CHANNEL) +) + +type CPUCompareResult int + +const ( + CPU_COMPARE_ERROR = CPUCompareResult(C.VIR_CPU_COMPARE_ERROR) + CPU_COMPARE_INCOMPATIBLE = CPUCompareResult(C.VIR_CPU_COMPARE_INCOMPATIBLE) + CPU_COMPARE_IDENTICAL = CPUCompareResult(C.VIR_CPU_COMPARE_IDENTICAL) + CPU_COMPARE_SUPERSET = CPUCompareResult(C.VIR_CPU_COMPARE_SUPERSET) +) + +type NodeAllocPagesFlags uint + +const ( + NODE_ALLOC_PAGES_ADD = NodeAllocPagesFlags(C.VIR_NODE_ALLOC_PAGES_ADD) + NODE_ALLOC_PAGES_SET = NodeAllocPagesFlags(C.VIR_NODE_ALLOC_PAGES_SET) +) + +type NodeSuspendTarget int + +const ( + NODE_SUSPEND_TARGET_MEM = NodeSuspendTarget(C.VIR_NODE_SUSPEND_TARGET_MEM) + NODE_SUSPEND_TARGET_DISK = NodeSuspendTarget(C.VIR_NODE_SUSPEND_TARGET_DISK) + NODE_SUSPEND_TARGET_HYBRID = NodeSuspendTarget(C.VIR_NODE_SUSPEND_TARGET_HYBRID) +) + +type NodeGetCPUStatsAllCPUs int + +const ( + NODE_CPU_STATS_ALL_CPUS = NodeGetCPUStatsAllCPUs(C.VIR_NODE_CPU_STATS_ALL_CPUS) +) + +const ( + NODE_MEMORY_STATS_ALL_CELLS = int(C.VIR_NODE_MEMORY_STATS_ALL_CELLS) +) + +type ConnectCredentialType int + +const ( + CRED_USERNAME = ConnectCredentialType(C.VIR_CRED_USERNAME) + CRED_AUTHNAME = ConnectCredentialType(C.VIR_CRED_AUTHNAME) + CRED_LANGUAGE = ConnectCredentialType(C.VIR_CRED_LANGUAGE) + CRED_CNONCE = ConnectCredentialType(C.VIR_CRED_CNONCE) + CRED_PASSPHRASE = ConnectCredentialType(C.VIR_CRED_PASSPHRASE) + CRED_ECHOPROMPT = ConnectCredentialType(C.VIR_CRED_ECHOPROMPT) + CRED_NOECHOPROMPT = ConnectCredentialType(C.VIR_CRED_NOECHOPROMPT) + CRED_REALM = ConnectCredentialType(C.VIR_CRED_REALM) + CRED_EXTERNAL = ConnectCredentialType(C.VIR_CRED_EXTERNAL) +) + +type Connect struct { + ptr C.virConnectPtr +} + +type NodeInfo struct { + Model string + Memory uint64 + Cpus uint + MHz uint + Nodes uint32 + Sockets uint32 + Cores uint32 + Threads uint32 +} + +// Additional data associated to the connection. +type virConnectionData struct { + errCallbackId *int + closeCallbackId *int +} + +var connections map[C.virConnectPtr]*virConnectionData +var connectionsLock sync.RWMutex + +func init() { + connections = make(map[C.virConnectPtr]*virConnectionData) +} + +func saveConnectionData(c *Connect, d *virConnectionData) { + if c.ptr == nil { + return // Or panic? + } + connectionsLock.Lock() + defer connectionsLock.Unlock() + connections[c.ptr] = d +} + +func getConnectionData(c *Connect) *virConnectionData { + connectionsLock.RLock() + d := connections[c.ptr] + connectionsLock.RUnlock() + if d != nil { + return d + } + d = &virConnectionData{} + saveConnectionData(c, d) + return d +} + +func releaseConnectionData(c *Connect) { + if c.ptr == nil { + return + } + connectionsLock.Lock() + defer connectionsLock.Unlock() + delete(connections, c.ptr) +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virGetVersion +func GetVersion() (uint32, error) { + var version C.ulong + var err C.virError + ret := C.virGetVersionWrapper(&version, nil, nil, &err) + if ret < 0 { + return 0, makeError(&err) + } + return uint32(version), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectOpen +func NewConnect(uri string) (*Connect, error) { + var cUri *C.char + if uri != "" { + cUri = C.CString(uri) + defer C.free(unsafe.Pointer(cUri)) + } + var err C.virError + ptr := C.virConnectOpenWrapper(cUri, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Connect{ptr: ptr}, nil +} + +type ConnectCredential struct { + Type ConnectCredentialType + Prompt string + Challenge string + DefResult string + Result string + ResultLen int +} + +type ConnectAuthCallback func(creds []*ConnectCredential) + +type ConnectAuth struct { + CredType []ConnectCredentialType + Callback ConnectAuthCallback +} + +//export connectAuthCallback +func connectAuthCallback(ccredlist C.virConnectCredentialPtr, ncred C.uint, callbackID C.int) C.int { + cred := make([]*ConnectCredential, int(ncred)) + + for i := 0; i < int(ncred); i++ { + ccred := (C.virConnectCredentialPtr)(unsafe.Pointer((uintptr)(unsafe.Pointer(ccredlist)) + (unsafe.Sizeof(*ccredlist) * uintptr(i)))) + cred[i] = &ConnectCredential{ + Type: ConnectCredentialType(ccred._type), + Prompt: C.GoString(ccred.prompt), + Challenge: C.GoString(ccred.challenge), + DefResult: C.GoString(ccred.defresult), + ResultLen: -1, + } + } + callbackEntry := getCallbackId(int(callbackID)) + callback, ok := callbackEntry.(ConnectAuthCallback) + if !ok { + panic("Unexpected callback type") + } + + callback(cred) + + for i := 0; i < int(ncred); i++ { + ccred := (C.virConnectCredentialPtr)(unsafe.Pointer((uintptr)(unsafe.Pointer(ccredlist)) + (unsafe.Sizeof(*ccredlist) * uintptr(i)))) + if cred[i].ResultLen >= 0 { + ccred.result = C.CString(cred[i].Result) + ccred.resultlen = C.uint(cred[i].ResultLen) + } + } + + return 0 +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectOpenAuth +func NewConnectWithAuth(uri string, auth *ConnectAuth, flags ConnectFlags) (*Connect, error) { + var cUri *C.char + var err C.virError + var ptr C.virConnectPtr + + if uri != "" { + cUri = C.CString(uri) + defer C.free(unsafe.Pointer(cUri)) + } + + if auth == nil || len(auth.CredType) == 0 { + ptr = C.virConnectOpenAuthWrapper(cUri, nil, C.uint(flags), &err) + } else { + ccredtype := make([]C.int, len(auth.CredType)) + + for i := 0; i < len(auth.CredType); i++ { + ccredtype[i] = C.int(auth.CredType[i]) + } + + callbackID := registerCallbackId(auth.Callback) + + ptr = C.virConnectOpenAuthHelper(cUri, &ccredtype[0], C.uint(len(auth.CredType)), C.int(callbackID), C.uint(flags), &err) + freeCallbackId(callbackID) + } + + if ptr == nil { + return nil, makeError(&err) + } + return &Connect{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectOpenAuth +func NewConnectWithAuthDefault(uri string, flags ConnectFlags) (*Connect, error) { + var cUri *C.char + + if uri != "" { + cUri = C.CString(uri) + defer C.free(unsafe.Pointer(cUri)) + } + + var err C.virError + ptr := C.virConnectOpenAuthDefaultHelper(cUri, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Connect{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectOpenReadOnly +func NewConnectReadOnly(uri string) (*Connect, error) { + var cUri *C.char + if uri != "" { + cUri = C.CString(uri) + defer C.free(unsafe.Pointer(cUri)) + } + var err C.virError + ptr := C.virConnectOpenReadOnlyWrapper(cUri, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Connect{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectClose +func (c *Connect) Close() (int, error) { + var err C.virError + result := int(C.virConnectCloseWrapper(c.ptr, &err)) + if result == -1 { + return result, makeError(&err) + } + if result == 0 { + // No more reference to this connection, release data. + releaseConnectionData(c) + c.ptr = nil + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectRef +func (c *Connect) Ref() error { + var err C.virError + ret := C.virConnectRefWrapper(c.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// Return the raw pointer. Caller is responsible for closing it via +// CloseRawPtr(). This is intended to allow integration with Go bindings +// to other C APIs that require direct access a virConnectPtr. This should +// not be used in other scenarios. +func (c *Connect) RawPtr() (C.virConnectPtr, error) { + var err C.virError + ret := C.virConnectRefWrapper(c.ptr, &err) + if ret == -1 { + return nil, makeError(&err) + } + return c.ptr, nil +} + +// Unref (and possibly close) raw libvirt connection object, previously +// obtained via RawPtr(). +func CloseRawPtr(c C.virConnectPtr) (int, error) { + cc := Connect{ptr: c} + return cc.Close() +} + +type CloseCallback func(conn *Connect, reason ConnectCloseReason) + +// Register a close callback for the given destination. Only one +// callback per connection is allowed. Setting a callback will remove +// the previous one. +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectRegisterCloseCallback +func (c *Connect) RegisterCloseCallback(callback CloseCallback) error { + c.UnregisterCloseCallback() + goCallbackId := registerCallbackId(callback) + var err C.virError + res := C.virConnectRegisterCloseCallbackHelper(c.ptr, C.long(goCallbackId), &err) + if res != 0 { + freeCallbackId(goCallbackId) + return makeError(&err) + } + connData := getConnectionData(c) + connData.closeCallbackId = &goCallbackId + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectUnregisterCloseCallback +func (c *Connect) UnregisterCloseCallback() error { + connData := getConnectionData(c) + if connData.closeCallbackId == nil { + return nil + } + var err C.virError + res := C.virConnectUnregisterCloseCallbackHelper(c.ptr, &err) + if res != 0 { + return makeError(&err) + } + connData.closeCallbackId = nil + return nil +} + +//export closeCallback +func closeCallback(conn C.virConnectPtr, reason ConnectCloseReason, goCallbackId int) { + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(CloseCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(&Connect{ptr: conn}, reason) +} + +type ConnectIdentity struct { + UserNameSet bool + UserName string + UNIXUserIDSet bool + UNIXUserID uint64 + GroupNameSet bool + GroupName string + UNIXGroupIDSet bool + UNIXGroupID uint64 + ProcessIDSet bool + ProcessID int64 + ProcessTimeSet bool + ProcessTime uint64 + SASLUserNameSet bool + SASLUserName string + X509DistinguishedNameSet bool + X509DistinguishedName string + SELinuxContextSet bool + SELinuxContext string +} + +func getConnectIdentityFieldInfo(params *ConnectIdentity) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_CONNECT_IDENTITY_USER_NAME: typedParamsFieldInfo{ + set: ¶ms.UserNameSet, + s: ¶ms.UserName, + }, + C.VIR_CONNECT_IDENTITY_UNIX_USER_ID: typedParamsFieldInfo{ + set: ¶ms.UNIXUserIDSet, + ul: ¶ms.UNIXUserID, + }, + C.VIR_CONNECT_IDENTITY_GROUP_NAME: typedParamsFieldInfo{ + set: ¶ms.GroupNameSet, + s: ¶ms.GroupName, + }, + C.VIR_CONNECT_IDENTITY_UNIX_GROUP_ID: typedParamsFieldInfo{ + set: ¶ms.UNIXGroupIDSet, + ul: ¶ms.UNIXGroupID, + }, + C.VIR_CONNECT_IDENTITY_PROCESS_ID: typedParamsFieldInfo{ + set: ¶ms.ProcessIDSet, + l: ¶ms.ProcessID, + }, + C.VIR_CONNECT_IDENTITY_PROCESS_TIME: typedParamsFieldInfo{ + set: ¶ms.ProcessTimeSet, + ul: ¶ms.ProcessTime, + }, + C.VIR_CONNECT_IDENTITY_SASL_USER_NAME: typedParamsFieldInfo{ + set: ¶ms.SASLUserNameSet, + s: ¶ms.SASLUserName, + }, + C.VIR_CONNECT_IDENTITY_X509_DISTINGUISHED_NAME: typedParamsFieldInfo{ + set: ¶ms.X509DistinguishedNameSet, + s: ¶ms.X509DistinguishedName, + }, + C.VIR_CONNECT_IDENTITY_SELINUX_CONTEXT: typedParamsFieldInfo{ + set: ¶ms.SELinuxContextSet, + s: ¶ms.SELinuxContext, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectSetIdentity +func (c *Connect) SetIdentity(ident *ConnectIdentity, flags uint32) error { + info := getConnectIdentityFieldInfo(ident) + + cparams, cnparams, gerr := typedParamsPackNew(info) + if gerr != nil { + return gerr + } + + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + + var err C.virError + ret := C.virConnectSetIdentityWrapper(c.ptr, cparams, cnparams, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectGetCapabilities +func (c *Connect) GetCapabilities() (string, error) { + var err C.virError + str := C.virConnectGetCapabilitiesWrapper(c.ptr, &err) + if str == nil { + return "", makeError(&err) + } + capabilities := C.GoString(str) + C.free(unsafe.Pointer(str)) + return capabilities, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virNodeGetInfo +func (c *Connect) GetNodeInfo() (*NodeInfo, error) { + var cinfo C.virNodeInfo + var err C.virError + result := C.virNodeGetInfoWrapper(c.ptr, &cinfo, &err) + if result == -1 { + return nil, makeError(&err) + } + return &NodeInfo{ + Model: C.GoString((*C.char)(unsafe.Pointer(&cinfo.model[0]))), + Memory: uint64(cinfo.memory), + Cpus: uint(cinfo.cpus), + MHz: uint(cinfo.mhz), + Nodes: uint32(cinfo.nodes), + Sockets: uint32(cinfo.sockets), + Cores: uint32(cinfo.cores), + Threads: uint32(cinfo.threads), + }, nil +} + +func (ni *NodeInfo) GetMaxCPUs() uint32 { + return ni.Nodes * ni.Sockets * ni.Cores * ni.Threads +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectGetHostname +func (c *Connect) GetHostname() (string, error) { + var err C.virError + str := C.virConnectGetHostnameWrapper(c.ptr, &err) + if str == nil { + return "", makeError(&err) + } + hostname := C.GoString(str) + C.free(unsafe.Pointer(str)) + return hostname, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectGetLibVersion +func (c *Connect) GetLibVersion() (uint32, error) { + var version C.ulong + var err C.virError + ret := C.virConnectGetLibVersionWrapper(c.ptr, &version, &err) + if ret < 0 { + return 0, makeError(&err) + } + return uint32(version), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectGetType +func (c *Connect) GetType() (string, error) { + var err C.virError + str := C.virConnectGetTypeWrapper(c.ptr, &err) + if str == nil { + return "", makeError(&err) + } + hypDriver := C.GoString(str) + return hypDriver, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectIsAlive +func (c *Connect) IsAlive() (bool, error) { + var err C.virError + result := C.virConnectIsAliveWrapper(c.ptr, &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectIsEncrypted +func (c *Connect) IsEncrypted() (bool, error) { + var err C.virError + result := C.virConnectIsEncryptedWrapper(c.ptr, &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectIsSecure +func (c *Connect) IsSecure() (bool, error) { + var err C.virError + result := C.virConnectIsSecureWrapper(c.ptr, &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectListDefinedDomains +func (c *Connect) ListDefinedDomains() ([]string, error) { + var names [1024](*C.char) + namesPtr := unsafe.Pointer(&names) + var err C.virError + numDomains := C.virConnectListDefinedDomainsWrapper( + c.ptr, + (**C.char)(namesPtr), + 1024, &err) + if numDomains == -1 { + return nil, makeError(&err) + } + goNames := make([]string, numDomains) + for k := 0; k < int(numDomains); k++ { + goNames[k] = C.GoString(names[k]) + C.free(unsafe.Pointer(names[k])) + } + return goNames, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectListDomains +func (c *Connect) ListDomains() ([]uint32, error) { + var cDomainsIds [512](uint32) + cDomainsPointer := unsafe.Pointer(&cDomainsIds) + var err C.virError + numDomains := C.virConnectListDomainsWrapper(c.ptr, (*C.int)(cDomainsPointer), 512, &err) + if numDomains == -1 { + return nil, makeError(&err) + } + + return cDomainsIds[:numDomains], nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virConnectListInterfaces +func (c *Connect) ListInterfaces() ([]string, error) { + const maxIfaces = 1024 + var names [maxIfaces](*C.char) + namesPtr := unsafe.Pointer(&names) + var err C.virError + numIfaces := C.virConnectListInterfacesWrapper( + c.ptr, + (**C.char)(namesPtr), + maxIfaces, &err) + if numIfaces == -1 { + return nil, makeError(&err) + } + goNames := make([]string, numIfaces) + for k := 0; k < int(numIfaces); k++ { + goNames[k] = C.GoString(names[k]) + C.free(unsafe.Pointer(names[k])) + } + return goNames, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virConnectListNetworks +func (c *Connect) ListNetworks() ([]string, error) { + const maxNets = 1024 + var names [maxNets](*C.char) + namesPtr := unsafe.Pointer(&names) + var err C.virError + numNetworks := C.virConnectListNetworksWrapper( + c.ptr, + (**C.char)(namesPtr), + maxNets, &err) + if numNetworks == -1 { + return nil, makeError(&err) + } + goNames := make([]string, numNetworks) + for k := 0; k < int(numNetworks); k++ { + goNames[k] = C.GoString(names[k]) + C.free(unsafe.Pointer(names[k])) + } + return goNames, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virConnectListNWFilters +func (c *Connect) ListNWFilters() ([]string, error) { + const maxFilters = 1024 + var names [maxFilters](*C.char) + namesPtr := unsafe.Pointer(&names) + var err C.virError + numNWFilters := C.virConnectListNWFiltersWrapper( + c.ptr, + (**C.char)(namesPtr), + maxFilters, &err) + if numNWFilters == -1 { + return nil, makeError(&err) + } + goNames := make([]string, numNWFilters) + for k := 0; k < int(numNWFilters); k++ { + goNames[k] = C.GoString(names[k]) + C.free(unsafe.Pointer(names[k])) + } + return goNames, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virConnectListStoragePools +func (c *Connect) ListStoragePools() ([]string, error) { + const maxPools = 1024 + var names [maxPools](*C.char) + namesPtr := unsafe.Pointer(&names) + var err C.virError + numStoragePools := C.virConnectListStoragePoolsWrapper( + c.ptr, + (**C.char)(namesPtr), + maxPools, &err) + if numStoragePools == -1 { + return nil, makeError(&err) + } + goNames := make([]string, numStoragePools) + for k := 0; k < int(numStoragePools); k++ { + goNames[k] = C.GoString(names[k]) + C.free(unsafe.Pointer(names[k])) + } + return goNames, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virConnectListSecrets +func (c *Connect) ListSecrets() ([]string, error) { + const maxSecrets = 1024 + var uuids [maxSecrets](*C.char) + uuidsPtr := unsafe.Pointer(&uuids) + var err C.virError + numSecrets := C.virConnectListSecretsWrapper( + c.ptr, + (**C.char)(uuidsPtr), + maxSecrets, &err) + if numSecrets == -1 { + return nil, makeError(&err) + } + goUuids := make([]string, numSecrets) + for k := 0; k < int(numSecrets); k++ { + goUuids[k] = C.GoString(uuids[k]) + C.free(unsafe.Pointer(uuids[k])) + } + return goUuids, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeListDevices +func (c *Connect) ListDevices(cap string, flags uint32) ([]string, error) { + ccap := C.CString(cap) + defer C.free(unsafe.Pointer(ccap)) + const maxNodeDevices = 1024 + var uuids [maxNodeDevices](*C.char) + uuidsPtr := unsafe.Pointer(&uuids) + var err C.virError + numNodeDevices := C.virNodeListDevicesWrapper( + c.ptr, ccap, + (**C.char)(uuidsPtr), + maxNodeDevices, C.uint(flags), &err) + if numNodeDevices == -1 { + return nil, makeError(&err) + } + goUuids := make([]string, numNodeDevices) + for k := 0; k < int(numNodeDevices); k++ { + goUuids[k] = C.GoString(uuids[k]) + C.free(unsafe.Pointer(uuids[k])) + } + return goUuids, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainLookupByID +func (c *Connect) LookupDomainById(id uint32) (*Domain, error) { + var err C.virError + ptr := C.virDomainLookupByIDWrapper(c.ptr, C.int(id), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Domain{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainLookupByName +func (c *Connect) LookupDomainByName(id string) (*Domain, error) { + cName := C.CString(id) + defer C.free(unsafe.Pointer(cName)) + var err C.virError + ptr := C.virDomainLookupByNameWrapper(c.ptr, cName, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Domain{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainLookupByUUIDString +func (c *Connect) LookupDomainByUUIDString(uuid string) (*Domain, error) { + cUuid := C.CString(uuid) + defer C.free(unsafe.Pointer(cUuid)) + var err C.virError + ptr := C.virDomainLookupByUUIDStringWrapper(c.ptr, cUuid, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Domain{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainLookupByUUID +func (c *Connect) LookupDomainByUUID(uuid []byte) (*Domain, error) { + if len(uuid) != C.VIR_UUID_BUFLEN { + return nil, fmt.Errorf("UUID must be exactly %d bytes in size", + int(C.VIR_UUID_BUFLEN)) + } + cUuid := make([]C.uchar, C.VIR_UUID_BUFLEN) + for i := 0; i < C.VIR_UUID_BUFLEN; i++ { + cUuid[i] = C.uchar(uuid[i]) + } + var err C.virError + ptr := C.virDomainLookupByUUIDWrapper(c.ptr, &cUuid[0], &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Domain{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainCreateXML +func (c *Connect) DomainCreateXML(xmlConfig string, flags DomainCreateFlags) (*Domain, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virDomainCreateXMLWrapper(c.ptr, cXml, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Domain{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainCreateXMLWithFiles +func (c *Connect) DomainCreateXMLWithFiles(xmlConfig string, files []os.File, flags DomainCreateFlags) (*Domain, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + nfiles := len(files) + cfiles := make([]C.int, nfiles) + for i := 0; i < nfiles; i++ { + cfiles[i] = C.int(files[i].Fd()) + } + var err C.virError + var cfilesPtr *C.int = nil + if nfiles > 0 { + cfilesPtr = &cfiles[0] + } + ptr := C.virDomainCreateXMLWithFilesWrapper(c.ptr, cXml, C.uint(nfiles), cfilesPtr, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Domain{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainDefineXML +func (c *Connect) DomainDefineXML(xmlConfig string) (*Domain, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virDomainDefineXMLWrapper(c.ptr, cXml, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Domain{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainDefineXMLFlags +func (c *Connect) DomainDefineXMLFlags(xmlConfig string, flags DomainDefineFlags) (*Domain, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virDomainDefineXMLFlagsWrapper(c.ptr, cXml, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Domain{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virConnectListDefinedInterfaces +func (c *Connect) ListDefinedInterfaces() ([]string, error) { + const maxIfaces = 1024 + var names [maxIfaces](*C.char) + namesPtr := unsafe.Pointer(&names) + var err C.virError + numIfaces := C.virConnectListDefinedInterfacesWrapper( + c.ptr, + (**C.char)(namesPtr), + maxIfaces, &err) + if numIfaces == -1 { + return nil, makeError(&err) + } + goNames := make([]string, numIfaces) + for k := 0; k < int(numIfaces); k++ { + goNames[k] = C.GoString(names[k]) + C.free(unsafe.Pointer(names[k])) + } + return goNames, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virConnectListDefinedNetworks +func (c *Connect) ListDefinedNetworks() ([]string, error) { + const maxNets = 1024 + var names [maxNets](*C.char) + namesPtr := unsafe.Pointer(&names) + var err C.virError + numNetworks := C.virConnectListDefinedNetworksWrapper( + c.ptr, + (**C.char)(namesPtr), + maxNets, &err) + if numNetworks == -1 { + return nil, makeError(&err) + } + goNames := make([]string, numNetworks) + for k := 0; k < int(numNetworks); k++ { + goNames[k] = C.GoString(names[k]) + C.free(unsafe.Pointer(names[k])) + } + return goNames, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virConnectListDefinedStoragePools +func (c *Connect) ListDefinedStoragePools() ([]string, error) { + const maxPools = 1024 + var names [maxPools](*C.char) + namesPtr := unsafe.Pointer(&names) + var err C.virError + numStoragePools := C.virConnectListDefinedStoragePoolsWrapper( + c.ptr, + (**C.char)(namesPtr), + maxPools, &err) + if numStoragePools == -1 { + return nil, makeError(&err) + } + goNames := make([]string, numStoragePools) + for k := 0; k < int(numStoragePools); k++ { + goNames[k] = C.GoString(names[k]) + C.free(unsafe.Pointer(names[k])) + } + return goNames, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectNumOfDefinedDomains +func (c *Connect) NumOfDefinedDomains() (int, error) { + var err C.virError + result := int(C.virConnectNumOfDefinedDomainsWrapper(c.ptr, &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virConnectNumOfDefinedInterfaces +func (c *Connect) NumOfDefinedInterfaces() (int, error) { + var err C.virError + result := int(C.virConnectNumOfDefinedInterfacesWrapper(c.ptr, &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virConnectNumOfDefinedNetworks +func (c *Connect) NumOfDefinedNetworks() (int, error) { + var err C.virError + result := int(C.virConnectNumOfDefinedNetworksWrapper(c.ptr, &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virConnectNumOfDefinedStoragePools +func (c *Connect) NumOfDefinedStoragePools() (int, error) { + var err C.virError + result := int(C.virConnectNumOfDefinedStoragePoolsWrapper(c.ptr, &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectNumOfDomains +func (c *Connect) NumOfDomains() (int, error) { + var err C.virError + result := int(C.virConnectNumOfDomainsWrapper(c.ptr, &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virConnectNumOfStoragePools +func (c *Connect) NumOfStoragePools() (int, error) { + var err C.virError + result := int(C.virConnectNumOfStoragePoolsWrapper(c.ptr, &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virConnectNumOfInterfaces +func (c *Connect) NumOfInterfaces() (int, error) { + var err C.virError + result := int(C.virConnectNumOfInterfacesWrapper(c.ptr, &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virConnectNumOfNetworks +func (c *Connect) NumOfNetworks() (int, error) { + var err C.virError + result := int(C.virConnectNumOfNetworksWrapper(c.ptr, &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virConnectNumOfNWFilters +func (c *Connect) NumOfNWFilters() (int, error) { + var err C.virError + result := int(C.virConnectNumOfNWFiltersWrapper(c.ptr, &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virConnectNumOfSecrets +func (c *Connect) NumOfSecrets() (int, error) { + var err C.virError + result := int(C.virConnectNumOfSecretsWrapper(c.ptr, &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeNumOfDevices +func (c *Connect) NumOfDevices(cap string, flags uint32) (int, error) { + ccap := C.CString(cap) + defer C.free(unsafe.Pointer(ccap)) + var err C.virError + result := int(C.virNodeNumOfDevicesWrapper(c.ptr, ccap, C.uint(flags), &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkDefineXML +func (c *Connect) NetworkDefineXML(xmlConfig string) (*Network, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virNetworkDefineXMLWrapper(c.ptr, cXml, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Network{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkDefineXMLFlags +func (c *Connect) NetworkDefineXMLFlags(xmlConfig string, flags NetworkDefineFlags) (*Network, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virNetworkDefineXMLFlagsWrapper(c.ptr, cXml, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Network{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkCreateXML +func (c *Connect) NetworkCreateXML(xmlConfig string) (*Network, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virNetworkCreateXMLWrapper(c.ptr, cXml, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Network{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkCreateXML +func (c *Connect) NetworkCreateXMLFlags(xmlConfig string, flags NetworkCreateFlags) (*Network, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virNetworkCreateXMLFlagsWrapper(c.ptr, cXml, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Network{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkLookupByName +func (c *Connect) LookupNetworkByName(name string) (*Network, error) { + cName := C.CString(name) + defer C.free(unsafe.Pointer(cName)) + var err C.virError + ptr := C.virNetworkLookupByNameWrapper(c.ptr, cName, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Network{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkLookupByUUIDString +func (c *Connect) LookupNetworkByUUIDString(uuid string) (*Network, error) { + cUuid := C.CString(uuid) + defer C.free(unsafe.Pointer(cUuid)) + var err C.virError + ptr := C.virNetworkLookupByUUIDStringWrapper(c.ptr, cUuid, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Network{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkLookupByUUID +func (c *Connect) LookupNetworkByUUID(uuid []byte) (*Network, error) { + if len(uuid) != C.VIR_UUID_BUFLEN { + return nil, fmt.Errorf("UUID must be exactly %d bytes in size", + int(C.VIR_UUID_BUFLEN)) + } + cUuid := make([]C.uchar, C.VIR_UUID_BUFLEN) + for i := 0; i < C.VIR_UUID_BUFLEN; i++ { + cUuid[i] = C.uchar(uuid[i]) + } + var err C.virError + ptr := C.virNetworkLookupByUUIDWrapper(c.ptr, &cUuid[0], &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Network{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectSetKeepAlive +func (c *Connect) SetKeepAlive(interval int, count uint) error { + var err C.virError + res := int(C.virConnectSetKeepAliveWrapper(c.ptr, C.int(interval), C.uint(count), &err)) + switch res { + case 0: + return nil + default: + return makeError(&err) + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectGetSysinfo +func (c *Connect) GetSysinfo(flags uint32) (string, error) { + var err C.virError + cStr := C.virConnectGetSysinfoWrapper(c.ptr, C.uint(flags), &err) + if cStr == nil { + return "", makeError(&err) + } + info := C.GoString(cStr) + C.free(unsafe.Pointer(cStr)) + return info, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectGetURI +func (c *Connect) GetURI() (string, error) { + var err C.virError + cStr := C.virConnectGetURIWrapper(c.ptr, &err) + if cStr == nil { + return "", makeError(&err) + } + uri := C.GoString(cStr) + C.free(unsafe.Pointer(cStr)) + return uri, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectGetMaxVcpus +func (c *Connect) GetMaxVcpus(typeAttr string) (int, error) { + var cTypeAttr *C.char + if typeAttr != "" { + cTypeAttr = C.CString(typeAttr) + defer C.free(unsafe.Pointer(cTypeAttr)) + } + var err C.virError + result := int(C.virConnectGetMaxVcpusWrapper(c.ptr, cTypeAttr, &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceDefineXML +func (c *Connect) InterfaceDefineXML(xmlConfig string, flags InterfaceDefineFlags) (*Interface, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virInterfaceDefineXMLWrapper(c.ptr, cXml, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Interface{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceLookupByName +func (c *Connect) LookupInterfaceByName(name string) (*Interface, error) { + cName := C.CString(name) + defer C.free(unsafe.Pointer(cName)) + var err C.virError + ptr := C.virInterfaceLookupByNameWrapper(c.ptr, cName, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Interface{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceLookupByMACString +func (c *Connect) LookupInterfaceByMACString(mac string) (*Interface, error) { + cName := C.CString(mac) + defer C.free(unsafe.Pointer(cName)) + var err C.virError + ptr := C.virInterfaceLookupByMACStringWrapper(c.ptr, cName, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Interface{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolDefineXML +func (c *Connect) StoragePoolDefineXML(xmlConfig string, flags StoragePoolDefineFlags) (*StoragePool, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virStoragePoolDefineXMLWrapper(c.ptr, cXml, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &StoragePool{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolCreateXML +func (c *Connect) StoragePoolCreateXML(xmlConfig string, flags StoragePoolCreateFlags) (*StoragePool, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virStoragePoolCreateXMLWrapper(c.ptr, cXml, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &StoragePool{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolLookupByName +func (c *Connect) LookupStoragePoolByName(name string) (*StoragePool, error) { + cName := C.CString(name) + defer C.free(unsafe.Pointer(cName)) + var err C.virError + ptr := C.virStoragePoolLookupByNameWrapper(c.ptr, cName, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &StoragePool{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolLookupByUUIDString +func (c *Connect) LookupStoragePoolByUUIDString(uuid string) (*StoragePool, error) { + cUuid := C.CString(uuid) + defer C.free(unsafe.Pointer(cUuid)) + var err C.virError + ptr := C.virStoragePoolLookupByUUIDStringWrapper(c.ptr, cUuid, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &StoragePool{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolLookupByUUID +func (c *Connect) LookupStoragePoolByUUID(uuid []byte) (*StoragePool, error) { + if len(uuid) != C.VIR_UUID_BUFLEN { + return nil, fmt.Errorf("UUID must be exactly %d bytes in size", + int(C.VIR_UUID_BUFLEN)) + } + cUuid := make([]C.uchar, C.VIR_UUID_BUFLEN) + for i := 0; i < C.VIR_UUID_BUFLEN; i++ { + cUuid[i] = C.uchar(uuid[i]) + } + var err C.virError + ptr := C.virStoragePoolLookupByUUIDWrapper(c.ptr, &cUuid[0], &err) + if ptr == nil { + return nil, makeError(&err) + } + return &StoragePool{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolLookupByTargetPath +func (c *Connect) LookupStoragePoolByTargetPath(path string) (*StoragePool, error) { + cPath := C.CString(path) + defer C.free(unsafe.Pointer(cPath)) + var err C.virError + ptr := C.virStoragePoolLookupByTargetPathWrapper(c.ptr, cPath, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &StoragePool{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterDefineXML +func (c *Connect) NWFilterDefineXML(xmlConfig string) (*NWFilter, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virNWFilterDefineXMLWrapper(c.ptr, cXml, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &NWFilter{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterDefineXMLFlags +func (c *Connect) NWFilterDefineXMLFlags(xmlConfig string, flags NWFilterDefineFlags) (*NWFilter, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virNWFilterDefineXMLFlagsWrapper(c.ptr, cXml, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &NWFilter{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterLookupByName +func (c *Connect) LookupNWFilterByName(name string) (*NWFilter, error) { + cName := C.CString(name) + defer C.free(unsafe.Pointer(cName)) + var err C.virError + ptr := C.virNWFilterLookupByNameWrapper(c.ptr, cName, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &NWFilter{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterLookupByUUIDString +func (c *Connect) LookupNWFilterByUUIDString(uuid string) (*NWFilter, error) { + cUuid := C.CString(uuid) + defer C.free(unsafe.Pointer(cUuid)) + var err C.virError + ptr := C.virNWFilterLookupByUUIDStringWrapper(c.ptr, cUuid, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &NWFilter{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterLookupByUUID +func (c *Connect) LookupNWFilterByUUID(uuid []byte) (*NWFilter, error) { + if len(uuid) != C.VIR_UUID_BUFLEN { + return nil, fmt.Errorf("UUID must be exactly %d bytes in size", + int(C.VIR_UUID_BUFLEN)) + } + cUuid := make([]C.uchar, C.VIR_UUID_BUFLEN) + for i := 0; i < C.VIR_UUID_BUFLEN; i++ { + cUuid[i] = C.uchar(uuid[i]) + } + var err C.virError + ptr := C.virNWFilterLookupByUUIDWrapper(c.ptr, &cUuid[0], &err) + if ptr == nil { + return nil, makeError(&err) + } + return &NWFilter{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterBindingLookupByPortDev +func (c *Connect) LookupNWFilterBindingByPortDev(name string) (*NWFilterBinding, error) { + cName := C.CString(name) + defer C.free(unsafe.Pointer(cName)) + var err C.virError + ptr := C.virNWFilterBindingLookupByPortDevWrapper(c.ptr, cName, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &NWFilterBinding{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolLookupByKey +func (c *Connect) LookupStorageVolByKey(key string) (*StorageVol, error) { + cKey := C.CString(key) + defer C.free(unsafe.Pointer(cKey)) + var err C.virError + ptr := C.virStorageVolLookupByKeyWrapper(c.ptr, cKey, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &StorageVol{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolLookupByPath +func (c *Connect) LookupStorageVolByPath(path string) (*StorageVol, error) { + cPath := C.CString(path) + defer C.free(unsafe.Pointer(cPath)) + var err C.virError + ptr := C.virStorageVolLookupByPathWrapper(c.ptr, cPath, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &StorageVol{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretDefineXML +func (c *Connect) SecretDefineXML(xmlConfig string, flags SecretDefineFlags) (*Secret, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virSecretDefineXMLWrapper(c.ptr, cXml, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Secret{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretLookupByUUID +func (c *Connect) LookupSecretByUUID(uuid []byte) (*Secret, error) { + if len(uuid) != C.VIR_UUID_BUFLEN { + return nil, fmt.Errorf("UUID must be exactly %d bytes in size", + int(C.VIR_UUID_BUFLEN)) + } + cUuid := make([]C.uchar, C.VIR_UUID_BUFLEN) + for i := 0; i < C.VIR_UUID_BUFLEN; i++ { + cUuid[i] = C.uchar(uuid[i]) + } + var err C.virError + ptr := C.virSecretLookupByUUIDWrapper(c.ptr, &cUuid[0], &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Secret{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretLookupByUUIDString +func (c *Connect) LookupSecretByUUIDString(uuid string) (*Secret, error) { + cUuid := C.CString(uuid) + defer C.free(unsafe.Pointer(cUuid)) + var err C.virError + ptr := C.virSecretLookupByUUIDStringWrapper(c.ptr, cUuid, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Secret{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretLookupByUsage +func (c *Connect) LookupSecretByUsage(usageType SecretUsageType, usageID string) (*Secret, error) { + cUsageID := C.CString(usageID) + defer C.free(unsafe.Pointer(cUsageID)) + var err C.virError + ptr := C.virSecretLookupByUsageWrapper(c.ptr, C.int(usageType), cUsageID, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Secret{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceLookupByName +func (c *Connect) LookupDeviceByName(id string) (*NodeDevice, error) { + cName := C.CString(id) + defer C.free(unsafe.Pointer(cName)) + var err C.virError + ptr := C.virNodeDeviceLookupByNameWrapper(c.ptr, cName, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &NodeDevice{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceLookupSCSIHostByWWN +func (c *Connect) LookupDeviceSCSIHostByWWN(wwnn, wwpn string, flags uint32) (*NodeDevice, error) { + cWwnn := C.CString(wwnn) + cWwpn := C.CString(wwpn) + defer C.free(unsafe.Pointer(cWwnn)) + defer C.free(unsafe.Pointer(cWwpn)) + var err C.virError + ptr := C.virNodeDeviceLookupSCSIHostByWWNWrapper(c.ptr, cWwnn, cWwpn, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &NodeDevice{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceCreateXML +func (c *Connect) DeviceCreateXML(xmlConfig string, flags NodeDeviceCreateXMLFlags) (*NodeDevice, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virNodeDeviceCreateXMLWrapper(c.ptr, cXml, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &NodeDevice{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceDefineXML +func (c *Connect) DeviceDefineXML(xmlConfig string, flags NodeDeviceDefineXMLFlags) (*NodeDevice, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virNodeDeviceDefineXMLWrapper(c.ptr, cXml, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &NodeDevice{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virConnectListAllInterfaces +func (c *Connect) ListAllInterfaces(flags ConnectListAllInterfacesFlags) ([]Interface, error) { + var cList *C.virInterfacePtr + var err C.virError + numIfaces := C.virConnectListAllInterfacesWrapper(c.ptr, (**C.virInterfacePtr)(&cList), C.uint(flags), &err) + if numIfaces == -1 { + return nil, makeError(&err) + } + hdr := reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(cList)), + Len: int(numIfaces), + Cap: int(numIfaces), + } + var ifaces []Interface + slice := *(*[]C.virInterfacePtr)(unsafe.Pointer(&hdr)) + for _, ptr := range slice { + ifaces = append(ifaces, Interface{ptr}) + } + C.free(unsafe.Pointer(cList)) + return ifaces, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virConnectListAllNetworks +func (c *Connect) ListAllNetworks(flags ConnectListAllNetworksFlags) ([]Network, error) { + var cList *C.virNetworkPtr + var err C.virError + numNets := C.virConnectListAllNetworksWrapper(c.ptr, (**C.virNetworkPtr)(&cList), C.uint(flags), &err) + if numNets == -1 { + return nil, makeError(&err) + } + hdr := reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(cList)), + Len: int(numNets), + Cap: int(numNets), + } + var nets []Network + slice := *(*[]C.virNetworkPtr)(unsafe.Pointer(&hdr)) + for _, ptr := range slice { + nets = append(nets, Network{ptr}) + } + C.free(unsafe.Pointer(cList)) + return nets, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectListAllDomains +func (c *Connect) ListAllDomains(flags ConnectListAllDomainsFlags) ([]Domain, error) { + var cList *C.virDomainPtr + var err C.virError + numDomains := C.virConnectListAllDomainsWrapper(c.ptr, (**C.virDomainPtr)(&cList), C.uint(flags), &err) + if numDomains == -1 { + return nil, makeError(&err) + } + hdr := reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(cList)), + Len: int(numDomains), + Cap: int(numDomains), + } + var domains []Domain + slice := *(*[]C.virDomainPtr)(unsafe.Pointer(&hdr)) + for _, ptr := range slice { + domains = append(domains, Domain{ptr}) + } + C.free(unsafe.Pointer(cList)) + return domains, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virConnectListAllNWFilters +func (c *Connect) ListAllNWFilters(flags uint32) ([]NWFilter, error) { + var cList *C.virNWFilterPtr + var err C.virError + numNWFilters := C.virConnectListAllNWFiltersWrapper(c.ptr, (**C.virNWFilterPtr)(&cList), C.uint(flags), &err) + if numNWFilters == -1 { + return nil, makeError(&err) + } + hdr := reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(cList)), + Len: int(numNWFilters), + Cap: int(numNWFilters), + } + var filters []NWFilter + slice := *(*[]C.virNWFilterPtr)(unsafe.Pointer(&hdr)) + for _, ptr := range slice { + filters = append(filters, NWFilter{ptr}) + } + C.free(unsafe.Pointer(cList)) + return filters, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virConnectListAllNWFilterBindings +func (c *Connect) ListAllNWFilterBindings(flags uint32) ([]NWFilterBinding, error) { + var cList *C.virNWFilterBindingPtr + var err C.virError + numNWFilters := C.virConnectListAllNWFilterBindingsWrapper(c.ptr, (**C.virNWFilterBindingPtr)(&cList), C.uint(flags), &err) + if numNWFilters == -1 { + return nil, makeError(&err) + } + hdr := reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(cList)), + Len: int(numNWFilters), + Cap: int(numNWFilters), + } + var filters []NWFilterBinding + slice := *(*[]C.virNWFilterBindingPtr)(unsafe.Pointer(&hdr)) + for _, ptr := range slice { + filters = append(filters, NWFilterBinding{ptr}) + } + C.free(unsafe.Pointer(cList)) + return filters, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virConnectListAllStoragePools +func (c *Connect) ListAllStoragePools(flags ConnectListAllStoragePoolsFlags) ([]StoragePool, error) { + var cList *C.virStoragePoolPtr + var err C.virError + numPools := C.virConnectListAllStoragePoolsWrapper(c.ptr, (**C.virStoragePoolPtr)(&cList), C.uint(flags), &err) + if numPools == -1 { + return nil, makeError(&err) + } + hdr := reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(cList)), + Len: int(numPools), + Cap: int(numPools), + } + var pools []StoragePool + slice := *(*[]C.virStoragePoolPtr)(unsafe.Pointer(&hdr)) + for _, ptr := range slice { + pools = append(pools, StoragePool{ptr}) + } + C.free(unsafe.Pointer(cList)) + return pools, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virConnectListAllSecrets +func (c *Connect) ListAllSecrets(flags ConnectListAllSecretsFlags) ([]Secret, error) { + var cList *C.virSecretPtr + var err C.virError + numPools := C.virConnectListAllSecretsWrapper(c.ptr, (**C.virSecretPtr)(&cList), C.uint(flags), &err) + if numPools == -1 { + return nil, makeError(&err) + } + hdr := reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(cList)), + Len: int(numPools), + Cap: int(numPools), + } + var pools []Secret + slice := *(*[]C.virSecretPtr)(unsafe.Pointer(&hdr)) + for _, ptr := range slice { + pools = append(pools, Secret{ptr}) + } + C.free(unsafe.Pointer(cList)) + return pools, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virConnectListAllNodeDevices +func (c *Connect) ListAllNodeDevices(flags ConnectListAllNodeDeviceFlags) ([]NodeDevice, error) { + var cList *C.virNodeDevicePtr + var err C.virError + numPools := C.virConnectListAllNodeDevicesWrapper(c.ptr, (**C.virNodeDevicePtr)(&cList), C.uint(flags), &err) + if numPools == -1 { + return nil, makeError(&err) + } + hdr := reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(cList)), + Len: int(numPools), + Cap: int(numPools), + } + var pools []NodeDevice + slice := *(*[]C.virNodeDevicePtr)(unsafe.Pointer(&hdr)) + for _, ptr := range slice { + pools = append(pools, NodeDevice{ptr}) + } + C.free(unsafe.Pointer(cList)) + return pools, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceChangeBegin +func (c *Connect) InterfaceChangeBegin(flags uint32) error { + var err C.virError + ret := C.virInterfaceChangeBeginWrapper(c.ptr, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceChangeCommit +func (c *Connect) InterfaceChangeCommit(flags uint32) error { + var err C.virError + ret := C.virInterfaceChangeCommitWrapper(c.ptr, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceChangeRollback +func (c *Connect) InterfaceChangeRollback(flags uint32) error { + var err C.virError + ret := C.virInterfaceChangeRollbackWrapper(c.ptr, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virNodeAllocPages +func (c *Connect) AllocPages(pageSizes map[int]int64, startCell int, cellCount uint, flags NodeAllocPagesFlags) (int, error) { + npageSizes := len(pageSizes) + cpages := make([]C.uint, npageSizes) + ccounts := make([]C.ulonglong, npageSizes) + + i := 0 + for key, val := range pageSizes { + cpages[i] = C.uint(key) + ccounts[i] = C.ulonglong(val) + i++ + } + + var err C.virError + var cpagesPtr *C.uint = nil + var ccountsPtr *C.ulonglong = nil + if npageSizes > 0 { + cpagesPtr = &cpages[0] + ccountsPtr = &ccounts[0] + } + ret := C.virNodeAllocPagesWrapper(c.ptr, C.uint(len(pageSizes)), cpagesPtr, ccountsPtr, + C.int(startCell), C.uint(cellCount), C.uint(flags), &err) + if ret == -1 { + return 0, makeError(&err) + } + + return int(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virNodeGetCPUMap +func (c *Connect) GetCPUMap(flags uint32) (map[int]bool, uint, error) { + var ccpumap *C.uchar + var conline C.uint + var err C.virError + ret := C.virNodeGetCPUMapWrapper(c.ptr, &ccpumap, &conline, C.uint(flags), &err) + if ret == -1 { + return map[int]bool{}, 0, makeError(&err) + } + defer C.free(unsafe.Pointer(ccpumap)) + + cpumapbytes := C.GoBytes(unsafe.Pointer(ccpumap), C.int((ret+7)/8)) + + cpumap := make(map[int]bool, ret) + for i := 0; i < int(ret); i++ { + idx := int(i / 8) + val := byte(cpumapbytes[idx]) + shift := i % 8 + cpumap[i] = (val & (1 << uint(shift))) != 0 + } + + return cpumap, uint(conline), nil +} + +type NodeCPUStats struct { + KernelSet bool + Kernel uint64 + UserSet bool + User uint64 + IdleSet bool + Idle uint64 + IowaitSet bool + Iowait uint64 + IntrSet bool + Intr uint64 + UtilizationSet bool + Utilization uint64 +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virNodeGetCPUStats +func (c *Connect) GetCPUStats(cpuNum int, flags uint32) (*NodeCPUStats, error) { + var cnparams C.int + + var err C.virError + ret := C.virNodeGetCPUStatsWrapper(c.ptr, C.int(cpuNum), nil, &cnparams, C.uint(0), &err) + if ret == -1 { + return nil, makeError(&err) + } + + params := make([]C.virNodeCPUStats, cnparams) + ret = C.virNodeGetCPUStatsWrapper(c.ptr, C.int(cpuNum), (*C.virNodeCPUStats)(unsafe.Pointer(¶ms[0])), &cnparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + stats := &NodeCPUStats{} + for i := 0; i < int(cnparams); i++ { + param := params[i] + field := C.GoString((*C.char)(unsafe.Pointer(¶m.field))) + switch field { + case C.VIR_NODE_CPU_STATS_KERNEL: + stats.KernelSet = true + stats.Kernel = uint64(param.value) + case C.VIR_NODE_CPU_STATS_USER: + stats.UserSet = true + stats.User = uint64(param.value) + case C.VIR_NODE_CPU_STATS_IDLE: + stats.IdleSet = true + stats.Idle = uint64(param.value) + case C.VIR_NODE_CPU_STATS_IOWAIT: + stats.IowaitSet = true + stats.Iowait = uint64(param.value) + case C.VIR_NODE_CPU_STATS_INTR: + stats.IntrSet = true + stats.Intr = uint64(param.value) + case C.VIR_NODE_CPU_STATS_UTILIZATION: + stats.UtilizationSet = true + stats.Utilization = uint64(param.value) + } + } + + return stats, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virNodeGetCellsFreeMemory +func (c *Connect) GetCellsFreeMemory(startCell int, maxCells int) ([]uint64, error) { + cmem := make([]C.ulonglong, maxCells) + var err C.virError + ret := C.virNodeGetCellsFreeMemoryWrapper(c.ptr, (*C.ulonglong)(unsafe.Pointer(&cmem[0])), C.int(startCell), C.int(maxCells), &err) + if ret == -1 { + return []uint64{}, makeError(&err) + } + + mem := make([]uint64, ret) + for i := 0; i < int(ret); i++ { + mem[i] = uint64(cmem[i]) + } + + return mem, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virNodeGetFreeMemory +func (c *Connect) GetFreeMemory() (uint64, error) { + var err C.virError + ret := C.virNodeGetFreeMemoryWrapper(c.ptr, &err) + if ret == 0 { + return 0, makeError(&err) + } + + return (uint64)(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virNodeGetFreePages +func (c *Connect) GetFreePages(pageSizes []uint64, startCell int, maxCells uint, flags uint32) ([]uint64, error) { + npageSizes := len(pageSizes) + cpageSizes := make([]C.uint, npageSizes) + ccounts := make([]C.ulonglong, npageSizes*int(maxCells)) + + for i := 0; i < len(pageSizes); i++ { + cpageSizes[i] = C.uint(pageSizes[i]) + } + + var err C.virError + var cpageSizesPtr *C.uint = nil + var ccountsPtr *C.ulonglong = nil + if npageSizes > 0 { + cpageSizesPtr = &cpageSizes[0] + ccountsPtr = &ccounts[0] + } + ret := C.virNodeGetFreePagesWrapper(c.ptr, C.uint(len(pageSizes)), cpageSizesPtr, C.int(startCell), + C.uint(maxCells), ccountsPtr, C.uint(flags), &err) + if ret == -1 { + return []uint64{}, makeError(&err) + } + + counts := make([]uint64, ret) + for i := 0; i < int(ret); i++ { + counts[i] = uint64(ccounts[i]) + } + + return counts, nil +} + +type NodeMemoryParameters struct { + ShmPagesToScanSet bool + ShmPagesToScan uint + ShmSleepMillisecsSet bool + ShmSleepMillisecs uint + ShmPagesSharedSet bool + ShmPagesShared uint64 + ShmPagesSharingSet bool + ShmPagesSharing uint64 + ShmPagesUnsharedSet bool + ShmPagesUnshared uint64 + ShmPagesVolatileSet bool + ShmPagesVolatile uint64 + ShmFullScansSet bool + ShmFullScans uint64 + ShmMergeAcrossNodesSet bool + ShmMergeAcrossNodes uint +} + +func getMemoryParameterFieldInfo(params *NodeMemoryParameters) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_NODE_MEMORY_SHARED_PAGES_TO_SCAN: typedParamsFieldInfo{ + set: ¶ms.ShmPagesToScanSet, + ui: ¶ms.ShmPagesToScan, + }, + C.VIR_NODE_MEMORY_SHARED_SLEEP_MILLISECS: typedParamsFieldInfo{ + set: ¶ms.ShmSleepMillisecsSet, + ui: ¶ms.ShmSleepMillisecs, + }, + C.VIR_NODE_MEMORY_SHARED_MERGE_ACROSS_NODES: typedParamsFieldInfo{ + set: ¶ms.ShmMergeAcrossNodesSet, + ui: ¶ms.ShmMergeAcrossNodes, + }, + C.VIR_NODE_MEMORY_SHARED_PAGES_SHARED: typedParamsFieldInfo{ + set: ¶ms.ShmPagesSharedSet, + ul: ¶ms.ShmPagesShared, + }, + C.VIR_NODE_MEMORY_SHARED_PAGES_SHARING: typedParamsFieldInfo{ + set: ¶ms.ShmPagesSharingSet, + ul: ¶ms.ShmPagesSharing, + }, + C.VIR_NODE_MEMORY_SHARED_PAGES_UNSHARED: typedParamsFieldInfo{ + set: ¶ms.ShmPagesUnsharedSet, + ul: ¶ms.ShmPagesUnshared, + }, + C.VIR_NODE_MEMORY_SHARED_PAGES_VOLATILE: typedParamsFieldInfo{ + set: ¶ms.ShmPagesVolatileSet, + ul: ¶ms.ShmPagesVolatile, + }, + C.VIR_NODE_MEMORY_SHARED_FULL_SCANS: typedParamsFieldInfo{ + set: ¶ms.ShmFullScansSet, + ul: ¶ms.ShmFullScans, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virNodeGetMemoryParameters +func (c *Connect) GetMemoryParameters(flags uint32) (*NodeMemoryParameters, error) { + params := &NodeMemoryParameters{} + info := getMemoryParameterFieldInfo(params) + + var cnparams C.int + + var err C.virError + ret := C.virNodeGetMemoryParametersWrapper(c.ptr, nil, &cnparams, C.uint(0), &err) + if ret == -1 { + return nil, makeError(&err) + } + + cparams := typedParamsNew(cnparams) + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + ret = C.virNodeGetMemoryParametersWrapper(c.ptr, cparams, &cnparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + _, gerr := typedParamsUnpack(cparams, cnparams, info) + if gerr != nil { + return nil, gerr + } + + return params, nil +} + +type NodeMemoryStats struct { + TotalSet bool + Total uint64 + FreeSet bool + Free uint64 + BuffersSet bool + Buffers uint64 + CachedSet bool + Cached uint64 +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virNodeGetMemoryStats +func (c *Connect) GetMemoryStats(cellNum int, flags uint32) (*NodeMemoryStats, error) { + var cnparams C.int + + var err C.virError + ret := C.virNodeGetMemoryStatsWrapper(c.ptr, C.int(cellNum), nil, &cnparams, 0, &err) + if ret == -1 { + return nil, makeError(&err) + } + + params := make([]C.virNodeMemoryStats, cnparams) + ret = C.virNodeGetMemoryStatsWrapper(c.ptr, C.int(cellNum), (*C.virNodeMemoryStats)(unsafe.Pointer(¶ms[0])), &cnparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + stats := &NodeMemoryStats{} + for i := 0; i < int(cnparams); i++ { + param := params[i] + field := C.GoString((*C.char)(unsafe.Pointer(¶m.field))) + switch field { + case C.VIR_NODE_MEMORY_STATS_TOTAL: + stats.TotalSet = true + stats.Total = uint64(param.value) + case C.VIR_NODE_MEMORY_STATS_FREE: + stats.FreeSet = true + stats.Free = uint64(param.value) + case C.VIR_NODE_MEMORY_STATS_BUFFERS: + stats.BuffersSet = true + stats.Buffers = uint64(param.value) + case C.VIR_NODE_MEMORY_STATS_CACHED: + stats.CachedSet = true + stats.Cached = uint64(param.value) + } + } + + return stats, nil +} + +type NodeSecurityModel struct { + Model string + Doi string +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virNodeGetSecurityModel +func (c *Connect) GetSecurityModel() (*NodeSecurityModel, error) { + var cmodel C.virSecurityModel + var err C.virError + ret := C.virNodeGetSecurityModelWrapper(c.ptr, &cmodel, &err) + if ret == -1 { + return nil, makeError(&err) + } + + return &NodeSecurityModel{ + Model: C.GoString((*C.char)(unsafe.Pointer(&cmodel.model))), + Doi: C.GoString((*C.char)(unsafe.Pointer(&cmodel.doi))), + }, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virNodeSetMemoryParameters +func (c *Connect) SetMemoryParameters(params *NodeMemoryParameters, flags uint32) error { + info := getMemoryParameterFieldInfo(params) + + cparams, cnparams, gerr := typedParamsPackNew(info) + if gerr != nil { + return gerr + } + + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + + var err C.virError + ret := C.virNodeSetMemoryParametersWrapper(c.ptr, cparams, cnparams, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virNodeSuspendForDuration +func (c *Connect) SuspendForDuration(target NodeSuspendTarget, duration uint64, flags uint32) error { + var err C.virError + ret := C.virNodeSuspendForDurationWrapper(c.ptr, C.uint(target), C.ulonglong(duration), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSaveImageDefineXML +func (c *Connect) DomainSaveImageDefineXML(file string, xml string, flags DomainSaveRestoreFlags) error { + cfile := C.CString(file) + defer C.free(unsafe.Pointer(cfile)) + cxml := C.CString(xml) + defer C.free(unsafe.Pointer(cxml)) + + var err C.virError + ret := C.virDomainSaveImageDefineXMLWrapper(c.ptr, cfile, cxml, C.uint(flags), &err) + + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSaveImageGetXMLDesc +func (c *Connect) DomainSaveImageGetXMLDesc(file string, flags DomainSaveImageXMLFlags) (string, error) { + cfile := C.CString(file) + defer C.free(unsafe.Pointer(cfile)) + + var err C.virError + ret := C.virDomainSaveImageGetXMLDescWrapper(c.ptr, cfile, C.uint(flags), &err) + + if ret == nil { + return "", makeError(&err) + } + + defer C.free(unsafe.Pointer(ret)) + + return C.GoString(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectBaselineCPU +func (c *Connect) BaselineCPU(xmlCPUs []string, flags ConnectBaselineCPUFlags) (string, error) { + nxmlCPUs := len(xmlCPUs) + cxmlCPUs := make([]*C.char, nxmlCPUs) + for i := 0; i < nxmlCPUs; i++ { + cxmlCPUs[i] = C.CString(xmlCPUs[i]) + defer C.free(unsafe.Pointer(cxmlCPUs[i])) + } + + var err C.virError + var cxmlCPUsPtr **C.char = nil + if nxmlCPUs > 0 { + cxmlCPUsPtr = &cxmlCPUs[0] + } + ret := C.virConnectBaselineCPUWrapper(c.ptr, cxmlCPUsPtr, C.uint(nxmlCPUs), C.uint(flags), &err) + if ret == nil { + return "", makeError(&err) + } + + defer C.free(unsafe.Pointer(ret)) + + return C.GoString(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectBaselineHypervisorCPU +func (c *Connect) BaselineHypervisorCPU(emulator string, arch string, machine string, virttype string, xmlCPUs []string, flags ConnectBaselineCPUFlags) (string, error) { + var cemulator, carch, cmachine, cvirttype *C.char + if emulator != "" { + cemulator = C.CString(emulator) + defer C.free(unsafe.Pointer(cemulator)) + } + if arch != "" { + carch = C.CString(arch) + defer C.free(unsafe.Pointer(carch)) + } + if machine != "" { + cmachine = C.CString(machine) + defer C.free(unsafe.Pointer(cmachine)) + } + if virttype != "" { + cvirttype = C.CString(virttype) + defer C.free(unsafe.Pointer(cvirttype)) + } + nxmlCPUs := len(xmlCPUs) + cxmlCPUs := make([]*C.char, nxmlCPUs) + for i := 0; i < nxmlCPUs; i++ { + cxmlCPUs[i] = C.CString(xmlCPUs[i]) + defer C.free(unsafe.Pointer(cxmlCPUs[i])) + } + + var err C.virError + var cxmlCPUsPtr **C.char = nil + if nxmlCPUs > 0 { + cxmlCPUsPtr = &cxmlCPUs[0] + } + ret := C.virConnectBaselineHypervisorCPUWrapper(c.ptr, cemulator, carch, cmachine, cvirttype, + cxmlCPUsPtr, C.uint(len(xmlCPUs)), C.uint(flags), &err) + if ret == nil { + return "", makeError(&err) + } + + defer C.free(unsafe.Pointer(ret)) + + return C.GoString(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectCompareCPU +func (c *Connect) CompareCPU(xmlDesc string, flags ConnectCompareCPUFlags) (CPUCompareResult, error) { + cxmlDesc := C.CString(xmlDesc) + defer C.free(unsafe.Pointer(cxmlDesc)) + + var err C.virError + ret := C.virConnectCompareCPUWrapper(c.ptr, cxmlDesc, C.uint(flags), &err) + if ret == C.VIR_CPU_COMPARE_ERROR { + return CPU_COMPARE_ERROR, makeError(&err) + } + + return CPUCompareResult(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectCompareHypervisorCPU +func (c *Connect) CompareHypervisorCPU(emulator string, arch string, machine string, virttype string, xmlDesc string, flags ConnectCompareCPUFlags) (CPUCompareResult, error) { + var cemulator, carch, cmachine, cvirttype *C.char + if emulator != "" { + cemulator = C.CString(emulator) + defer C.free(unsafe.Pointer(cemulator)) + } + if arch != "" { + carch = C.CString(arch) + defer C.free(unsafe.Pointer(carch)) + } + if machine != "" { + cmachine = C.CString(machine) + defer C.free(unsafe.Pointer(cmachine)) + } + if virttype != "" { + cvirttype = C.CString(virttype) + defer C.free(unsafe.Pointer(cvirttype)) + } + + cxmlDesc := C.CString(xmlDesc) + defer C.free(unsafe.Pointer(cxmlDesc)) + + var err C.virError + ret := C.virConnectCompareHypervisorCPUWrapper(c.ptr, cemulator, carch, cmachine, cvirttype, cxmlDesc, C.uint(flags), &err) + if ret == C.VIR_CPU_COMPARE_ERROR { + return CPU_COMPARE_ERROR, makeError(&err) + } + + return CPUCompareResult(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainXMLFromNative +func (c *Connect) DomainXMLFromNative(nativeFormat string, nativeConfig string, flags uint32) (string, error) { + cnativeFormat := C.CString(nativeFormat) + defer C.free(unsafe.Pointer(cnativeFormat)) + cnativeConfig := C.CString(nativeConfig) + defer C.free(unsafe.Pointer(cnativeConfig)) + + var err C.virError + ret := C.virConnectDomainXMLFromNativeWrapper(c.ptr, cnativeFormat, cnativeConfig, C.uint(flags), &err) + if ret == nil { + return "", makeError(&err) + } + + defer C.free(unsafe.Pointer(ret)) + + return C.GoString(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainXMLToNative +func (c *Connect) DomainXMLToNative(nativeFormat string, domainXml string, flags uint32) (string, error) { + cnativeFormat := C.CString(nativeFormat) + defer C.free(unsafe.Pointer(cnativeFormat)) + cdomainXml := C.CString(domainXml) + defer C.free(unsafe.Pointer(cdomainXml)) + + var err C.virError + ret := C.virConnectDomainXMLToNativeWrapper(c.ptr, cnativeFormat, cdomainXml, C.uint(flags), &err) + if ret == nil { + return "", makeError(&err) + } + + defer C.free(unsafe.Pointer(ret)) + + return C.GoString(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectGetCPUModelNames +func (c *Connect) GetCPUModelNames(arch string, flags uint32) ([]string, error) { + carch := C.CString(arch) + defer C.free(unsafe.Pointer(carch)) + + var cmodels **C.char + var err C.virError + ret := C.virConnectGetCPUModelNamesWrapper(c.ptr, carch, &cmodels, C.uint(flags), &err) + if ret == -1 { + return []string{}, makeError(&err) + } + + models := make([]string, int(ret)) + for i := 0; i < int(ret); i++ { + cmodel := *(**C.char)(unsafe.Pointer(uintptr(unsafe.Pointer(cmodels)) + (unsafe.Sizeof(*cmodels) * uintptr(i)))) + + defer C.free(unsafe.Pointer(cmodel)) + models[i] = C.GoString(cmodel) + } + defer C.free(unsafe.Pointer(cmodels)) + + return models, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectGetDomainCapabilities +func (c *Connect) GetDomainCapabilities(emulatorbin string, arch string, machine string, virttype string, flags uint32) (string, error) { + var cemulatorbin *C.char + if emulatorbin != "" { + cemulatorbin = C.CString(emulatorbin) + defer C.free(unsafe.Pointer(cemulatorbin)) + } + var carch *C.char + if arch != "" { + carch = C.CString(arch) + defer C.free(unsafe.Pointer(carch)) + } + var cmachine *C.char + if machine != "" { + cmachine = C.CString(machine) + defer C.free(unsafe.Pointer(cmachine)) + } + var cvirttype *C.char + if virttype != "" { + cvirttype = C.CString(virttype) + defer C.free(unsafe.Pointer(cvirttype)) + } + + var err C.virError + ret := C.virConnectGetDomainCapabilitiesWrapper(c.ptr, cemulatorbin, carch, cmachine, cvirttype, C.uint(flags), &err) + if ret == nil { + return "", makeError(&err) + } + + defer C.free(unsafe.Pointer(ret)) + + return C.GoString(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virConnectGetVersion +func (c *Connect) GetVersion() (uint32, error) { + var hvVer C.ulong + var err C.virError + ret := C.virConnectGetVersionWrapper(c.ptr, &hvVer, &err) + if ret == -1 { + return 0, makeError(&err) + } + + return uint32(hvVer), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virConnectFindStoragePoolSources +func (c *Connect) FindStoragePoolSources(pooltype string, srcSpec string, flags uint32) (string, error) { + cpooltype := C.CString(pooltype) + defer C.free(unsafe.Pointer(cpooltype)) + var csrcSpec *C.char + if srcSpec != "" { + csrcSpec = C.CString(srcSpec) + defer C.free(unsafe.Pointer(csrcSpec)) + } + var err C.virError + ret := C.virConnectFindStoragePoolSourcesWrapper(c.ptr, cpooltype, csrcSpec, C.uint(flags), &err) + if ret == nil { + return "", makeError(&err) + } + + defer C.free(unsafe.Pointer(ret)) + + return C.GoString(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainRestore +func (c *Connect) DomainRestore(srcFile string) error { + cPath := C.CString(srcFile) + defer C.free(unsafe.Pointer(cPath)) + var err C.virError + if result := C.virDomainRestoreWrapper(c.ptr, cPath, &err); result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainRestoreFlags +func (c *Connect) DomainRestoreFlags(srcFile, xmlConf string, flags DomainSaveRestoreFlags) error { + cPath := C.CString(srcFile) + defer C.free(unsafe.Pointer(cPath)) + var cXmlConf *C.char + if xmlConf != "" { + cXmlConf = C.CString(xmlConf) + defer C.free(unsafe.Pointer(cXmlConf)) + } + var err C.virError + if result := C.virDomainRestoreFlagsWrapper(c.ptr, cPath, cXmlConf, C.uint(flags), &err); result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainRestoreParams +func (c *Connect) DomainRestoreParams(params DomainSaveRestoreParams, flags DomainSaveRestoreFlags) error { + info := getDomainSaveRestoreParametersFieldInfo(¶ms) + cparams, cnparams, gerr := typedParamsPackNew(info) + if gerr != nil { + return gerr + } + + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + + var err C.virError + if result := C.virDomainRestoreParamsWrapper(c.ptr, cparams, cnparams, C.uint(flags), &err); result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamNew +func (c *Connect) NewStream(flags StreamFlags) (*Stream, error) { + var err C.virError + virStream := C.virStreamNewWrapper(c.ptr, C.uint(flags), &err) + if virStream == nil { + return nil, makeError(&err) + } + + return &Stream{ + ptr: virStream, + }, nil +} + +type DomainStatsState struct { + StateSet bool + State DomainState + ReasonSet bool + Reason int +} + +func getDomainStatsStateFieldInfo(params *DomainStatsState) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + "state.state": typedParamsFieldInfo{ + set: ¶ms.StateSet, + i: (*int)(unsafe.Pointer(¶ms.State)), + }, + "state.reason": typedParamsFieldInfo{ + set: ¶ms.ReasonSet, + i: ¶ms.Reason, + }, + } +} + +type DomainStatsCPU struct { + TimeSet bool + Time uint64 + UserSet bool + User uint64 + SystemSet bool + System uint64 +} + +func getDomainStatsCPUFieldInfo(params *DomainStatsCPU) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + "cpu.time": typedParamsFieldInfo{ + set: ¶ms.TimeSet, + ul: ¶ms.Time, + }, + "cpu.user": typedParamsFieldInfo{ + set: ¶ms.UserSet, + ul: ¶ms.User, + }, + "cpu.system": typedParamsFieldInfo{ + set: ¶ms.SystemSet, + ul: ¶ms.System, + }, + } +} + +type DomainStatsBalloon struct { + CurrentSet bool + Current uint64 + MaximumSet bool + Maximum uint64 + SwapInSet bool + SwapIn uint64 + SwapOutSet bool + SwapOut uint64 + MajorFaultSet bool + MajorFault uint64 + MinorFaultSet bool + MinorFault uint64 + UnusedSet bool + Unused uint64 + AvailableSet bool + Available uint64 + RssSet bool + Rss uint64 + UsableSet bool + Usable uint64 + LastUpdateSet bool + LastUpdate uint64 + DiskCachesSet bool + DiskCaches uint64 + HugetlbPgAllocSet bool + HugetlbPgAlloc uint64 + HugetlbPgFailSet bool + HugetlbPgFail uint64 +} + +func getDomainStatsBalloonFieldInfo(params *DomainStatsBalloon) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + "balloon.current": typedParamsFieldInfo{ + set: ¶ms.CurrentSet, + ul: ¶ms.Current, + }, + "balloon.maximum": typedParamsFieldInfo{ + set: ¶ms.MaximumSet, + ul: ¶ms.Maximum, + }, + "balloon.swap_in": typedParamsFieldInfo{ + set: ¶ms.SwapInSet, + ul: ¶ms.SwapIn, + }, + "balloon.swap_out": typedParamsFieldInfo{ + set: ¶ms.SwapOutSet, + ul: ¶ms.SwapOut, + }, + "balloon.major_fault": typedParamsFieldInfo{ + set: ¶ms.MajorFaultSet, + ul: ¶ms.MajorFault, + }, + "balloon.minor_fault": typedParamsFieldInfo{ + set: ¶ms.MinorFaultSet, + ul: ¶ms.MinorFault, + }, + "balloon.unused": typedParamsFieldInfo{ + set: ¶ms.UnusedSet, + ul: ¶ms.Unused, + }, + "balloon.available": typedParamsFieldInfo{ + set: ¶ms.AvailableSet, + ul: ¶ms.Available, + }, + "balloon.rss": typedParamsFieldInfo{ + set: ¶ms.RssSet, + ul: ¶ms.Rss, + }, + "balloon.usable": typedParamsFieldInfo{ + set: ¶ms.UsableSet, + ul: ¶ms.Usable, + }, + // note: last-update not last_update, verified in libvirt source + "balloon.last-update": typedParamsFieldInfo{ + set: ¶ms.LastUpdateSet, + ul: ¶ms.LastUpdate, + }, + "balloon.disk_caches": typedParamsFieldInfo{ + set: ¶ms.DiskCachesSet, + ul: ¶ms.DiskCaches, + }, + "balloon.hugetlb_pgalloc": typedParamsFieldInfo{ + set: ¶ms.HugetlbPgAllocSet, + ul: ¶ms.HugetlbPgAlloc, + }, + "balloon.hugetlb_pgfail": typedParamsFieldInfo{ + set: ¶ms.HugetlbPgFailSet, + ul: ¶ms.HugetlbPgFail, + }, + } +} + +type DomainStatsVcpu struct { + StateSet bool + State VcpuState + TimeSet bool + Time uint64 + WaitSet bool + Wait uint64 + HaltedSet bool + Halted bool + DelaySet bool + Delay uint64 +} + +func getDomainStatsVcpuFieldInfo(idx int, params *DomainStatsVcpu) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + fmt.Sprintf("vcpu.%d.state", idx): typedParamsFieldInfo{ + set: ¶ms.StateSet, + i: (*int)(unsafe.Pointer(¶ms.State)), + }, + fmt.Sprintf("vcpu.%d.time", idx): typedParamsFieldInfo{ + set: ¶ms.TimeSet, + ul: ¶ms.Time, + }, + fmt.Sprintf("vcpu.%d.wait", idx): typedParamsFieldInfo{ + set: ¶ms.WaitSet, + ul: ¶ms.Wait, + }, + fmt.Sprintf("vcpu.%d.halted", idx): typedParamsFieldInfo{ + set: ¶ms.HaltedSet, + b: ¶ms.Halted, + }, + fmt.Sprintf("vcpu.%d.delay", idx): typedParamsFieldInfo{ + set: ¶ms.DelaySet, + ul: ¶ms.Delay, + }, + } +} + +type DomainStatsNet struct { + NameSet bool + Name string + RxBytesSet bool + RxBytes uint64 + RxPktsSet bool + RxPkts uint64 + RxErrsSet bool + RxErrs uint64 + RxDropSet bool + RxDrop uint64 + TxBytesSet bool + TxBytes uint64 + TxPktsSet bool + TxPkts uint64 + TxErrsSet bool + TxErrs uint64 + TxDropSet bool + TxDrop uint64 +} + +func getDomainStatsNetFieldInfo(idx int, params *DomainStatsNet) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + fmt.Sprintf("net.%d.name", idx): typedParamsFieldInfo{ + set: ¶ms.NameSet, + s: ¶ms.Name, + }, + fmt.Sprintf("net.%d.rx.bytes", idx): typedParamsFieldInfo{ + set: ¶ms.RxBytesSet, + ul: ¶ms.RxBytes, + }, + fmt.Sprintf("net.%d.rx.pkts", idx): typedParamsFieldInfo{ + set: ¶ms.RxPktsSet, + ul: ¶ms.RxPkts, + }, + fmt.Sprintf("net.%d.rx.errs", idx): typedParamsFieldInfo{ + set: ¶ms.RxErrsSet, + ul: ¶ms.RxErrs, + }, + fmt.Sprintf("net.%d.rx.drop", idx): typedParamsFieldInfo{ + set: ¶ms.RxDropSet, + ul: ¶ms.RxDrop, + }, + fmt.Sprintf("net.%d.tx.bytes", idx): typedParamsFieldInfo{ + set: ¶ms.TxBytesSet, + ul: ¶ms.TxBytes, + }, + fmt.Sprintf("net.%d.tx.pkts", idx): typedParamsFieldInfo{ + set: ¶ms.TxPktsSet, + ul: ¶ms.TxPkts, + }, + fmt.Sprintf("net.%d.tx.errs", idx): typedParamsFieldInfo{ + set: ¶ms.TxErrsSet, + ul: ¶ms.TxErrs, + }, + fmt.Sprintf("net.%d.tx.drop", idx): typedParamsFieldInfo{ + set: ¶ms.TxDropSet, + ul: ¶ms.TxDrop, + }, + } +} + +type DomainStatsBlock struct { + NameSet bool + Name string + BackingIndexSet bool + BackingIndex uint + PathSet bool + Path string + RdReqsSet bool + RdReqs uint64 + RdBytesSet bool + RdBytes uint64 + RdTimesSet bool + RdTimes uint64 + WrReqsSet bool + WrReqs uint64 + WrBytesSet bool + WrBytes uint64 + WrTimesSet bool + WrTimes uint64 + FlReqsSet bool + FlReqs uint64 + FlTimesSet bool + FlTimes uint64 + ErrorsSet bool + Errors uint64 + AllocationSet bool + Allocation uint64 + CapacitySet bool + Capacity uint64 + PhysicalSet bool + Physical uint64 +} + +func getDomainStatsBlockFieldInfo(idx int, params *DomainStatsBlock) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + fmt.Sprintf("block.%d.name", idx): typedParamsFieldInfo{ + set: ¶ms.NameSet, + s: ¶ms.Name, + }, + fmt.Sprintf("block.%d.backingIndex", idx): typedParamsFieldInfo{ + set: ¶ms.BackingIndexSet, + ui: ¶ms.BackingIndex, + }, + fmt.Sprintf("block.%d.path", idx): typedParamsFieldInfo{ + set: ¶ms.PathSet, + s: ¶ms.Path, + }, + fmt.Sprintf("block.%d.rd.reqs", idx): typedParamsFieldInfo{ + set: ¶ms.RdReqsSet, + ul: ¶ms.RdReqs, + }, + fmt.Sprintf("block.%d.rd.bytes", idx): typedParamsFieldInfo{ + set: ¶ms.RdBytesSet, + ul: ¶ms.RdBytes, + }, + fmt.Sprintf("block.%d.rd.times", idx): typedParamsFieldInfo{ + set: ¶ms.RdTimesSet, + ul: ¶ms.RdTimes, + }, + fmt.Sprintf("block.%d.wr.reqs", idx): typedParamsFieldInfo{ + set: ¶ms.WrReqsSet, + ul: ¶ms.WrReqs, + }, + fmt.Sprintf("block.%d.wr.bytes", idx): typedParamsFieldInfo{ + set: ¶ms.WrBytesSet, + ul: ¶ms.WrBytes, + }, + fmt.Sprintf("block.%d.wr.times", idx): typedParamsFieldInfo{ + set: ¶ms.WrTimesSet, + ul: ¶ms.WrTimes, + }, + fmt.Sprintf("block.%d.fl.reqs", idx): typedParamsFieldInfo{ + set: ¶ms.FlReqsSet, + ul: ¶ms.FlReqs, + }, + fmt.Sprintf("block.%d.fl.times", idx): typedParamsFieldInfo{ + set: ¶ms.FlTimesSet, + ul: ¶ms.FlTimes, + }, + fmt.Sprintf("block.%d.errors", idx): typedParamsFieldInfo{ + set: ¶ms.ErrorsSet, + ul: ¶ms.Errors, + }, + fmt.Sprintf("block.%d.allocation", idx): typedParamsFieldInfo{ + set: ¶ms.AllocationSet, + ul: ¶ms.Allocation, + }, + fmt.Sprintf("block.%d.capacity", idx): typedParamsFieldInfo{ + set: ¶ms.CapacitySet, + ul: ¶ms.Capacity, + }, + fmt.Sprintf("block.%d.physical", idx): typedParamsFieldInfo{ + set: ¶ms.PhysicalSet, + ul: ¶ms.Physical, + }, + } +} + +type DomainStatsPerf struct { + CmtSet bool + Cmt uint64 + MbmtSet bool + Mbmt uint64 + MbmlSet bool + Mbml uint64 + CacheMissesSet bool + CacheMisses uint64 + CacheReferencesSet bool + CacheReferences uint64 + InstructionsSet bool + Instructions uint64 + CpuCyclesSet bool + CpuCycles uint64 + BranchInstructionsSet bool + BranchInstructions uint64 + BranchMissesSet bool + BranchMisses uint64 + BusCyclesSet bool + BusCycles uint64 + StalledCyclesFrontendSet bool + StalledCyclesFrontend uint64 + StalledCyclesBackendSet bool + StalledCyclesBackend uint64 + RefCpuCyclesSet bool + RefCpuCycles uint64 + CpuClockSet bool + CpuClock uint64 + TaskClockSet bool + TaskClock uint64 + PageFaultsSet bool + PageFaults uint64 + ContextSwitchesSet bool + ContextSwitches uint64 + CpuMigrationsSet bool + CpuMigrations uint64 + PageFaultsMinSet bool + PageFaultsMin uint64 + PageFaultsMajSet bool + PageFaultsMaj uint64 + AlignmentFaultsSet bool + AlignmentFaults uint64 + EmulationFaultsSet bool + EmulationFaults uint64 +} + +func getDomainStatsPerfFieldInfo(params *DomainStatsPerf) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + "perf.cmt": typedParamsFieldInfo{ + set: ¶ms.CmtSet, + ul: ¶ms.Cmt, + }, + "perf.mbmt": typedParamsFieldInfo{ + set: ¶ms.MbmtSet, + ul: ¶ms.Mbmt, + }, + "perf.mbml": typedParamsFieldInfo{ + set: ¶ms.MbmlSet, + ul: ¶ms.Mbml, + }, + "perf.cache_misses": typedParamsFieldInfo{ + set: ¶ms.CacheMissesSet, + ul: ¶ms.CacheMisses, + }, + "perf.cache_references": typedParamsFieldInfo{ + set: ¶ms.CacheReferencesSet, + ul: ¶ms.CacheReferences, + }, + "perf.instructions": typedParamsFieldInfo{ + set: ¶ms.InstructionsSet, + ul: ¶ms.Instructions, + }, + "perf.cpu_cycles": typedParamsFieldInfo{ + set: ¶ms.CpuCyclesSet, + ul: ¶ms.CpuCycles, + }, + "perf.branch_instructions": typedParamsFieldInfo{ + set: ¶ms.BranchInstructionsSet, + ul: ¶ms.BranchInstructions, + }, + "perf.branch_misses": typedParamsFieldInfo{ + set: ¶ms.BranchMissesSet, + ul: ¶ms.BranchMisses, + }, + "perf.bus_cycles": typedParamsFieldInfo{ + set: ¶ms.BusCyclesSet, + ul: ¶ms.BusCycles, + }, + "perf.stalled_cycles_frontend": typedParamsFieldInfo{ + set: ¶ms.StalledCyclesFrontendSet, + ul: ¶ms.StalledCyclesFrontend, + }, + "perf.stalled_cycles_backend": typedParamsFieldInfo{ + set: ¶ms.StalledCyclesBackendSet, + ul: ¶ms.StalledCyclesBackend, + }, + "perf.ref_cpu_cycles": typedParamsFieldInfo{ + set: ¶ms.RefCpuCyclesSet, + ul: ¶ms.RefCpuCycles, + }, + "perf.cpu_clock": typedParamsFieldInfo{ + set: ¶ms.CpuClockSet, + ul: ¶ms.CpuClock, + }, + "perf.task_clock": typedParamsFieldInfo{ + set: ¶ms.TaskClockSet, + ul: ¶ms.TaskClock, + }, + "perf.page_faults": typedParamsFieldInfo{ + set: ¶ms.PageFaultsSet, + ul: ¶ms.PageFaults, + }, + "perf.context_switches": typedParamsFieldInfo{ + set: ¶ms.ContextSwitchesSet, + ul: ¶ms.ContextSwitches, + }, + "perf.cpu_migrations": typedParamsFieldInfo{ + set: ¶ms.CpuMigrationsSet, + ul: ¶ms.CpuMigrations, + }, + "perf.page_faults_min": typedParamsFieldInfo{ + set: ¶ms.PageFaultsMinSet, + ul: ¶ms.PageFaultsMin, + }, + "perf.page_faults_maj": typedParamsFieldInfo{ + set: ¶ms.PageFaultsMajSet, + ul: ¶ms.PageFaultsMaj, + }, + "perf.alignment_faults": typedParamsFieldInfo{ + set: ¶ms.AlignmentFaultsSet, + ul: ¶ms.AlignmentFaults, + }, + "perf.emulation_faults": typedParamsFieldInfo{ + set: ¶ms.EmulationFaultsSet, + ul: ¶ms.EmulationFaults, + }, + } +} + +type DomainStatsMemory struct { + BandwidthMonitor []DomainStatsMemoryBandwidthMonitor +} + +type DomainStatsMemoryBandwidthMonitor struct { + NameSet bool + Name string + VCPUsSet bool + VCPUs string + Nodes []DomainStatsMemoryBandwidthMonitorNode +} + +func getDomainStatsMemoryBandwidthMonitorFieldInfo(idx int, params *DomainStatsMemoryBandwidthMonitor) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + fmt.Sprintf("memory.bandwidth.monitor.%d.name", idx): typedParamsFieldInfo{ + set: ¶ms.NameSet, + s: ¶ms.Name, + }, + fmt.Sprintf("memory.bandwidth.monitor.%d.vcpus", idx): typedParamsFieldInfo{ + set: ¶ms.VCPUsSet, + s: ¶ms.VCPUs, + }, + } +} + +type domainStatsMemoryBandwidthMonitorLengths struct { + NodeCountSet bool + NodeCount uint +} + +func getDomainStatsMemoryBandwidthMonitorLengthsFieldInfo(idx int, params *domainStatsMemoryBandwidthMonitorLengths) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + fmt.Sprintf("memory.bandwidth.monitor.%d.node.count", idx): typedParamsFieldInfo{ + set: ¶ms.NodeCountSet, + ui: ¶ms.NodeCount, + }, + } +} + +type DomainStatsMemoryBandwidthMonitorNode struct { + IDSet bool + ID uint + BytesLocalSet bool + BytesLocal uint64 + BytesTotalSet bool + BytesTotal uint64 +} + +func getDomainStatsMemoryBandwidthMonitorNodeFieldInfo(idx1, idx2 int, params *DomainStatsMemoryBandwidthMonitorNode) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + fmt.Sprintf("memory.bandwidth.monitor.%d.node.%d.id", idx1, idx2): typedParamsFieldInfo{ + set: ¶ms.IDSet, + ui: ¶ms.ID, + }, + fmt.Sprintf("memory.bandwidth.monitor.%d.node.%d.bytes.local", idx1, idx2): typedParamsFieldInfo{ + set: ¶ms.BytesLocalSet, + ul: ¶ms.BytesLocal, + }, + fmt.Sprintf("memory.bandwidth.monitor.%d.node.%d.bytes.total", idx1, idx2): typedParamsFieldInfo{ + set: ¶ms.BytesTotalSet, + ul: ¶ms.BytesTotal, + }, + } +} + +type DomainStatsDirtyRate struct { + CalcStatusSet bool + CalcStatus int + CalcStartTimeSet bool + CalcStartTime int64 + CalcPeriodSet bool + CalcPeriod int + MegabytesPerSecondSet bool + MegabytesPerSecond int64 +} + +func getDomainStatsDirtyRateFieldInfo(params *DomainStatsDirtyRate) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + "dirtyrate.calc_status": typedParamsFieldInfo{ + set: ¶ms.CalcStatusSet, + i: ¶ms.CalcStatus, + }, + "dirtyrate.calc_start_time": typedParamsFieldInfo{ + set: ¶ms.CalcStartTimeSet, + l: ¶ms.CalcStartTime, + }, + "dirtyrate.calc_period": typedParamsFieldInfo{ + set: ¶ms.CalcPeriodSet, + i: ¶ms.CalcPeriod, + }, + "dirtyrate.megabytes_per_second": typedParamsFieldInfo{ + set: ¶ms.MegabytesPerSecondSet, + l: ¶ms.MegabytesPerSecond, + }, + } +} + +type DomainStats struct { + Domain *Domain + State *DomainStatsState + Cpu *DomainStatsCPU + Balloon *DomainStatsBalloon + Vcpu []DomainStatsVcpu + Net []DomainStatsNet + Block []DomainStatsBlock + Perf *DomainStatsPerf + Memory *DomainStatsMemory + DirtyRate *DomainStatsDirtyRate + VM []TypedParamValue +} + +type domainStatsLengths struct { + VcpuCurrentSet bool + VcpuCurrent uint + VcpuMaximumSet bool + VcpuMaximum uint + NetCountSet bool + NetCount uint + BlockCountSet bool + BlockCount uint + BandwidthCountSet bool + BandwidthCount uint +} + +func getDomainStatsLengthsFieldInfo(params *domainStatsLengths) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + "vcpu.current": typedParamsFieldInfo{ + set: ¶ms.VcpuCurrentSet, + ui: ¶ms.VcpuCurrent, + }, + "vcpu.maximum": typedParamsFieldInfo{ + set: ¶ms.VcpuMaximumSet, + ui: ¶ms.VcpuMaximum, + }, + "net.count": typedParamsFieldInfo{ + set: ¶ms.NetCountSet, + ui: ¶ms.NetCount, + }, + "block.count": typedParamsFieldInfo{ + set: ¶ms.BlockCountSet, + ui: ¶ms.BlockCount, + }, + "memory.bandwidth.monitor.count": typedParamsFieldInfo{ + set: ¶ms.BandwidthCountSet, + ui: ¶ms.BandwidthCount, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectGetAllDomainStats +// +// Note that each struct element in the returned 'DomainStats' +// array will contain a pointer to a 'Domain' object which +// holds a new reference. This pointer may or may not be the +// same as any pointers passed into the 'doms' parameter, but +// will at least refer to the same libvirt object. +// +// The caller must invoke 'Free' on the 'Domain' object in +// each array element, in order to release the references. +func (c *Connect) GetAllDomainStats(doms []*Domain, statsTypes DomainStatsTypes, flags ConnectGetAllDomainStatsFlags) ([]DomainStats, error) { + var ret C.int + var cstats *C.virDomainStatsRecordPtr + var err C.virError + if len(doms) > 0 { + cdoms := make([]C.virDomainPtr, len(doms)+1) + for i := 0; i < len(doms); i++ { + cdoms[i] = doms[i].ptr + } + + ret = C.virDomainListGetStatsWrapper(&cdoms[0], C.uint(statsTypes), &cstats, C.uint(flags), &err) + } else { + ret = C.virConnectGetAllDomainStatsWrapper(c.ptr, C.uint(statsTypes), &cstats, C.uint(flags), &err) + } + if ret == -1 { + return []DomainStats{}, makeError(&err) + } + + defer C.virDomainStatsRecordListFreeWrapper(cstats) + + stats := make([]DomainStats, ret) + for i := 0; i < int(ret); i++ { + cdomstats := *(*C.virDomainStatsRecordPtr)(unsafe.Pointer(uintptr(unsafe.Pointer(cstats)) + (unsafe.Sizeof(*cstats) * uintptr(i)))) + + domstats := DomainStats{ + Domain: &Domain{ptr: cdomstats.dom}, + } + + state := &DomainStatsState{} + stateInfo := getDomainStatsStateFieldInfo(state) + + count, gerr := typedParamsUnpack(cdomstats.params, cdomstats.nparams, stateInfo) + if gerr != nil { + return []DomainStats{}, gerr + } + if count != 0 { + domstats.State = state + } + + cpu := &DomainStatsCPU{} + cpuInfo := getDomainStatsCPUFieldInfo(cpu) + + count, gerr = typedParamsUnpack(cdomstats.params, cdomstats.nparams, cpuInfo) + if gerr != nil { + return []DomainStats{}, gerr + } + if count != 0 { + domstats.Cpu = cpu + } + + balloon := &DomainStatsBalloon{} + balloonInfo := getDomainStatsBalloonFieldInfo(balloon) + + count, gerr = typedParamsUnpack(cdomstats.params, cdomstats.nparams, balloonInfo) + if gerr != nil { + return []DomainStats{}, gerr + } + if count != 0 { + domstats.Balloon = balloon + } + + perf := &DomainStatsPerf{} + perfInfo := getDomainStatsPerfFieldInfo(perf) + + count, gerr = typedParamsUnpack(cdomstats.params, cdomstats.nparams, perfInfo) + if gerr != nil { + return []DomainStats{}, gerr + } + if count != 0 { + domstats.Perf = perf + } + + lengths := domainStatsLengths{} + lengthsInfo := getDomainStatsLengthsFieldInfo(&lengths) + + count, gerr = typedParamsUnpack(cdomstats.params, cdomstats.nparams, lengthsInfo) + if gerr != nil { + return []DomainStats{}, gerr + } + + if !lengths.VcpuMaximumSet && lengths.VcpuCurrentSet { + lengths.VcpuMaximum = lengths.VcpuCurrent + } + + if lengths.VcpuMaximum > 0 { + + domstats.Vcpu = make([]DomainStatsVcpu, lengths.VcpuMaximum) + for j := 0; j < int(lengths.VcpuMaximum); j++ { + vcpu := DomainStatsVcpu{} + vcpuInfo := getDomainStatsVcpuFieldInfo(j, &vcpu) + + count, gerr = typedParamsUnpack(cdomstats.params, cdomstats.nparams, vcpuInfo) + if gerr != nil { + return []DomainStats{}, gerr + } + if count == 0 { + vcpu.StateSet = true + vcpu.State = VCPU_OFFLINE + } + domstats.Vcpu[j] = vcpu + } + } + + if lengths.BlockCountSet && lengths.BlockCount > 0 { + domstats.Block = make([]DomainStatsBlock, lengths.BlockCount) + for j := 0; j < int(lengths.BlockCount); j++ { + block := DomainStatsBlock{} + blockInfo := getDomainStatsBlockFieldInfo(j, &block) + + count, gerr = typedParamsUnpack(cdomstats.params, cdomstats.nparams, blockInfo) + if gerr != nil { + return []DomainStats{}, gerr + } + if count != 0 { + domstats.Block[j] = block + } + } + } + + if lengths.NetCountSet && lengths.NetCount > 0 { + domstats.Net = make([]DomainStatsNet, lengths.NetCount) + for j := 0; j < int(lengths.NetCount); j++ { + net := DomainStatsNet{} + netInfo := getDomainStatsNetFieldInfo(j, &net) + + count, gerr = typedParamsUnpack(cdomstats.params, cdomstats.nparams, netInfo) + if gerr != nil { + return []DomainStats{}, gerr + } + if count != 0 { + domstats.Net[j] = net + } + } + } + + if lengths.BandwidthCountSet && lengths.BandwidthCount > 0 { + domstats.Memory = &DomainStatsMemory{ + BandwidthMonitor: make([]DomainStatsMemoryBandwidthMonitor, lengths.BandwidthCount), + } + + for j := 0; j < int(lengths.BandwidthCount); j++ { + bwmon := DomainStatsMemoryBandwidthMonitor{} + + bwmonInfo := getDomainStatsMemoryBandwidthMonitorFieldInfo(j, &bwmon) + + _, gerr = typedParamsUnpack(cdomstats.params, cdomstats.nparams, bwmonInfo) + if gerr != nil { + return []DomainStats{}, gerr + } + + bwmonlen := domainStatsMemoryBandwidthMonitorLengths{} + + bwmonlenInfo := getDomainStatsMemoryBandwidthMonitorLengthsFieldInfo(j, &bwmonlen) + + _, gerr = typedParamsUnpack(cdomstats.params, cdomstats.nparams, bwmonlenInfo) + if gerr != nil { + return []DomainStats{}, gerr + } + + if bwmonlen.NodeCountSet && bwmonlen.NodeCount > 0 { + bwmon.Nodes = make([]DomainStatsMemoryBandwidthMonitorNode, bwmonlen.NodeCount) + for k := 0; k < int(bwmonlen.NodeCount); k++ { + bwmonnode := DomainStatsMemoryBandwidthMonitorNode{} + + bwmonnodeInfo := getDomainStatsMemoryBandwidthMonitorNodeFieldInfo(j, k, &bwmonnode) + + _, gerr = typedParamsUnpack(cdomstats.params, cdomstats.nparams, bwmonnodeInfo) + if gerr != nil { + return []DomainStats{}, gerr + } + + bwmon.Nodes[k] = bwmonnode + } + } + + domstats.Memory.BandwidthMonitor[j] = bwmon + } + } + + dirtyrate := &DomainStatsDirtyRate{} + dirtyrateInfo := getDomainStatsDirtyRateFieldInfo(dirtyrate) + + count, gerr = typedParamsUnpack(cdomstats.params, cdomstats.nparams, dirtyrateInfo) + if gerr != nil { + return []DomainStats{}, gerr + } + if count != 0 { + domstats.DirtyRate = dirtyrate + } + + domstats.VM, gerr = typedParamsUnpackRaw("vm.", cdomstats.params, cdomstats.nparams) + if gerr != nil { + return []DomainStats{}, gerr + } + + stats[i] = domstats + } + + for i := 0; i < len(stats); i++ { + ret = C.virDomainRefWrapper(stats[i].Domain.ptr, &err) + if ret < 0 { + return []DomainStats{}, makeError(&err) + } + } + + return stats, nil +} + +type NodeSEVParameters struct { + PDHSet bool + PDH string + CertChainSet bool + CertChain string + CBitPosSet bool + CBitPos uint + ReducedPhysBitsSet bool + ReducedPhysBits uint + MaxGuestsSet bool + MaxGuests uint + MaxEsGuestsSet bool + MaxEsGuests uint + CPU0IDSet bool + CPU0ID string +} + +func getNodeSEVFieldInfo(params *NodeSEVParameters) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_NODE_SEV_PDH: typedParamsFieldInfo{ + set: ¶ms.PDHSet, + s: ¶ms.PDH, + }, + C.VIR_NODE_SEV_CERT_CHAIN: typedParamsFieldInfo{ + set: ¶ms.CertChainSet, + s: ¶ms.CertChain, + }, + C.VIR_NODE_SEV_CBITPOS: typedParamsFieldInfo{ + set: ¶ms.CBitPosSet, + ui: ¶ms.CBitPos, + }, + C.VIR_NODE_SEV_REDUCED_PHYS_BITS: typedParamsFieldInfo{ + set: ¶ms.ReducedPhysBitsSet, + ui: ¶ms.ReducedPhysBits, + }, + C.VIR_NODE_SEV_MAX_GUESTS: typedParamsFieldInfo{ + set: ¶ms.MaxGuestsSet, + ui: ¶ms.MaxGuests, + }, + C.VIR_NODE_SEV_MAX_ES_GUESTS: typedParamsFieldInfo{ + set: ¶ms.MaxEsGuestsSet, + ui: ¶ms.MaxEsGuests, + }, + C.VIR_NODE_SEV_CPU0_ID: typedParamsFieldInfo{ + set: ¶ms.CPU0IDSet, + s: ¶ms.CPU0ID, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-host.html#virNodeGetSEVInfo +func (c *Connect) GetSEVInfo(flags uint32) (*NodeSEVParameters, error) { + params := &NodeSEVParameters{} + info := getNodeSEVFieldInfo(params) + + var cparams *C.virTypedParameter + var cnparams C.int + + var err C.virError + ret := C.virNodeGetSEVInfoWrapper(c.ptr, (*C.virTypedParameterPtr)(unsafe.Pointer(&cparams)), &cnparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + + _, gerr := typedParamsUnpack(cparams, cnparams, info) + if gerr != nil { + return nil, gerr + } + + return params, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterBindingCreateXML +func (c *Connect) NWFilterBindingCreateXML(xmlConfig string, flags NWFilterBindingCreateFlags) (*NWFilterBinding, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virNWFilterBindingCreateXMLWrapper(c.ptr, cXml, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &NWFilterBinding{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virConnectGetStoragePoolCapabilities +func (c *Connect) GetStoragePoolCapabilities(flags uint32) (string, error) { + var err C.virError + ret := C.virConnectGetStoragePoolCapabilitiesWrapper(c.ptr, C.uint(flags), &err) + if ret == nil { + return "", makeError(&err) + } + + defer C.free(unsafe.Pointer(ret)) + + return C.GoString(ret), nil +} diff --git a/vendor/libvirt.org/go/libvirt/connect_helper.go b/vendor/libvirt.org/go/libvirt/connect_helper.go new file mode 100644 index 000000000..04d787fe5 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/connect_helper.go @@ -0,0 +1,99 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include "connect_helper.h" +#include "callbacks_helper.h" + +extern void closeCallback(virConnectPtr, int, long); +void closeCallbackHelper(virConnectPtr conn, int reason, void *opaque) +{ + closeCallback(conn, reason, (long)opaque); +} + + +extern int connectAuthCallback(virConnectCredentialPtr, unsigned int, int); +int connectAuthCallbackHelper(virConnectCredentialPtr cred, unsigned int ncred, void *cbdata) +{ + int *callbackID = cbdata; + + return connectAuthCallback(cred, ncred, *callbackID); +} + + +virConnectPtr +virConnectOpenAuthHelper(const char *name, + int *credtype, + unsigned int ncredtype, + int callbackID, + unsigned int flags, + virErrorPtr err) +{ + virConnectAuth auth = { + .credtype = credtype, + .ncredtype = ncredtype, + .cb = connectAuthCallbackHelper, + .cbdata = &callbackID, + }; + + return virConnectOpenAuthWrapper(name, &auth, flags, err); +} + + +virConnectPtr +virConnectOpenAuthDefaultHelper(const char *name, + unsigned int flags, + virErrorPtr err) +{ + return virConnectOpenAuthWrapper(name, *virConnectAuthPtrDefaultVar, flags, err); +} + + +int +virConnectRegisterCloseCallbackHelper(virConnectPtr conn, + long goCallbackId, + virErrorPtr err) +{ + void *id = (void *)goCallbackId; + return virConnectRegisterCloseCallbackWrapper(conn, closeCallbackHelper, id, + freeGoCallbackHelper, err); +} + + +int +virConnectUnregisterCloseCallbackHelper(virConnectPtr conn, + virErrorPtr err) +{ + return virConnectUnregisterCloseCallbackWrapper(conn, closeCallbackHelper, err); +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/connect_helper.h b/vendor/libvirt.org/go/libvirt/connect_helper.h new file mode 100644 index 000000000..b62eca554 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/connect_helper.h @@ -0,0 +1,65 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_CONNECT_HELPER_H__ +#define LIBVIRT_GO_CONNECT_HELPER_H__ + +#include "libvirt_generated.h" + + +void +closeCallbackHelper(virConnectPtr conn, + int reason, + void *opaque); + + +virConnectPtr +virConnectOpenAuthHelper(const char *name, + int *credtype, + unsigned int ncredtype, + int callbackID, + unsigned int flags, + virErrorPtr err); + + +virConnectPtr +virConnectOpenAuthDefaultHelper(const char *name, + unsigned int flags, + virErrorPtr err); + + +int +virConnectRegisterCloseCallbackHelper(virConnectPtr conn, + long goCallbackId, + virErrorPtr err); + + +int +virConnectUnregisterCloseCallbackHelper(virConnectPtr conn, + virErrorPtr err); + + +#endif /* LIBVIRT_GO_CONNECT_HELPER_H__ */ diff --git a/vendor/libvirt.org/go/libvirt/doc.go b/vendor/libvirt.org/go/libvirt/doc.go new file mode 100644 index 000000000..67ccf1aa9 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/doc.go @@ -0,0 +1,143 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +// Package libvirt provides a Go binding to the libvirt C library +// +// Through conditional compilation it supports libvirt versions 1.2.0 onwards. +// This is done automatically, with no requirement to use magic Go build tags. +// If an API was not available in the particular version of libvirt this package +// was built against, an error will be returned with a code of ERR_NO_SUPPORT. +// This is the same code seen if using a new libvirt library to talk to an old +// libvirtd lacking the API, or if a hypervisor does not support a given feature, +// so an application can easily handle all scenarios together. +// +// The Go binding is a fairly direct mapping of the underling C API which seeks +// to maximise the use of the Go type system to allow strong compiler type +// checking. The following rules describe how APIs/constants are mapped from C +// to Go +// +// For structs, the 'vir' prefix and 'Ptr' suffix are removed from the name. +// e.g. virConnectPtr in C becomes 'Connect' in Go. +// +// For structs which are reference counted at the C level, it is neccessary to +// explicitly release the reference at the Go level. e.g. if a Go method returns +// a '* Domain' struct, it is neccessary to call 'Free' on this when no longer +// required. The use of 'defer' is recommended for this purpose +// +// dom, err := conn.LookupDomainByName("myguest") +// if err != nil { +// ... +// } +// defer dom.Free() +// +// If multiple goroutines are using the same libvirt object struct, it may +// not be possible to determine which goroutine should call 'Free'. In such +// scenarios each new goroutine should call 'Ref' to obtain a private reference +// on the underlying C struct. All goroutines can call 'Free' unconditionally +// with the final one causing the release of the C object. +// +// For methods, the 'vir' prefix and object name prefix are remove from the name. +// The C functions become methods with an object receiver. e.g. +// 'virDomainScreenshot' in C becomes 'Screenshot' with a 'Domain *' receiver. +// +// For methods which accept a 'unsigned int flags' parameter in the C level, +// the corresponding Go parameter will be a named type corresponding to the +// C enum that defines the valid flags. For example, the ListAllDomains +// method takes a 'flags ConnectListAllDomainsFlags' parameter. If there are +// not currently any flags defined for a method in the C API, then the Go +// method parameter will be declared as a "flags uint32". Callers should always +// pass the literal integer value 0 for such parameters, without forcing any +// specific type. This will allow compatibility with future updates to the +// libvirt-go-module binding which may replace the 'uint32' type with a enum +// type at a later date. +// +// For enums, the VIR_ prefix is removed from the name. The enums get a dedicated +// type defined in Go. e.g. the VIR_NODE_SUSPEND_TARGET_MEM enum constant in C, +// becomes NODE_SUSPEND_TARGET_MEM with a type of NodeSuspendTarget. +// +// Methods accepting or returning virTypedParameter arrays in C will map the +// parameters into a Go struct. The struct will contain two fields for each +// possible parameter. One boolean field with a suffix of 'Set' indicates whether +// the parameter has a value set, and the other custom typed field provides the +// parameter value. This makes it possible to distinguish a parameter with a +// default value of '0' from a parameter which is 0 because it isn't supported by +// the hypervisor. If the C API defines additional typed parameters, then the +// corresponding Go struct will be extended to have further fields. +// e.g. the GetMemoryStats method in Go (which is backed by +// virNodeGetMemoryStats in C) will return a NodeMemoryStats struct containing +// the typed parameter values. +// +// stats, err := conn.GetMemoryParameters() +// if err != nil { +// .... +// } +// if stats.TotalSet { +// fmt.Printf("Total memory: %d KB", stats.Total) +// } +// +// Every method that can fail will include an 'error' object as the last return +// value. This will be an instance of the Error struct if an error occurred. To +// check for specific libvirt error codes, it is neccessary to cast the error. +// +// err := storage_vol.Wipe(0) +// if err != nil { +// lverr, ok := err.(libvirt.Error) +// if ok && lverr.Code == libvirt.ERR_NO_SUPPORT { +// fmt.Println("Wiping storage volumes is not supported"); +// } else { +// fmt.Println("Error wiping storage volume: %s", err) +// } +// } +// +// # Example usage +// +// To connect to libvirt +// +// import ( +// "libvirt.org/go/libvirt" +// ) +// conn, err := libvirt.NewConnect("qemu:///system") +// if err != nil { +// ... +// } +// defer conn.Close() +// +// doms, err := conn.ListAllDomains(libvirt.CONNECT_LIST_DOMAINS_ACTIVE) +// if err != nil { +// ... +// } +// +// fmt.Printf("%d running domains:\n", len(doms)) +// for _, dom := range doms { +// name, err := dom.GetName() +// if err == nil { +// fmt.Printf(" %s\n", name) +// } +// dom.Free() +// } +// +//go:generate go build -o generator ./gen +//go:generate ./generator +package libvirt diff --git a/vendor/libvirt.org/go/libvirt/domain.go b/vendor/libvirt.org/go/libvirt/domain.go new file mode 100644 index 000000000..11a3fb143 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/domain.go @@ -0,0 +1,5820 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include +#include "libvirt_generated.h" +*/ +import "C" + +import ( + "fmt" + "os" + "reflect" + "strconv" + "strings" + "unsafe" +) + +const ( + DOMAIN_SEND_KEY_MAX_KEYS = uint32(C.VIR_DOMAIN_SEND_KEY_MAX_KEYS) +) + +type DomainState int + +const ( + DOMAIN_NOSTATE = DomainState(C.VIR_DOMAIN_NOSTATE) + DOMAIN_RUNNING = DomainState(C.VIR_DOMAIN_RUNNING) + DOMAIN_BLOCKED = DomainState(C.VIR_DOMAIN_BLOCKED) + DOMAIN_PAUSED = DomainState(C.VIR_DOMAIN_PAUSED) + DOMAIN_SHUTDOWN = DomainState(C.VIR_DOMAIN_SHUTDOWN) + DOMAIN_CRASHED = DomainState(C.VIR_DOMAIN_CRASHED) + DOMAIN_PMSUSPENDED = DomainState(C.VIR_DOMAIN_PMSUSPENDED) + DOMAIN_SHUTOFF = DomainState(C.VIR_DOMAIN_SHUTOFF) +) + +type DomainMetadataType int + +const ( + DOMAIN_METADATA_DESCRIPTION = DomainMetadataType(C.VIR_DOMAIN_METADATA_DESCRIPTION) + DOMAIN_METADATA_TITLE = DomainMetadataType(C.VIR_DOMAIN_METADATA_TITLE) + DOMAIN_METADATA_ELEMENT = DomainMetadataType(C.VIR_DOMAIN_METADATA_ELEMENT) +) + +type DomainVcpuFlags uint + +const ( + DOMAIN_VCPU_CONFIG = DomainVcpuFlags(C.VIR_DOMAIN_VCPU_CONFIG) + DOMAIN_VCPU_CURRENT = DomainVcpuFlags(C.VIR_DOMAIN_VCPU_CURRENT) + DOMAIN_VCPU_LIVE = DomainVcpuFlags(C.VIR_DOMAIN_VCPU_LIVE) + DOMAIN_VCPU_MAXIMUM = DomainVcpuFlags(C.VIR_DOMAIN_VCPU_MAXIMUM) + DOMAIN_VCPU_GUEST = DomainVcpuFlags(C.VIR_DOMAIN_VCPU_GUEST) + DOMAIN_VCPU_HOTPLUGGABLE = DomainVcpuFlags(C.VIR_DOMAIN_VCPU_HOTPLUGGABLE) +) + +type DomainModificationImpact int + +const ( + DOMAIN_AFFECT_CONFIG = DomainModificationImpact(C.VIR_DOMAIN_AFFECT_CONFIG) + DOMAIN_AFFECT_CURRENT = DomainModificationImpact(C.VIR_DOMAIN_AFFECT_CURRENT) + DOMAIN_AFFECT_LIVE = DomainModificationImpact(C.VIR_DOMAIN_AFFECT_LIVE) +) + +type DomainMemoryModFlags uint + +const ( + DOMAIN_MEM_CONFIG = DomainMemoryModFlags(C.VIR_DOMAIN_MEM_CONFIG) + DOMAIN_MEM_CURRENT = DomainMemoryModFlags(C.VIR_DOMAIN_MEM_CURRENT) + DOMAIN_MEM_LIVE = DomainMemoryModFlags(C.VIR_DOMAIN_MEM_LIVE) + DOMAIN_MEM_MAXIMUM = DomainMemoryModFlags(C.VIR_DOMAIN_MEM_MAXIMUM) +) + +type DomainDestroyFlags uint + +const ( + DOMAIN_DESTROY_DEFAULT = DomainDestroyFlags(C.VIR_DOMAIN_DESTROY_DEFAULT) + DOMAIN_DESTROY_GRACEFUL = DomainDestroyFlags(C.VIR_DOMAIN_DESTROY_GRACEFUL) + DOMAIN_DESTROY_REMOVE_LOGS = DomainDestroyFlags(C.VIR_DOMAIN_DESTROY_REMOVE_LOGS) +) + +type DomainShutdownFlags uint + +const ( + DOMAIN_SHUTDOWN_DEFAULT = DomainShutdownFlags(C.VIR_DOMAIN_SHUTDOWN_DEFAULT) + DOMAIN_SHUTDOWN_ACPI_POWER_BTN = DomainShutdownFlags(C.VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN) + DOMAIN_SHUTDOWN_GUEST_AGENT = DomainShutdownFlags(C.VIR_DOMAIN_SHUTDOWN_GUEST_AGENT) + DOMAIN_SHUTDOWN_INITCTL = DomainShutdownFlags(C.VIR_DOMAIN_SHUTDOWN_INITCTL) + DOMAIN_SHUTDOWN_SIGNAL = DomainShutdownFlags(C.VIR_DOMAIN_SHUTDOWN_SIGNAL) + DOMAIN_SHUTDOWN_PARAVIRT = DomainShutdownFlags(C.VIR_DOMAIN_SHUTDOWN_PARAVIRT) +) + +type DomainUndefineFlagsValues int + +const ( + DOMAIN_UNDEFINE_MANAGED_SAVE = DomainUndefineFlagsValues(C.VIR_DOMAIN_UNDEFINE_MANAGED_SAVE) // Also remove any managed save + DOMAIN_UNDEFINE_SNAPSHOTS_METADATA = DomainUndefineFlagsValues(C.VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA) // If last use of domain, then also remove any snapshot metadata + DOMAIN_UNDEFINE_NVRAM = DomainUndefineFlagsValues(C.VIR_DOMAIN_UNDEFINE_NVRAM) // Also remove any nvram file + DOMAIN_UNDEFINE_KEEP_NVRAM = DomainUndefineFlagsValues(C.VIR_DOMAIN_UNDEFINE_KEEP_NVRAM) // Keep nvram file + DOMAIN_UNDEFINE_CHECKPOINTS_METADATA = DomainUndefineFlagsValues(C.VIR_DOMAIN_UNDEFINE_CHECKPOINTS_METADATA) // If last use of domain, then also remove any checkpoint metadata + DOMAIN_UNDEFINE_TPM = DomainUndefineFlagsValues(C.VIR_DOMAIN_UNDEFINE_TPM) // Also remove any TPM state + DOMAIN_UNDEFINE_KEEP_TPM = DomainUndefineFlagsValues(C.VIR_DOMAIN_UNDEFINE_KEEP_TPM) // Keep TPM state +) + +type DomainDeviceModifyFlags uint + +const ( + DOMAIN_DEVICE_MODIFY_CONFIG = DomainDeviceModifyFlags(C.VIR_DOMAIN_DEVICE_MODIFY_CONFIG) + DOMAIN_DEVICE_MODIFY_CURRENT = DomainDeviceModifyFlags(C.VIR_DOMAIN_DEVICE_MODIFY_CURRENT) + DOMAIN_DEVICE_MODIFY_LIVE = DomainDeviceModifyFlags(C.VIR_DOMAIN_DEVICE_MODIFY_LIVE) + DOMAIN_DEVICE_MODIFY_FORCE = DomainDeviceModifyFlags(C.VIR_DOMAIN_DEVICE_MODIFY_FORCE) +) + +type DomainCreateFlags uint + +const ( + DOMAIN_NONE = DomainCreateFlags(C.VIR_DOMAIN_NONE) + DOMAIN_START_PAUSED = DomainCreateFlags(C.VIR_DOMAIN_START_PAUSED) + DOMAIN_START_AUTODESTROY = DomainCreateFlags(C.VIR_DOMAIN_START_AUTODESTROY) + DOMAIN_START_BYPASS_CACHE = DomainCreateFlags(C.VIR_DOMAIN_START_BYPASS_CACHE) + DOMAIN_START_FORCE_BOOT = DomainCreateFlags(C.VIR_DOMAIN_START_FORCE_BOOT) + DOMAIN_START_VALIDATE = DomainCreateFlags(C.VIR_DOMAIN_START_VALIDATE) + DOMAIN_START_RESET_NVRAM = DomainCreateFlags(C.VIR_DOMAIN_START_RESET_NVRAM) +) + +const DOMAIN_MEMORY_PARAM_UNLIMITED = C.VIR_DOMAIN_MEMORY_PARAM_UNLIMITED + +type DomainEventType int + +const ( + DOMAIN_EVENT_DEFINED = DomainEventType(C.VIR_DOMAIN_EVENT_DEFINED) + DOMAIN_EVENT_UNDEFINED = DomainEventType(C.VIR_DOMAIN_EVENT_UNDEFINED) + DOMAIN_EVENT_STARTED = DomainEventType(C.VIR_DOMAIN_EVENT_STARTED) + DOMAIN_EVENT_SUSPENDED = DomainEventType(C.VIR_DOMAIN_EVENT_SUSPENDED) + DOMAIN_EVENT_RESUMED = DomainEventType(C.VIR_DOMAIN_EVENT_RESUMED) + DOMAIN_EVENT_STOPPED = DomainEventType(C.VIR_DOMAIN_EVENT_STOPPED) + DOMAIN_EVENT_SHUTDOWN = DomainEventType(C.VIR_DOMAIN_EVENT_SHUTDOWN) + DOMAIN_EVENT_PMSUSPENDED = DomainEventType(C.VIR_DOMAIN_EVENT_PMSUSPENDED) + DOMAIN_EVENT_CRASHED = DomainEventType(C.VIR_DOMAIN_EVENT_CRASHED) +) + +type DomainEventWatchdogAction int + +// The action that is to be taken due to the watchdog device firing +const ( + // No action, watchdog ignored + DOMAIN_EVENT_WATCHDOG_NONE = DomainEventWatchdogAction(C.VIR_DOMAIN_EVENT_WATCHDOG_NONE) + + // Guest CPUs are paused + DOMAIN_EVENT_WATCHDOG_PAUSE = DomainEventWatchdogAction(C.VIR_DOMAIN_EVENT_WATCHDOG_PAUSE) + + // Guest CPUs are reset + DOMAIN_EVENT_WATCHDOG_RESET = DomainEventWatchdogAction(C.VIR_DOMAIN_EVENT_WATCHDOG_RESET) + + // Guest is forcibly powered off + DOMAIN_EVENT_WATCHDOG_POWEROFF = DomainEventWatchdogAction(C.VIR_DOMAIN_EVENT_WATCHDOG_POWEROFF) + + // Guest is requested to gracefully shutdown + DOMAIN_EVENT_WATCHDOG_SHUTDOWN = DomainEventWatchdogAction(C.VIR_DOMAIN_EVENT_WATCHDOG_SHUTDOWN) + + // No action, a debug message logged + DOMAIN_EVENT_WATCHDOG_DEBUG = DomainEventWatchdogAction(C.VIR_DOMAIN_EVENT_WATCHDOG_DEBUG) + + // Inject a non-maskable interrupt into guest + DOMAIN_EVENT_WATCHDOG_INJECTNMI = DomainEventWatchdogAction(C.VIR_DOMAIN_EVENT_WATCHDOG_INJECTNMI) +) + +type DomainEventIOErrorAction int + +// The action that is to be taken due to an IO error occurring +const ( + // No action, IO error ignored + DOMAIN_EVENT_IO_ERROR_NONE = DomainEventIOErrorAction(C.VIR_DOMAIN_EVENT_IO_ERROR_NONE) + + // Guest CPUs are paused + DOMAIN_EVENT_IO_ERROR_PAUSE = DomainEventIOErrorAction(C.VIR_DOMAIN_EVENT_IO_ERROR_PAUSE) + + // IO error reported to guest OS + DOMAIN_EVENT_IO_ERROR_REPORT = DomainEventIOErrorAction(C.VIR_DOMAIN_EVENT_IO_ERROR_REPORT) +) + +type DomainEventGraphicsPhase int + +// The phase of the graphics client connection +const ( + // Initial socket connection established + DOMAIN_EVENT_GRAPHICS_CONNECT = DomainEventGraphicsPhase(C.VIR_DOMAIN_EVENT_GRAPHICS_CONNECT) + + // Authentication & setup completed + DOMAIN_EVENT_GRAPHICS_INITIALIZE = DomainEventGraphicsPhase(C.VIR_DOMAIN_EVENT_GRAPHICS_INITIALIZE) + + // Final socket disconnection + DOMAIN_EVENT_GRAPHICS_DISCONNECT = DomainEventGraphicsPhase(C.VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT) +) + +type DomainEventGraphicsAddressType int + +const ( + // IPv4 address + DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4 = DomainEventGraphicsAddressType(C.VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4) + + // IPv6 address + DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6 = DomainEventGraphicsAddressType(C.VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6) + + // UNIX socket path + DOMAIN_EVENT_GRAPHICS_ADDRESS_UNIX = DomainEventGraphicsAddressType(C.VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_UNIX) +) + +type DomainBlockJobType int + +const ( + // Placeholder + DOMAIN_BLOCK_JOB_TYPE_UNKNOWN = DomainBlockJobType(C.VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN) + + // Block Pull (virDomainBlockPull, or virDomainBlockRebase without + // flags), job ends on completion + DOMAIN_BLOCK_JOB_TYPE_PULL = DomainBlockJobType(C.VIR_DOMAIN_BLOCK_JOB_TYPE_PULL) + + // Block Copy (virDomainBlockCopy, or virDomainBlockRebase with + // flags), job exists as long as mirroring is active + DOMAIN_BLOCK_JOB_TYPE_COPY = DomainBlockJobType(C.VIR_DOMAIN_BLOCK_JOB_TYPE_COPY) + + // Block Commit (virDomainBlockCommit without flags), job ends on + // completion + DOMAIN_BLOCK_JOB_TYPE_COMMIT = DomainBlockJobType(C.VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT) + + // Active Block Commit (virDomainBlockCommit with flags), job + // exists as long as sync is active + DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT = DomainBlockJobType(C.VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT) + + // Live disk backup job + DOMAIN_BLOCK_JOB_TYPE_BACKUP = DomainBlockJobType(C.VIR_DOMAIN_BLOCK_JOB_TYPE_BACKUP) +) + +type DomainRunningReason int + +const ( + DOMAIN_RUNNING_UNKNOWN = DomainRunningReason(C.VIR_DOMAIN_RUNNING_UNKNOWN) + DOMAIN_RUNNING_BOOTED = DomainRunningReason(C.VIR_DOMAIN_RUNNING_BOOTED) /* normal startup from boot */ + DOMAIN_RUNNING_MIGRATED = DomainRunningReason(C.VIR_DOMAIN_RUNNING_MIGRATED) /* migrated from another host */ + DOMAIN_RUNNING_RESTORED = DomainRunningReason(C.VIR_DOMAIN_RUNNING_RESTORED) /* restored from a state file */ + DOMAIN_RUNNING_FROM_SNAPSHOT = DomainRunningReason(C.VIR_DOMAIN_RUNNING_FROM_SNAPSHOT) /* restored from snapshot */ + DOMAIN_RUNNING_UNPAUSED = DomainRunningReason(C.VIR_DOMAIN_RUNNING_UNPAUSED) /* returned from paused state */ + DOMAIN_RUNNING_MIGRATION_CANCELED = DomainRunningReason(C.VIR_DOMAIN_RUNNING_MIGRATION_CANCELED) /* returned from migration */ + DOMAIN_RUNNING_SAVE_CANCELED = DomainRunningReason(C.VIR_DOMAIN_RUNNING_SAVE_CANCELED) /* returned from failed save process */ + DOMAIN_RUNNING_WAKEUP = DomainRunningReason(C.VIR_DOMAIN_RUNNING_WAKEUP) /* returned from pmsuspended due to wakeup event */ + DOMAIN_RUNNING_CRASHED = DomainRunningReason(C.VIR_DOMAIN_RUNNING_CRASHED) /* resumed from crashed */ + DOMAIN_RUNNING_POSTCOPY = DomainRunningReason(C.VIR_DOMAIN_RUNNING_POSTCOPY) /* running in post-copy migration mode */ + DOMAIN_RUNNING_POSTCOPY_FAILED = DomainRunningReason(C.VIR_DOMAIN_RUNNING_POSTCOPY_FAILED) /* running in post-copy migration mode after failure */ +) + +type DomainPausedReason int + +const ( + DOMAIN_PAUSED_UNKNOWN = DomainPausedReason(C.VIR_DOMAIN_PAUSED_UNKNOWN) /* the reason is unknown */ + DOMAIN_PAUSED_USER = DomainPausedReason(C.VIR_DOMAIN_PAUSED_USER) /* paused on user request */ + DOMAIN_PAUSED_MIGRATION = DomainPausedReason(C.VIR_DOMAIN_PAUSED_MIGRATION) /* paused for offline migration */ + DOMAIN_PAUSED_SAVE = DomainPausedReason(C.VIR_DOMAIN_PAUSED_SAVE) /* paused for save */ + DOMAIN_PAUSED_DUMP = DomainPausedReason(C.VIR_DOMAIN_PAUSED_DUMP) /* paused for offline core dump */ + DOMAIN_PAUSED_IOERROR = DomainPausedReason(C.VIR_DOMAIN_PAUSED_IOERROR) /* paused due to a disk I/O error */ + DOMAIN_PAUSED_WATCHDOG = DomainPausedReason(C.VIR_DOMAIN_PAUSED_WATCHDOG) /* paused due to a watchdog event */ + DOMAIN_PAUSED_FROM_SNAPSHOT = DomainPausedReason(C.VIR_DOMAIN_PAUSED_FROM_SNAPSHOT) /* paused after restoring from snapshot */ + DOMAIN_PAUSED_SHUTTING_DOWN = DomainPausedReason(C.VIR_DOMAIN_PAUSED_SHUTTING_DOWN) /* paused during shutdown process */ + DOMAIN_PAUSED_SNAPSHOT = DomainPausedReason(C.VIR_DOMAIN_PAUSED_SNAPSHOT) /* paused while creating a snapshot */ + DOMAIN_PAUSED_CRASHED = DomainPausedReason(C.VIR_DOMAIN_PAUSED_CRASHED) /* paused due to a guest crash */ + DOMAIN_PAUSED_STARTING_UP = DomainPausedReason(C.VIR_DOMAIN_PAUSED_STARTING_UP) /* the domainis being started */ + DOMAIN_PAUSED_POSTCOPY = DomainPausedReason(C.VIR_DOMAIN_PAUSED_POSTCOPY) /* paused for post-copy migration */ + DOMAIN_PAUSED_POSTCOPY_FAILED = DomainPausedReason(C.VIR_DOMAIN_PAUSED_POSTCOPY_FAILED) /* paused after failed post-copy */ + DOMAIN_PAUSED_API_ERROR = DomainPausedReason(C.VIR_DOMAIN_PAUSED_API_ERROR) /* Some APIs (e.g., migration, snapshot) internally need to suspend a domain. This paused state reason is used when resume operation at the end of such API fails.*/ +) + +type DomainXMLFlags uint + +const ( + DOMAIN_XML_SECURE = DomainXMLFlags(C.VIR_DOMAIN_XML_SECURE) /* dump security sensitive information too */ + DOMAIN_XML_INACTIVE = DomainXMLFlags(C.VIR_DOMAIN_XML_INACTIVE) /* dump inactive domain information */ + DOMAIN_XML_UPDATE_CPU = DomainXMLFlags(C.VIR_DOMAIN_XML_UPDATE_CPU) /* update guest CPU requirements according to host CPU */ + DOMAIN_XML_MIGRATABLE = DomainXMLFlags(C.VIR_DOMAIN_XML_MIGRATABLE) /* dump XML suitable for migration */ +) + +type DomainEventDefinedDetailType int + +const ( + DOMAIN_EVENT_DEFINED_ADDED = DomainEventDefinedDetailType(C.VIR_DOMAIN_EVENT_DEFINED_ADDED) + DOMAIN_EVENT_DEFINED_UPDATED = DomainEventDefinedDetailType(C.VIR_DOMAIN_EVENT_DEFINED_UPDATED) + DOMAIN_EVENT_DEFINED_RENAMED = DomainEventDefinedDetailType(C.VIR_DOMAIN_EVENT_DEFINED_RENAMED) + DOMAIN_EVENT_DEFINED_FROM_SNAPSHOT = DomainEventDefinedDetailType(C.VIR_DOMAIN_EVENT_DEFINED_FROM_SNAPSHOT) +) + +type DomainEventUndefinedDetailType int + +const ( + DOMAIN_EVENT_UNDEFINED_REMOVED = DomainEventUndefinedDetailType(C.VIR_DOMAIN_EVENT_UNDEFINED_REMOVED) + DOMAIN_EVENT_UNDEFINED_RENAMED = DomainEventUndefinedDetailType(C.VIR_DOMAIN_EVENT_UNDEFINED_RENAMED) +) + +type DomainEventStartedDetailType int + +const ( + DOMAIN_EVENT_STARTED_BOOTED = DomainEventStartedDetailType(C.VIR_DOMAIN_EVENT_STARTED_BOOTED) + DOMAIN_EVENT_STARTED_MIGRATED = DomainEventStartedDetailType(C.VIR_DOMAIN_EVENT_STARTED_MIGRATED) + DOMAIN_EVENT_STARTED_RESTORED = DomainEventStartedDetailType(C.VIR_DOMAIN_EVENT_STARTED_RESTORED) + DOMAIN_EVENT_STARTED_FROM_SNAPSHOT = DomainEventStartedDetailType(C.VIR_DOMAIN_EVENT_STARTED_FROM_SNAPSHOT) + DOMAIN_EVENT_STARTED_WAKEUP = DomainEventStartedDetailType(C.VIR_DOMAIN_EVENT_STARTED_WAKEUP) +) + +type DomainEventSuspendedDetailType int + +const ( + DOMAIN_EVENT_SUSPENDED_PAUSED = DomainEventSuspendedDetailType(C.VIR_DOMAIN_EVENT_SUSPENDED_PAUSED) + DOMAIN_EVENT_SUSPENDED_MIGRATED = DomainEventSuspendedDetailType(C.VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED) + DOMAIN_EVENT_SUSPENDED_IOERROR = DomainEventSuspendedDetailType(C.VIR_DOMAIN_EVENT_SUSPENDED_IOERROR) + DOMAIN_EVENT_SUSPENDED_WATCHDOG = DomainEventSuspendedDetailType(C.VIR_DOMAIN_EVENT_SUSPENDED_WATCHDOG) + DOMAIN_EVENT_SUSPENDED_RESTORED = DomainEventSuspendedDetailType(C.VIR_DOMAIN_EVENT_SUSPENDED_RESTORED) + DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT = DomainEventSuspendedDetailType(C.VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT) + DOMAIN_EVENT_SUSPENDED_API_ERROR = DomainEventSuspendedDetailType(C.VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR) + DOMAIN_EVENT_SUSPENDED_POSTCOPY = DomainEventSuspendedDetailType(C.VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY) + DOMAIN_EVENT_SUSPENDED_POSTCOPY_FAILED = DomainEventSuspendedDetailType(C.VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY_FAILED) +) + +type DomainEventResumedDetailType int + +const ( + DOMAIN_EVENT_RESUMED_UNPAUSED = DomainEventResumedDetailType(C.VIR_DOMAIN_EVENT_RESUMED_UNPAUSED) + DOMAIN_EVENT_RESUMED_MIGRATED = DomainEventResumedDetailType(C.VIR_DOMAIN_EVENT_RESUMED_MIGRATED) + DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT = DomainEventResumedDetailType(C.VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT) + DOMAIN_EVENT_RESUMED_POSTCOPY = DomainEventResumedDetailType(C.VIR_DOMAIN_EVENT_RESUMED_POSTCOPY) + DOMAIN_EVENT_RESUMED_POSTCOPY_FAILED = DomainEventResumedDetailType(C.VIR_DOMAIN_EVENT_RESUMED_POSTCOPY_FAILED) +) + +type DomainEventStoppedDetailType int + +const ( + DOMAIN_EVENT_STOPPED_SHUTDOWN = DomainEventStoppedDetailType(C.VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN) + DOMAIN_EVENT_STOPPED_DESTROYED = DomainEventStoppedDetailType(C.VIR_DOMAIN_EVENT_STOPPED_DESTROYED) + DOMAIN_EVENT_STOPPED_CRASHED = DomainEventStoppedDetailType(C.VIR_DOMAIN_EVENT_STOPPED_CRASHED) + DOMAIN_EVENT_STOPPED_MIGRATED = DomainEventStoppedDetailType(C.VIR_DOMAIN_EVENT_STOPPED_MIGRATED) + DOMAIN_EVENT_STOPPED_SAVED = DomainEventStoppedDetailType(C.VIR_DOMAIN_EVENT_STOPPED_SAVED) + DOMAIN_EVENT_STOPPED_FAILED = DomainEventStoppedDetailType(C.VIR_DOMAIN_EVENT_STOPPED_FAILED) + DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT = DomainEventStoppedDetailType(C.VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT) +) + +type DomainEventShutdownDetailType int + +const ( + DOMAIN_EVENT_SHUTDOWN_FINISHED = DomainEventShutdownDetailType(C.VIR_DOMAIN_EVENT_SHUTDOWN_FINISHED) + DOMAIN_EVENT_SHUTDOWN_GUEST = DomainEventShutdownDetailType(C.VIR_DOMAIN_EVENT_SHUTDOWN_GUEST) + DOMAIN_EVENT_SHUTDOWN_HOST = DomainEventShutdownDetailType(C.VIR_DOMAIN_EVENT_SHUTDOWN_HOST) +) + +type DomainMemoryStatTags int + +const ( + DOMAIN_MEMORY_STAT_LAST = DomainMemoryStatTags(C.VIR_DOMAIN_MEMORY_STAT_NR) + DOMAIN_MEMORY_STAT_SWAP_IN = DomainMemoryStatTags(C.VIR_DOMAIN_MEMORY_STAT_SWAP_IN) + DOMAIN_MEMORY_STAT_SWAP_OUT = DomainMemoryStatTags(C.VIR_DOMAIN_MEMORY_STAT_SWAP_OUT) + DOMAIN_MEMORY_STAT_MAJOR_FAULT = DomainMemoryStatTags(C.VIR_DOMAIN_MEMORY_STAT_MAJOR_FAULT) + DOMAIN_MEMORY_STAT_MINOR_FAULT = DomainMemoryStatTags(C.VIR_DOMAIN_MEMORY_STAT_MINOR_FAULT) + DOMAIN_MEMORY_STAT_UNUSED = DomainMemoryStatTags(C.VIR_DOMAIN_MEMORY_STAT_UNUSED) + DOMAIN_MEMORY_STAT_AVAILABLE = DomainMemoryStatTags(C.VIR_DOMAIN_MEMORY_STAT_AVAILABLE) + DOMAIN_MEMORY_STAT_ACTUAL_BALLOON = DomainMemoryStatTags(C.VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON) + DOMAIN_MEMORY_STAT_RSS = DomainMemoryStatTags(C.VIR_DOMAIN_MEMORY_STAT_RSS) + DOMAIN_MEMORY_STAT_USABLE = DomainMemoryStatTags(C.VIR_DOMAIN_MEMORY_STAT_USABLE) + DOMAIN_MEMORY_STAT_LAST_UPDATE = DomainMemoryStatTags(C.VIR_DOMAIN_MEMORY_STAT_LAST_UPDATE) + DOMAIN_MEMORY_STAT_DISK_CACHES = DomainMemoryStatTags(C.VIR_DOMAIN_MEMORY_STAT_DISK_CACHES) + DOMAIN_MEMORY_STAT_HUGETLB_PGALLOC = DomainMemoryStatTags(C.VIR_DOMAIN_MEMORY_STAT_HUGETLB_PGALLOC) + DOMAIN_MEMORY_STAT_HUGETLB_PGFAIL = DomainMemoryStatTags(C.VIR_DOMAIN_MEMORY_STAT_HUGETLB_PGFAIL) + DOMAIN_MEMORY_STAT_NR = DomainMemoryStatTags(C.VIR_DOMAIN_MEMORY_STAT_NR) +) + +type DomainCPUStatsTags string + +const ( + DOMAIN_CPU_STATS_CPUTIME = DomainCPUStatsTags(C.VIR_DOMAIN_CPU_STATS_CPUTIME) + DOMAIN_CPU_STATS_SYSTEMTIME = DomainCPUStatsTags(C.VIR_DOMAIN_CPU_STATS_SYSTEMTIME) + DOMAIN_CPU_STATS_USERTIME = DomainCPUStatsTags(C.VIR_DOMAIN_CPU_STATS_USERTIME) + DOMAIN_CPU_STATS_VCPUTIME = DomainCPUStatsTags(C.VIR_DOMAIN_CPU_STATS_VCPUTIME) +) + +type DomainInterfaceAddressesSource int + +const ( + DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE = DomainInterfaceAddressesSource(C.VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE) + DOMAIN_INTERFACE_ADDRESSES_SRC_AGENT = DomainInterfaceAddressesSource(C.VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_AGENT) + DOMAIN_INTERFACE_ADDRESSES_SRC_ARP = DomainInterfaceAddressesSource(C.VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_ARP) +) + +type KeycodeSet int + +const ( + KEYCODE_SET_LINUX = KeycodeSet(C.VIR_KEYCODE_SET_LINUX) + KEYCODE_SET_XT = KeycodeSet(C.VIR_KEYCODE_SET_XT) + KEYCODE_SET_ATSET1 = KeycodeSet(C.VIR_KEYCODE_SET_ATSET1) + KEYCODE_SET_ATSET2 = KeycodeSet(C.VIR_KEYCODE_SET_ATSET2) + KEYCODE_SET_ATSET3 = KeycodeSet(C.VIR_KEYCODE_SET_ATSET3) + KEYCODE_SET_OSX = KeycodeSet(C.VIR_KEYCODE_SET_OSX) + KEYCODE_SET_XT_KBD = KeycodeSet(C.VIR_KEYCODE_SET_XT_KBD) + KEYCODE_SET_USB = KeycodeSet(C.VIR_KEYCODE_SET_USB) + KEYCODE_SET_WIN32 = KeycodeSet(C.VIR_KEYCODE_SET_WIN32) + KEYCODE_SET_RFB = KeycodeSet(C.VIR_KEYCODE_SET_RFB) + KEYCODE_SET_QNUM = KeycodeSet(C.VIR_KEYCODE_SET_QNUM) +) + +type ConnectDomainEventBlockJobStatus int + +const ( + DOMAIN_BLOCK_JOB_COMPLETED = ConnectDomainEventBlockJobStatus(C.VIR_DOMAIN_BLOCK_JOB_COMPLETED) + DOMAIN_BLOCK_JOB_FAILED = ConnectDomainEventBlockJobStatus(C.VIR_DOMAIN_BLOCK_JOB_FAILED) + DOMAIN_BLOCK_JOB_CANCELED = ConnectDomainEventBlockJobStatus(C.VIR_DOMAIN_BLOCK_JOB_CANCELED) + DOMAIN_BLOCK_JOB_READY = ConnectDomainEventBlockJobStatus(C.VIR_DOMAIN_BLOCK_JOB_READY) +) + +type ConnectDomainEventDiskChangeReason int + +const ( + // OldSrcPath is set + DOMAIN_EVENT_DISK_CHANGE_MISSING_ON_START = ConnectDomainEventDiskChangeReason(C.VIR_DOMAIN_EVENT_DISK_CHANGE_MISSING_ON_START) + DOMAIN_EVENT_DISK_DROP_MISSING_ON_START = ConnectDomainEventDiskChangeReason(C.VIR_DOMAIN_EVENT_DISK_DROP_MISSING_ON_START) +) + +type ConnectDomainEventTrayChangeReason int + +const ( + DOMAIN_EVENT_TRAY_CHANGE_OPEN = ConnectDomainEventTrayChangeReason(C.VIR_DOMAIN_EVENT_TRAY_CHANGE_OPEN) + DOMAIN_EVENT_TRAY_CHANGE_CLOSE = ConnectDomainEventTrayChangeReason(C.VIR_DOMAIN_EVENT_TRAY_CHANGE_CLOSE) +) + +type DomainProcessSignal int + +const ( + DOMAIN_PROCESS_SIGNAL_NOP = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_NOP) + DOMAIN_PROCESS_SIGNAL_HUP = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_HUP) + DOMAIN_PROCESS_SIGNAL_INT = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_INT) + DOMAIN_PROCESS_SIGNAL_QUIT = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_QUIT) + DOMAIN_PROCESS_SIGNAL_ILL = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_ILL) + DOMAIN_PROCESS_SIGNAL_TRAP = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_TRAP) + DOMAIN_PROCESS_SIGNAL_ABRT = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_ABRT) + DOMAIN_PROCESS_SIGNAL_BUS = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_BUS) + DOMAIN_PROCESS_SIGNAL_FPE = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_FPE) + DOMAIN_PROCESS_SIGNAL_KILL = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_KILL) + + DOMAIN_PROCESS_SIGNAL_USR1 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_USR1) + DOMAIN_PROCESS_SIGNAL_SEGV = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_SEGV) + DOMAIN_PROCESS_SIGNAL_USR2 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_USR2) + DOMAIN_PROCESS_SIGNAL_PIPE = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_PIPE) + DOMAIN_PROCESS_SIGNAL_ALRM = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_ALRM) + DOMAIN_PROCESS_SIGNAL_TERM = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_TERM) + DOMAIN_PROCESS_SIGNAL_STKFLT = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_STKFLT) + DOMAIN_PROCESS_SIGNAL_CHLD = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_CHLD) + DOMAIN_PROCESS_SIGNAL_CONT = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_CONT) + DOMAIN_PROCESS_SIGNAL_STOP = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_STOP) + + DOMAIN_PROCESS_SIGNAL_TSTP = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_TSTP) + DOMAIN_PROCESS_SIGNAL_TTIN = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_TTIN) + DOMAIN_PROCESS_SIGNAL_TTOU = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_TTOU) + DOMAIN_PROCESS_SIGNAL_URG = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_URG) + DOMAIN_PROCESS_SIGNAL_XCPU = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_XCPU) + DOMAIN_PROCESS_SIGNAL_XFSZ = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_XFSZ) + DOMAIN_PROCESS_SIGNAL_VTALRM = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_VTALRM) + DOMAIN_PROCESS_SIGNAL_PROF = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_PROF) + DOMAIN_PROCESS_SIGNAL_WINCH = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_WINCH) + DOMAIN_PROCESS_SIGNAL_POLL = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_POLL) + + DOMAIN_PROCESS_SIGNAL_PWR = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_PWR) + DOMAIN_PROCESS_SIGNAL_SYS = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_SYS) + DOMAIN_PROCESS_SIGNAL_RT0 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT0) + DOMAIN_PROCESS_SIGNAL_RT1 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT1) + DOMAIN_PROCESS_SIGNAL_RT2 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT2) + DOMAIN_PROCESS_SIGNAL_RT3 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT3) + DOMAIN_PROCESS_SIGNAL_RT4 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT4) + DOMAIN_PROCESS_SIGNAL_RT5 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT5) + DOMAIN_PROCESS_SIGNAL_RT6 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT6) + DOMAIN_PROCESS_SIGNAL_RT7 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT7) + + DOMAIN_PROCESS_SIGNAL_RT8 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT8) + DOMAIN_PROCESS_SIGNAL_RT9 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT9) + DOMAIN_PROCESS_SIGNAL_RT10 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT10) + DOMAIN_PROCESS_SIGNAL_RT11 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT11) + DOMAIN_PROCESS_SIGNAL_RT12 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT12) + DOMAIN_PROCESS_SIGNAL_RT13 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT13) + DOMAIN_PROCESS_SIGNAL_RT14 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT14) + DOMAIN_PROCESS_SIGNAL_RT15 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT15) + DOMAIN_PROCESS_SIGNAL_RT16 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT16) + DOMAIN_PROCESS_SIGNAL_RT17 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT17) + DOMAIN_PROCESS_SIGNAL_RT18 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT18) + + DOMAIN_PROCESS_SIGNAL_RT19 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT19) + DOMAIN_PROCESS_SIGNAL_RT20 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT20) + DOMAIN_PROCESS_SIGNAL_RT21 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT21) + DOMAIN_PROCESS_SIGNAL_RT22 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT22) + DOMAIN_PROCESS_SIGNAL_RT23 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT23) + DOMAIN_PROCESS_SIGNAL_RT24 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT24) + DOMAIN_PROCESS_SIGNAL_RT25 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT25) + DOMAIN_PROCESS_SIGNAL_RT26 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT26) + DOMAIN_PROCESS_SIGNAL_RT27 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT27) + + DOMAIN_PROCESS_SIGNAL_RT28 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT28) + DOMAIN_PROCESS_SIGNAL_RT29 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT29) + DOMAIN_PROCESS_SIGNAL_RT30 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT30) + DOMAIN_PROCESS_SIGNAL_RT31 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT31) + DOMAIN_PROCESS_SIGNAL_RT32 = DomainProcessSignal(C.VIR_DOMAIN_PROCESS_SIGNAL_RT32) +) + +type DomainBlockedReason int + +const ( + DOMAIN_BLOCKED_UNKNOWN = DomainBlockedReason(C.VIR_DOMAIN_BLOCKED_UNKNOWN) +) + +type DomainControlState int + +const ( + DOMAIN_CONTROL_OK = DomainControlState(C.VIR_DOMAIN_CONTROL_OK) + DOMAIN_CONTROL_JOB = DomainControlState(C.VIR_DOMAIN_CONTROL_JOB) + DOMAIN_CONTROL_OCCUPIED = DomainControlState(C.VIR_DOMAIN_CONTROL_OCCUPIED) + DOMAIN_CONTROL_ERROR = DomainControlState(C.VIR_DOMAIN_CONTROL_ERROR) +) + +type DomainControlErrorReason int + +const ( + DOMAIN_CONTROL_ERROR_REASON_NONE = DomainControlErrorReason(C.VIR_DOMAIN_CONTROL_ERROR_REASON_NONE) + DOMAIN_CONTROL_ERROR_REASON_UNKNOWN = DomainControlErrorReason(C.VIR_DOMAIN_CONTROL_ERROR_REASON_UNKNOWN) + DOMAIN_CONTROL_ERROR_REASON_MONITOR = DomainControlErrorReason(C.VIR_DOMAIN_CONTROL_ERROR_REASON_MONITOR) + DOMAIN_CONTROL_ERROR_REASON_INTERNAL = DomainControlErrorReason(C.VIR_DOMAIN_CONTROL_ERROR_REASON_INTERNAL) +) + +type DomainCrashedReason int + +const ( + DOMAIN_CRASHED_UNKNOWN = DomainCrashedReason(C.VIR_DOMAIN_CRASHED_UNKNOWN) + DOMAIN_CRASHED_PANICKED = DomainCrashedReason(C.VIR_DOMAIN_CRASHED_PANICKED) +) + +type DomainEventCrashedDetailType int + +const ( + DOMAIN_EVENT_CRASHED_PANICKED = DomainEventCrashedDetailType(C.VIR_DOMAIN_EVENT_CRASHED_PANICKED) + DOMAIN_EVENT_CRASHED_CRASHLOADED = DomainEventCrashedDetailType(C.VIR_DOMAIN_EVENT_CRASHED_CRASHLOADED) +) + +type DomainEventPMSuspendedDetailType int + +const ( + DOMAIN_EVENT_PMSUSPENDED_MEMORY = DomainEventPMSuspendedDetailType(C.VIR_DOMAIN_EVENT_PMSUSPENDED_MEMORY) + DOMAIN_EVENT_PMSUSPENDED_DISK = DomainEventPMSuspendedDetailType(C.VIR_DOMAIN_EVENT_PMSUSPENDED_DISK) +) + +type DomainNostateReason int + +const ( + DOMAIN_NOSTATE_UNKNOWN = DomainNostateReason(C.VIR_DOMAIN_NOSTATE_UNKNOWN) +) + +type DomainPMSuspendedReason int + +const ( + DOMAIN_PMSUSPENDED_UNKNOWN = DomainPMSuspendedReason(C.VIR_DOMAIN_PMSUSPENDED_UNKNOWN) +) + +type DomainPMSuspendedDiskReason int + +const ( + DOMAIN_PMSUSPENDED_DISK_UNKNOWN = DomainPMSuspendedDiskReason(C.VIR_DOMAIN_PMSUSPENDED_DISK_UNKNOWN) +) + +type DomainShutdownReason int + +const ( + DOMAIN_SHUTDOWN_UNKNOWN = DomainShutdownReason(C.VIR_DOMAIN_SHUTDOWN_UNKNOWN) + DOMAIN_SHUTDOWN_USER = DomainShutdownReason(C.VIR_DOMAIN_SHUTDOWN_USER) +) + +type DomainShutoffReason int + +const ( + DOMAIN_SHUTOFF_UNKNOWN = DomainShutoffReason(C.VIR_DOMAIN_SHUTOFF_UNKNOWN) + DOMAIN_SHUTOFF_SHUTDOWN = DomainShutoffReason(C.VIR_DOMAIN_SHUTOFF_SHUTDOWN) + DOMAIN_SHUTOFF_DESTROYED = DomainShutoffReason(C.VIR_DOMAIN_SHUTOFF_DESTROYED) + DOMAIN_SHUTOFF_CRASHED = DomainShutoffReason(C.VIR_DOMAIN_SHUTOFF_CRASHED) + DOMAIN_SHUTOFF_MIGRATED = DomainShutoffReason(C.VIR_DOMAIN_SHUTOFF_MIGRATED) + DOMAIN_SHUTOFF_SAVED = DomainShutoffReason(C.VIR_DOMAIN_SHUTOFF_SAVED) + DOMAIN_SHUTOFF_FAILED = DomainShutoffReason(C.VIR_DOMAIN_SHUTOFF_FAILED) + DOMAIN_SHUTOFF_FROM_SNAPSHOT = DomainShutoffReason(C.VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT) + DOMAIN_SHUTOFF_DAEMON = DomainShutoffReason(C.VIR_DOMAIN_SHUTOFF_DAEMON) +) + +type DomainBlockCommitFlags uint + +const ( + DOMAIN_BLOCK_COMMIT_SHALLOW = DomainBlockCommitFlags(C.VIR_DOMAIN_BLOCK_COMMIT_SHALLOW) + DOMAIN_BLOCK_COMMIT_DELETE = DomainBlockCommitFlags(C.VIR_DOMAIN_BLOCK_COMMIT_DELETE) + DOMAIN_BLOCK_COMMIT_ACTIVE = DomainBlockCommitFlags(C.VIR_DOMAIN_BLOCK_COMMIT_ACTIVE) + DOMAIN_BLOCK_COMMIT_RELATIVE = DomainBlockCommitFlags(C.VIR_DOMAIN_BLOCK_COMMIT_RELATIVE) + DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES = DomainBlockCommitFlags(C.VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES) +) + +type DomainBlockCopyFlags uint + +const ( + DOMAIN_BLOCK_COPY_SHALLOW = DomainBlockCopyFlags(C.VIR_DOMAIN_BLOCK_COPY_SHALLOW) + DOMAIN_BLOCK_COPY_REUSE_EXT = DomainBlockCopyFlags(C.VIR_DOMAIN_BLOCK_COPY_REUSE_EXT) + DOMAIN_BLOCK_COPY_TRANSIENT_JOB = DomainBlockCopyFlags(C.VIR_DOMAIN_BLOCK_COPY_TRANSIENT_JOB) + DOMAIN_BLOCK_COPY_SYNCHRONOUS_WRITES = DomainBlockCopyFlags(C.VIR_DOMAIN_BLOCK_COPY_SYNCHRONOUS_WRITES) +) + +type DomainBlockRebaseFlags uint + +const ( + DOMAIN_BLOCK_REBASE_SHALLOW = DomainBlockRebaseFlags(C.VIR_DOMAIN_BLOCK_REBASE_SHALLOW) + DOMAIN_BLOCK_REBASE_REUSE_EXT = DomainBlockRebaseFlags(C.VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT) + DOMAIN_BLOCK_REBASE_COPY_RAW = DomainBlockRebaseFlags(C.VIR_DOMAIN_BLOCK_REBASE_COPY_RAW) + DOMAIN_BLOCK_REBASE_COPY = DomainBlockRebaseFlags(C.VIR_DOMAIN_BLOCK_REBASE_COPY) + DOMAIN_BLOCK_REBASE_RELATIVE = DomainBlockRebaseFlags(C.VIR_DOMAIN_BLOCK_REBASE_RELATIVE) + DOMAIN_BLOCK_REBASE_COPY_DEV = DomainBlockRebaseFlags(C.VIR_DOMAIN_BLOCK_REBASE_COPY_DEV) + DOMAIN_BLOCK_REBASE_BANDWIDTH_BYTES = DomainBlockRebaseFlags(C.VIR_DOMAIN_BLOCK_REBASE_BANDWIDTH_BYTES) +) + +type DomainBlockJobAbortFlags uint + +const ( + DOMAIN_BLOCK_JOB_ABORT_ASYNC = DomainBlockJobAbortFlags(C.VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC) + DOMAIN_BLOCK_JOB_ABORT_PIVOT = DomainBlockJobAbortFlags(C.VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT) +) + +type DomainBlockJobInfoFlags uint + +const ( + DOMAIN_BLOCK_JOB_INFO_BANDWIDTH_BYTES = DomainBlockJobInfoFlags(C.VIR_DOMAIN_BLOCK_JOB_INFO_BANDWIDTH_BYTES) +) + +type DomainBlockJobSetSpeedFlags uint + +const ( + DOMAIN_BLOCK_JOB_SPEED_BANDWIDTH_BYTES = DomainBlockJobSetSpeedFlags(C.VIR_DOMAIN_BLOCK_JOB_SPEED_BANDWIDTH_BYTES) +) + +type DomainBlockPullFlags uint + +const ( + DOMAIN_BLOCK_PULL_BANDWIDTH_BYTES = DomainBlockPullFlags(C.VIR_DOMAIN_BLOCK_PULL_BANDWIDTH_BYTES) +) + +type DomainBlockResizeFlags uint + +const ( + DOMAIN_BLOCK_RESIZE_BYTES = DomainBlockResizeFlags(C.VIR_DOMAIN_BLOCK_RESIZE_BYTES) + DOMAIN_BLOCK_RESIZE_CAPACITY = DomainBlockResizeFlags(C.VIR_DOMAIN_BLOCK_RESIZE_CAPACITY) +) + +type Domain struct { + ptr C.virDomainPtr +} + +type DomainChannelFlags uint + +const ( + DOMAIN_CHANNEL_FORCE = DomainChannelFlags(C.VIR_DOMAIN_CHANNEL_FORCE) +) + +type DomainConsoleFlags uint + +const ( + DOMAIN_CONSOLE_FORCE = DomainConsoleFlags(C.VIR_DOMAIN_CONSOLE_FORCE) + DOMAIN_CONSOLE_SAFE = DomainConsoleFlags(C.VIR_DOMAIN_CONSOLE_SAFE) +) + +type DomainCoreDumpFormat int + +const ( + DOMAIN_CORE_DUMP_FORMAT_RAW = DomainCoreDumpFormat(C.VIR_DOMAIN_CORE_DUMP_FORMAT_RAW) + DOMAIN_CORE_DUMP_FORMAT_KDUMP_ZLIB = DomainCoreDumpFormat(C.VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_ZLIB) + DOMAIN_CORE_DUMP_FORMAT_KDUMP_LZO = DomainCoreDumpFormat(C.VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_LZO) + DOMAIN_CORE_DUMP_FORMAT_KDUMP_SNAPPY = DomainCoreDumpFormat(C.VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_SNAPPY) + DOMAIN_CORE_DUMP_FORMAT_WIN_DMP = DomainCoreDumpFormat(C.VIR_DOMAIN_CORE_DUMP_FORMAT_WIN_DMP) +) + +type DomainDefineFlags uint + +const ( + DOMAIN_DEFINE_VALIDATE = DomainDefineFlags(C.VIR_DOMAIN_DEFINE_VALIDATE) +) + +type DomainJobType int + +const ( + DOMAIN_JOB_NONE = DomainJobType(C.VIR_DOMAIN_JOB_NONE) + DOMAIN_JOB_BOUNDED = DomainJobType(C.VIR_DOMAIN_JOB_BOUNDED) + DOMAIN_JOB_UNBOUNDED = DomainJobType(C.VIR_DOMAIN_JOB_UNBOUNDED) + DOMAIN_JOB_COMPLETED = DomainJobType(C.VIR_DOMAIN_JOB_COMPLETED) + DOMAIN_JOB_FAILED = DomainJobType(C.VIR_DOMAIN_JOB_FAILED) + DOMAIN_JOB_CANCELLED = DomainJobType(C.VIR_DOMAIN_JOB_CANCELLED) +) + +type DomainGetJobStatsFlags uint + +const ( + DOMAIN_JOB_STATS_COMPLETED = DomainGetJobStatsFlags(C.VIR_DOMAIN_JOB_STATS_COMPLETED) + DOMAIN_JOB_STATS_KEEP_COMPLETED = DomainGetJobStatsFlags(C.VIR_DOMAIN_JOB_STATS_KEEP_COMPLETED) +) + +type DomainNumatuneMemMode int + +const ( + DOMAIN_NUMATUNE_MEM_STRICT = DomainNumatuneMemMode(C.VIR_DOMAIN_NUMATUNE_MEM_STRICT) + DOMAIN_NUMATUNE_MEM_PREFERRED = DomainNumatuneMemMode(C.VIR_DOMAIN_NUMATUNE_MEM_PREFERRED) + DOMAIN_NUMATUNE_MEM_INTERLEAVE = DomainNumatuneMemMode(C.VIR_DOMAIN_NUMATUNE_MEM_INTERLEAVE) + DOMAIN_NUMATUNE_MEM_RESTRICTIVE = DomainNumatuneMemMode(C.VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE) +) + +type DomainOpenGraphicsFlags uint + +const ( + DOMAIN_OPEN_GRAPHICS_SKIPAUTH = DomainOpenGraphicsFlags(C.VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH) +) + +type DomainSetUserPasswordFlags uint + +const ( + DOMAIN_PASSWORD_ENCRYPTED = DomainSetUserPasswordFlags(C.VIR_DOMAIN_PASSWORD_ENCRYPTED) +) + +type DomainRebootFlagValues uint + +const ( + DOMAIN_REBOOT_DEFAULT = DomainRebootFlagValues(C.VIR_DOMAIN_REBOOT_DEFAULT) + DOMAIN_REBOOT_ACPI_POWER_BTN = DomainRebootFlagValues(C.VIR_DOMAIN_REBOOT_ACPI_POWER_BTN) + DOMAIN_REBOOT_GUEST_AGENT = DomainRebootFlagValues(C.VIR_DOMAIN_REBOOT_GUEST_AGENT) + DOMAIN_REBOOT_INITCTL = DomainRebootFlagValues(C.VIR_DOMAIN_REBOOT_INITCTL) + DOMAIN_REBOOT_SIGNAL = DomainRebootFlagValues(C.VIR_DOMAIN_REBOOT_SIGNAL) + DOMAIN_REBOOT_PARAVIRT = DomainRebootFlagValues(C.VIR_DOMAIN_REBOOT_PARAVIRT) +) + +type DomainSaveRestoreFlags uint + +const ( + DOMAIN_SAVE_BYPASS_CACHE = DomainSaveRestoreFlags(C.VIR_DOMAIN_SAVE_BYPASS_CACHE) + DOMAIN_SAVE_RUNNING = DomainSaveRestoreFlags(C.VIR_DOMAIN_SAVE_RUNNING) + DOMAIN_SAVE_PAUSED = DomainSaveRestoreFlags(C.VIR_DOMAIN_SAVE_PAUSED) + DOMAIN_SAVE_RESET_NVRAM = DomainSaveRestoreFlags(C.VIR_DOMAIN_SAVE_RESET_NVRAM) +) + +type DomainSetTimeFlags uint + +const ( + DOMAIN_TIME_SYNC = DomainSetTimeFlags(C.VIR_DOMAIN_TIME_SYNC) +) + +type DomainDiskErrorCode int + +const ( + DOMAIN_DISK_ERROR_NONE = DomainDiskErrorCode(C.VIR_DOMAIN_DISK_ERROR_NONE) + DOMAIN_DISK_ERROR_UNSPEC = DomainDiskErrorCode(C.VIR_DOMAIN_DISK_ERROR_UNSPEC) + DOMAIN_DISK_ERROR_NO_SPACE = DomainDiskErrorCode(C.VIR_DOMAIN_DISK_ERROR_NO_SPACE) +) + +type DomainStatsTypes int + +const ( + DOMAIN_STATS_STATE = DomainStatsTypes(C.VIR_DOMAIN_STATS_STATE) + DOMAIN_STATS_CPU_TOTAL = DomainStatsTypes(C.VIR_DOMAIN_STATS_CPU_TOTAL) + DOMAIN_STATS_BALLOON = DomainStatsTypes(C.VIR_DOMAIN_STATS_BALLOON) + DOMAIN_STATS_VCPU = DomainStatsTypes(C.VIR_DOMAIN_STATS_VCPU) + DOMAIN_STATS_INTERFACE = DomainStatsTypes(C.VIR_DOMAIN_STATS_INTERFACE) + DOMAIN_STATS_BLOCK = DomainStatsTypes(C.VIR_DOMAIN_STATS_BLOCK) + DOMAIN_STATS_PERF = DomainStatsTypes(C.VIR_DOMAIN_STATS_PERF) + DOMAIN_STATS_IOTHREAD = DomainStatsTypes(C.VIR_DOMAIN_STATS_IOTHREAD) + DOMAIN_STATS_MEMORY = DomainStatsTypes(C.VIR_DOMAIN_STATS_MEMORY) + DOMAIN_STATS_DIRTYRATE = DomainStatsTypes(C.VIR_DOMAIN_STATS_DIRTYRATE) + DOMAIN_STATS_VM = DomainStatsTypes(C.VIR_DOMAIN_STATS_VM) +) + +type DomainCoreDumpFlags uint + +const ( + DUMP_CRASH = DomainCoreDumpFlags(C.VIR_DUMP_CRASH) + DUMP_LIVE = DomainCoreDumpFlags(C.VIR_DUMP_LIVE) + DUMP_BYPASS_CACHE = DomainCoreDumpFlags(C.VIR_DUMP_BYPASS_CACHE) + DUMP_RESET = DomainCoreDumpFlags(C.VIR_DUMP_RESET) + DUMP_MEMORY_ONLY = DomainCoreDumpFlags(C.VIR_DUMP_MEMORY_ONLY) +) + +type DomainMemoryFlags uint + +const ( + MEMORY_VIRTUAL = DomainMemoryFlags(C.VIR_MEMORY_VIRTUAL) + MEMORY_PHYSICAL = DomainMemoryFlags(C.VIR_MEMORY_PHYSICAL) +) + +type DomainMigrateFlags uint + +const ( + MIGRATE_LIVE = DomainMigrateFlags(C.VIR_MIGRATE_LIVE) + MIGRATE_PEER2PEER = DomainMigrateFlags(C.VIR_MIGRATE_PEER2PEER) + MIGRATE_TUNNELLED = DomainMigrateFlags(C.VIR_MIGRATE_TUNNELLED) + MIGRATE_PERSIST_DEST = DomainMigrateFlags(C.VIR_MIGRATE_PERSIST_DEST) + MIGRATE_UNDEFINE_SOURCE = DomainMigrateFlags(C.VIR_MIGRATE_UNDEFINE_SOURCE) + MIGRATE_PAUSED = DomainMigrateFlags(C.VIR_MIGRATE_PAUSED) + MIGRATE_NON_SHARED_DISK = DomainMigrateFlags(C.VIR_MIGRATE_NON_SHARED_DISK) + MIGRATE_NON_SHARED_INC = DomainMigrateFlags(C.VIR_MIGRATE_NON_SHARED_INC) + MIGRATE_CHANGE_PROTECTION = DomainMigrateFlags(C.VIR_MIGRATE_CHANGE_PROTECTION) + MIGRATE_UNSAFE = DomainMigrateFlags(C.VIR_MIGRATE_UNSAFE) + MIGRATE_OFFLINE = DomainMigrateFlags(C.VIR_MIGRATE_OFFLINE) + MIGRATE_COMPRESSED = DomainMigrateFlags(C.VIR_MIGRATE_COMPRESSED) + MIGRATE_ABORT_ON_ERROR = DomainMigrateFlags(C.VIR_MIGRATE_ABORT_ON_ERROR) + MIGRATE_AUTO_CONVERGE = DomainMigrateFlags(C.VIR_MIGRATE_AUTO_CONVERGE) + MIGRATE_RDMA_PIN_ALL = DomainMigrateFlags(C.VIR_MIGRATE_RDMA_PIN_ALL) + MIGRATE_POSTCOPY = DomainMigrateFlags(C.VIR_MIGRATE_POSTCOPY) + MIGRATE_TLS = DomainMigrateFlags(C.VIR_MIGRATE_TLS) + MIGRATE_PARALLEL = DomainMigrateFlags(C.VIR_MIGRATE_PARALLEL) + MIGRATE_NON_SHARED_SYNCHRONOUS_WRITES = DomainMigrateFlags(C.VIR_MIGRATE_NON_SHARED_SYNCHRONOUS_WRITES) + MIGRATE_POSTCOPY_RESUME = DomainMigrateFlags(C.VIR_MIGRATE_POSTCOPY_RESUME) + MIGRATE_ZEROCOPY = DomainMigrateFlags(C.VIR_MIGRATE_ZEROCOPY) +) + +type DomainMigrateMaxSpeedFlags uint + +const ( + MIGRATE_MAX_SPEED_POSTCOPY = DomainMigrateMaxSpeedFlags(C.VIR_DOMAIN_MIGRATE_MAX_SPEED_POSTCOPY) +) + +type DomainSaveImageXMLFlags uint + +const ( + DOMAIN_SAVE_IMAGE_XML_SECURE = DomainSaveImageXMLFlags(C.VIR_DOMAIN_SAVE_IMAGE_XML_SECURE) +) + +type VcpuState int + +const ( + VCPU_OFFLINE = VcpuState(C.VIR_VCPU_OFFLINE) + VCPU_RUNNING = VcpuState(C.VIR_VCPU_RUNNING) + VCPU_BLOCKED = VcpuState(C.VIR_VCPU_BLOCKED) +) + +type VcpuHostCpuState int + +const ( + VCPU_INFO_CPU_OFFLINE = VcpuHostCpuState(C.VIR_VCPU_INFO_CPU_OFFLINE) + VCPU_INFO_CPU_UNAVAILABLE = VcpuHostCpuState(C.VIR_VCPU_INFO_CPU_UNAVAILABLE) +) + +type DomainJobOperationType int + +const ( + DOMAIN_JOB_OPERATION_UNKNOWN = DomainJobOperationType(C.VIR_DOMAIN_JOB_OPERATION_UNKNOWN) + DOMAIN_JOB_OPERATION_START = DomainJobOperationType(C.VIR_DOMAIN_JOB_OPERATION_START) + DOMAIN_JOB_OPERATION_SAVE = DomainJobOperationType(C.VIR_DOMAIN_JOB_OPERATION_SAVE) + DOMAIN_JOB_OPERATION_RESTORE = DomainJobOperationType(C.VIR_DOMAIN_JOB_OPERATION_RESTORE) + DOMAIN_JOB_OPERATION_MIGRATION_IN = DomainJobOperationType(C.VIR_DOMAIN_JOB_OPERATION_MIGRATION_IN) + DOMAIN_JOB_OPERATION_MIGRATION_OUT = DomainJobOperationType(C.VIR_DOMAIN_JOB_OPERATION_MIGRATION_OUT) + DOMAIN_JOB_OPERATION_SNAPSHOT = DomainJobOperationType(C.VIR_DOMAIN_JOB_OPERATION_SNAPSHOT) + DOMAIN_JOB_OPERATION_SNAPSHOT_REVERT = DomainJobOperationType(C.VIR_DOMAIN_JOB_OPERATION_SNAPSHOT_REVERT) + DOMAIN_JOB_OPERATION_DUMP = DomainJobOperationType(C.VIR_DOMAIN_JOB_OPERATION_DUMP) + DOMAIN_JOB_OPERATION_BACKUP = DomainJobOperationType(C.VIR_DOMAIN_JOB_OPERATION_BACKUP) + DOMAIN_JOB_OPERATION_SNAPSHOT_DELETE = DomainJobOperationType(C.VIR_DOMAIN_JOB_OPERATION_SNAPSHOT_DELETE) +) + +type DomainBackupBeginFlags uint + +const ( + DOMAIN_BACKUP_BEGIN_REUSE_EXTERNAL = DomainBackupBeginFlags(C.VIR_DOMAIN_BACKUP_BEGIN_REUSE_EXTERNAL) +) + +type DomainBlockInfo struct { + Capacity uint64 + Allocation uint64 + Physical uint64 +} + +type DomainInfo struct { + State DomainState + MaxMem uint64 + Memory uint64 + NrVirtCpu uint + CpuTime uint64 +} + +type DomainMemoryStat struct { + Tag int32 + Val uint64 +} + +type DomainVcpuInfo struct { + Number uint32 + State int32 + CpuTime uint64 + Cpu int32 + CpuMap []bool +} + +type DomainGuestInfoTypes int + +const ( + DOMAIN_GUEST_INFO_USERS = DomainGuestInfoTypes(C.VIR_DOMAIN_GUEST_INFO_USERS) + DOMAIN_GUEST_INFO_OS = DomainGuestInfoTypes(C.VIR_DOMAIN_GUEST_INFO_OS) + DOMAIN_GUEST_INFO_TIMEZONE = DomainGuestInfoTypes(C.VIR_DOMAIN_GUEST_INFO_TIMEZONE) + DOMAIN_GUEST_INFO_HOSTNAME = DomainGuestInfoTypes(C.VIR_DOMAIN_GUEST_INFO_HOSTNAME) + DOMAIN_GUEST_INFO_FILESYSTEM = DomainGuestInfoTypes(C.VIR_DOMAIN_GUEST_INFO_FILESYSTEM) + DOMAIN_GUEST_INFO_DISKS = DomainGuestInfoTypes(C.VIR_DOMAIN_GUEST_INFO_DISKS) + DOMAIN_GUEST_INFO_INTERFACES = DomainGuestInfoTypes(C.VIR_DOMAIN_GUEST_INFO_INTERFACES) +) + +type DomainAgentSetResponseTimeoutValues int + +const ( + DOMAIN_AGENT_RESPONSE_TIMEOUT_BLOCK = DomainAgentSetResponseTimeoutValues(C.VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_BLOCK) + DOMAIN_AGENT_RESPONSE_TIMEOUT_DEFAULT = DomainAgentSetResponseTimeoutValues(C.VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_DEFAULT) + DOMAIN_AGENT_RESPONSE_TIMEOUT_NOWAIT = DomainAgentSetResponseTimeoutValues(C.VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_NOWAIT) +) + +type DomainGetHostnameFlags uint + +const ( + DOMAIN_GET_HOSTNAME_AGENT = DomainGetHostnameFlags(C.VIR_DOMAIN_GET_HOSTNAME_AGENT) + DOMAIN_GET_HOSTNAME_LEASE = DomainGetHostnameFlags(C.VIR_DOMAIN_GET_HOSTNAME_LEASE) +) + +type DomainMemoryFailureRecipientType uint + +const ( + DOMAIN_EVENT_MEMORY_FAILURE_RECIPIENT_HYPERVISOR = DomainMemoryFailureRecipientType(C.VIR_DOMAIN_EVENT_MEMORY_FAILURE_RECIPIENT_HYPERVISOR) + + DOMAIN_EVENT_MEMORY_FAILURE_RECIPIENT_GUEST = DomainMemoryFailureRecipientType(C.VIR_DOMAIN_EVENT_MEMORY_FAILURE_RECIPIENT_GUEST) +) + +type DomainMemoryFailureActionType uint + +const ( + DOMAIN_EVENT_MEMORY_FAILURE_ACTION_IGNORE = DomainMemoryFailureActionType(C.VIR_DOMAIN_EVENT_MEMORY_FAILURE_ACTION_IGNORE) + + DOMAIN_EVENT_MEMORY_FAILURE_ACTION_INJECT = DomainMemoryFailureActionType(C.VIR_DOMAIN_EVENT_MEMORY_FAILURE_ACTION_INJECT) + + DOMAIN_EVENT_MEMORY_FAILURE_ACTION_FATAL = DomainMemoryFailureActionType(C.VIR_DOMAIN_EVENT_MEMORY_FAILURE_ACTION_FATAL) + + DOMAIN_EVENT_MEMORY_FAILURE_ACTION_RESET = DomainMemoryFailureActionType(C.VIR_DOMAIN_EVENT_MEMORY_FAILURE_ACTION_RESET) +) + +type DomainMemoryFailureFlags uint + +const ( + DOMAIN_MEMORY_FAILURE_ACTION_REQUIRED = DomainMemoryFailureFlags(C.VIR_DOMAIN_MEMORY_FAILURE_ACTION_REQUIRED) + DOMAIN_MEMORY_FAILURE_RECURSIVE = DomainMemoryFailureFlags(C.VIR_DOMAIN_MEMORY_FAILURE_RECURSIVE) +) + +type DomainAuthorizedSSHKeysFlags uint + +const ( + DOMAIN_AUTHORIZED_SSH_KEYS_SET_APPEND = DomainAuthorizedSSHKeysFlags(C.VIR_DOMAIN_AUTHORIZED_SSH_KEYS_SET_APPEND) + DOMAIN_AUTHORIZED_SSH_KEYS_SET_REMOVE = DomainAuthorizedSSHKeysFlags(C.VIR_DOMAIN_AUTHORIZED_SSH_KEYS_SET_REMOVE) +) + +type DomainMessageType uint + +const ( + DOMAIN_MESSAGE_DEPRECATION = DomainMessageType(C.VIR_DOMAIN_MESSAGE_DEPRECATION) + DOMAIN_MESSAGE_TAINTING = DomainMessageType(C.VIR_DOMAIN_MESSAGE_TAINTING) +) + +type DomainDirtyRateStatus uint + +const ( + DOMAIN_DIRTYRATE_UNSTARTED = DomainDirtyRateStatus(C.VIR_DOMAIN_DIRTYRATE_UNSTARTED) + DOMAIN_DIRTYRATE_MEASURING = DomainDirtyRateStatus(C.VIR_DOMAIN_DIRTYRATE_MEASURING) + DOMAIN_DIRTYRATE_MEASURED = DomainDirtyRateStatus(C.VIR_DOMAIN_DIRTYRATE_MEASURED) +) + +type DomainDirtyRateCalcFlags uint + +const ( + DOMAIN_DIRTYRATE_MODE_PAGE_SAMPLING = DomainDirtyRateCalcFlags(C.VIR_DOMAIN_DIRTYRATE_MODE_PAGE_SAMPLING) + DOMAIN_DIRTYRATE_MODE_DIRTY_BITMAP = DomainDirtyRateCalcFlags(C.VIR_DOMAIN_DIRTYRATE_MODE_DIRTY_BITMAP) + DOMAIN_DIRTYRATE_MODE_DIRTY_RING = DomainDirtyRateCalcFlags(C.VIR_DOMAIN_DIRTYRATE_MODE_DIRTY_RING) +) + +type DomainAbortJobFlags uint + +const ( + DOMAIN_ABORT_JOB_POSTCOPY = DomainAbortJobFlags(C.VIR_DOMAIN_ABORT_JOB_POSTCOPY) +) + +type DomainFDAssociateFlags uint + +const ( + DOMAIN_FD_ASSOCIATE_SECLABEL_RESTORE = DomainFDAssociateFlags(C.VIR_DOMAIN_FD_ASSOCIATE_SECLABEL_RESTORE) + DOMAIN_FD_ASSOCIATE_SECLABEL_WRITABLE = DomainFDAssociateFlags(C.VIR_DOMAIN_FD_ASSOCIATE_SECLABEL_WRITABLE) +) + +type DomainGraphicsReloadType uint + +const ( + DOMAIN_GRAPHICS_RELOAD_TYPE_ANY = DomainGraphicsReloadType(C.VIR_DOMAIN_GRAPHICS_RELOAD_TYPE_ANY) + DOMAIN_GRAPHICS_RELOAD_TYPE_VNC = DomainGraphicsReloadType(C.VIR_DOMAIN_GRAPHICS_RELOAD_TYPE_VNC) +) + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainFree +func (d *Domain) Free() error { + var err C.virError + ret := C.virDomainFreeWrapper(d.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainRef +func (c *Domain) Ref() error { + var err C.virError + ret := C.virDomainRefWrapper(c.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainCreate +func (d *Domain) Create() error { + var err C.virError + result := C.virDomainCreateWrapper(d.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainCreateWithFlags +func (d *Domain) CreateWithFlags(flags DomainCreateFlags) error { + var err C.virError + result := C.virDomainCreateWithFlagsWrapper(d.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainCreateWithFiles +func (d *Domain) CreateWithFiles(files []os.File, flags DomainCreateFlags) error { + nfiles := len(files) + cfiles := make([]C.int, nfiles) + for i := 0; i < nfiles; i++ { + cfiles[i] = C.int(files[i].Fd()) + } + + var err C.virError + var cfilesPtr *C.int = nil + if nfiles > 0 { + cfilesPtr = &cfiles[0] + } + result := C.virDomainCreateWithFilesWrapper(d.ptr, C.uint(nfiles), cfilesPtr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainDestroy +func (d *Domain) Destroy() error { + var err C.virError + result := C.virDomainDestroyWrapper(d.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainShutdown +func (d *Domain) Shutdown() error { + var err C.virError + result := C.virDomainShutdownWrapper(d.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainReboot +func (d *Domain) Reboot(flags DomainRebootFlagValues) error { + var err C.virError + result := C.virDomainRebootWrapper(d.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainIsActive +func (d *Domain) IsActive() (bool, error) { + var err C.virError + result := C.virDomainIsActiveWrapper(d.ptr, &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainIsPersistent +func (d *Domain) IsPersistent() (bool, error) { + var err C.virError + result := C.virDomainIsPersistentWrapper(d.ptr, &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainIsUpdated +func (d *Domain) IsUpdated() (bool, error) { + var err C.virError + result := C.virDomainIsUpdatedWrapper(d.ptr, &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetAutostart +func (d *Domain) SetAutostart(autostart bool) error { + var cAutostart C.int + switch autostart { + case true: + cAutostart = 1 + default: + cAutostart = 0 + } + var err C.virError + result := C.virDomainSetAutostartWrapper(d.ptr, cAutostart, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetAutostart +func (d *Domain) GetAutostart() (bool, error) { + var out C.int + var err C.virError + result := C.virDomainGetAutostartWrapper(d.ptr, (*C.int)(unsafe.Pointer(&out)), &err) + if result == -1 { + return false, makeError(&err) + } + switch out { + case 1: + return true, nil + default: + return false, nil + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetBlockInfo +func (d *Domain) GetBlockInfo(disk string, flags uint32) (*DomainBlockInfo, error) { + var cinfo C.virDomainBlockInfo + cDisk := C.CString(disk) + defer C.free(unsafe.Pointer(cDisk)) + var err C.virError + result := C.virDomainGetBlockInfoWrapper(d.ptr, cDisk, &cinfo, C.uint(flags), &err) + if result == -1 { + return nil, makeError(&err) + } + + return &DomainBlockInfo{ + Capacity: uint64(cinfo.capacity), + Allocation: uint64(cinfo.allocation), + Physical: uint64(cinfo.physical), + }, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetName +func (d *Domain) GetName() (string, error) { + var err C.virError + name := C.virDomainGetNameWrapper(d.ptr, &err) + if name == nil { + return "", makeError(&err) + } + return C.GoString(name), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetState +func (d *Domain) GetState() (DomainState, int, error) { + var cState C.int + var cReason C.int + var err C.virError + result := C.virDomainGetStateWrapper(d.ptr, + (*C.int)(unsafe.Pointer(&cState)), + (*C.int)(unsafe.Pointer(&cReason)), + 0, &err) + if int(result) == -1 { + return 0, 0, makeError(&err) + } + return DomainState(cState), int(cReason), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetID +func (d *Domain) GetID() (uint, error) { + var err C.virError + id := C.virDomainGetIDWrapper(d.ptr, &err) + if id == ^C.uint(0) { + return uint(id), makeError(&err) + } + return uint(id), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetUUID +func (d *Domain) GetUUID() ([]byte, error) { + var cUuid [C.VIR_UUID_BUFLEN](byte) + cuidPtr := unsafe.Pointer(&cUuid) + var err C.virError + result := C.virDomainGetUUIDWrapper(d.ptr, (*C.uchar)(cuidPtr), &err) + if result != 0 { + return []byte{}, makeError(&err) + } + return C.GoBytes(cuidPtr, C.VIR_UUID_BUFLEN), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetUUIDString +func (d *Domain) GetUUIDString() (string, error) { + var cUuid [C.VIR_UUID_STRING_BUFLEN](C.char) + cuidPtr := unsafe.Pointer(&cUuid) + var err C.virError + result := C.virDomainGetUUIDStringWrapper(d.ptr, (*C.char)(cuidPtr), &err) + if result != 0 { + return "", makeError(&err) + } + return C.GoString((*C.char)(cuidPtr)), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetInfo +func (d *Domain) GetInfo() (*DomainInfo, error) { + var cinfo C.virDomainInfo + var err C.virError + result := C.virDomainGetInfoWrapper(d.ptr, &cinfo, &err) + if result == -1 { + return nil, makeError(&err) + } + return &DomainInfo{ + State: DomainState(cinfo.state), + MaxMem: uint64(cinfo.maxMem), + Memory: uint64(cinfo.memory), + NrVirtCpu: uint(cinfo.nrVirtCpu), + CpuTime: uint64(cinfo.cpuTime), + }, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetXMLDesc +func (d *Domain) GetXMLDesc(flags DomainXMLFlags) (string, error) { + var err C.virError + result := C.virDomainGetXMLDescWrapper(d.ptr, C.uint(flags), &err) + if result == nil { + return "", makeError(&err) + } + xml := C.GoString(result) + C.free(unsafe.Pointer(result)) + return xml, nil +} + +type DomainCPUStats struct { + CpuTimeSet bool + CpuTime uint64 + UserTimeSet bool + UserTime uint64 + SystemTimeSet bool + SystemTime uint64 + VcpuTimeSet bool + VcpuTime uint64 +} + +func getCPUStatsFieldInfo(params *DomainCPUStats) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_CPU_STATS_CPUTIME: typedParamsFieldInfo{ + set: ¶ms.CpuTimeSet, + ul: ¶ms.CpuTime, + }, + C.VIR_DOMAIN_CPU_STATS_USERTIME: typedParamsFieldInfo{ + set: ¶ms.UserTimeSet, + ul: ¶ms.UserTime, + }, + C.VIR_DOMAIN_CPU_STATS_SYSTEMTIME: typedParamsFieldInfo{ + set: ¶ms.SystemTimeSet, + ul: ¶ms.SystemTime, + }, + C.VIR_DOMAIN_CPU_STATS_VCPUTIME: typedParamsFieldInfo{ + set: ¶ms.VcpuTimeSet, + ul: ¶ms.VcpuTime, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetCPUStats +func (d *Domain) GetCPUStats(startCpu int, nCpus uint, flags uint32) ([]DomainCPUStats, error) { + var err C.virError + if nCpus == 0 { + if startCpu == -1 { + nCpus = 1 + } else { + ret := C.virDomainGetCPUStatsWrapper(d.ptr, nil, 0, 0, 0, 0, &err) + if ret == -1 { + return []DomainCPUStats{}, makeError(&err) + } + nCpus = uint(ret) + } + } + + ret := C.virDomainGetCPUStatsWrapper(d.ptr, nil, 0, C.int(startCpu), C.uint(nCpus), 0, &err) + if ret == -1 { + return []DomainCPUStats{}, makeError(&err) + } + cnparams := C.int(ret) + + var cnallocparams C.int + if startCpu == -1 { + cnallocparams = cnparams + } else { + cnallocparams = cnparams * C.int(nCpus) + } + cparams := typedParamsNew(cnallocparams) + defer C.virTypedParamsFreeWrapper(cparams, cnallocparams) + ret = C.virDomainGetCPUStatsWrapper(d.ptr, cparams, C.uint(cnparams), C.int(startCpu), C.uint(nCpus), C.uint(flags), &err) + if ret == -1 { + return []DomainCPUStats{}, makeError(&err) + } + + stats := make([]DomainCPUStats, nCpus) + for i := 0; i < int(nCpus); i++ { + coffset := C.int(i) * cnparams + info := getCPUStatsFieldInfo(&stats[i]) + var cparamscpu *C.virTypedParameter + cparamscpu = (*C.virTypedParameter)(unsafe.Pointer(uintptr(unsafe.Pointer(cparams)) + + (unsafe.Sizeof(*cparams) * uintptr(coffset)))) + _, gerr := typedParamsUnpack(cparamscpu, cnparams, info) + if gerr != nil { + return []DomainCPUStats{}, gerr + } + } + return stats, nil +} + +type DomainInterfaceParameters struct { + BandwidthInAverageSet bool + BandwidthInAverage uint + BandwidthInPeakSet bool + BandwidthInPeak uint + BandwidthInBurstSet bool + BandwidthInBurst uint + BandwidthInFloorSet bool + BandwidthInFloor uint + BandwidthOutAverageSet bool + BandwidthOutAverage uint + BandwidthOutPeakSet bool + BandwidthOutPeak uint + BandwidthOutBurstSet bool + BandwidthOutBurst uint +} + +func getInterfaceParameterFieldInfo(params *DomainInterfaceParameters) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_BANDWIDTH_IN_AVERAGE: typedParamsFieldInfo{ + set: ¶ms.BandwidthInAverageSet, + ui: ¶ms.BandwidthInAverage, + }, + C.VIR_DOMAIN_BANDWIDTH_IN_PEAK: typedParamsFieldInfo{ + set: ¶ms.BandwidthInPeakSet, + ui: ¶ms.BandwidthInPeak, + }, + C.VIR_DOMAIN_BANDWIDTH_IN_BURST: typedParamsFieldInfo{ + set: ¶ms.BandwidthInBurstSet, + ui: ¶ms.BandwidthInBurst, + }, + C.VIR_DOMAIN_BANDWIDTH_IN_FLOOR: typedParamsFieldInfo{ + set: ¶ms.BandwidthInFloorSet, + ui: ¶ms.BandwidthInFloor, + }, + C.VIR_DOMAIN_BANDWIDTH_OUT_AVERAGE: typedParamsFieldInfo{ + set: ¶ms.BandwidthOutAverageSet, + ui: ¶ms.BandwidthOutAverage, + }, + C.VIR_DOMAIN_BANDWIDTH_OUT_PEAK: typedParamsFieldInfo{ + set: ¶ms.BandwidthOutPeakSet, + ui: ¶ms.BandwidthOutPeak, + }, + C.VIR_DOMAIN_BANDWIDTH_OUT_BURST: typedParamsFieldInfo{ + set: ¶ms.BandwidthOutBurstSet, + ui: ¶ms.BandwidthOutBurst, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetInterfaceParameters +func (d *Domain) GetInterfaceParameters(device string, flags DomainModificationImpact) (*DomainInterfaceParameters, error) { + params := &DomainInterfaceParameters{} + info := getInterfaceParameterFieldInfo(params) + + var cnparams C.int + + cdevice := C.CString(device) + defer C.free(unsafe.Pointer(cdevice)) + var err C.virError + ret := C.virDomainGetInterfaceParametersWrapper(d.ptr, cdevice, nil, &cnparams, C.uint(0), &err) + if ret == -1 { + return nil, makeError(&err) + } + + cparams := typedParamsNew(cnparams) + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + ret = C.virDomainGetInterfaceParametersWrapper(d.ptr, cdevice, cparams, &cnparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + _, gerr := typedParamsUnpack(cparams, cnparams, info) + if gerr != nil { + return nil, gerr + } + + return params, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetInterfaceParameters +func (d *Domain) SetInterfaceParameters(device string, params *DomainInterfaceParameters, flags DomainModificationImpact) error { + info := getInterfaceParameterFieldInfo(params) + + cdevice := C.CString(device) + defer C.free(unsafe.Pointer(cdevice)) + + cparams, cnparams, gerr := typedParamsPackNew(info) + if gerr != nil { + return gerr + } + + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + + var err C.virError + ret := C.virDomainSetInterfaceParametersWrapper(d.ptr, cdevice, cparams, cnparams, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetMetadata +func (d *Domain) GetMetadata(metadataType DomainMetadataType, uri string, flags DomainModificationImpact) (string, error) { + var cUri *C.char + if uri != "" { + cUri = C.CString(uri) + defer C.free(unsafe.Pointer(cUri)) + } + + var err C.virError + result := C.virDomainGetMetadataWrapper(d.ptr, C.int(metadataType), cUri, C.uint(flags), &err) + if result == nil { + return "", makeError(&err) + + } + defer C.free(unsafe.Pointer(result)) + return C.GoString(result), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMetadata +func (d *Domain) SetMetadata(metadataType DomainMetadataType, metaDataCont, uriKey, uri string, flags DomainModificationImpact) error { + var cMetaDataCont *C.char + var cUriKey *C.char + var cUri *C.char + + if metaDataCont != "" { + cMetaDataCont = C.CString(metaDataCont) + defer C.free(unsafe.Pointer(cMetaDataCont)) + } + + if metadataType == DOMAIN_METADATA_ELEMENT { + if uriKey != "" { + cUriKey = C.CString(uriKey) + defer C.free(unsafe.Pointer(cUriKey)) + } + cUri = C.CString(uri) + defer C.free(unsafe.Pointer(cUri)) + } + var err C.virError + result := C.virDomainSetMetadataWrapper(d.ptr, C.int(metadataType), cMetaDataCont, cUriKey, cUri, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainUndefine +func (d *Domain) Undefine() error { + var err C.virError + result := C.virDomainUndefineWrapper(d.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainUndefineFlags +func (d *Domain) UndefineFlags(flags DomainUndefineFlagsValues) error { + var err C.virError + result := C.virDomainUndefineFlagsWrapper(d.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMaxMemory +func (d *Domain) SetMaxMemory(memory uint64) error { + var err C.virError + result := C.virDomainSetMaxMemoryWrapper(d.ptr, C.ulong(memory), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMemory +func (d *Domain) SetMemory(memory uint64) error { + var err C.virError + result := C.virDomainSetMemoryWrapper(d.ptr, C.ulong(memory), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMemoryFlags +func (d *Domain) SetMemoryFlags(memory uint64, flags DomainMemoryModFlags) error { + var err C.virError + result := C.virDomainSetMemoryFlagsWrapper(d.ptr, C.ulong(memory), C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMemoryStatsPeriod +func (d *Domain) SetMemoryStatsPeriod(period int, flags DomainMemoryModFlags) error { + var err C.virError + result := C.virDomainSetMemoryStatsPeriodWrapper(d.ptr, C.int(period), C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetVcpus +func (d *Domain) SetVcpus(vcpu uint) error { + var err C.virError + result := C.virDomainSetVcpusWrapper(d.ptr, C.uint(vcpu), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetVcpusFlags +func (d *Domain) SetVcpusFlags(vcpu uint, flags DomainVcpuFlags) error { + var err C.virError + result := C.virDomainSetVcpusFlagsWrapper(d.ptr, C.uint(vcpu), C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSuspend +func (d *Domain) Suspend() error { + var err C.virError + result := C.virDomainSuspendWrapper(d.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainResume +func (d *Domain) Resume() error { + var err C.virError + result := C.virDomainResumeWrapper(d.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainAbortJob +func (d *Domain) AbortJob() error { + var err C.virError + result := C.virDomainAbortJobWrapper(d.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainAbortJobFlags +func (d *Domain) AbortJobFlags(flags DomainAbortJobFlags) error { + var err C.virError + result := C.virDomainAbortJobFlagsWrapper(d.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainDestroyFlags +func (d *Domain) DestroyFlags(flags DomainDestroyFlags) error { + var err C.virError + result := C.virDomainDestroyFlagsWrapper(d.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainShutdownFlags +func (d *Domain) ShutdownFlags(flags DomainShutdownFlags) error { + var err C.virError + result := C.virDomainShutdownFlagsWrapper(d.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainAttachDevice +func (d *Domain) AttachDevice(xml string) error { + cXml := C.CString(xml) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + result := C.virDomainAttachDeviceWrapper(d.ptr, cXml, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainAttachDeviceFlags +func (d *Domain) AttachDeviceFlags(xml string, flags DomainDeviceModifyFlags) error { + cXml := C.CString(xml) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + result := C.virDomainAttachDeviceFlagsWrapper(d.ptr, cXml, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainDetachDevice +func (d *Domain) DetachDevice(xml string) error { + cXml := C.CString(xml) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + result := C.virDomainDetachDeviceWrapper(d.ptr, cXml, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainDetachDeviceFlags +func (d *Domain) DetachDeviceFlags(xml string, flags DomainDeviceModifyFlags) error { + cXml := C.CString(xml) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + result := C.virDomainDetachDeviceFlagsWrapper(d.ptr, cXml, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainDetachDeviceAlias +func (d *Domain) DetachDeviceAlias(alias string, flags DomainDeviceModifyFlags) error { + cAlias := C.CString(alias) + defer C.free(unsafe.Pointer(cAlias)) + var err C.virError + result := C.virDomainDetachDeviceAliasWrapper(d.ptr, cAlias, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainUpdateDeviceFlags +func (d *Domain) UpdateDeviceFlags(xml string, flags DomainDeviceModifyFlags) error { + cXml := C.CString(xml) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + result := C.virDomainUpdateDeviceFlagsWrapper(d.ptr, cXml, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainScreenshot +func (d *Domain) Screenshot(stream *Stream, screen, flags uint32) (string, error) { + var err C.virError + cType := C.virDomainScreenshotWrapper(d.ptr, stream.ptr, C.uint(screen), C.uint(flags), &err) + if cType == nil { + return "", makeError(&err) + } + defer C.free(unsafe.Pointer(cType)) + + mimeType := C.GoString(cType) + return mimeType, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSendKey +func (d *Domain) SendKey(codeset, holdtime uint, keycodes []uint, flags uint32) error { + var err C.virError + nkeycodes := len(keycodes) + ckeycodes := make([]C.uint, nkeycodes) + for i, keycode := range keycodes { + ckeycodes[i] = C.uint(keycode) + } + + var ckeycodesPtr *C.uint = nil + if nkeycodes > 0 { + ckeycodesPtr = &ckeycodes[0] + } + result := C.virDomainSendKeyWrapper(d.ptr, C.uint(codeset), C.uint(holdtime), ckeycodesPtr, C.int(nkeycodes), C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + + return nil +} + +type DomainBlockStats struct { + RdBytesSet bool + RdBytes int64 + RdReqSet bool + RdReq int64 + RdTotalTimesSet bool + RdTotalTimes int64 + WrBytesSet bool + WrBytes int64 + WrReqSet bool + WrReq int64 + WrTotalTimesSet bool + WrTotalTimes int64 + FlushReqSet bool + FlushReq int64 + FlushTotalTimesSet bool + FlushTotalTimes int64 + ErrsSet bool + Errs int64 +} + +func getBlockStatsFieldInfo(params *DomainBlockStats) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_BLOCK_STATS_READ_BYTES: typedParamsFieldInfo{ + set: ¶ms.RdBytesSet, + l: ¶ms.RdBytes, + }, + C.VIR_DOMAIN_BLOCK_STATS_READ_REQ: typedParamsFieldInfo{ + set: ¶ms.RdReqSet, + l: ¶ms.RdReq, + }, + C.VIR_DOMAIN_BLOCK_STATS_READ_TOTAL_TIMES: typedParamsFieldInfo{ + set: ¶ms.RdTotalTimesSet, + l: ¶ms.RdTotalTimes, + }, + C.VIR_DOMAIN_BLOCK_STATS_WRITE_BYTES: typedParamsFieldInfo{ + set: ¶ms.WrBytesSet, + l: ¶ms.WrBytes, + }, + C.VIR_DOMAIN_BLOCK_STATS_WRITE_REQ: typedParamsFieldInfo{ + set: ¶ms.WrReqSet, + l: ¶ms.WrReq, + }, + C.VIR_DOMAIN_BLOCK_STATS_WRITE_TOTAL_TIMES: typedParamsFieldInfo{ + set: ¶ms.WrTotalTimesSet, + l: ¶ms.WrTotalTimes, + }, + C.VIR_DOMAIN_BLOCK_STATS_FLUSH_REQ: typedParamsFieldInfo{ + set: ¶ms.FlushReqSet, + l: ¶ms.FlushReq, + }, + C.VIR_DOMAIN_BLOCK_STATS_FLUSH_TOTAL_TIMES: typedParamsFieldInfo{ + set: ¶ms.FlushTotalTimesSet, + l: ¶ms.FlushTotalTimes, + }, + C.VIR_DOMAIN_BLOCK_STATS_ERRS: typedParamsFieldInfo{ + set: ¶ms.ErrsSet, + l: ¶ms.Errs, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockStatsFlags +func (d *Domain) BlockStatsFlags(disk string, flags uint32) (*DomainBlockStats, error) { + params := &DomainBlockStats{} + info := getBlockStatsFieldInfo(params) + + var cnparams C.int + + cdisk := C.CString(disk) + defer C.free(unsafe.Pointer(cdisk)) + var err C.virError + ret := C.virDomainBlockStatsFlagsWrapper(d.ptr, cdisk, nil, &cnparams, C.uint(0), &err) + if ret == -1 { + return nil, makeError(&err) + } + + cparams := typedParamsNew(cnparams) + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + ret = C.virDomainBlockStatsFlagsWrapper(d.ptr, cdisk, cparams, &cnparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + _, gerr := typedParamsUnpack(cparams, cnparams, info) + if gerr != nil { + return nil, gerr + } + + return params, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockStats +func (d *Domain) BlockStats(path string) (*DomainBlockStats, error) { + cPath := C.CString(path) + defer C.free(unsafe.Pointer(cPath)) + + size := C.size_t(unsafe.Sizeof(C.struct__virDomainBlockStats{})) + + cStats := (C.virDomainBlockStatsPtr)(C.malloc(size)) + defer C.free(unsafe.Pointer(cStats)) + + var err C.virError + result := C.virDomainBlockStatsWrapper(d.ptr, cPath, (C.virDomainBlockStatsPtr)(cStats), size, &err) + + if result != 0 { + return nil, makeError(&err) + } + return &DomainBlockStats{ + WrReqSet: true, + WrReq: int64(cStats.wr_req), + RdReqSet: true, + RdReq: int64(cStats.rd_req), + RdBytesSet: true, + RdBytes: int64(cStats.rd_bytes), + WrBytesSet: true, + WrBytes: int64(cStats.wr_bytes), + }, nil +} + +type DomainInterfaceStats struct { + RxBytesSet bool + RxBytes int64 + RxPacketsSet bool + RxPackets int64 + RxErrsSet bool + RxErrs int64 + RxDropSet bool + RxDrop int64 + TxBytesSet bool + TxBytes int64 + TxPacketsSet bool + TxPackets int64 + TxErrsSet bool + TxErrs int64 + TxDropSet bool + TxDrop int64 +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainInterfaceStats +func (d *Domain) InterfaceStats(path string) (*DomainInterfaceStats, error) { + cPath := C.CString(path) + defer C.free(unsafe.Pointer(cPath)) + + size := C.size_t(unsafe.Sizeof(C.struct__virDomainInterfaceStats{})) + + cStats := (C.virDomainInterfaceStatsPtr)(C.malloc(size)) + defer C.free(unsafe.Pointer(cStats)) + + var err C.virError + result := C.virDomainInterfaceStatsWrapper(d.ptr, cPath, (C.virDomainInterfaceStatsPtr)(cStats), size, &err) + + if result != 0 { + return nil, makeError(&err) + } + return &DomainInterfaceStats{ + RxBytesSet: true, + RxBytes: int64(cStats.rx_bytes), + RxPacketsSet: true, + RxPackets: int64(cStats.rx_packets), + RxErrsSet: true, + RxErrs: int64(cStats.rx_errs), + RxDropSet: true, + RxDrop: int64(cStats.rx_drop), + TxBytesSet: true, + TxBytes: int64(cStats.tx_bytes), + TxPacketsSet: true, + TxPackets: int64(cStats.tx_packets), + TxErrsSet: true, + TxErrs: int64(cStats.tx_errs), + TxDropSet: true, + TxDrop: int64(cStats.tx_drop), + }, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMemoryStats +func (d *Domain) MemoryStats(nrStats uint32, flags uint32) ([]DomainMemoryStat, error) { + cstats := make([]C.virDomainMemoryStatStruct, nrStats) + + var err C.virError + var cstatsPtr *C.virDomainMemoryStatStruct = nil + if nrStats > 0 { + cstatsPtr = &cstats[0] + } + result := C.virDomainMemoryStatsWrapper(d.ptr, cstatsPtr, C.uint(nrStats), C.uint(flags), &err) + + if result == -1 { + return []DomainMemoryStat{}, makeError(&err) + } + + out := make([]DomainMemoryStat, 0) + for i := 0; i < int(result); i++ { + out = append(out, DomainMemoryStat{ + Tag: int32(cstats[i].tag), + Val: uint64(cstats[i].val), + }) + } + return out, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetConnect +// +// Contrary to the native C API behaviour, the Go API will +// acquire a reference on the returned Connect, which must +// be released by calling Close() +func (d *Domain) DomainGetConnect() (*Connect, error) { + var err C.virError + ptr := C.virDomainGetConnectWrapper(d.ptr, &err) + if ptr == nil { + return nil, makeError(&err) + } + + ret := C.virConnectRefWrapper(ptr, &err) + if ret == -1 { + return nil, makeError(&err) + } + + return &Connect{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetVcpus +func (d *Domain) GetVcpus() ([]DomainVcpuInfo, error) { + var cnodeinfo C.virNodeInfo + var err C.virError + ptr := C.virDomainGetConnectWrapper(d.ptr, &err) + if ptr == nil { + return []DomainVcpuInfo{}, makeError(&err) + } + ret := C.virNodeGetInfoWrapper(ptr, &cnodeinfo, &err) + if ret == -1 { + return []DomainVcpuInfo{}, makeError(&err) + } + + var cdominfo C.virDomainInfo + ret = C.virDomainGetInfoWrapper(d.ptr, &cdominfo, &err) + if ret == -1 { + return []DomainVcpuInfo{}, makeError(&err) + } + + nvcpus := int(cdominfo.nrVirtCpu) + npcpus := int(cnodeinfo.nodes * cnodeinfo.sockets * cnodeinfo.cores * cnodeinfo.threads) + maplen := ((npcpus + 7) / 8) + ccpumaps := make([]C.uchar, maplen*nvcpus) + cinfo := make([]C.virVcpuInfo, nvcpus) + + ret = C.virDomainGetVcpusWrapper(d.ptr, &cinfo[0], C.int(nvcpus), &ccpumaps[0], C.int(maplen), &err) + if ret == -1 { + return []DomainVcpuInfo{}, makeError(&err) + } + + info := make([]DomainVcpuInfo, int(ret)) + for i := 0; i < int(ret); i++ { + affinity := make([]bool, npcpus) + for j := 0; j < npcpus; j++ { + byte := (i * maplen) + (j / 8) + bit := j % 8 + + affinity[j] = (ccpumaps[byte] & (1 << uint(bit))) != 0 + } + + info[i] = DomainVcpuInfo{ + Number: uint32(cinfo[i].number), + State: int32(cinfo[i].state), + CpuTime: uint64(cinfo[i].cpuTime), + Cpu: int32(cinfo[i].cpu), + CpuMap: affinity, + } + } + + return info, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetVcpusFlags +func (d *Domain) GetVcpusFlags(flags DomainVcpuFlags) (int32, error) { + var err C.virError + result := C.virDomainGetVcpusFlagsWrapper(d.ptr, C.uint(flags), &err) + if result == -1 { + return 0, makeError(&err) + } + return int32(result), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainPinVcpu +func (d *Domain) PinVcpu(vcpu uint, cpuMap []bool) error { + maplen := (len(cpuMap) + 7) / 8 + ccpumap := make([]C.uchar, maplen) + for i := 0; i < len(cpuMap); i++ { + if cpuMap[i] { + byte := i / 8 + bit := i % 8 + ccpumap[byte] |= (1 << uint(bit)) + } + } + + var err C.virError + var ccpumapPtr *C.uchar = nil + if maplen > 0 { + ccpumapPtr = &ccpumap[0] + } + result := C.virDomainPinVcpuWrapper(d.ptr, C.uint(vcpu), ccpumapPtr, C.int(maplen), &err) + + if result == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainPinVcpuFlags +func (d *Domain) PinVcpuFlags(vcpu uint, cpuMap []bool, flags DomainModificationImpact) error { + maplen := (len(cpuMap) + 7) / 8 + ccpumap := make([]C.uchar, maplen) + for i := 0; i < len(cpuMap); i++ { + if cpuMap[i] { + byte := i / 8 + bit := i % 8 + ccpumap[byte] |= (1 << uint(bit)) + } + } + + var err C.virError + var ccpumapPtr *C.uchar = nil + if maplen > 0 { + ccpumapPtr = &ccpumap[0] + } + result := C.virDomainPinVcpuFlagsWrapper(d.ptr, C.uint(vcpu), ccpumapPtr, C.int(maplen), C.uint(flags), &err) + + if result == -1 { + return makeError(&err) + } + + return nil +} + +type DomainIPAddress struct { + Type IPAddrType + Addr string + Prefix uint +} + +type DomainInterface struct { + Name string + Hwaddr string + Addrs []DomainIPAddress +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainInterfaceAddresses +func (d *Domain) ListAllInterfaceAddresses(src DomainInterfaceAddressesSource) ([]DomainInterface, error) { + var cList *C.virDomainInterfacePtr + var err C.virError + numIfaces := int(C.virDomainInterfaceAddressesWrapper(d.ptr, (**C.virDomainInterfacePtr)(&cList), C.uint(src), 0, &err)) + if numIfaces == -1 { + return nil, makeError(&err) + } + + ifaces := make([]DomainInterface, numIfaces) + + for i := 0; i < numIfaces; i++ { + var ciface *C.virDomainInterface + ciface = *(**C.virDomainInterface)(unsafe.Pointer(uintptr(unsafe.Pointer(cList)) + (unsafe.Sizeof(ciface) * uintptr(i)))) + + ifaces[i].Name = C.GoString(ciface.name) + ifaces[i].Hwaddr = C.GoString(ciface.hwaddr) + + numAddr := int(ciface.naddrs) + + ifaces[i].Addrs = make([]DomainIPAddress, numAddr) + + for k := 0; k < numAddr; k++ { + var caddr *C.virDomainIPAddress + caddr = (*C.virDomainIPAddress)(unsafe.Pointer(uintptr(unsafe.Pointer(ciface.addrs)) + (unsafe.Sizeof(*caddr) * uintptr(k)))) + ifaces[i].Addrs[k] = DomainIPAddress{} + ifaces[i].Addrs[k].Type = IPAddrType(caddr._type) + ifaces[i].Addrs[k].Addr = C.GoString(caddr.addr) + ifaces[i].Addrs[k].Prefix = uint(caddr.prefix) + + } + C.virDomainInterfaceFreeWrapper(ciface) + } + C.free(unsafe.Pointer(cList)) + return ifaces, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotCurrent +func (d *Domain) SnapshotCurrent(flags uint32) (*DomainSnapshot, error) { + var err C.virError + result := C.virDomainSnapshotCurrentWrapper(d.ptr, C.uint(flags), &err) + if result == nil { + return nil, makeError(&err) + } + return &DomainSnapshot{ptr: result}, nil + +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotNum +func (d *Domain) SnapshotNum(flags DomainSnapshotListFlags) (int, error) { + var err C.virError + result := int(C.virDomainSnapshotNumWrapper(d.ptr, C.uint(flags), &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotLookupByName +func (d *Domain) SnapshotLookupByName(name string, flags uint32) (*DomainSnapshot, error) { + cName := C.CString(name) + defer C.free(unsafe.Pointer(cName)) + var err C.virError + ptr := C.virDomainSnapshotLookupByNameWrapper(d.ptr, cName, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &DomainSnapshot{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-checkpoint.html#virDomainCheckpointLookupByName +func (d *Domain) CheckpointLookupByName(name string, flags uint32) (*DomainCheckpoint, error) { + cName := C.CString(name) + defer C.free(unsafe.Pointer(cName)) + var err C.virError + ptr := C.virDomainCheckpointLookupByNameWrapper(d.ptr, cName, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &DomainCheckpoint{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotListNames +func (d *Domain) SnapshotListNames(flags DomainSnapshotListFlags) ([]string, error) { + const maxNames = 1024 + var names [maxNames](*C.char) + namesPtr := unsafe.Pointer(&names) + var err C.virError + numNames := C.virDomainSnapshotListNamesWrapper( + d.ptr, + (**C.char)(namesPtr), + maxNames, C.uint(flags), &err) + if numNames == -1 { + return nil, makeError(&err) + } + goNames := make([]string, numNames) + for k := 0; k < int(numNames); k++ { + goNames[k] = C.GoString(names[k]) + C.free(unsafe.Pointer(names[k])) + } + return goNames, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainListAllSnapshots +func (d *Domain) ListAllSnapshots(flags DomainSnapshotListFlags) ([]DomainSnapshot, error) { + var cList *C.virDomainSnapshotPtr + var err C.virError + numVols := C.virDomainListAllSnapshotsWrapper(d.ptr, (**C.virDomainSnapshotPtr)(&cList), C.uint(flags), &err) + if numVols == -1 { + return nil, makeError(&err) + } + hdr := reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(cList)), + Len: int(numVols), + Cap: int(numVols), + } + var pools []DomainSnapshot + slice := *(*[]C.virDomainSnapshotPtr)(unsafe.Pointer(&hdr)) + for _, ptr := range slice { + pools = append(pools, DomainSnapshot{ptr}) + } + C.free(unsafe.Pointer(cList)) + return pools, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-checkpoint.html#virDomainListAllCheckpoints +func (d *Domain) ListAllCheckpoints(flags DomainCheckpointListFlags) ([]DomainCheckpoint, error) { + var cList *C.virDomainCheckpointPtr + var err C.virError + numCps := C.virDomainListAllCheckpointsWrapper(d.ptr, (**C.virDomainCheckpointPtr)(&cList), C.uint(flags), &err) + if numCps == -1 { + return nil, makeError(&err) + } + hdr := reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(cList)), + Len: int(numCps), + Cap: int(numCps), + } + var cps []DomainCheckpoint + slice := *(*[]C.virDomainCheckpointPtr)(unsafe.Pointer(&hdr)) + for _, ptr := range slice { + cps = append(cps, DomainCheckpoint{ptr}) + } + C.free(unsafe.Pointer(cList)) + return cps, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockCommit +func (d *Domain) BlockCommit(disk string, base string, top string, bandwidth uint64, flags DomainBlockCommitFlags) error { + cdisk := C.CString(disk) + defer C.free(unsafe.Pointer(cdisk)) + var cbase *C.char + if base != "" { + cbase = C.CString(base) + defer C.free(unsafe.Pointer(cbase)) + } + var ctop *C.char + if top != "" { + ctop = C.CString(top) + defer C.free(unsafe.Pointer(ctop)) + } + var err C.virError + ret := C.virDomainBlockCommitWrapper(d.ptr, cdisk, cbase, ctop, C.ulong(bandwidth), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +type DomainBlockCopyParameters struct { + BandwidthSet bool + Bandwidth uint64 + GranularitySet bool + Granularity uint + BufSizeSet bool + BufSize uint64 +} + +func getBlockCopyParameterFieldInfo(params *DomainBlockCopyParameters) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_BLOCK_COPY_BANDWIDTH: typedParamsFieldInfo{ + set: ¶ms.BandwidthSet, + ul: ¶ms.Bandwidth, + }, + C.VIR_DOMAIN_BLOCK_COPY_GRANULARITY: typedParamsFieldInfo{ + set: ¶ms.GranularitySet, + ui: ¶ms.Granularity, + }, + C.VIR_DOMAIN_BLOCK_COPY_BUF_SIZE: typedParamsFieldInfo{ + set: ¶ms.BufSizeSet, + ul: ¶ms.BufSize, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockCopy +func (d *Domain) BlockCopy(disk string, destxml string, params *DomainBlockCopyParameters, flags DomainBlockCopyFlags) error { + cdisk := C.CString(disk) + defer C.free(unsafe.Pointer(cdisk)) + cdestxml := C.CString(destxml) + defer C.free(unsafe.Pointer(cdestxml)) + + info := getBlockCopyParameterFieldInfo(params) + + cparams, cnparams, gerr := typedParamsPackNew(info) + if gerr != nil { + return gerr + } + + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + + var err C.virError + ret := C.virDomainBlockCopyWrapper(d.ptr, cdisk, cdestxml, cparams, cnparams, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockJobAbort +func (d *Domain) BlockJobAbort(disk string, flags DomainBlockJobAbortFlags) error { + cdisk := C.CString(disk) + defer C.free(unsafe.Pointer(cdisk)) + var err C.virError + ret := C.virDomainBlockJobAbortWrapper(d.ptr, cdisk, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockJobSetSpeed +func (d *Domain) BlockJobSetSpeed(disk string, bandwidth uint64, flags DomainBlockJobSetSpeedFlags) error { + cdisk := C.CString(disk) + defer C.free(unsafe.Pointer(cdisk)) + var err C.virError + ret := C.virDomainBlockJobSetSpeedWrapper(d.ptr, cdisk, C.ulong(bandwidth), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockPull +func (d *Domain) BlockPull(disk string, bandwidth uint64, flags DomainBlockPullFlags) error { + cdisk := C.CString(disk) + defer C.free(unsafe.Pointer(cdisk)) + var err C.virError + ret := C.virDomainBlockPullWrapper(d.ptr, cdisk, C.ulong(bandwidth), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockRebase +func (d *Domain) BlockRebase(disk string, base string, bandwidth uint64, flags DomainBlockRebaseFlags) error { + cdisk := C.CString(disk) + defer C.free(unsafe.Pointer(cdisk)) + var cbase *C.char + if base != "" { + cbase = C.CString(base) + defer C.free(unsafe.Pointer(cbase)) + } + var err C.virError + ret := C.virDomainBlockRebaseWrapper(d.ptr, cdisk, cbase, C.ulong(bandwidth), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockResize +func (d *Domain) BlockResize(disk string, size uint64, flags DomainBlockResizeFlags) error { + cdisk := C.CString(disk) + defer C.free(unsafe.Pointer(cdisk)) + var err C.virError + ret := C.virDomainBlockResizeWrapper(d.ptr, cdisk, C.ulonglong(size), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockPeek +func (d *Domain) BlockPeek(disk string, offset uint64, size uint64, flags uint32) ([]byte, error) { + cdisk := C.CString(disk) + defer C.free(unsafe.Pointer(cdisk)) + data := make([]byte, size) + var err C.virError + + var dataPtr unsafe.Pointer = nil + if size > 0 { + dataPtr = unsafe.Pointer(&data[0]) + } + ret := C.virDomainBlockPeekWrapper(d.ptr, cdisk, C.ulonglong(offset), C.size_t(size), dataPtr, C.uint(flags), &err) + if ret == -1 { + return []byte{}, makeError(&err) + } + + return data, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMemoryPeek +func (d *Domain) MemoryPeek(start uint64, size uint64, flags DomainMemoryFlags) ([]byte, error) { + data := make([]byte, size) + var err C.virError + + var dataPtr unsafe.Pointer = nil + if size > 0 { + dataPtr = unsafe.Pointer(&data[0]) + } + ret := C.virDomainMemoryPeekWrapper(d.ptr, C.ulonglong(start), C.size_t(size), dataPtr, C.uint(flags), &err) + if ret == -1 { + return []byte{}, makeError(&err) + } + + return data, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrate +func (d *Domain) Migrate(dconn *Connect, flags DomainMigrateFlags, dname string, uri string, bandwidth uint64) (*Domain, error) { + var cdname *C.char + if dname != "" { + cdname = C.CString(dname) + defer C.free(unsafe.Pointer(cdname)) + } + var curi *C.char + if uri != "" { + curi = C.CString(uri) + defer C.free(unsafe.Pointer(curi)) + } + + var err C.virError + ret := C.virDomainMigrateWrapper(d.ptr, dconn.ptr, C.ulong(flags), cdname, curi, C.ulong(bandwidth), &err) + if ret == nil { + return nil, makeError(&err) + } + + return &Domain{ + ptr: ret, + }, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrate2 +func (d *Domain) Migrate2(dconn *Connect, dxml string, flags DomainMigrateFlags, dname string, uri string, bandwidth uint64) (*Domain, error) { + var cdxml *C.char + if dxml != "" { + cdxml = C.CString(dxml) + defer C.free(unsafe.Pointer(cdxml)) + } + var cdname *C.char + if dname != "" { + cdname = C.CString(dname) + defer C.free(unsafe.Pointer(cdname)) + } + var curi *C.char + if uri != "" { + curi = C.CString(uri) + defer C.free(unsafe.Pointer(curi)) + } + + var err C.virError + ret := C.virDomainMigrate2Wrapper(d.ptr, dconn.ptr, cdxml, C.ulong(flags), cdname, curi, C.ulong(bandwidth), &err) + if ret == nil { + return nil, makeError(&err) + } + + return &Domain{ + ptr: ret, + }, nil +} + +type DomainMigrateParameters struct { + URISet bool + URI string + DestNameSet bool + DestName string + DestXMLSet bool + DestXML string + PersistXMLSet bool + PersistXML string + BandwidthSet bool + Bandwidth uint64 + GraphicsURISet bool + GraphicsURI string + ListenAddressSet bool + ListenAddress string + MigrateDisksSet bool + MigrateDisks []string + DisksPortSet bool + DisksPort int + CompressionSet bool + Compression string + CompressionMTLevelSet bool + CompressionMTLevel int + CompressionMTThreadsSet bool + CompressionMTThreads int + CompressionMTDThreadsSet bool + CompressionMTDThreads int + CompressionXBZRLECacheSet bool + CompressionXBZRLECache uint64 + AutoConvergeInitialSet bool + AutoConvergeInitial int + AutoConvergeIncrementSet bool + AutoConvergeIncrement int + ParallelConnectionsSet bool + ParallelConnections int + TLSDestinationSet bool + TLSDestination string + DisksURISet bool + DisksURI string + CompressionZlibLevelSet bool + CompressionZlibLevel int + CompressionZstdLevelSet bool + CompressionZstdLevel int + MigrateDisksDetectZeroesSet bool + MigrateDisksDetectZeroes bool // Deprecated: wrong type & unused. Delete in v2.nnn + MigrateDisksDetectZeroesList []string +} + +func getMigrateParameterFieldInfo(params *DomainMigrateParameters) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_MIGRATE_PARAM_URI: typedParamsFieldInfo{ + set: ¶ms.URISet, + s: ¶ms.URI, + }, + C.VIR_MIGRATE_PARAM_DEST_NAME: typedParamsFieldInfo{ + set: ¶ms.DestNameSet, + s: ¶ms.DestName, + }, + C.VIR_MIGRATE_PARAM_DEST_XML: typedParamsFieldInfo{ + set: ¶ms.DestXMLSet, + s: ¶ms.DestXML, + }, + C.VIR_MIGRATE_PARAM_PERSIST_XML: typedParamsFieldInfo{ + set: ¶ms.PersistXMLSet, + s: ¶ms.PersistXML, + }, + C.VIR_MIGRATE_PARAM_BANDWIDTH: typedParamsFieldInfo{ + set: ¶ms.BandwidthSet, + ul: ¶ms.Bandwidth, + }, + C.VIR_MIGRATE_PARAM_BANDWIDTH_POSTCOPY: typedParamsFieldInfo{ + set: ¶ms.BandwidthSet, + ul: ¶ms.Bandwidth, + }, + C.VIR_MIGRATE_PARAM_GRAPHICS_URI: typedParamsFieldInfo{ + set: ¶ms.GraphicsURISet, + s: ¶ms.GraphicsURI, + }, + C.VIR_MIGRATE_PARAM_LISTEN_ADDRESS: typedParamsFieldInfo{ + set: ¶ms.ListenAddressSet, + s: ¶ms.ListenAddress, + }, + C.VIR_MIGRATE_PARAM_MIGRATE_DISKS: typedParamsFieldInfo{ + set: ¶ms.MigrateDisksSet, + sl: ¶ms.MigrateDisks, + }, + C.VIR_MIGRATE_PARAM_DISKS_PORT: typedParamsFieldInfo{ + set: ¶ms.DisksPortSet, + i: ¶ms.DisksPort, + }, + C.VIR_MIGRATE_PARAM_COMPRESSION: typedParamsFieldInfo{ + set: ¶ms.CompressionSet, + s: ¶ms.Compression, + }, + C.VIR_MIGRATE_PARAM_COMPRESSION_MT_LEVEL: typedParamsFieldInfo{ + set: ¶ms.CompressionMTLevelSet, + i: ¶ms.CompressionMTLevel, + }, + C.VIR_MIGRATE_PARAM_COMPRESSION_MT_THREADS: typedParamsFieldInfo{ + set: ¶ms.CompressionMTThreadsSet, + i: ¶ms.CompressionMTThreads, + }, + C.VIR_MIGRATE_PARAM_COMPRESSION_MT_DTHREADS: typedParamsFieldInfo{ + set: ¶ms.CompressionMTDThreadsSet, + i: ¶ms.CompressionMTDThreads, + }, + C.VIR_MIGRATE_PARAM_COMPRESSION_XBZRLE_CACHE: typedParamsFieldInfo{ + set: ¶ms.CompressionXBZRLECacheSet, + ul: ¶ms.CompressionXBZRLECache, + }, + C.VIR_MIGRATE_PARAM_AUTO_CONVERGE_INITIAL: typedParamsFieldInfo{ + set: ¶ms.AutoConvergeInitialSet, + i: ¶ms.AutoConvergeInitial, + }, + C.VIR_MIGRATE_PARAM_AUTO_CONVERGE_INCREMENT: typedParamsFieldInfo{ + set: ¶ms.AutoConvergeIncrementSet, + i: ¶ms.AutoConvergeIncrement, + }, + C.VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS: typedParamsFieldInfo{ + set: ¶ms.ParallelConnectionsSet, + i: ¶ms.ParallelConnections, + }, + C.VIR_MIGRATE_PARAM_TLS_DESTINATION: typedParamsFieldInfo{ + set: ¶ms.TLSDestinationSet, + s: ¶ms.TLSDestination, + }, + C.VIR_MIGRATE_PARAM_DISKS_URI: typedParamsFieldInfo{ + set: ¶ms.DisksURISet, + s: ¶ms.DisksURI, + }, + C.VIR_MIGRATE_PARAM_COMPRESSION_ZLIB_LEVEL: typedParamsFieldInfo{ + set: ¶ms.CompressionZlibLevelSet, + i: ¶ms.CompressionZlibLevel, + }, + C.VIR_MIGRATE_PARAM_COMPRESSION_ZSTD_LEVEL: typedParamsFieldInfo{ + set: ¶ms.CompressionZstdLevelSet, + i: ¶ms.CompressionZstdLevel, + }, + C.VIR_MIGRATE_PARAM_MIGRATE_DISKS_DETECT_ZEROES: typedParamsFieldInfo{ + set: ¶ms.MigrateDisksDetectZeroesSet, + sl: ¶ms.MigrateDisksDetectZeroesList, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrate3 +func (d *Domain) Migrate3(dconn *Connect, params *DomainMigrateParameters, flags DomainMigrateFlags) (*Domain, error) { + + info := getMigrateParameterFieldInfo(params) + cparams, cnparams, gerr := typedParamsPackNew(info) + if gerr != nil { + return nil, gerr + } + + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + + var err C.virError + ret := C.virDomainMigrate3Wrapper(d.ptr, dconn.ptr, cparams, C.uint(cnparams), C.uint(flags), &err) + if ret == nil { + return nil, makeError(&err) + } + + return &Domain{ + ptr: ret, + }, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateToURI +func (d *Domain) MigrateToURI(duri string, flags DomainMigrateFlags, dname string, bandwidth uint64) error { + cduri := C.CString(duri) + defer C.free(unsafe.Pointer(cduri)) + + var cdname *C.char + if dname != "" { + cdname = C.CString(dname) + defer C.free(unsafe.Pointer(cdname)) + } + + var err C.virError + ret := C.virDomainMigrateToURIWrapper(d.ptr, cduri, C.ulong(flags), cdname, C.ulong(bandwidth), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateToURI2 +func (d *Domain) MigrateToURI2(dconnuri string, miguri string, dxml string, flags DomainMigrateFlags, dname string, bandwidth uint64) error { + var cdconnuri *C.char + if dconnuri != "" { + cdconnuri = C.CString(dconnuri) + defer C.free(unsafe.Pointer(cdconnuri)) + } + var cmiguri *C.char + if miguri != "" { + cmiguri = C.CString(miguri) + defer C.free(unsafe.Pointer(cmiguri)) + } + var cdxml *C.char + if dxml != "" { + cdxml = C.CString(dxml) + defer C.free(unsafe.Pointer(cdxml)) + } + var cdname *C.char + if dname != "" { + cdname = C.CString(dname) + defer C.free(unsafe.Pointer(cdname)) + } + + var err C.virError + ret := C.virDomainMigrateToURI2Wrapper(d.ptr, cdconnuri, cmiguri, cdxml, C.ulong(flags), cdname, C.ulong(bandwidth), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateToURI3 +func (d *Domain) MigrateToURI3(dconnuri string, params *DomainMigrateParameters, flags DomainMigrateFlags) error { + var cdconnuri *C.char + if dconnuri != "" { + cdconnuri = C.CString(dconnuri) + defer C.free(unsafe.Pointer(cdconnuri)) + } + + info := getMigrateParameterFieldInfo(params) + cparams, cnparams, gerr := typedParamsPackNew(info) + if gerr != nil { + return gerr + } + + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + + var err C.virError + ret := C.virDomainMigrateToURI3Wrapper(d.ptr, cdconnuri, cparams, C.uint(cnparams), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateGetCompressionCache +func (d *Domain) MigrateGetCompressionCache(flags uint32) (uint64, error) { + var cacheSize C.ulonglong + + var err C.virError + ret := C.virDomainMigrateGetCompressionCacheWrapper(d.ptr, &cacheSize, C.uint(flags), &err) + if ret == -1 { + return 0, makeError(&err) + } + + return uint64(cacheSize), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateSetCompressionCache +func (d *Domain) MigrateSetCompressionCache(size uint64, flags uint32) error { + var err C.virError + ret := C.virDomainMigrateSetCompressionCacheWrapper(d.ptr, C.ulonglong(size), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateGetMaxSpeed +func (d *Domain) MigrateGetMaxSpeed(flags DomainMigrateMaxSpeedFlags) (uint64, error) { + var maxSpeed C.ulong + + var err C.virError + ret := C.virDomainMigrateGetMaxSpeedWrapper(d.ptr, &maxSpeed, C.uint(flags), &err) + if ret == -1 { + return 0, makeError(&err) + } + + return uint64(maxSpeed), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateSetMaxSpeed +func (d *Domain) MigrateSetMaxSpeed(speed uint64, flags DomainMigrateMaxSpeedFlags) error { + var err C.virError + ret := C.virDomainMigrateSetMaxSpeedWrapper(d.ptr, C.ulong(speed), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateSetMaxDowntime +func (d *Domain) MigrateSetMaxDowntime(downtime uint64, flags uint32) error { + var err C.virError + ret := C.virDomainMigrateSetMaxDowntimeWrapper(d.ptr, C.ulonglong(downtime), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateGetMaxDowntime +func (d *Domain) MigrateGetMaxDowntime(flags uint32) (uint64, error) { + var downtimeLen C.ulonglong + var err C.virError + ret := C.virDomainMigrateGetMaxDowntimeWrapper(d.ptr, &downtimeLen, C.uint(flags), &err) + if ret == -1 { + return 0, makeError(&err) + } + + return uint64(downtimeLen), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateStartPostCopy +func (d *Domain) MigrateStartPostCopy(flags uint32) error { + var err C.virError + ret := C.virDomainMigrateStartPostCopyWrapper(d.ptr, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +type DomainBlkioParameters struct { + WeightSet bool + Weight uint + DeviceWeightSet bool + DeviceWeight string + DeviceReadIopsSet bool + DeviceReadIops string + DeviceWriteIopsSet bool + DeviceWriteIops string + DeviceReadBpsSet bool + DeviceReadBps string + DeviceWriteBpsSet bool + DeviceWriteBps string +} + +func getBlkioParametersFieldInfo(params *DomainBlkioParameters) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_BLKIO_WEIGHT: typedParamsFieldInfo{ + set: ¶ms.WeightSet, + ui: ¶ms.Weight, + }, + C.VIR_DOMAIN_BLKIO_DEVICE_WEIGHT: typedParamsFieldInfo{ + set: ¶ms.DeviceWeightSet, + s: ¶ms.DeviceWeight, + }, + C.VIR_DOMAIN_BLKIO_DEVICE_READ_IOPS: typedParamsFieldInfo{ + set: ¶ms.DeviceReadIopsSet, + s: ¶ms.DeviceReadIops, + }, + C.VIR_DOMAIN_BLKIO_DEVICE_WRITE_IOPS: typedParamsFieldInfo{ + set: ¶ms.DeviceWriteIopsSet, + s: ¶ms.DeviceWriteIops, + }, + C.VIR_DOMAIN_BLKIO_DEVICE_READ_BPS: typedParamsFieldInfo{ + set: ¶ms.DeviceReadBpsSet, + s: ¶ms.DeviceReadBps, + }, + C.VIR_DOMAIN_BLKIO_DEVICE_WRITE_BPS: typedParamsFieldInfo{ + set: ¶ms.DeviceWriteBpsSet, + s: ¶ms.DeviceWriteBps, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetBlkioParameters +func (d *Domain) GetBlkioParameters(flags DomainModificationImpact) (*DomainBlkioParameters, error) { + params := &DomainBlkioParameters{} + info := getBlkioParametersFieldInfo(params) + + var cnparams C.int + var err C.virError + ret := C.virDomainGetBlkioParametersWrapper(d.ptr, nil, &cnparams, 0, &err) + if ret == -1 { + return nil, makeError(&err) + } + + cparams := typedParamsNew(cnparams) + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + ret = C.virDomainGetBlkioParametersWrapper(d.ptr, cparams, &cnparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + _, gerr := typedParamsUnpack(cparams, cnparams, info) + if gerr != nil { + return nil, gerr + } + + return params, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetBlkioParameters +func (d *Domain) SetBlkioParameters(params *DomainBlkioParameters, flags DomainModificationImpact) error { + info := getBlkioParametersFieldInfo(params) + + cparams, cnparams, gerr := typedParamsPackNew(info) + if gerr != nil { + return gerr + } + + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + + var err C.virError + ret := C.virDomainSetBlkioParametersWrapper(d.ptr, cparams, cnparams, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +type DomainBlockIoTuneParameters struct { + TotalBytesSecSet bool + TotalBytesSec uint64 + ReadBytesSecSet bool + ReadBytesSec uint64 + WriteBytesSecSet bool + WriteBytesSec uint64 + TotalIopsSecSet bool + TotalIopsSec uint64 + ReadIopsSecSet bool + ReadIopsSec uint64 + WriteIopsSecSet bool + WriteIopsSec uint64 + TotalBytesSecMaxSet bool + TotalBytesSecMax uint64 + ReadBytesSecMaxSet bool + ReadBytesSecMax uint64 + WriteBytesSecMaxSet bool + WriteBytesSecMax uint64 + TotalIopsSecMaxSet bool + TotalIopsSecMax uint64 + ReadIopsSecMaxSet bool + ReadIopsSecMax uint64 + WriteIopsSecMaxSet bool + WriteIopsSecMax uint64 + TotalBytesSecMaxLengthSet bool + TotalBytesSecMaxLength uint64 + ReadBytesSecMaxLengthSet bool + ReadBytesSecMaxLength uint64 + WriteBytesSecMaxLengthSet bool + WriteBytesSecMaxLength uint64 + TotalIopsSecMaxLengthSet bool + TotalIopsSecMaxLength uint64 + ReadIopsSecMaxLengthSet bool + ReadIopsSecMaxLength uint64 + WriteIopsSecMaxLengthSet bool + WriteIopsSecMaxLength uint64 + SizeIopsSecSet bool + SizeIopsSec uint64 + GroupNameSet bool + GroupName string +} + +func getBlockIoTuneParametersFieldInfo(params *DomainBlockIoTuneParameters) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC: typedParamsFieldInfo{ + set: ¶ms.TotalBytesSecSet, + ul: ¶ms.TotalBytesSec, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC: typedParamsFieldInfo{ + set: ¶ms.ReadBytesSecSet, + ul: ¶ms.ReadBytesSec, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC: typedParamsFieldInfo{ + set: ¶ms.WriteBytesSecSet, + ul: ¶ms.WriteBytesSec, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC: typedParamsFieldInfo{ + set: ¶ms.TotalIopsSecSet, + ul: ¶ms.TotalIopsSec, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC: typedParamsFieldInfo{ + set: ¶ms.ReadIopsSecSet, + ul: ¶ms.ReadIopsSec, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC: typedParamsFieldInfo{ + set: ¶ms.WriteIopsSecSet, + ul: ¶ms.WriteIopsSec, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC_MAX: typedParamsFieldInfo{ + set: ¶ms.TotalBytesSecMaxSet, + ul: ¶ms.TotalBytesSecMax, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC_MAX: typedParamsFieldInfo{ + set: ¶ms.ReadBytesSecMaxSet, + ul: ¶ms.ReadBytesSecMax, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC_MAX: typedParamsFieldInfo{ + set: ¶ms.WriteBytesSecMaxSet, + ul: ¶ms.WriteBytesSecMax, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC_MAX: typedParamsFieldInfo{ + set: ¶ms.TotalIopsSecMaxSet, + ul: ¶ms.TotalIopsSecMax, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC_MAX: typedParamsFieldInfo{ + set: ¶ms.ReadIopsSecMaxSet, + ul: ¶ms.ReadIopsSecMax, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC_MAX: typedParamsFieldInfo{ + set: ¶ms.WriteIopsSecMaxSet, + ul: ¶ms.WriteIopsSecMax, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC_MAX_LENGTH: typedParamsFieldInfo{ + set: ¶ms.TotalBytesSecMaxLengthSet, + ul: ¶ms.TotalBytesSecMaxLength, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC_MAX_LENGTH: typedParamsFieldInfo{ + set: ¶ms.ReadBytesSecMaxLengthSet, + ul: ¶ms.ReadBytesSecMaxLength, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC_MAX_LENGTH: typedParamsFieldInfo{ + set: ¶ms.WriteBytesSecMaxLengthSet, + ul: ¶ms.WriteBytesSecMaxLength, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC_MAX_LENGTH: typedParamsFieldInfo{ + set: ¶ms.TotalIopsSecMaxLengthSet, + ul: ¶ms.TotalIopsSecMaxLength, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC_MAX_LENGTH: typedParamsFieldInfo{ + set: ¶ms.ReadIopsSecMaxLengthSet, + ul: ¶ms.ReadIopsSecMaxLength, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC_MAX_LENGTH: typedParamsFieldInfo{ + set: ¶ms.WriteIopsSecMaxLengthSet, + ul: ¶ms.WriteIopsSecMaxLength, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_SIZE_IOPS_SEC: typedParamsFieldInfo{ + set: ¶ms.SizeIopsSecSet, + ul: ¶ms.SizeIopsSec, + }, + C.VIR_DOMAIN_BLOCK_IOTUNE_GROUP_NAME: typedParamsFieldInfo{ + set: ¶ms.GroupNameSet, + s: ¶ms.GroupName, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetBlockIoTune +func (d *Domain) GetBlockIoTune(disk string, flags DomainModificationImpact) (*DomainBlockIoTuneParameters, error) { + cdisk := C.CString(disk) + defer C.free(unsafe.Pointer(cdisk)) + + params := &DomainBlockIoTuneParameters{} + info := getBlockIoTuneParametersFieldInfo(params) + + var cnparams C.int + var err C.virError + ret := C.virDomainGetBlockIoTuneWrapper(d.ptr, cdisk, nil, &cnparams, 0, &err) + if ret == -1 { + return nil, makeError(&err) + } + + cparams := typedParamsNew(cnparams) + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + ret = C.virDomainGetBlockIoTuneWrapper(d.ptr, cdisk, cparams, &cnparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + _, gerr := typedParamsUnpack(cparams, cnparams, info) + if gerr != nil { + return nil, gerr + } + + return params, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetBlockIoTune +func (d *Domain) SetBlockIoTune(disk string, params *DomainBlockIoTuneParameters, flags DomainModificationImpact) error { + cdisk := C.CString(disk) + defer C.free(unsafe.Pointer(cdisk)) + + info := getBlockIoTuneParametersFieldInfo(params) + + cparams, cnparams, gerr := typedParamsPackNew(info) + if gerr != nil { + return gerr + } + + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + + var err C.virError + ret := C.virDomainSetBlockIoTuneWrapper(d.ptr, cdisk, cparams, cnparams, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +type DomainBlockJobInfo struct { + Type DomainBlockJobType + Bandwidth uint64 + Cur uint64 + End uint64 +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetBlockJobInfo +func (d *Domain) GetBlockJobInfo(disk string, flags DomainBlockJobInfoFlags) (*DomainBlockJobInfo, error) { + cdisk := C.CString(disk) + defer C.free(unsafe.Pointer(cdisk)) + + var cinfo C.virDomainBlockJobInfo + + var err C.virError + ret := C.virDomainGetBlockJobInfoWrapper(d.ptr, cdisk, &cinfo, C.uint(flags), &err) + + if ret == -1 { + return nil, makeError(&err) + } + + return &DomainBlockJobInfo{ + Type: DomainBlockJobType(cinfo._type), + Bandwidth: uint64(cinfo.bandwidth), + Cur: uint64(cinfo.cur), + End: uint64(cinfo.end), + }, nil +} + +type DomainControlInfo struct { + State DomainControlState + Details int + StateTime uint64 +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetControlInfo +func (d *Domain) GetControlInfo(flags uint32) (*DomainControlInfo, error) { + + var cinfo C.virDomainControlInfo + + var err C.virError + ret := C.virDomainGetControlInfoWrapper(d.ptr, &cinfo, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + return &DomainControlInfo{ + State: DomainControlState(cinfo.state), + Details: int(cinfo.details), + StateTime: uint64(cinfo.stateTime), + }, nil +} + +type DomainDiskError struct { + Disk string + Error DomainDiskErrorCode +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetDiskErrors +func (d *Domain) GetDiskErrors(flags uint32) ([]DomainDiskError, error) { + var err C.virError + ret := C.virDomainGetDiskErrorsWrapper(d.ptr, nil, 0, 0, &err) + if ret == -1 { + return []DomainDiskError{}, makeError(&err) + } + + maxerrors := ret + cerrors := make([]C.virDomainDiskError, maxerrors) + var cerrorsPtr *C.virDomainDiskError = nil + if maxerrors > 0 { + cerrorsPtr = &cerrors[0] + } + + ret = C.virDomainGetDiskErrorsWrapper(d.ptr, cerrorsPtr, C.uint(maxerrors), C.uint(flags), &err) + if ret == -1 { + return []DomainDiskError{}, makeError(&err) + } + + errors := make([]DomainDiskError, maxerrors) + + for i, cerror := range cerrors { + errors[i] = DomainDiskError{ + Disk: C.GoString(cerror.disk), + Error: DomainDiskErrorCode(cerror.error), + } + C.free(unsafe.Pointer(cerror.disk)) + } + + return errors, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetHostname +func (d *Domain) GetHostname(flags DomainGetHostnameFlags) (string, error) { + var err C.virError + ret := C.virDomainGetHostnameWrapper(d.ptr, C.uint(flags), &err) + if ret == nil { + return "", makeError(&err) + } + + defer C.free(unsafe.Pointer(ret)) + + return C.GoString(ret), nil +} + +type DomainJobInfo struct { + Type DomainJobType + TimeElapsedSet bool + TimeElapsed uint64 + TimeElapsedNetSet bool + TimeElapsedNet uint64 + TimeRemainingSet bool + TimeRemaining uint64 + DowntimeSet bool + Downtime uint64 + DowntimeNetSet bool + DowntimeNet uint64 + SetupTimeSet bool + SetupTime uint64 + DataTotalSet bool + DataTotal uint64 + DataProcessedSet bool + DataProcessed uint64 + DataRemainingSet bool + DataRemaining uint64 + MemTotalSet bool + MemTotal uint64 + MemProcessedSet bool + MemProcessed uint64 + MemRemainingSet bool + MemRemaining uint64 + MemConstantSet bool + MemConstant uint64 + MemNormalSet bool + MemNormal uint64 + MemNormalBytesSet bool + MemNormalBytes uint64 + MemBpsSet bool + MemBps uint64 + MemDirtyRateSet bool + MemDirtyRate uint64 + MemPageSizeSet bool + MemPageSize uint64 + MemIterationSet bool + MemIteration uint64 + DiskTotalSet bool + DiskTotal uint64 + DiskProcessedSet bool + DiskProcessed uint64 + DiskRemainingSet bool + DiskRemaining uint64 + DiskBpsSet bool + DiskBps uint64 + CompressionCacheSet bool + CompressionCache uint64 + CompressionBytesSet bool + CompressionBytes uint64 + CompressionPagesSet bool + CompressionPages uint64 + CompressionCacheMissesSet bool + CompressionCacheMisses uint64 + CompressionOverflowSet bool + CompressionOverflow uint64 + AutoConvergeThrottleSet bool + AutoConvergeThrottle int + OperationSet bool + Operation DomainJobOperationType + MemPostcopyReqsSet bool + MemPostcopyReqs uint64 + JobSuccessSet bool + JobSuccess bool + DiskTempUsedSet bool + DiskTempUsed uint64 + DiskTempTotalSet bool + DiskTempTotal uint64 + ErrorMessageSet bool + ErrorMessage string + VFIODataTransferredSet bool + VFIODataTransferred uint64 +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetJobInfo +func (d *Domain) GetJobInfo() (*DomainJobInfo, error) { + var cinfo C.virDomainJobInfo + + var err C.virError + ret := C.virDomainGetJobInfoWrapper(d.ptr, &cinfo, &err) + if ret == -1 { + return nil, makeError(&err) + } + + return &DomainJobInfo{ + Type: DomainJobType(cinfo._type), + TimeElapsedSet: true, + TimeElapsed: uint64(cinfo.timeElapsed), + TimeRemainingSet: true, + TimeRemaining: uint64(cinfo.timeRemaining), + DataTotalSet: true, + DataTotal: uint64(cinfo.dataTotal), + DataProcessedSet: true, + DataProcessed: uint64(cinfo.dataProcessed), + DataRemainingSet: true, + DataRemaining: uint64(cinfo.dataRemaining), + MemTotalSet: true, + MemTotal: uint64(cinfo.memTotal), + MemProcessedSet: true, + MemProcessed: uint64(cinfo.memProcessed), + MemRemainingSet: true, + MemRemaining: uint64(cinfo.memRemaining), + DiskTotalSet: true, + DiskTotal: uint64(cinfo.fileTotal), + DiskProcessedSet: true, + DiskProcessed: uint64(cinfo.fileProcessed), + DiskRemainingSet: true, + DiskRemaining: uint64(cinfo.fileRemaining), + }, nil +} + +func getDomainJobInfoFieldInfo(params *DomainJobInfo) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_JOB_TIME_ELAPSED: typedParamsFieldInfo{ + set: ¶ms.TimeElapsedSet, + ul: ¶ms.TimeElapsed, + }, + C.VIR_DOMAIN_JOB_TIME_ELAPSED_NET: typedParamsFieldInfo{ + set: ¶ms.TimeElapsedNetSet, + ul: ¶ms.TimeElapsedNet, + }, + C.VIR_DOMAIN_JOB_TIME_REMAINING: typedParamsFieldInfo{ + set: ¶ms.TimeRemainingSet, + ul: ¶ms.TimeRemaining, + }, + C.VIR_DOMAIN_JOB_DOWNTIME: typedParamsFieldInfo{ + set: ¶ms.DowntimeSet, + ul: ¶ms.Downtime, + }, + C.VIR_DOMAIN_JOB_DOWNTIME_NET: typedParamsFieldInfo{ + set: ¶ms.DowntimeNetSet, + ul: ¶ms.DowntimeNet, + }, + C.VIR_DOMAIN_JOB_SETUP_TIME: typedParamsFieldInfo{ + set: ¶ms.SetupTimeSet, + ul: ¶ms.SetupTime, + }, + C.VIR_DOMAIN_JOB_DATA_TOTAL: typedParamsFieldInfo{ + set: ¶ms.DataTotalSet, + ul: ¶ms.DataTotal, + }, + C.VIR_DOMAIN_JOB_DATA_PROCESSED: typedParamsFieldInfo{ + set: ¶ms.DataProcessedSet, + ul: ¶ms.DataProcessed, + }, + C.VIR_DOMAIN_JOB_DATA_REMAINING: typedParamsFieldInfo{ + set: ¶ms.DataRemainingSet, + ul: ¶ms.DataRemaining, + }, + C.VIR_DOMAIN_JOB_MEMORY_TOTAL: typedParamsFieldInfo{ + set: ¶ms.MemTotalSet, + ul: ¶ms.MemTotal, + }, + C.VIR_DOMAIN_JOB_MEMORY_PROCESSED: typedParamsFieldInfo{ + set: ¶ms.MemProcessedSet, + ul: ¶ms.MemProcessed, + }, + C.VIR_DOMAIN_JOB_MEMORY_REMAINING: typedParamsFieldInfo{ + set: ¶ms.MemRemainingSet, + ul: ¶ms.MemRemaining, + }, + C.VIR_DOMAIN_JOB_MEMORY_CONSTANT: typedParamsFieldInfo{ + set: ¶ms.MemConstantSet, + ul: ¶ms.MemConstant, + }, + C.VIR_DOMAIN_JOB_MEMORY_NORMAL: typedParamsFieldInfo{ + set: ¶ms.MemNormalSet, + ul: ¶ms.MemNormal, + }, + C.VIR_DOMAIN_JOB_MEMORY_NORMAL_BYTES: typedParamsFieldInfo{ + set: ¶ms.MemNormalBytesSet, + ul: ¶ms.MemNormalBytes, + }, + C.VIR_DOMAIN_JOB_MEMORY_BPS: typedParamsFieldInfo{ + set: ¶ms.MemBpsSet, + ul: ¶ms.MemBps, + }, + C.VIR_DOMAIN_JOB_MEMORY_DIRTY_RATE: typedParamsFieldInfo{ + set: ¶ms.MemDirtyRateSet, + ul: ¶ms.MemDirtyRate, + }, + C.VIR_DOMAIN_JOB_MEMORY_PAGE_SIZE: typedParamsFieldInfo{ + set: ¶ms.MemPageSizeSet, + ul: ¶ms.MemPageSize, + }, + C.VIR_DOMAIN_JOB_MEMORY_ITERATION: typedParamsFieldInfo{ + set: ¶ms.MemIterationSet, + ul: ¶ms.MemIteration, + }, + C.VIR_DOMAIN_JOB_DISK_TOTAL: typedParamsFieldInfo{ + set: ¶ms.DiskTotalSet, + ul: ¶ms.DiskTotal, + }, + C.VIR_DOMAIN_JOB_DISK_PROCESSED: typedParamsFieldInfo{ + set: ¶ms.DiskProcessedSet, + ul: ¶ms.DiskProcessed, + }, + C.VIR_DOMAIN_JOB_DISK_REMAINING: typedParamsFieldInfo{ + set: ¶ms.DiskRemainingSet, + ul: ¶ms.DiskRemaining, + }, + C.VIR_DOMAIN_JOB_DISK_BPS: typedParamsFieldInfo{ + set: ¶ms.DiskBpsSet, + ul: ¶ms.DiskBps, + }, + C.VIR_DOMAIN_JOB_COMPRESSION_CACHE: typedParamsFieldInfo{ + set: ¶ms.CompressionCacheSet, + ul: ¶ms.CompressionCache, + }, + C.VIR_DOMAIN_JOB_COMPRESSION_BYTES: typedParamsFieldInfo{ + set: ¶ms.CompressionBytesSet, + ul: ¶ms.CompressionBytes, + }, + C.VIR_DOMAIN_JOB_COMPRESSION_PAGES: typedParamsFieldInfo{ + set: ¶ms.CompressionPagesSet, + ul: ¶ms.CompressionPages, + }, + C.VIR_DOMAIN_JOB_COMPRESSION_CACHE_MISSES: typedParamsFieldInfo{ + set: ¶ms.CompressionCacheMissesSet, + ul: ¶ms.CompressionCacheMisses, + }, + C.VIR_DOMAIN_JOB_COMPRESSION_OVERFLOW: typedParamsFieldInfo{ + set: ¶ms.CompressionOverflowSet, + ul: ¶ms.CompressionOverflow, + }, + C.VIR_DOMAIN_JOB_AUTO_CONVERGE_THROTTLE: typedParamsFieldInfo{ + set: ¶ms.AutoConvergeThrottleSet, + i: ¶ms.AutoConvergeThrottle, + }, + C.VIR_DOMAIN_JOB_OPERATION: typedParamsFieldInfo{ + set: ¶ms.OperationSet, + i: (*int)(¶ms.Operation), + }, + C.VIR_DOMAIN_JOB_MEMORY_POSTCOPY_REQS: typedParamsFieldInfo{ + set: ¶ms.MemPostcopyReqsSet, + ul: ¶ms.MemPostcopyReqs, + }, + C.VIR_DOMAIN_JOB_SUCCESS: typedParamsFieldInfo{ + set: ¶ms.JobSuccessSet, + b: ¶ms.JobSuccess, + }, + C.VIR_DOMAIN_JOB_DISK_TEMP_USED: typedParamsFieldInfo{ + set: ¶ms.DiskTempUsedSet, + ul: ¶ms.DiskTempUsed, + }, + C.VIR_DOMAIN_JOB_DISK_TEMP_TOTAL: typedParamsFieldInfo{ + set: ¶ms.DiskTempTotalSet, + ul: ¶ms.DiskTempTotal, + }, + C.VIR_DOMAIN_JOB_ERRMSG: typedParamsFieldInfo{ + set: ¶ms.ErrorMessageSet, + s: ¶ms.ErrorMessage, + }, + C.VIR_DOMAIN_JOB_VFIO_DATA_TRANSFERRED: typedParamsFieldInfo{ + set: ¶ms.VFIODataTransferredSet, + ul: ¶ms.VFIODataTransferred, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetJobStats +func (d *Domain) GetJobStats(flags DomainGetJobStatsFlags) (*DomainJobInfo, error) { + var cparams C.virTypedParameterPtr + var cnparams C.int + var jobtype C.int + var err C.virError + ret := C.virDomainGetJobStatsWrapper(d.ptr, &jobtype, &cparams, &cnparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + + params := DomainJobInfo{ + Type: DomainJobType(jobtype), + } + info := getDomainJobInfoFieldInfo(¶ms) + + _, gerr := typedParamsUnpack(cparams, cnparams, info) + if gerr != nil { + return nil, gerr + } + + return ¶ms, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetMaxMemory +func (d *Domain) GetMaxMemory() (uint64, error) { + var err C.virError + ret := C.virDomainGetMaxMemoryWrapper(d.ptr, &err) + if ret == 0 { + return 0, makeError(&err) + } + + return uint64(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetMaxVcpus +func (d *Domain) GetMaxVcpus() (uint, error) { + var err C.virError + ret := C.virDomainGetMaxVcpusWrapper(d.ptr, &err) + if ret == -1 { + return 0, makeError(&err) + } + + return uint(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetOSType +func (d *Domain) GetOSType() (string, error) { + var err C.virError + ret := C.virDomainGetOSTypeWrapper(d.ptr, &err) + if ret == nil { + return "", makeError(&err) + } + + defer C.free(unsafe.Pointer(ret)) + + return C.GoString(ret), nil +} + +type DomainMemoryParameters struct { + HardLimitSet bool + HardLimit uint64 + SoftLimitSet bool + SoftLimit uint64 + MinGuaranteeSet bool + MinGuarantee uint64 + SwapHardLimitSet bool + SwapHardLimit uint64 +} + +func getDomainMemoryParametersFieldInfo(params *DomainMemoryParameters) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_MEMORY_HARD_LIMIT: typedParamsFieldInfo{ + set: ¶ms.HardLimitSet, + ul: ¶ms.HardLimit, + }, + C.VIR_DOMAIN_MEMORY_SOFT_LIMIT: typedParamsFieldInfo{ + set: ¶ms.SoftLimitSet, + ul: ¶ms.SoftLimit, + }, + C.VIR_DOMAIN_MEMORY_MIN_GUARANTEE: typedParamsFieldInfo{ + set: ¶ms.MinGuaranteeSet, + ul: ¶ms.MinGuarantee, + }, + C.VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT: typedParamsFieldInfo{ + set: ¶ms.SwapHardLimitSet, + ul: ¶ms.SwapHardLimit, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetMemoryParameters +func (d *Domain) GetMemoryParameters(flags DomainModificationImpact) (*DomainMemoryParameters, error) { + params := &DomainMemoryParameters{} + info := getDomainMemoryParametersFieldInfo(params) + + var cnparams C.int + var err C.virError + ret := C.virDomainGetMemoryParametersWrapper(d.ptr, nil, &cnparams, 0, &err) + if ret == -1 { + return nil, makeError(&err) + } + + cparams := typedParamsNew(cnparams) + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + ret = C.virDomainGetMemoryParametersWrapper(d.ptr, cparams, &cnparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + _, gerr := typedParamsUnpack(cparams, cnparams, info) + if gerr != nil { + return nil, gerr + } + + return params, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMemoryParameters +func (d *Domain) SetMemoryParameters(params *DomainMemoryParameters, flags DomainModificationImpact) error { + info := getDomainMemoryParametersFieldInfo(params) + + cparams, cnparams, gerr := typedParamsPackNew(info) + if gerr != nil { + return gerr + } + + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + + var err C.virError + ret := C.virDomainSetMemoryParametersWrapper(d.ptr, cparams, cnparams, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +type DomainNumaParameters struct { + NodesetSet bool + Nodeset string + ModeSet bool + Mode DomainNumatuneMemMode +} + +func getDomainNumaParametersFieldInfo(params *DomainNumaParameters) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_NUMA_NODESET: typedParamsFieldInfo{ + set: ¶ms.NodesetSet, + s: ¶ms.Nodeset, + }, + C.VIR_DOMAIN_NUMA_MODE: typedParamsFieldInfo{ + set: ¶ms.ModeSet, + i: (*int)(¶ms.Mode), + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetNumaParameters +func (d *Domain) GetNumaParameters(flags DomainModificationImpact) (*DomainNumaParameters, error) { + params := &DomainNumaParameters{} + info := getDomainNumaParametersFieldInfo(params) + + var cnparams C.int + var err C.virError + ret := C.virDomainGetNumaParametersWrapper(d.ptr, nil, &cnparams, 0, &err) + if ret == -1 { + return nil, makeError(&err) + } + + cparams := typedParamsNew(cnparams) + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + ret = C.virDomainGetNumaParametersWrapper(d.ptr, cparams, &cnparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + _, gerr := typedParamsUnpack(cparams, cnparams, info) + if gerr != nil { + return nil, gerr + } + + return params, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetNumaParameters +func (d *Domain) SetNumaParameters(params *DomainNumaParameters, flags DomainModificationImpact) error { + info := getDomainNumaParametersFieldInfo(params) + + cparams, cnparams, gerr := typedParamsPackNew(info) + if gerr != nil { + return gerr + } + + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + + var err C.virError + ret := C.virDomainSetNumaParametersWrapper(d.ptr, cparams, cnparams, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +type DomainPerfEvents struct { + CmtSet bool + Cmt bool + MbmtSet bool + Mbmt bool + MbmlSet bool + Mbml bool + CacheMissesSet bool + CacheMisses bool + CacheReferencesSet bool + CacheReferences bool + InstructionsSet bool + Instructions bool + CpuCyclesSet bool + CpuCycles bool + BranchInstructionsSet bool + BranchInstructions bool + BranchMissesSet bool + BranchMisses bool + BusCyclesSet bool + BusCycles bool + StalledCyclesFrontendSet bool + StalledCyclesFrontend bool + StalledCyclesBackendSet bool + StalledCyclesBackend bool + RefCpuCyclesSet bool + RefCpuCycles bool + CpuClockSet bool + CpuClock bool + TaskClockSet bool + TaskClock bool + PageFaultsSet bool + PageFaults bool + ContextSwitchesSet bool + ContextSwitches bool + CpuMigrationsSet bool + CpuMigrations bool + PageFaultsMinSet bool + PageFaultsMin bool + PageFaultsMajSet bool + PageFaultsMaj bool + AlignmentFaultsSet bool + AlignmentFaults bool + EmulationFaultsSet bool + EmulationFaults bool +} + +/* Remember to also update DomainStatsPerf in connect.go when adding to the stuct above */ + +func getDomainPerfEventsFieldInfo(params *DomainPerfEvents) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_PERF_PARAM_CMT: typedParamsFieldInfo{ + set: ¶ms.CmtSet, + b: ¶ms.Cmt, + }, + C.VIR_PERF_PARAM_MBMT: typedParamsFieldInfo{ + set: ¶ms.MbmtSet, + b: ¶ms.Mbmt, + }, + C.VIR_PERF_PARAM_MBML: typedParamsFieldInfo{ + set: ¶ms.MbmlSet, + b: ¶ms.Mbml, + }, + C.VIR_PERF_PARAM_CACHE_MISSES: typedParamsFieldInfo{ + set: ¶ms.CacheMissesSet, + b: ¶ms.CacheMisses, + }, + C.VIR_PERF_PARAM_CACHE_REFERENCES: typedParamsFieldInfo{ + set: ¶ms.CacheReferencesSet, + b: ¶ms.CacheReferences, + }, + C.VIR_PERF_PARAM_INSTRUCTIONS: typedParamsFieldInfo{ + set: ¶ms.InstructionsSet, + b: ¶ms.Instructions, + }, + C.VIR_PERF_PARAM_CPU_CYCLES: typedParamsFieldInfo{ + set: ¶ms.CpuCyclesSet, + b: ¶ms.CpuCycles, + }, + C.VIR_PERF_PARAM_BRANCH_INSTRUCTIONS: typedParamsFieldInfo{ + set: ¶ms.BranchInstructionsSet, + b: ¶ms.BranchInstructions, + }, + C.VIR_PERF_PARAM_BRANCH_MISSES: typedParamsFieldInfo{ + set: ¶ms.BranchMissesSet, + b: ¶ms.BranchMisses, + }, + C.VIR_PERF_PARAM_BUS_CYCLES: typedParamsFieldInfo{ + set: ¶ms.BusCyclesSet, + b: ¶ms.BusCycles, + }, + C.VIR_PERF_PARAM_STALLED_CYCLES_FRONTEND: typedParamsFieldInfo{ + set: ¶ms.StalledCyclesFrontendSet, + b: ¶ms.StalledCyclesFrontend, + }, + C.VIR_PERF_PARAM_STALLED_CYCLES_BACKEND: typedParamsFieldInfo{ + set: ¶ms.StalledCyclesBackendSet, + b: ¶ms.StalledCyclesBackend, + }, + C.VIR_PERF_PARAM_REF_CPU_CYCLES: typedParamsFieldInfo{ + set: ¶ms.RefCpuCyclesSet, + b: ¶ms.RefCpuCycles, + }, + C.VIR_PERF_PARAM_CPU_CLOCK: typedParamsFieldInfo{ + set: ¶ms.CpuClockSet, + b: ¶ms.CpuClock, + }, + C.VIR_PERF_PARAM_TASK_CLOCK: typedParamsFieldInfo{ + set: ¶ms.TaskClockSet, + b: ¶ms.TaskClock, + }, + C.VIR_PERF_PARAM_PAGE_FAULTS: typedParamsFieldInfo{ + set: ¶ms.PageFaultsSet, + b: ¶ms.PageFaults, + }, + C.VIR_PERF_PARAM_CONTEXT_SWITCHES: typedParamsFieldInfo{ + set: ¶ms.ContextSwitchesSet, + b: ¶ms.ContextSwitches, + }, + C.VIR_PERF_PARAM_CPU_MIGRATIONS: typedParamsFieldInfo{ + set: ¶ms.CpuMigrationsSet, + b: ¶ms.CpuMigrations, + }, + C.VIR_PERF_PARAM_PAGE_FAULTS_MIN: typedParamsFieldInfo{ + set: ¶ms.PageFaultsMinSet, + b: ¶ms.PageFaultsMin, + }, + C.VIR_PERF_PARAM_PAGE_FAULTS_MAJ: typedParamsFieldInfo{ + set: ¶ms.PageFaultsMajSet, + b: ¶ms.PageFaultsMaj, + }, + C.VIR_PERF_PARAM_ALIGNMENT_FAULTS: typedParamsFieldInfo{ + set: ¶ms.AlignmentFaultsSet, + b: ¶ms.AlignmentFaults, + }, + C.VIR_PERF_PARAM_EMULATION_FAULTS: typedParamsFieldInfo{ + set: ¶ms.EmulationFaultsSet, + b: ¶ms.EmulationFaults, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetPerfEvents +func (d *Domain) GetPerfEvents(flags DomainModificationImpact) (*DomainPerfEvents, error) { + params := &DomainPerfEvents{} + info := getDomainPerfEventsFieldInfo(params) + + var cparams C.virTypedParameterPtr + var cnparams C.int + var err C.virError + ret := C.virDomainGetPerfEventsWrapper(d.ptr, &cparams, &cnparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + + _, gerr := typedParamsUnpack(cparams, cnparams, info) + if gerr != nil { + return nil, gerr + } + + return params, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetPerfEvents +func (d *Domain) SetPerfEvents(params *DomainPerfEvents, flags DomainModificationImpact) error { + info := getDomainPerfEventsFieldInfo(params) + + cparams, cnparams, gerr := typedParamsPackNew(info) + if gerr != nil { + return gerr + } + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + + var err C.virError + ret := C.virDomainSetPerfEventsWrapper(d.ptr, cparams, cnparams, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +type DomainSchedulerParameters struct { + Type string + CpuSharesSet bool + CpuShares uint64 + GlobalPeriodSet bool + GlobalPeriod uint64 + GlobalQuotaSet bool + GlobalQuota int64 + VcpuPeriodSet bool + VcpuPeriod uint64 + VcpuQuotaSet bool + VcpuQuota int64 + EmulatorPeriodSet bool + EmulatorPeriod uint64 + EmulatorQuotaSet bool + EmulatorQuota int64 + IothreadPeriodSet bool + IothreadPeriod uint64 + IothreadQuotaSet bool + IothreadQuota int64 + WeightSet bool + Weight uint + CapSet bool + Cap uint + ReservationSet bool + Reservation int64 + LimitSet bool + Limit int64 + SharesSet bool + Shares int +} + +func getDomainSchedulerParametersFieldInfo(params *DomainSchedulerParameters) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_SCHEDULER_CPU_SHARES: typedParamsFieldInfo{ + set: ¶ms.CpuSharesSet, + ul: ¶ms.CpuShares, + }, + C.VIR_DOMAIN_SCHEDULER_GLOBAL_PERIOD: typedParamsFieldInfo{ + set: ¶ms.GlobalPeriodSet, + ul: ¶ms.GlobalPeriod, + }, + C.VIR_DOMAIN_SCHEDULER_GLOBAL_QUOTA: typedParamsFieldInfo{ + set: ¶ms.GlobalQuotaSet, + l: ¶ms.GlobalQuota, + }, + C.VIR_DOMAIN_SCHEDULER_EMULATOR_PERIOD: typedParamsFieldInfo{ + set: ¶ms.EmulatorPeriodSet, + ul: ¶ms.EmulatorPeriod, + }, + C.VIR_DOMAIN_SCHEDULER_EMULATOR_QUOTA: typedParamsFieldInfo{ + set: ¶ms.EmulatorQuotaSet, + l: ¶ms.EmulatorQuota, + }, + C.VIR_DOMAIN_SCHEDULER_VCPU_PERIOD: typedParamsFieldInfo{ + set: ¶ms.VcpuPeriodSet, + ul: ¶ms.VcpuPeriod, + }, + C.VIR_DOMAIN_SCHEDULER_VCPU_QUOTA: typedParamsFieldInfo{ + set: ¶ms.VcpuQuotaSet, + l: ¶ms.VcpuQuota, + }, + C.VIR_DOMAIN_SCHEDULER_IOTHREAD_PERIOD: typedParamsFieldInfo{ + set: ¶ms.IothreadPeriodSet, + ul: ¶ms.IothreadPeriod, + }, + C.VIR_DOMAIN_SCHEDULER_IOTHREAD_QUOTA: typedParamsFieldInfo{ + set: ¶ms.IothreadQuotaSet, + l: ¶ms.IothreadQuota, + }, + C.VIR_DOMAIN_SCHEDULER_WEIGHT: typedParamsFieldInfo{ + set: ¶ms.WeightSet, + ui: ¶ms.Weight, + }, + C.VIR_DOMAIN_SCHEDULER_CAP: typedParamsFieldInfo{ + set: ¶ms.CapSet, + ui: ¶ms.Cap, + }, + C.VIR_DOMAIN_SCHEDULER_RESERVATION: typedParamsFieldInfo{ + set: ¶ms.ReservationSet, + l: ¶ms.Reservation, + }, + C.VIR_DOMAIN_SCHEDULER_LIMIT: typedParamsFieldInfo{ + set: ¶ms.LimitSet, + l: ¶ms.Limit, + }, + C.VIR_DOMAIN_SCHEDULER_SHARES: typedParamsFieldInfo{ + set: ¶ms.SharesSet, + i: ¶ms.Shares, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetSchedulerParameters +func (d *Domain) GetSchedulerParameters() (*DomainSchedulerParameters, error) { + params := &DomainSchedulerParameters{} + info := getDomainSchedulerParametersFieldInfo(params) + + var cnparams C.int + var err C.virError + schedtype := C.virDomainGetSchedulerTypeWrapper(d.ptr, &cnparams, &err) + if schedtype == nil { + return nil, makeError(&err) + } + + defer C.free(unsafe.Pointer(schedtype)) + if cnparams == 0 { + return &DomainSchedulerParameters{ + Type: C.GoString(schedtype), + }, nil + } + + cparams := typedParamsNew(cnparams) + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + ret := C.virDomainGetSchedulerParametersWrapper(d.ptr, cparams, &cnparams, &err) + if ret == -1 { + return nil, makeError(&err) + } + + _, gerr := typedParamsUnpack(cparams, cnparams, info) + if gerr != nil { + return nil, gerr + } + + return params, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetSchedulerParametersFlags +func (d *Domain) GetSchedulerParametersFlags(flags DomainModificationImpact) (*DomainSchedulerParameters, error) { + params := &DomainSchedulerParameters{} + info := getDomainSchedulerParametersFieldInfo(params) + + var cnparams C.int + var err C.virError + schedtype := C.virDomainGetSchedulerTypeWrapper(d.ptr, &cnparams, &err) + if schedtype == nil { + return nil, makeError(&err) + } + + defer C.free(unsafe.Pointer(schedtype)) + if cnparams == 0 { + return &DomainSchedulerParameters{ + Type: C.GoString(schedtype), + }, nil + } + + cparams := typedParamsNew(cnparams) + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + ret := C.virDomainGetSchedulerParametersFlagsWrapper(d.ptr, cparams, &cnparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + _, gerr := typedParamsUnpack(cparams, cnparams, info) + if gerr != nil { + return nil, gerr + } + + return params, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetSchedulerParameters +func (d *Domain) SetSchedulerParameters(params *DomainSchedulerParameters) error { + info := getDomainSchedulerParametersFieldInfo(params) + + cparams, cnparams, gerr := typedParamsPackNew(info) + if gerr != nil { + return gerr + } + + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + + var err C.virError + ret := C.virDomainSetSchedulerParametersWrapper(d.ptr, cparams, cnparams, &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetSchedulerParametersFlags +func (d *Domain) SetSchedulerParametersFlags(params *DomainSchedulerParameters, flags DomainModificationImpact) error { + info := getDomainSchedulerParametersFieldInfo(params) + + cparams, cnparams, gerr := typedParamsPackNew(info) + if gerr != nil { + return gerr + } + + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + + var err C.virError + ret := C.virDomainSetSchedulerParametersFlagsWrapper(d.ptr, cparams, cnparams, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +type SecurityLabel struct { + Label string + Enforcing bool +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetSecurityLabel +func (d *Domain) GetSecurityLabel() (*SecurityLabel, error) { + var clabel C.virSecurityLabel + + var err C.virError + ret := C.virDomainGetSecurityLabelWrapper(d.ptr, &clabel, &err) + if ret == -1 { + return nil, makeError(&err) + } + + return &SecurityLabel{ + Label: C.GoString((*C.char)(unsafe.Pointer(&clabel.label))), + Enforcing: clabel.enforcing == 1, + }, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetSecurityLabelList +func (d *Domain) GetSecurityLabelList() ([]SecurityLabel, error) { + var clabels *C.virSecurityLabel + + var err C.virError + ret := C.virDomainGetSecurityLabelListWrapper(d.ptr, (*C.virSecurityLabelPtr)(unsafe.Pointer(&clabels)), &err) + if ret == -1 { + return []SecurityLabel{}, makeError(&err) + } + + labels := make([]SecurityLabel, ret) + for i := 0; i < int(ret); i++ { + var clabel *C.virSecurityLabel + clabel = (*C.virSecurityLabel)(unsafe.Pointer(uintptr(unsafe.Pointer(clabels)) + (unsafe.Sizeof(*clabel) * uintptr(i)))) + labels[i] = SecurityLabel{ + Label: C.GoString((*C.char)(unsafe.Pointer(&clabel.label))), + Enforcing: clabel.enforcing == 1, + } + } + + return labels, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetTime +func (d *Domain) GetTime(flags uint32) (int64, uint, error) { + var secs C.longlong + var nsecs C.uint + var err C.virError + ret := C.virDomainGetTimeWrapper(d.ptr, &secs, &nsecs, C.uint(flags), &err) + if ret == -1 { + return 0, 0, makeError(&err) + } + + return int64(secs), uint(nsecs), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetTime +func (d *Domain) SetTime(secs int64, nsecs uint, flags DomainSetTimeFlags) error { + var err C.virError + ret := C.virDomainSetTimeWrapper(d.ptr, C.longlong(secs), C.uint(nsecs), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetUserPassword +func (d *Domain) SetUserPassword(user string, password string, flags DomainSetUserPasswordFlags) error { + cuser := C.CString(user) + cpassword := C.CString(password) + + defer C.free(unsafe.Pointer(cuser)) + defer C.free(unsafe.Pointer(cpassword)) + + var err C.virError + ret := C.virDomainSetUserPasswordWrapper(d.ptr, cuser, cpassword, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainManagedSave +func (d *Domain) ManagedSave(flags DomainSaveRestoreFlags) error { + var err C.virError + ret := C.virDomainManagedSaveWrapper(d.ptr, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainHasManagedSaveImage +func (d *Domain) HasManagedSaveImage(flags uint32) (bool, error) { + var err C.virError + result := C.virDomainHasManagedSaveImageWrapper(d.ptr, C.uint(flags), &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainManagedSaveRemove +func (d *Domain) ManagedSaveRemove(flags uint32) error { + var err C.virError + ret := C.virDomainManagedSaveRemoveWrapper(d.ptr, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainRename +func (d *Domain) Rename(name string, flags uint32) error { + cname := C.CString(name) + defer C.free(unsafe.Pointer(cname)) + var err C.virError + ret := C.virDomainRenameWrapper(d.ptr, cname, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainReset +func (d *Domain) Reset(flags uint32) error { + var err C.virError + ret := C.virDomainResetWrapper(d.ptr, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSendProcessSignal +func (d *Domain) SendProcessSignal(pid int64, signum DomainProcessSignal, flags uint32) error { + var err C.virError + ret := C.virDomainSendProcessSignalWrapper(d.ptr, C.longlong(pid), C.uint(signum), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainInjectNMI +func (d *Domain) InjectNMI(flags uint32) error { + var err C.virError + ret := C.virDomainInjectNMIWrapper(d.ptr, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainCoreDump +func (d *Domain) CoreDump(to string, flags DomainCoreDumpFlags) error { + cto := C.CString(to) + defer C.free(unsafe.Pointer(cto)) + + var err C.virError + ret := C.virDomainCoreDumpWrapper(d.ptr, cto, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainCoreDumpWithFormat +func (d *Domain) CoreDumpWithFormat(to string, format DomainCoreDumpFormat, flags DomainCoreDumpFlags) error { + cto := C.CString(to) + defer C.free(unsafe.Pointer(cto)) + + var err C.virError + ret := C.virDomainCoreDumpWithFormatWrapper(d.ptr, cto, C.uint(format), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainHasCurrentSnapshot +func (d *Domain) HasCurrentSnapshot(flags uint32) (bool, error) { + var err C.virError + result := C.virDomainHasCurrentSnapshotWrapper(d.ptr, C.uint(flags), &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainFSFreeze +func (d *Domain) FSFreeze(mounts []string, flags uint32) error { + var err C.virError + var ret C.int + nmounts := len(mounts) + cmounts := make([](*C.char), nmounts) + + for i := 0; i < nmounts; i++ { + cmounts[i] = C.CString(mounts[i]) + defer C.free(unsafe.Pointer(cmounts[i])) + } + + var cmountsPtr **C.char = nil + if nmounts > 0 { + cmountsPtr = &cmounts[0] + } + + ret = C.virDomainFSFreezeWrapper(d.ptr, cmountsPtr, C.uint(nmounts), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainFSThaw +func (d *Domain) FSThaw(mounts []string, flags uint32) error { + var err C.virError + var ret C.int + nmounts := len(mounts) + + cmounts := make([](*C.char), nmounts) + + for i := 0; i < nmounts; i++ { + cmounts[i] = C.CString(mounts[i]) + defer C.free(unsafe.Pointer(cmounts[i])) + } + + var cmountsPtr **C.char = nil + if nmounts > 0 { + cmountsPtr = &cmounts[0] + } + + ret = C.virDomainFSThawWrapper(d.ptr, cmountsPtr, C.uint(nmounts), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainFSTrim +func (d *Domain) FSTrim(mount string, minimum uint64, flags uint32) error { + var cmount *C.char + if mount != "" { + cmount = C.CString(mount) + defer C.free(unsafe.Pointer(cmount)) + } + + var err C.virError + ret := C.virDomainFSTrimWrapper(d.ptr, cmount, C.ulonglong(minimum), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +type DomainFSInfo struct { + MountPoint string + Name string + FSType string + DevAlias []string +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetFSInfo +func (d *Domain) GetFSInfo(flags uint32) ([]DomainFSInfo, error) { + var cfsinfolist **C.virDomainFSInfo + + var err C.virError + ret := C.virDomainGetFSInfoWrapper(d.ptr, (**C.virDomainFSInfoPtr)(unsafe.Pointer(&cfsinfolist)), C.uint(flags), &err) + if ret == -1 { + return []DomainFSInfo{}, makeError(&err) + } + + fsinfo := make([]DomainFSInfo, int(ret)) + + for i := 0; i < int(ret); i++ { + cfsinfo := (*C.virDomainFSInfo)(*(**C.virDomainFSInfo)(unsafe.Pointer(uintptr(unsafe.Pointer(cfsinfolist)) + (unsafe.Sizeof(*cfsinfolist) * uintptr(i))))) + + aliases := make([]string, int(cfsinfo.ndevAlias)) + for j := 0; j < int(cfsinfo.ndevAlias); j++ { + calias := (*C.char)(*(**C.char)(unsafe.Pointer(uintptr(unsafe.Pointer(cfsinfo.devAlias)) + (unsafe.Sizeof(*cfsinfo) * uintptr(j))))) + aliases[j] = C.GoString(calias) + } + fsinfo[i] = DomainFSInfo{ + MountPoint: C.GoString(cfsinfo.mountpoint), + Name: C.GoString(cfsinfo.name), + FSType: C.GoString(cfsinfo.fstype), + DevAlias: aliases, + } + + C.virDomainFSInfoFreeWrapper(cfsinfo) + } + C.free(unsafe.Pointer(cfsinfolist)) + + return fsinfo, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainPMSuspendForDuration +func (d *Domain) PMSuspendForDuration(target NodeSuspendTarget, duration uint64, flags uint32) error { + var err C.virError + ret := C.virDomainPMSuspendForDurationWrapper(d.ptr, C.uint(target), C.ulonglong(duration), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainPMWakeup +func (d *Domain) PMWakeup(flags uint32) error { + var err C.virError + ret := C.virDomainPMWakeupWrapper(d.ptr, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainAddIOThread +func (d *Domain) AddIOThread(id uint, flags DomainModificationImpact) error { + var err C.virError + ret := C.virDomainAddIOThreadWrapper(d.ptr, C.uint(id), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainDelIOThread +func (d *Domain) DelIOThread(id uint, flags DomainModificationImpact) error { + var err C.virError + ret := C.virDomainDelIOThreadWrapper(d.ptr, C.uint(id), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetIOThreadParams + +type DomainSetIOThreadParams struct { + PollMaxNsSet bool + PollMaxNs uint64 + PollGrowSet bool + PollGrow uint + PollShrinkSet bool + PollShrink uint + ThreadPoolMinSet bool + ThreadPoolMin int + ThreadPoolMaxSet bool + ThreadPoolMax int +} + +func getSetIOThreadParamsFieldInfo(params *DomainSetIOThreadParams) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_IOTHREAD_POLL_MAX_NS: typedParamsFieldInfo{ + set: ¶ms.PollMaxNsSet, + ul: ¶ms.PollMaxNs, + }, + C.VIR_DOMAIN_IOTHREAD_POLL_GROW: typedParamsFieldInfo{ + set: ¶ms.PollGrowSet, + ui: ¶ms.PollGrow, + }, + C.VIR_DOMAIN_IOTHREAD_POLL_SHRINK: typedParamsFieldInfo{ + set: ¶ms.PollShrinkSet, + ui: ¶ms.PollShrink, + }, + C.VIR_DOMAIN_IOTHREAD_THREAD_POOL_MIN: typedParamsFieldInfo{ + set: ¶ms.ThreadPoolMinSet, + i: ¶ms.ThreadPoolMin, + }, + C.VIR_DOMAIN_IOTHREAD_THREAD_POOL_MAX: typedParamsFieldInfo{ + set: ¶ms.ThreadPoolMaxSet, + i: ¶ms.ThreadPoolMax, + }, + } +} + +func (d *Domain) SetIOThreadParams(iothreadid uint, params *DomainSetIOThreadParams, flags DomainModificationImpact) error { + info := getSetIOThreadParamsFieldInfo(params) + + cparams, cnparams, gerr := typedParamsPackNew(info) + if gerr != nil { + return gerr + } + + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + + var err C.virError + ret := C.virDomainSetIOThreadParamsWrapper(d.ptr, C.uint(iothreadid), cparams, cnparams, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetEmulatorPinInfo +func (d *Domain) GetEmulatorPinInfo(flags DomainModificationImpact) ([]bool, error) { + var cnodeinfo C.virNodeInfo + var err C.virError + ptr := C.virDomainGetConnectWrapper(d.ptr, &err) + if ptr == nil { + return []bool{}, makeError(&err) + } + ret := C.virNodeGetInfoWrapper(ptr, &cnodeinfo, &err) + if ret == -1 { + return []bool{}, makeError(&err) + } + + ncpus := cnodeinfo.nodes * cnodeinfo.sockets * cnodeinfo.cores * cnodeinfo.threads + maplen := int((ncpus + 7) / 8) + ccpumaps := make([]C.uchar, maplen) + ret = C.virDomainGetEmulatorPinInfoWrapper(d.ptr, &ccpumaps[0], C.int(maplen), C.uint(flags), &err) + if ret == -1 { + return []bool{}, makeError(&err) + } + + cpumaps := make([]bool, ncpus) + for i := 0; i < int(ncpus); i++ { + byte := i / 8 + bit := i % 8 + cpumaps[i] = (ccpumaps[byte] & (1 << uint(bit))) != 0 + } + + return cpumaps, nil +} + +type DomainIOThreadInfo struct { + IOThreadID uint + CpuMap []bool +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetIOThreadInfo +func (d *Domain) GetIOThreadInfo(flags DomainModificationImpact) ([]DomainIOThreadInfo, error) { + var cinfolist **C.virDomainIOThreadInfo + + var err C.virError + ret := C.virDomainGetIOThreadInfoWrapper(d.ptr, (**C.virDomainIOThreadInfoPtr)(unsafe.Pointer(&cinfolist)), C.uint(flags), &err) + if ret == -1 { + return []DomainIOThreadInfo{}, makeError(&err) + } + + info := make([]DomainIOThreadInfo, int(ret)) + + for i := 0; i < int(ret); i++ { + cinfo := (*(**C.virDomainIOThreadInfo)(unsafe.Pointer(uintptr(unsafe.Pointer(cinfolist)) + (unsafe.Sizeof(*cinfolist) * uintptr(i))))) + + ncpus := int(cinfo.cpumaplen * 8) + cpumap := make([]bool, ncpus) + for j := 0; j < ncpus; j++ { + byte := j / 8 + bit := j % 8 + + cpumapbyte := *(*C.uchar)(unsafe.Pointer(uintptr(unsafe.Pointer(cinfo.cpumap)) + (unsafe.Sizeof(*cinfo.cpumap) * uintptr(byte)))) + cpumap[j] = (cpumapbyte & (1 << uint(bit))) != 0 + } + + info[i] = DomainIOThreadInfo{ + IOThreadID: uint(cinfo.iothread_id), + CpuMap: cpumap, + } + + C.virDomainIOThreadInfoFreeWrapper(cinfo) + } + C.free(unsafe.Pointer(cinfolist)) + + return info, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetVcpuPinInfo +func (d *Domain) GetVcpuPinInfo(flags DomainModificationImpact) ([][]bool, error) { + var cnodeinfo C.virNodeInfo + var err C.virError + ptr := C.virDomainGetConnectWrapper(d.ptr, &err) + if ptr == nil { + return [][]bool{}, makeError(&err) + } + ret := C.virNodeGetInfoWrapper(ptr, &cnodeinfo, &err) + if ret == -1 { + return [][]bool{}, makeError(&err) + } + + var cdominfo C.virDomainInfo + ret = C.virDomainGetInfoWrapper(d.ptr, &cdominfo, &err) + if ret == -1 { + return [][]bool{}, makeError(&err) + } + + nvcpus := int(cdominfo.nrVirtCpu) + npcpus := int(cnodeinfo.nodes * cnodeinfo.sockets * cnodeinfo.cores * cnodeinfo.threads) + maplen := ((npcpus + 7) / 8) + ccpumaps := make([]C.uchar, maplen*nvcpus) + + ret = C.virDomainGetVcpuPinInfoWrapper(d.ptr, C.int(nvcpus), &ccpumaps[0], C.int(maplen), C.uint(flags), &err) + if ret == -1 { + return [][]bool{}, makeError(&err) + } + + cpumaps := make([][]bool, nvcpus) + for i := 0; i < nvcpus; i++ { + cpumaps[i] = make([]bool, npcpus) + for j := 0; j < npcpus; j++ { + byte := (i * maplen) + (j / 8) + bit := j % 8 + + if (ccpumaps[byte] & (1 << uint(bit))) != 0 { + cpumaps[i][j] = true + } + } + } + + return cpumaps, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainPinEmulator +func (d *Domain) PinEmulator(cpumap []bool, flags DomainModificationImpact) error { + + maplen := (len(cpumap) + 7) / 8 + ccpumaps := make([]C.uchar, maplen) + for i := 0; i < len(cpumap); i++ { + if cpumap[i] { + byte := i / 8 + bit := i % 8 + + ccpumaps[byte] |= (1 << uint(bit)) + } + } + + var err C.virError + var ccpumapPtr *C.uchar = nil + if maplen > 0 { + ccpumapPtr = &ccpumaps[0] + } + ret := C.virDomainPinEmulatorWrapper(d.ptr, ccpumapPtr, C.int(maplen), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainPinIOThread +func (d *Domain) PinIOThread(iothreadid uint, cpumap []bool, flags DomainModificationImpact) error { + maplen := (len(cpumap) + 7) / 8 + ccpumaps := make([]C.uchar, maplen) + for i := 0; i < len(cpumap); i++ { + if cpumap[i] { + byte := i / 8 + bit := i % 8 + + ccpumaps[byte] |= (1 << uint(bit)) + } + } + + var err C.virError + var ccpumapPtr *C.uchar = nil + if maplen > 0 { + ccpumapPtr = &ccpumaps[0] + } + ret := C.virDomainPinIOThreadWrapper(d.ptr, C.uint(iothreadid), ccpumapPtr, C.int(maplen), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainOpenChannel +func (d *Domain) OpenChannel(name string, stream *Stream, flags DomainChannelFlags) error { + cname := C.CString(name) + defer C.free(unsafe.Pointer(cname)) + + var err C.virError + ret := C.virDomainOpenChannelWrapper(d.ptr, cname, stream.ptr, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainOpenConsole +func (d *Domain) OpenConsole(devname string, stream *Stream, flags DomainConsoleFlags) error { + var cdevname *C.char + if devname != "" { + cdevname = C.CString(devname) + defer C.free(unsafe.Pointer(cdevname)) + } + + var err C.virError + ret := C.virDomainOpenConsoleWrapper(d.ptr, cdevname, stream.ptr, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainOpenGraphics +func (d *Domain) OpenGraphics(idx uint, file os.File, flags DomainOpenGraphicsFlags) error { + var err C.virError + ret := C.virDomainOpenGraphicsWrapper(d.ptr, C.uint(idx), C.int(file.Fd()), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainOpenGraphicsFD +func (d *Domain) OpenGraphicsFD(idx uint, flags DomainOpenGraphicsFlags) (*os.File, error) { + var err C.virError + ret := C.virDomainOpenGraphicsFDWrapper(d.ptr, C.uint(idx), C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + return os.NewFile(uintptr(ret), "graphics"), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotCreateXML +func (d *Domain) CreateSnapshotXML(xml string, flags DomainSnapshotCreateFlags) (*DomainSnapshot, error) { + cXml := C.CString(xml) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + result := C.virDomainSnapshotCreateXMLWrapper(d.ptr, cXml, C.uint(flags), &err) + if result == nil { + return nil, makeError(&err) + } + return &DomainSnapshot{ptr: result}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-checkpoint.html#virDomainCheckpointCreateXML +func (d *Domain) CreateCheckpointXML(xml string, flags DomainCheckpointCreateFlags) (*DomainCheckpoint, error) { + cXml := C.CString(xml) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + result := C.virDomainCheckpointCreateXMLWrapper(d.ptr, cXml, C.uint(flags), &err) + if result == nil { + return nil, makeError(&err) + } + return &DomainCheckpoint{ptr: result}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSave +func (d *Domain) Save(destFile string) error { + cPath := C.CString(destFile) + defer C.free(unsafe.Pointer(cPath)) + var err C.virError + result := C.virDomainSaveWrapper(d.ptr, cPath, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSaveFlags +func (d *Domain) SaveFlags(destFile string, destXml string, flags DomainSaveRestoreFlags) error { + cDestFile := C.CString(destFile) + var cDestXml *C.char + if destXml != "" { + cDestXml = C.CString(destXml) + defer C.free(unsafe.Pointer(cDestXml)) + } + defer C.free(unsafe.Pointer(cDestFile)) + var err C.virError + result := C.virDomainSaveFlagsWrapper(d.ptr, cDestFile, cDestXml, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +type DomainSaveRestoreParams struct { + FileSet bool + File string + DXMLSet bool + DXML string +} + +func getDomainSaveRestoreParametersFieldInfo(params *DomainSaveRestoreParams) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_SAVE_PARAM_FILE: typedParamsFieldInfo{ + set: ¶ms.FileSet, + s: ¶ms.File, + }, + C.VIR_DOMAIN_SAVE_PARAM_DXML: typedParamsFieldInfo{ + set: ¶ms.DXMLSet, + s: ¶ms.DXML, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSaveParams +func (d *Domain) SaveParams(params DomainSaveRestoreParams, flags DomainSaveRestoreFlags) error { + info := getDomainSaveRestoreParametersFieldInfo(¶ms) + cparams, cnparams, gerr := typedParamsPackNew(info) + if gerr != nil { + return gerr + } + + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + + var err C.virError + result := C.virDomainSaveParamsWrapper(d.ptr, cparams, cnparams, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +type DomainGuestVcpus struct { + VcpusSet bool + Vcpus []bool + OnlineSet bool + Online []bool + OfflinableSet bool + Offlinable []bool +} + +func getDomainGuestVcpusParametersFieldInfo(vcpus *DomainGuestVcpus, Vcpus *string, Online *string, Offlinable *string) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + "vcpus": typedParamsFieldInfo{ + set: &vcpus.VcpusSet, + s: Vcpus, + }, + "online": typedParamsFieldInfo{ + set: &vcpus.OnlineSet, + s: Online, + }, + "offlinable": typedParamsFieldInfo{ + set: &vcpus.OfflinableSet, + s: Offlinable, + }, + } +} + +func parseCPUString(cpumapstr string) ([]bool, error) { + pieces := strings.Split(cpumapstr, ",") + var cpumap []bool + for _, piece := range pieces { + if len(piece) < 1 { + return []bool{}, fmt.Errorf("Malformed cpu map string %s", cpumapstr) + } + invert := false + if piece[0] == '^' { + invert = true + piece = piece[1:] + } + pair := strings.Split(piece, "-") + var start, end int + var err error + if len(pair) == 1 { + start, err = strconv.Atoi(pair[0]) + if err != nil { + return []bool{}, fmt.Errorf("Malformed cpu map string %s", cpumapstr) + } + end, err = strconv.Atoi(pair[0]) + if err != nil { + return []bool{}, fmt.Errorf("Malformed cpu map string %s", cpumapstr) + } + } else if len(pair) == 2 { + start, err = strconv.Atoi(pair[0]) + if err != nil { + return []bool{}, fmt.Errorf("Malformed cpu map string %s", cpumapstr) + } + end, err = strconv.Atoi(pair[1]) + if err != nil { + return []bool{}, fmt.Errorf("Malformed cpu map string %s", cpumapstr) + } + } else { + return []bool{}, fmt.Errorf("Malformed cpu map string %s", cpumapstr) + } + if start > end { + return []bool{}, fmt.Errorf("Malformed cpu map string %s", cpumapstr) + } + if (end + 1) > len(cpumap) { + newcpumap := make([]bool, end+1) + copy(newcpumap, cpumap) + cpumap = newcpumap + } + + for i := start; i <= end; i++ { + if invert { + cpumap[i] = false + } else { + cpumap[i] = true + } + } + } + + return cpumap, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetGuestVcpus +func (d *Domain) GetGuestVcpus(flags uint32) (*DomainGuestVcpus, error) { + vcpus := &DomainGuestVcpus{} + var VcpusStr, OnlineStr, OfflinableStr string + info := getDomainGuestVcpusParametersFieldInfo(vcpus, &VcpusStr, &OnlineStr, &OfflinableStr) + + var cparams C.virTypedParameterPtr + var cnparams C.uint + var err C.virError + ret := C.virDomainGetGuestVcpusWrapper(d.ptr, &cparams, &cnparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + defer C.virTypedParamsFreeWrapper(cparams, C.int(cnparams)) + + _, gerr := typedParamsUnpack(cparams, C.int(cnparams), info) + if gerr != nil { + return nil, gerr + } + + if vcpus.VcpusSet { + mask, gerr := parseCPUString(VcpusStr) + if gerr != nil { + return nil, gerr + } + vcpus.Vcpus = mask + } + if vcpus.OnlineSet { + mask, gerr := parseCPUString(OnlineStr) + if gerr != nil { + return nil, gerr + } + vcpus.Online = mask + } + if vcpus.OfflinableSet { + mask, gerr := parseCPUString(OfflinableStr) + if gerr != nil { + return nil, gerr + } + vcpus.Offlinable = mask + } + + return vcpus, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetGuestVcpus +func (d *Domain) SetGuestVcpus(cpus []bool, state bool, flags uint32) error { + cpumap := "" + for i := 0; i < len(cpus); i++ { + if cpus[i] { + if cpumap == "" { + cpumap = fmt.Sprintf("%d", i) + } else { + cpumap += "," + fmt.Sprintf("%d", i) + } + } + } + + var cstate C.int + if state { + cstate = 1 + } else { + cstate = 0 + } + ccpumap := C.CString(cpumap) + defer C.free(unsafe.Pointer(ccpumap)) + var err C.virError + ret := C.virDomainSetGuestVcpusWrapper(d.ptr, ccpumap, cstate, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetVcpu +func (d *Domain) SetVcpu(cpus []bool, state bool, flags uint32) error { + cpumap := "" + for i := 0; i < len(cpus); i++ { + if cpus[i] { + if cpumap == "" { + cpumap = fmt.Sprintf("%d", i) + } else { + cpumap += "," + fmt.Sprintf("%d", i) + } + } + } + + var cstate C.int + if state { + cstate = 1 + } else { + cstate = 0 + } + ccpumap := C.CString(cpumap) + defer C.free(unsafe.Pointer(ccpumap)) + var err C.virError + ret := C.virDomainSetVcpuWrapper(d.ptr, ccpumap, cstate, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetBlockThreshold +func (d *Domain) SetBlockThreshold(dev string, threshold uint64, flags uint32) error { + cdev := C.CString(dev) + defer C.free(unsafe.Pointer(cdev)) + var err C.virError + ret := C.virDomainSetBlockThresholdWrapper(d.ptr, cdev, C.ulonglong(threshold), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainManagedSaveDefineXML +func (d *Domain) ManagedSaveDefineXML(xml string, flags uint32) error { + cxml := C.CString(xml) + defer C.free(unsafe.Pointer(cxml)) + var err C.virError + ret := C.virDomainManagedSaveDefineXMLWrapper(d.ptr, cxml, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainManagedSaveGetXMLDesc +func (d *Domain) ManagedSaveGetXMLDesc(flags DomainSaveImageXMLFlags) (string, error) { + var err C.virError + ret := C.virDomainManagedSaveGetXMLDescWrapper(d.ptr, C.uint(flags), &err) + if ret == nil { + return "", makeError(&err) + } + + xml := C.GoString(ret) + C.free(unsafe.Pointer(ret)) + return xml, nil +} + +type DomainLifecycle int + +const ( + DOMAIN_LIFECYCLE_POWEROFF = DomainLifecycle(C.VIR_DOMAIN_LIFECYCLE_POWEROFF) + DOMAIN_LIFECYCLE_REBOOT = DomainLifecycle(C.VIR_DOMAIN_LIFECYCLE_REBOOT) + DOMAIN_LIFECYCLE_CRASH = DomainLifecycle(C.VIR_DOMAIN_LIFECYCLE_CRASH) +) + +type DomainLifecycleAction int + +const ( + DOMAIN_LIFECYCLE_ACTION_DESTROY = DomainLifecycleAction(C.VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY) + DOMAIN_LIFECYCLE_ACTION_RESTART = DomainLifecycleAction(C.VIR_DOMAIN_LIFECYCLE_ACTION_RESTART) + DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME = DomainLifecycleAction(C.VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME) + DOMAIN_LIFECYCLE_ACTION_PRESERVE = DomainLifecycleAction(C.VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE) + DOMAIN_LIFECYCLE_ACTION_COREDUMP_DESTROY = DomainLifecycleAction(C.VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_DESTROY) + DOMAIN_LIFECYCLE_ACTION_COREDUMP_RESTART = DomainLifecycleAction(C.VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_RESTART) +) + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetLifecycleAction +func (d *Domain) SetLifecycleAction(lifecycleType DomainLifecycle, action DomainLifecycleAction, flags uint32) error { + var err C.virError + ret := C.virDomainSetLifecycleActionWrapper(d.ptr, C.uint(lifecycleType), C.uint(action), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +type DomainLaunchSecurityParameters struct { + SEVMeasurementSet bool + SEVMeasurement string + SEVAPIMajorSet bool + SEVAPIMajor uint + SEVAPIMinorSet bool + SEVAPIMinor uint + SEVBuildIDSet bool + SEVBuildID uint + SEVPolicySet bool + SEVPolicy uint + SEVSNPPolicySet bool + SEVSNPPolicy uint64 +} + +func getDomainLaunchSecurityFieldInfo(params *DomainLaunchSecurityParameters) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_LAUNCH_SECURITY_SEV_MEASUREMENT: typedParamsFieldInfo{ + set: ¶ms.SEVMeasurementSet, + s: ¶ms.SEVMeasurement, + }, + C.VIR_DOMAIN_LAUNCH_SECURITY_SEV_API_MAJOR: typedParamsFieldInfo{ + set: ¶ms.SEVAPIMajorSet, + ui: ¶ms.SEVAPIMajor, + }, + C.VIR_DOMAIN_LAUNCH_SECURITY_SEV_API_MINOR: typedParamsFieldInfo{ + set: ¶ms.SEVAPIMinorSet, + ui: ¶ms.SEVAPIMinor, + }, + C.VIR_DOMAIN_LAUNCH_SECURITY_SEV_BUILD_ID: typedParamsFieldInfo{ + set: ¶ms.SEVBuildIDSet, + ui: ¶ms.SEVBuildID, + }, + C.VIR_DOMAIN_LAUNCH_SECURITY_SEV_POLICY: typedParamsFieldInfo{ + set: ¶ms.SEVPolicySet, + ui: ¶ms.SEVPolicy, + }, + C.VIR_DOMAIN_LAUNCH_SECURITY_SEV_SNP_POLICY: typedParamsFieldInfo{ + set: ¶ms.SEVSNPPolicySet, + ul: ¶ms.SEVSNPPolicy, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetLaunchSecurityInfo +func (d *Domain) GetLaunchSecurityInfo(flags uint32) (*DomainLaunchSecurityParameters, error) { + params := &DomainLaunchSecurityParameters{} + info := getDomainLaunchSecurityFieldInfo(params) + + var cparams *C.virTypedParameter + var cnparams C.int + + var err C.virError + ret := C.virDomainGetLaunchSecurityInfoWrapper(d.ptr, (*C.virTypedParameterPtr)(unsafe.Pointer(&cparams)), &cnparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + + _, gerr := typedParamsUnpack(cparams, cnparams, info) + if gerr != nil { + return nil, gerr + } + + return params, nil +} + +type DomainLaunchSecurityStateParameters struct { + SEVSecretSet bool + SEVSecret string + SEVSecretHeaderSet bool + SEVSecretHeader string + SEVSecretSetAddressSet bool + SEVSecretSetAddress uint64 +} + +func getDomainLaunchSecurityStateFieldInfo(params *DomainLaunchSecurityStateParameters) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_LAUNCH_SECURITY_SEV_SECRET: typedParamsFieldInfo{ + set: ¶ms.SEVSecretSet, + s: ¶ms.SEVSecret, + }, + C.VIR_DOMAIN_LAUNCH_SECURITY_SEV_SECRET_HEADER: typedParamsFieldInfo{ + set: ¶ms.SEVSecretHeaderSet, + s: ¶ms.SEVSecretHeader, + }, + C.VIR_DOMAIN_LAUNCH_SECURITY_SEV_SECRET_SET_ADDRESS: typedParamsFieldInfo{ + set: ¶ms.SEVSecretSetAddressSet, + ul: ¶ms.SEVSecretSetAddress, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetLaunchSecurityState +func (d *Domain) SetLaunchSecurityState(params *DomainLaunchSecurityStateParameters, flags uint32) error { + info := getDomainLaunchSecurityStateFieldInfo(params) + + cparams, cnparams, gerr := typedParamsPackNew(info) + if gerr != nil { + return gerr + } + + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + + var err C.virError + ret := C.virDomainSetLaunchSecurityStateWrapper(d.ptr, cparams, cnparams, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +type DomainGuestInfoUser struct { + NameSet bool + Name string + DomainSet bool + Domain string + LoginTimeSet bool + LoginTime uint64 +} + +func getDomainGuestInfoUserFieldInfo(idx int, params *DomainGuestInfoUser) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + fmt.Sprintf("user.%d.name", idx): typedParamsFieldInfo{ + set: ¶ms.NameSet, + s: ¶ms.Name, + }, + fmt.Sprintf("user.%d.domain", idx): typedParamsFieldInfo{ + set: ¶ms.DomainSet, + s: ¶ms.Domain, + }, + fmt.Sprintf("user.%d.logintime", idx): typedParamsFieldInfo{ + set: ¶ms.LoginTimeSet, + ul: ¶ms.LoginTime, + }, + } +} + +type DomainGuestInfoOS struct { + IDSet bool + ID string + NameSet bool + Name string + PrettyNameSet bool + PrettyName string + VersionSet bool + Version string + VersionIDSet bool + VersionID string + KernelReleaseSet bool + KernelRelease string + KernelVersionSet bool + KernelVersion string + MachineSet bool + Machine string + VariantSet bool + Variant string + VariantIDSet bool + VariantID string +} + +func getDomainGuestInfoOSFieldInfo(params *DomainGuestInfoOS) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + "os.id": typedParamsFieldInfo{ + set: ¶ms.IDSet, + s: ¶ms.ID, + }, + "os.name": typedParamsFieldInfo{ + set: ¶ms.NameSet, + s: ¶ms.Name, + }, + "os.pretty-name": typedParamsFieldInfo{ + set: ¶ms.PrettyNameSet, + s: ¶ms.PrettyName, + }, + "os.version": typedParamsFieldInfo{ + set: ¶ms.VersionSet, + s: ¶ms.Version, + }, + "os.version-id": typedParamsFieldInfo{ + set: ¶ms.VersionIDSet, + s: ¶ms.VersionID, + }, + "os.kernel-release": typedParamsFieldInfo{ + set: ¶ms.KernelReleaseSet, + s: ¶ms.KernelRelease, + }, + "os.kernel-version": typedParamsFieldInfo{ + set: ¶ms.KernelVersionSet, + s: ¶ms.KernelVersion, + }, + "os.machine": typedParamsFieldInfo{ + set: ¶ms.MachineSet, + s: ¶ms.Machine, + }, + "os.variant": typedParamsFieldInfo{ + set: ¶ms.VariantSet, + s: ¶ms.Variant, + }, + "os.variant-id": typedParamsFieldInfo{ + set: ¶ms.VariantIDSet, + s: ¶ms.VariantID, + }, + } +} + +type DomainGuestInfoTimeZone struct { + NameSet bool + Name string + OffsetSet bool + Offset int +} + +func getDomainGuestInfoTimeZoneFieldInfo(params *DomainGuestInfoTimeZone) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + "timezone.name": typedParamsFieldInfo{ + set: ¶ms.NameSet, + s: ¶ms.Name, + }, + "timezone.offset": typedParamsFieldInfo{ + set: ¶ms.OffsetSet, + i: ¶ms.Offset, + }, + } +} + +type DomainGuestInfoFileSystemDisk struct { + AliasSet bool + Alias string + SerialSet bool + Serial string + DeviceSet bool + Device string +} + +func getDomainGuestInfoFileSystemDiskFieldInfo(idx1, idx2 int, params *DomainGuestInfoFileSystemDisk) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + fmt.Sprintf("fs.%d.disk.%d.alias", idx1, idx2): typedParamsFieldInfo{ + set: ¶ms.AliasSet, + s: ¶ms.Alias, + }, + fmt.Sprintf("fs.%d.disk.%d.serial", idx1, idx2): typedParamsFieldInfo{ + set: ¶ms.SerialSet, + s: ¶ms.Serial, + }, + fmt.Sprintf("fs.%d.disk.%d.device", idx1, idx2): typedParamsFieldInfo{ + set: ¶ms.DeviceSet, + s: ¶ms.Device, + }, + } +} + +type DomainGuestInfoFileSystem struct { + MountPointSet bool + MountPoint string + NameSet bool + Name string + FSTypeSet bool + FSType string + TotalBytesSet bool + TotalBytes uint64 + UsedBytesSet bool + UsedBytes uint64 + Disks []DomainGuestInfoFileSystemDisk +} + +func getDomainGuestInfoFileSystemFieldInfo(idx int, params *DomainGuestInfoFileSystem) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + fmt.Sprintf("fs.%d.mountpoint", idx): typedParamsFieldInfo{ + set: ¶ms.MountPointSet, + s: ¶ms.MountPoint, + }, + fmt.Sprintf("fs.%d.name", idx): typedParamsFieldInfo{ + set: ¶ms.NameSet, + s: ¶ms.Name, + }, + fmt.Sprintf("fs.%d.fstype", idx): typedParamsFieldInfo{ + set: ¶ms.FSTypeSet, + s: ¶ms.FSType, + }, + fmt.Sprintf("fs.%d.total-bytes", idx): typedParamsFieldInfo{ + set: ¶ms.TotalBytesSet, + ul: ¶ms.TotalBytes, + }, + fmt.Sprintf("fs.%d.used-bytes", idx): typedParamsFieldInfo{ + set: ¶ms.UsedBytesSet, + ul: ¶ms.UsedBytes, + }, + } +} + +type domainGuestInfoFileSystemLengths struct { + DiskCountSet bool + DiskCount uint +} + +func getDomainGuestInfoFileSystemLengthsFieldInfo(idx int, params *domainGuestInfoFileSystemLengths) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + fmt.Sprintf("fs.%d.disk.count", idx): typedParamsFieldInfo{ + set: ¶ms.DiskCountSet, + ui: ¶ms.DiskCount, + }, + } +} + +type DomainGuestInfoDiskDependency struct { + NameSet bool + Name string +} + +func getDomainGuestInfoDiskDependencyFieldInfo(idx1, idx2 int, params *DomainGuestInfoDiskDependency) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + fmt.Sprintf("disk.%d.dependency.%d.name", idx1, idx2): typedParamsFieldInfo{ + set: ¶ms.NameSet, + s: ¶ms.Name, + }, + } +} + +type DomainGuestInfoDisk struct { + NameSet bool + Name string + PartitionSet bool + Partition bool + AliasSet bool + Alias string + GuestAliasSet bool + GuestAlias string + Dependencies []DomainGuestInfoDiskDependency +} + +func getDomainGuestInfoDiskFieldInfo(idx int, params *DomainGuestInfoDisk) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + fmt.Sprintf("disk.%d.name", idx): typedParamsFieldInfo{ + set: ¶ms.NameSet, + s: ¶ms.Name, + }, + fmt.Sprintf("disk.%d.partition", idx): typedParamsFieldInfo{ + set: ¶ms.PartitionSet, + b: ¶ms.Partition, + }, + fmt.Sprintf("disk.%d.alias", idx): typedParamsFieldInfo{ + set: ¶ms.AliasSet, + s: ¶ms.Alias, + }, + fmt.Sprintf("disk.%d.guest_alias", idx): typedParamsFieldInfo{ + set: ¶ms.GuestAliasSet, + s: ¶ms.GuestAlias, + }, + } +} + +type domainGuestInfoDiskLengths struct { + DependencyCountSet bool + DependencyCount uint +} + +func getDomainGuestInfoDiskLengthsFieldInfo(idx int, params *domainGuestInfoDiskLengths) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + fmt.Sprintf("disk.%d.dependency.count", idx): typedParamsFieldInfo{ + set: ¶ms.DependencyCountSet, + ui: ¶ms.DependencyCount, + }, + } +} + +type DomainGuestInfoIPAddress struct { + TypeSet bool + Type string + AddrSet bool + Addr string + PrefixSet bool + Prefix uint +} + +func getDomainGuestInfoIPAddressFieldInfo(idx1, idx2 int, params *DomainGuestInfoIPAddress) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + fmt.Sprintf("if.%d.addr.%d.type", idx1, idx2): typedParamsFieldInfo{ + set: ¶ms.TypeSet, + s: ¶ms.Type, + }, + fmt.Sprintf("if.%d.addr.%d.addr", idx1, idx2): typedParamsFieldInfo{ + set: ¶ms.AddrSet, + s: ¶ms.Addr, + }, + fmt.Sprintf("if.%d.addr.%d.prefix", idx1, idx2): typedParamsFieldInfo{ + set: ¶ms.PrefixSet, + ui: ¶ms.Prefix, + }, + } +} + +type DomainGuestInfoInterface struct { + NameSet bool + Name string + HwaddrSet bool + Hwaddr string + Addrs []DomainGuestInfoIPAddress +} + +func getDomainGuestInfoInterfaceFieldInfo(idx int, params *DomainGuestInfoInterface) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + fmt.Sprintf("if.%d.name", idx): typedParamsFieldInfo{ + set: ¶ms.NameSet, + s: ¶ms.Name, + }, + fmt.Sprintf("if.%d.hwaddr", idx): typedParamsFieldInfo{ + set: ¶ms.HwaddrSet, + s: ¶ms.Hwaddr, + }, + } +} + +type domainGuestInfoInterfaceLengths struct { + AddrCountSet bool + AddrCount uint +} + +func getDomainGuestInfoInterfaceLengthsFieldInfo(idx int, params *domainGuestInfoInterfaceLengths) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + fmt.Sprintf("if.%d.addr.count", idx): typedParamsFieldInfo{ + set: ¶ms.AddrCountSet, + ui: ¶ms.AddrCount, + }, + } +} + +type DomainGuestInfo struct { + Users []DomainGuestInfoUser + OS *DomainGuestInfoOS + TimeZone *DomainGuestInfoTimeZone + HostnameSet bool + Hostname string + FileSystems []DomainGuestInfoFileSystem + Disks []DomainGuestInfoDisk + Interfaces []DomainGuestInfoInterface +} + +func getDomainGuestInfoFieldInfo(params *DomainGuestInfo) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + "hostname": typedParamsFieldInfo{ + set: ¶ms.HostnameSet, + s: ¶ms.Hostname, + }, + } +} + +type domainGuestInfoLengths struct { + UserCountSet bool + UserCount uint + FileSystemCountSet bool + FileSystemCount uint + DiskCountSet bool + DiskCount uint + InterfaceCountSet bool + InterfaceCount uint +} + +func getDomainGuestInfoLengthsFieldInfo(params *domainGuestInfoLengths) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + "user.count": typedParamsFieldInfo{ + set: ¶ms.UserCountSet, + ui: ¶ms.UserCount, + }, + "fs.count": typedParamsFieldInfo{ + set: ¶ms.FileSystemCountSet, + ui: ¶ms.FileSystemCount, + }, + "disk.count": typedParamsFieldInfo{ + set: ¶ms.DiskCountSet, + ui: ¶ms.DiskCount, + }, + "if.count": typedParamsFieldInfo{ + set: ¶ms.InterfaceCountSet, + ui: ¶ms.InterfaceCount, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetGuestInfo +func (d *Domain) GetGuestInfo(types DomainGuestInfoTypes, flags uint32) (*DomainGuestInfo, error) { + var cparams *C.virTypedParameter + var cnparams C.int + + var err C.virError + ret := C.virDomainGetGuestInfoWrapper(d.ptr, C.uint(types), (*C.virTypedParameterPtr)(unsafe.Pointer(&cparams)), &cnparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + + info := DomainGuestInfo{} + infoInfo := getDomainGuestInfoFieldInfo(&info) + + _, gerr := typedParamsUnpack(cparams, cnparams, infoInfo) + if gerr != nil { + return nil, gerr + } + + lengths := domainGuestInfoLengths{} + lengthsInfo := getDomainGuestInfoLengthsFieldInfo(&lengths) + + _, gerr = typedParamsUnpack(cparams, cnparams, lengthsInfo) + if gerr != nil { + return nil, gerr + } + + if lengths.UserCountSet && lengths.UserCount > 0 { + info.Users = make([]DomainGuestInfoUser, lengths.UserCount) + for i := 0; i < int(lengths.UserCount); i++ { + usersInfo := getDomainGuestInfoUserFieldInfo(i, &info.Users[i]) + + _, gerr = typedParamsUnpack(cparams, cnparams, usersInfo) + if gerr != nil { + return nil, gerr + } + } + } + + info.OS = &DomainGuestInfoOS{} + osInfo := getDomainGuestInfoOSFieldInfo(info.OS) + + _, gerr = typedParamsUnpack(cparams, cnparams, osInfo) + if gerr != nil { + return nil, gerr + } + + info.TimeZone = &DomainGuestInfoTimeZone{} + timezoneInfo := getDomainGuestInfoTimeZoneFieldInfo(info.TimeZone) + + _, gerr = typedParamsUnpack(cparams, cnparams, timezoneInfo) + if gerr != nil { + return nil, gerr + } + + if lengths.FileSystemCountSet && lengths.FileSystemCount > 0 { + info.FileSystems = make([]DomainGuestInfoFileSystem, lengths.FileSystemCount) + for i := 0; i < int(lengths.FileSystemCount); i++ { + fsInfo := getDomainGuestInfoFileSystemFieldInfo(i, &info.FileSystems[i]) + + _, gerr = typedParamsUnpack(cparams, cnparams, fsInfo) + if gerr != nil { + return nil, gerr + } + + fsLengths := domainGuestInfoFileSystemLengths{} + fsLengthsInfo := getDomainGuestInfoFileSystemLengthsFieldInfo(i, &fsLengths) + + _, gerr = typedParamsUnpack(cparams, cnparams, fsLengthsInfo) + if gerr != nil { + return nil, gerr + } + + if fsLengths.DiskCountSet && fsLengths.DiskCount > 0 { + info.FileSystems[i].Disks = make([]DomainGuestInfoFileSystemDisk, fsLengths.DiskCount) + for j := 0; j < int(fsLengths.DiskCount); j++ { + diskInfo := getDomainGuestInfoFileSystemDiskFieldInfo(i, j, &info.FileSystems[i].Disks[j]) + + _, gerr = typedParamsUnpack(cparams, cnparams, diskInfo) + if gerr != nil { + return nil, gerr + } + } + } + } + } + + if lengths.DiskCountSet && lengths.DiskCount > 0 { + info.Disks = make([]DomainGuestInfoDisk, lengths.DiskCount) + for i := 0; i < int(lengths.DiskCount); i++ { + diskInfo := getDomainGuestInfoDiskFieldInfo(i, &info.Disks[i]) + + _, gerr = typedParamsUnpack(cparams, cnparams, diskInfo) + if gerr != nil { + return nil, gerr + } + + diskLengths := domainGuestInfoDiskLengths{} + diskLengthsInfo := getDomainGuestInfoDiskLengthsFieldInfo(i, &diskLengths) + + _, gerr = typedParamsUnpack(cparams, cnparams, diskLengthsInfo) + if gerr != nil { + return nil, gerr + } + + if diskLengths.DependencyCountSet && diskLengths.DependencyCount > 0 { + info.Disks[i].Dependencies = make([]DomainGuestInfoDiskDependency, diskLengths.DependencyCount) + for j := 0; j < int(diskLengths.DependencyCount); j++ { + diskInfoDep := getDomainGuestInfoDiskDependencyFieldInfo(i, j, &info.Disks[i].Dependencies[j]) + + _, gerr = typedParamsUnpack(cparams, cnparams, diskInfoDep) + if gerr != nil { + return nil, gerr + } + } + } + } + } + + if lengths.InterfaceCountSet && lengths.InterfaceCount > 0 { + info.Interfaces = make([]DomainGuestInfoInterface, lengths.InterfaceCount) + for i := 0; i < int(lengths.InterfaceCount); i++ { + interfaceInfo := getDomainGuestInfoInterfaceFieldInfo(i, &info.Interfaces[i]) + + _, gerr = typedParamsUnpack(cparams, cnparams, interfaceInfo) + if gerr != nil { + return nil, gerr + } + + interfaceLengths := domainGuestInfoInterfaceLengths{} + interfaceLengthsInfo := getDomainGuestInfoInterfaceLengthsFieldInfo(i, &interfaceLengths) + + _, gerr = typedParamsUnpack(cparams, cnparams, interfaceLengthsInfo) + if gerr != nil { + return nil, gerr + } + + if interfaceLengths.AddrCountSet && interfaceLengths.AddrCount > 0 { + info.Interfaces[i].Addrs = make([]DomainGuestInfoIPAddress, interfaceLengths.AddrCount) + for j := 0; j < int(interfaceLengths.AddrCount); j++ { + addrInfo := getDomainGuestInfoIPAddressFieldInfo(i, j, &info.Interfaces[i].Addrs[j]) + + _, gerr = typedParamsUnpack(cparams, cnparams, addrInfo) + if gerr != nil { + return nil, gerr + } + } + } + } + } + return &info, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainAgentSetResponseTimeout +func (d *Domain) AgentSetResponseTimeout(timeout int, flags uint32) error { + var err C.virError + ret := C.virDomainAgentSetResponseTimeoutWrapper(d.ptr, C.int(timeout), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBackupBegin +func (d *Domain) BackupBegin(backupXML string, checkpointXML string, flags DomainBackupBeginFlags) error { + cbackupXML := C.CString(backupXML) + defer C.free(unsafe.Pointer(cbackupXML)) + var ccheckpointXML *C.char + if checkpointXML != "" { + ccheckpointXML = C.CString(checkpointXML) + defer C.free(unsafe.Pointer(ccheckpointXML)) + } + var err C.virError + ret := C.virDomainBackupBeginWrapper(d.ptr, cbackupXML, ccheckpointXML, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBackupGetXMLDesc +func (d *Domain) BackupGetXMLDesc(flags uint32) (string, error) { + var err C.virError + ret := C.virDomainBackupGetXMLDescWrapper(d.ptr, C.uint(flags), &err) + if ret == nil { + return "", makeError(&err) + } + + xml := C.GoString(ret) + defer C.free(unsafe.Pointer(ret)) + + return xml, nil +} + +func (d *Domain) AuthorizedSSHKeysGet(user string, flags DomainAuthorizedSSHKeysFlags) ([]string, error) { + cuser := C.CString(user) + defer C.free(unsafe.Pointer(cuser)) + + var ckeys **C.char + var err C.virError + ret := C.virDomainAuthorizedSSHKeysGetWrapper(d.ptr, cuser, &ckeys, C.uint(flags), &err) + if ret == -1 { + return []string{}, makeError(&err) + } + + keys := make([]string, int(ret)) + for i := 0; i < int(ret); i++ { + cmodel := *(**C.char)(unsafe.Pointer(uintptr(unsafe.Pointer(ckeys)) + (unsafe.Sizeof(*ckeys) * uintptr(i)))) + + defer C.free(unsafe.Pointer(cmodel)) + keys[i] = C.GoString(cmodel) + } + defer C.free(unsafe.Pointer(ckeys)) + + return keys, nil +} + +func (d *Domain) AuthorizedSSHKeysSet(user string, keys []string, flags DomainAuthorizedSSHKeysFlags) error { + cuser := C.CString(user) + defer C.free(unsafe.Pointer(cuser)) + + ckeys := make([](*C.char), len(keys)) + + for i := 0; i < len(keys); i++ { + ckeys[i] = C.CString(keys[i]) + defer C.free(unsafe.Pointer(ckeys[i])) + } + + nkeys := len(keys) + var cKeysPtr **C.char = nil + if nkeys > 0 { + cKeysPtr = (**C.char)(unsafe.Pointer(&ckeys[0])) + } + + var err C.virError + ret := C.virDomainAuthorizedSSHKeysSetWrapper(d.ptr, cuser, cKeysPtr, C.uint(nkeys), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil + +} + +func (d *Domain) GetMessages(flags DomainMessageType) ([]string, error) { + var cmsgs **C.char + var err C.virError + ret := C.virDomainGetMessagesWrapper(d.ptr, &cmsgs, C.uint(flags), &err) + if ret == -1 { + return []string{}, makeError(&err) + } + + msgs := make([]string, int(ret)) + for i := 0; i < int(ret); i++ { + cmodel := *(**C.char)(unsafe.Pointer(uintptr(unsafe.Pointer(cmsgs)) + (unsafe.Sizeof(*cmsgs) * uintptr(i)))) + + defer C.free(unsafe.Pointer(cmodel)) + msgs[i] = C.GoString(cmodel) + } + defer C.free(unsafe.Pointer(cmsgs)) + + return msgs, nil +} + +func (d *Domain) StartDirtyRateCalc(secs int, flags DomainDirtyRateCalcFlags) error { + var err C.virError + ret := C.virDomainStartDirtyRateCalcWrapper(d.ptr, C.int(secs), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +func (d *Domain) FDAssociate(name string, files []os.File, flags DomainFDAssociateFlags) error { + nfiles := len(files) + cfiles := make([]C.int, nfiles) + for i := 0; i < nfiles; i++ { + cfiles[i] = C.int(files[i].Fd()) + } + cname := C.CString(name) + defer C.free(unsafe.Pointer(cname)) + var err C.virError + var cfilesPtr *C.int = nil + if nfiles > 0 { + cfilesPtr = &cfiles[0] + } + result := C.virDomainFDAssociateWrapper(d.ptr, cname, C.uint(nfiles), cfilesPtr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil + +} + +func (d *Domain) GraphicsReload(typ DomainGraphicsReloadType, flags uint32) error { + var err C.virError + ret := C.virDomainGraphicsReloadWrapper(d.ptr, C.uint(typ), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} diff --git a/vendor/libvirt.org/go/libvirt/domain_checkpoint.go b/vendor/libvirt.org/go/libvirt/domain_checkpoint.go new file mode 100644 index 000000000..192eeb9bc --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/domain_checkpoint.go @@ -0,0 +1,163 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016-2019 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include +#include "libvirt_generated.h" +*/ +import "C" + +import ( + "reflect" + "unsafe" +) + +type DomainCheckpointCreateFlags uint + +const ( + DOMAIN_CHECKPOINT_CREATE_REDEFINE = DomainCheckpointCreateFlags(C.VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE) + DOMAIN_CHECKPOINT_CREATE_QUIESCE = DomainCheckpointCreateFlags(C.VIR_DOMAIN_CHECKPOINT_CREATE_QUIESCE) + DOMAIN_CHECKPOINT_CREATE_REDEFINE_VALIDATE = DomainCheckpointCreateFlags(C.VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE_VALIDATE) +) + +type DomainCheckpointListFlags uint + +const ( + DOMAIN_CHECKPOINT_LIST_ROOTS = DomainCheckpointListFlags(C.VIR_DOMAIN_CHECKPOINT_LIST_ROOTS) + DOMAIN_CHECKPOINT_LIST_DESCENDANTS = DomainCheckpointListFlags(C.VIR_DOMAIN_CHECKPOINT_LIST_DESCENDANTS) + DOMAIN_CHECKPOINT_LIST_LEAVES = DomainCheckpointListFlags(C.VIR_DOMAIN_CHECKPOINT_LIST_LEAVES) + DOMAIN_CHECKPOINT_LIST_NO_LEAVES = DomainCheckpointListFlags(C.VIR_DOMAIN_CHECKPOINT_LIST_NO_LEAVES) + DOMAIN_CHECKPOINT_LIST_TOPOLOGICAL = DomainCheckpointListFlags(C.VIR_DOMAIN_CHECKPOINT_LIST_TOPOLOGICAL) +) + +type DomainCheckpointDeleteFlags uint + +const ( + DOMAIN_CHECKPOINT_DELETE_CHILDREN = DomainCheckpointDeleteFlags(C.VIR_DOMAIN_CHECKPOINT_DELETE_CHILDREN) + DOMAIN_CHECKPOINT_DELETE_METADATA_ONLY = DomainCheckpointDeleteFlags(C.VIR_DOMAIN_CHECKPOINT_DELETE_METADATA_ONLY) + DOMAIN_CHECKPOINT_DELETE_CHILDREN_ONLY = DomainCheckpointDeleteFlags(C.VIR_DOMAIN_CHECKPOINT_DELETE_CHILDREN_ONLY) +) + +type DomainCheckpointXMLFlags uint + +const ( + DOMAIN_CHECKPOINT_XML_SECURE = DomainCheckpointXMLFlags(C.VIR_DOMAIN_CHECKPOINT_XML_SECURE) + DOMAIN_CHECKPOINT_XML_NO_DOMAIN = DomainCheckpointXMLFlags(C.VIR_DOMAIN_CHECKPOINT_XML_NO_DOMAIN) + DOMAIN_CHECKPOINT_XML_SIZE = DomainCheckpointXMLFlags(C.VIR_DOMAIN_CHECKPOINT_XML_SIZE) +) + +type DomainCheckpoint struct { + ptr C.virDomainCheckpointPtr +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-checkpoint.html#virDomainCheckpointFree +func (s *DomainCheckpoint) Free() error { + var err C.virError + ret := C.virDomainCheckpointFreeWrapper(s.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-checkpoint.html#virDomainCheckpointRef +func (c *DomainCheckpoint) Ref() error { + var err C.virError + ret := C.virDomainCheckpointRefWrapper(c.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-checkpoint.html#virDomainCheckpointDelete +func (s *DomainCheckpoint) Delete(flags DomainCheckpointDeleteFlags) error { + var err C.virError + result := C.virDomainCheckpointDeleteWrapper(s.ptr, C.uint(flags), &err) + if result != 0 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-checkpoint.html#virDomainCheckpointGetXMLDesc +func (s *DomainCheckpoint) GetXMLDesc(flags DomainCheckpointXMLFlags) (string, error) { + var err C.virError + result := C.virDomainCheckpointGetXMLDescWrapper(s.ptr, C.uint(flags), &err) + if result == nil { + return "", makeError(&err) + } + xml := C.GoString(result) + C.free(unsafe.Pointer(result)) + return xml, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-checkpoint.html#virDomainCheckpointGetName +func (s *DomainCheckpoint) GetName() (string, error) { + var err C.virError + name := C.virDomainCheckpointGetNameWrapper(s.ptr, &err) + if name == nil { + return "", makeError(&err) + } + return C.GoString(name), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-checkpoint.html#virDomainCheckpointGetParent +func (s *DomainCheckpoint) GetParent(flags uint32) (*DomainCheckpoint, error) { + var err C.virError + ptr := C.virDomainCheckpointGetParentWrapper(s.ptr, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &DomainCheckpoint{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-checkpoint.html#virDomainCheckpointListAllChildren +func (d *DomainCheckpoint) ListAllChildren(flags DomainCheckpointListFlags) ([]DomainCheckpoint, error) { + var cList *C.virDomainCheckpointPtr + var err C.virError + numVols := C.virDomainCheckpointListAllChildrenWrapper(d.ptr, (**C.virDomainCheckpointPtr)(&cList), C.uint(flags), &err) + if numVols == -1 { + return nil, makeError(&err) + } + hdr := reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(cList)), + Len: int(numVols), + Cap: int(numVols), + } + var pools []DomainCheckpoint + slice := *(*[]C.virDomainCheckpointPtr)(unsafe.Pointer(&hdr)) + for _, ptr := range slice { + pools = append(pools, DomainCheckpoint{ptr}) + } + C.free(unsafe.Pointer(cList)) + return pools, nil +} diff --git a/vendor/libvirt.org/go/libvirt/domain_events.go b/vendor/libvirt.org/go/libvirt/domain_events.go new file mode 100644 index 000000000..9aadb3875 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/domain_events.go @@ -0,0 +1,1727 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +import ( + "fmt" + "unsafe" +) + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include "domain_events_helper.h" +*/ +import "C" + +type DomainEventGenericCallback func(c *Connect, d *Domain) + +type DomainEventLifecycle struct { + Event DomainEventType + // TODO: we can make Detail typesafe somehow ? + Detail int +} + +type DomainEventLifecycleCallback func(c *Connect, d *Domain, event *DomainEventLifecycle) + +type DomainEventRTCChange struct { + Utcoffset int64 +} + +type DomainEventRTCChangeCallback func(c *Connect, d *Domain, event *DomainEventRTCChange) + +type DomainEventWatchdog struct { + Action DomainEventWatchdogAction +} + +type DomainEventWatchdogCallback func(c *Connect, d *Domain, event *DomainEventWatchdog) + +type DomainEventIOError struct { + SrcPath string + DevAlias string + Action DomainEventIOErrorAction +} + +type DomainEventIOErrorCallback func(c *Connect, d *Domain, event *DomainEventIOError) + +type DomainEventGraphicsAddress struct { + Family DomainEventGraphicsAddressType + Node string + Service string +} + +type DomainEventGraphicsSubjectIdentity struct { + Type string + Name string +} + +type DomainEventGraphics struct { + Phase DomainEventGraphicsPhase + Local DomainEventGraphicsAddress + Remote DomainEventGraphicsAddress + AuthScheme string + Subject []DomainEventGraphicsSubjectIdentity +} + +type DomainEventGraphicsCallback func(c *Connect, d *Domain, event *DomainEventGraphics) + +type DomainEventIOErrorReason struct { + SrcPath string + DevAlias string + Action DomainEventIOErrorAction + Reason string +} + +type DomainEventIOErrorReasonCallback func(c *Connect, d *Domain, event *DomainEventIOErrorReason) + +type DomainEventBlockJob struct { + Disk string + Type DomainBlockJobType + Status ConnectDomainEventBlockJobStatus +} + +type DomainEventBlockJobCallback func(c *Connect, d *Domain, event *DomainEventBlockJob) + +type DomainEventDiskChange struct { + OldSrcPath string + NewSrcPath string + DevAlias string + Reason ConnectDomainEventDiskChangeReason +} + +type DomainEventDiskChangeCallback func(c *Connect, d *Domain, event *DomainEventDiskChange) + +type DomainEventTrayChange struct { + DevAlias string + Reason ConnectDomainEventTrayChangeReason +} + +type DomainEventTrayChangeCallback func(c *Connect, d *Domain, event *DomainEventTrayChange) + +type DomainEventPMSuspend struct { + Reason int +} + +type DomainEventPMSuspendCallback func(c *Connect, d *Domain, event *DomainEventPMSuspend) + +type DomainEventPMWakeup struct { + Reason int +} + +type DomainEventPMWakeupCallback func(c *Connect, d *Domain, event *DomainEventPMWakeup) + +type DomainEventPMSuspendDisk struct { + Reason int +} + +type DomainEventPMSuspendDiskCallback func(c *Connect, d *Domain, event *DomainEventPMSuspendDisk) + +type DomainEventBalloonChange struct { + Actual uint64 +} + +type DomainEventBalloonChangeCallback func(c *Connect, d *Domain, event *DomainEventBalloonChange) + +type DomainEventDeviceRemoved struct { + DevAlias string +} + +type DomainEventDeviceRemovedCallback func(c *Connect, d *Domain, event *DomainEventDeviceRemoved) + +type DomainEventTunableCpuPin struct { + VcpuPinSet bool + VcpuPin [][]bool + EmulatorPinSet bool + EmulatorPin []bool + IOThreadPinSet bool + IOThreadPin [][]bool +} + +type DomainEventTunable struct { + CpuSched *DomainSchedulerParameters + CpuPin *DomainEventTunableCpuPin + BlkdevDiskSet bool + BlkdevDisk string + BlkdevTune *DomainBlockIoTuneParameters +} + +type DomainEventTunableCallback func(c *Connect, d *Domain, event *DomainEventTunable) + +type DomainEventAgentLifecycle struct { + State ConnectDomainEventAgentLifecycleState + Reason ConnectDomainEventAgentLifecycleReason +} + +type DomainEventAgentLifecycleCallback func(c *Connect, d *Domain, event *DomainEventAgentLifecycle) + +type DomainEventDeviceAdded struct { + DevAlias string +} + +type DomainEventDeviceAddedCallback func(c *Connect, d *Domain, event *DomainEventDeviceAdded) + +type DomainEventMigrationIteration struct { + Iteration int +} + +type DomainEventMigrationIterationCallback func(c *Connect, d *Domain, event *DomainEventMigrationIteration) + +type DomainEventJobCompleted struct { + Info DomainJobInfo +} + +type DomainEventJobCompletedCallback func(c *Connect, d *Domain, event *DomainEventJobCompleted) + +type DomainEventDeviceRemovalFailed struct { + DevAlias string +} + +type DomainEventDeviceRemovalFailedCallback func(c *Connect, d *Domain, event *DomainEventDeviceRemovalFailed) + +type DomainEventMetadataChange struct { + Type DomainMetadataType + NSURI string +} + +type DomainEventMetadataChangeCallback func(c *Connect, d *Domain, event *DomainEventMetadataChange) + +type DomainEventBlockThreshold struct { + Dev string + Path string + Threshold uint64 + Excess uint64 +} + +type DomainEventBlockThresholdCallback func(c *Connect, d *Domain, event *DomainEventBlockThreshold) + +type DomainEventMemoryFailure struct { + Recipient DomainMemoryFailureRecipientType + Action DomainMemoryFailureActionType + Flags DomainMemoryFailureFlags +} + +type DomainEventMemoryFailureCallback func(c *Connect, d *Domain, event *DomainEventMemoryFailure) + +type DomainEventMemoryDeviceSizeChange struct { + Alias string + Size uint64 + Flags uint +} + +type DomainEventMemoryDeviceSizeChangeCallback func(c *Connect, d *Domain, event *DomainEventMemoryDeviceSizeChange) + +//export domainEventLifecycleCallback +func domainEventLifecycleCallback(c C.virConnectPtr, d C.virDomainPtr, + event int, detail int, + goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventLifecycle{ + Event: DomainEventType(event), + Detail: detail, + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventLifecycleCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) +} + +//export domainEventGenericCallback +func domainEventGenericCallback(c C.virConnectPtr, d C.virDomainPtr, + goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventGenericCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain) +} + +//export domainEventRTCChangeCallback +func domainEventRTCChangeCallback(c C.virConnectPtr, d C.virDomainPtr, + utcoffset int64, goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventRTCChange{ + Utcoffset: utcoffset, + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventRTCChangeCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventWatchdogCallback +func domainEventWatchdogCallback(c C.virConnectPtr, d C.virDomainPtr, + action int, goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventWatchdog{ + Action: DomainEventWatchdogAction(action), + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventWatchdogCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventIOErrorCallback +func domainEventIOErrorCallback(c C.virConnectPtr, d C.virDomainPtr, + srcPath *C.char, devAlias *C.char, action int, goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventIOError{ + SrcPath: C.GoString(srcPath), + DevAlias: C.GoString(devAlias), + Action: DomainEventIOErrorAction(action), + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventIOErrorCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventGraphicsCallback +func domainEventGraphicsCallback(c C.virConnectPtr, d C.virDomainPtr, + phase int, + local C.virDomainEventGraphicsAddressPtr, + remote C.virDomainEventGraphicsAddressPtr, + authScheme *C.char, + subject C.virDomainEventGraphicsSubjectPtr, + goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + subjectGo := make([]DomainEventGraphicsSubjectIdentity, 0) + for i := 0; i < int(subject.nidentity); i++ { + cidentity := *(**C.virDomainEventGraphicsSubjectIdentity)(unsafe.Pointer(uintptr(unsafe.Pointer(subject.identities)) + (unsafe.Sizeof(*subject.identities) * uintptr(i)))) + subjectGo = append(subjectGo, + DomainEventGraphicsSubjectIdentity{ + Type: C.GoString(cidentity._type), + Name: C.GoString(cidentity.name), + }, + ) + } + + eventDetails := &DomainEventGraphics{ + Phase: DomainEventGraphicsPhase(phase), + Local: DomainEventGraphicsAddress{ + Family: DomainEventGraphicsAddressType(local.family), + Node: C.GoString(local.node), + Service: C.GoString(local.service), + }, + Remote: DomainEventGraphicsAddress{ + Family: DomainEventGraphicsAddressType(remote.family), + Node: C.GoString(remote.node), + Service: C.GoString(remote.service), + }, + AuthScheme: C.GoString(authScheme), + Subject: subjectGo, + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventGraphicsCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventIOErrorReasonCallback +func domainEventIOErrorReasonCallback(c C.virConnectPtr, d C.virDomainPtr, + srcPath *C.char, devAlias *C.char, action int, reason *C.char, + goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventIOErrorReason{ + SrcPath: C.GoString(srcPath), + DevAlias: C.GoString(devAlias), + Action: DomainEventIOErrorAction(action), + Reason: C.GoString(reason), + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventIOErrorReasonCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventBlockJobCallback +func domainEventBlockJobCallback(c C.virConnectPtr, d C.virDomainPtr, + disk *C.char, _type int, status int, goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventBlockJob{ + Disk: C.GoString(disk), + Type: DomainBlockJobType(_type), + Status: ConnectDomainEventBlockJobStatus(status), + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventBlockJobCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventDiskChangeCallback +func domainEventDiskChangeCallback(c C.virConnectPtr, d C.virDomainPtr, + oldSrcPath *C.char, newSrcPath *C.char, devAlias *C.char, + reason int, goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventDiskChange{ + OldSrcPath: C.GoString(oldSrcPath), + NewSrcPath: C.GoString(newSrcPath), + DevAlias: C.GoString(devAlias), + Reason: ConnectDomainEventDiskChangeReason(reason), + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventDiskChangeCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventTrayChangeCallback +func domainEventTrayChangeCallback(c C.virConnectPtr, d C.virDomainPtr, + devAlias *C.char, reason int, goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventTrayChange{ + DevAlias: C.GoString(devAlias), + Reason: ConnectDomainEventTrayChangeReason(reason), + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventTrayChangeCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventPMSuspendCallback +func domainEventPMSuspendCallback(c C.virConnectPtr, d C.virDomainPtr, + reason int, goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventPMSuspend{ + Reason: reason, + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventPMSuspendCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventPMWakeupCallback +func domainEventPMWakeupCallback(c C.virConnectPtr, d C.virDomainPtr, + reason int, goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventPMWakeup{ + Reason: reason, + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventPMWakeupCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventPMSuspendDiskCallback +func domainEventPMSuspendDiskCallback(c C.virConnectPtr, d C.virDomainPtr, + reason int, goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventPMSuspendDisk{ + Reason: reason, + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventPMSuspendDiskCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventBalloonChangeCallback +func domainEventBalloonChangeCallback(c C.virConnectPtr, d C.virDomainPtr, + actual uint64, goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventBalloonChange{ + Actual: actual, + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventBalloonChangeCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventDeviceRemovedCallback +func domainEventDeviceRemovedCallback(c C.virConnectPtr, d C.virDomainPtr, + devAlias *C.char, goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventDeviceRemoved{ + DevAlias: C.GoString(devAlias), + } + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventDeviceRemovedCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventMetadataChangeCallback +func domainEventMetadataChangeCallback(c C.virConnectPtr, d C.virDomainPtr, + mtype int, nsuri *C.char, goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventMetadataChange{ + Type: DomainMetadataType(mtype), + NSURI: C.GoString(nsuri), + } + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventMetadataChangeCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +func getDomainTuneSchedulerParametersFieldInfo(params *DomainSchedulerParameters) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_TUNABLE_CPU_CPU_SHARES: typedParamsFieldInfo{ + set: ¶ms.CpuSharesSet, + ul: ¶ms.CpuShares, + }, + C.VIR_DOMAIN_TUNABLE_CPU_GLOBAL_PERIOD: typedParamsFieldInfo{ + set: ¶ms.GlobalPeriodSet, + ul: ¶ms.GlobalPeriod, + }, + C.VIR_DOMAIN_TUNABLE_CPU_GLOBAL_QUOTA: typedParamsFieldInfo{ + set: ¶ms.GlobalQuotaSet, + l: ¶ms.GlobalQuota, + }, + C.VIR_DOMAIN_TUNABLE_CPU_EMULATOR_PERIOD: typedParamsFieldInfo{ + set: ¶ms.EmulatorPeriodSet, + ul: ¶ms.EmulatorPeriod, + }, + C.VIR_DOMAIN_TUNABLE_CPU_EMULATOR_QUOTA: typedParamsFieldInfo{ + set: ¶ms.EmulatorQuotaSet, + l: ¶ms.EmulatorQuota, + }, + C.VIR_DOMAIN_TUNABLE_CPU_VCPU_PERIOD: typedParamsFieldInfo{ + set: ¶ms.VcpuPeriodSet, + ul: ¶ms.VcpuPeriod, + }, + C.VIR_DOMAIN_TUNABLE_CPU_VCPU_QUOTA: typedParamsFieldInfo{ + set: ¶ms.VcpuQuotaSet, + l: ¶ms.VcpuQuota, + }, + C.VIR_DOMAIN_TUNABLE_CPU_IOTHREAD_PERIOD: typedParamsFieldInfo{ + set: ¶ms.IothreadPeriodSet, + ul: ¶ms.IothreadPeriod, + }, + C.VIR_DOMAIN_TUNABLE_CPU_IOTHREAD_QUOTA: typedParamsFieldInfo{ + set: ¶ms.IothreadQuotaSet, + l: ¶ms.IothreadQuota, + }, + } +} + +func getTuneBlockIoTuneParametersFieldInfo(params *DomainBlockIoTuneParameters) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC: typedParamsFieldInfo{ + set: ¶ms.TotalBytesSecSet, + ul: ¶ms.TotalBytesSec, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC: typedParamsFieldInfo{ + set: ¶ms.ReadBytesSecSet, + ul: ¶ms.ReadBytesSec, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC: typedParamsFieldInfo{ + set: ¶ms.WriteBytesSecSet, + ul: ¶ms.WriteBytesSec, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC: typedParamsFieldInfo{ + set: ¶ms.TotalIopsSecSet, + ul: ¶ms.TotalIopsSec, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC: typedParamsFieldInfo{ + set: ¶ms.ReadIopsSecSet, + ul: ¶ms.ReadIopsSec, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC: typedParamsFieldInfo{ + set: ¶ms.WriteIopsSecSet, + ul: ¶ms.WriteIopsSec, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC_MAX: typedParamsFieldInfo{ + set: ¶ms.TotalBytesSecMaxSet, + ul: ¶ms.TotalBytesSecMax, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC_MAX: typedParamsFieldInfo{ + set: ¶ms.ReadBytesSecMaxSet, + ul: ¶ms.ReadBytesSecMax, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC_MAX: typedParamsFieldInfo{ + set: ¶ms.WriteBytesSecMaxSet, + ul: ¶ms.WriteBytesSecMax, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC_MAX: typedParamsFieldInfo{ + set: ¶ms.TotalIopsSecMaxSet, + ul: ¶ms.TotalIopsSecMax, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC_MAX: typedParamsFieldInfo{ + set: ¶ms.ReadIopsSecMaxSet, + ul: ¶ms.ReadIopsSecMax, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC_MAX: typedParamsFieldInfo{ + set: ¶ms.WriteIopsSecMaxSet, + ul: ¶ms.WriteIopsSecMax, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC_MAX_LENGTH: typedParamsFieldInfo{ + set: ¶ms.TotalBytesSecMaxLengthSet, + ul: ¶ms.TotalBytesSecMaxLength, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC_MAX_LENGTH: typedParamsFieldInfo{ + set: ¶ms.ReadBytesSecMaxLengthSet, + ul: ¶ms.ReadBytesSecMaxLength, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC_MAX_LENGTH: typedParamsFieldInfo{ + set: ¶ms.WriteBytesSecMaxLengthSet, + ul: ¶ms.WriteBytesSecMaxLength, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC_MAX_LENGTH: typedParamsFieldInfo{ + set: ¶ms.TotalIopsSecMaxLengthSet, + ul: ¶ms.TotalIopsSecMaxLength, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC_MAX_LENGTH: typedParamsFieldInfo{ + set: ¶ms.ReadIopsSecMaxLengthSet, + ul: ¶ms.ReadIopsSecMaxLength, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC_MAX_LENGTH: typedParamsFieldInfo{ + set: ¶ms.WriteIopsSecMaxLengthSet, + ul: ¶ms.WriteIopsSecMaxLength, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_SIZE_IOPS_SEC: typedParamsFieldInfo{ + set: ¶ms.SizeIopsSecSet, + ul: ¶ms.SizeIopsSec, + }, + C.VIR_DOMAIN_TUNABLE_BLKDEV_GROUP_NAME: typedParamsFieldInfo{ + set: ¶ms.GroupNameSet, + s: ¶ms.GroupName, + }, + } +} + +type domainEventTunablePinTemp struct { + VcpuPinSet bool + VcpuPin []string + EmulatorPinSet bool + EmulatorPin string + IOThreadPinSet bool + IOThreadPin []string +} + +func getDomainPinTempFieldInfo(numvcpu int, numiothread int, params *domainEventTunablePinTemp) map[string]typedParamsFieldInfo { + ret := map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_TUNABLE_CPU_EMULATORPIN: typedParamsFieldInfo{ + set: ¶ms.EmulatorPinSet, + s: ¶ms.EmulatorPin, + }, + } + for i := 0; i < numvcpu; i++ { + ret[fmt.Sprintf("cputune.vcpupin%d", i)] = typedParamsFieldInfo{ + s: ¶ms.VcpuPin[i], + } + } + for i := 0; i < numiothread; i++ { + ret[fmt.Sprintf("cputune.iothreadpin%d", i)] = typedParamsFieldInfo{ + s: ¶ms.IOThreadPin[i], + } + } + + return ret +} + +func countPinInfo(cparams C.virTypedParameterPtr, nparams C.int) (int, int) { + maxvcpus := 0 + maxiothreads := 0 + for i := 0; i < int(nparams); i++ { + var cparam *C.virTypedParameter + cparam = (*C.virTypedParameter)(unsafe.Pointer(uintptr(unsafe.Pointer(cparams)) + unsafe.Sizeof(*cparam)*uintptr(i))) + name := C.GoString((*C.char)(unsafe.Pointer(&cparam.field))) + + var vcpu int + _, err := fmt.Scanf(name, "cputune.vcpupin%d", &vcpu) + if err == nil { + if vcpu > maxvcpus { + maxvcpus = vcpu + } + } + + var iothread int + _, err = fmt.Scanf(name, "cputune.iothreadpin%d", &iothread) + if err == nil { + if iothread > maxiothreads { + maxiothreads = iothread + } + } + } + + return maxvcpus + 1, maxiothreads + 1 +} + +func domainEventTunableGetPin(params C.virTypedParameterPtr, cnparams C.int) *DomainEventTunableCpuPin { + var pin domainEventTunablePinTemp + numvcpus, numiothreads := countPinInfo(params, cnparams) + pinInfo := getDomainPinTempFieldInfo(numvcpus, numiothreads, &pin) + + num, err := typedParamsUnpack(params, cnparams, pinInfo) + if num == 0 || err != nil { + return nil + } + + info := &DomainEventTunableCpuPin{} + + if pin.VcpuPinSet { + info.VcpuPinSet = true + info.VcpuPin = make([][]bool, len(pin.VcpuPin)) + + for i := 0; i < len(pin.VcpuPin); i++ { + bits, err := parseCPUString(pin.VcpuPin[i]) + if err == nil { + info.VcpuPin[i] = bits + } + } + } + + if pin.EmulatorPinSet { + bits, err := parseCPUString(pin.EmulatorPin) + if err == nil { + info.EmulatorPinSet = true + info.EmulatorPin = bits + } + } + + if pin.IOThreadPinSet { + info.IOThreadPinSet = true + info.IOThreadPin = make([][]bool, len(pin.IOThreadPin)) + + for i := 0; i < len(pin.IOThreadPin); i++ { + bits, err := parseCPUString(pin.IOThreadPin[i]) + if err == nil { + info.IOThreadPin[i] = bits + } + } + } + + return info +} + +//export domainEventTunableCallback +func domainEventTunableCallback(c C.virConnectPtr, d C.virDomainPtr, params C.virTypedParameterPtr, cnparams C.int, goCallbackId int) { + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventTunable{} + + pin := domainEventTunableGetPin(params, cnparams) + if pin != nil { + eventDetails.CpuPin = pin + } + + var sched DomainSchedulerParameters + schedInfo := getDomainTuneSchedulerParametersFieldInfo(&sched) + + num, _ := typedParamsUnpack(params, cnparams, schedInfo) + if num > 0 { + eventDetails.CpuSched = &sched + } + + blknameInfo := map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_TUNABLE_BLKDEV_DISK: typedParamsFieldInfo{ + set: &eventDetails.BlkdevDiskSet, + s: &eventDetails.BlkdevDisk, + }, + } + typedParamsUnpack(params, cnparams, blknameInfo) + + var blktune DomainBlockIoTuneParameters + blktuneInfo := getTuneBlockIoTuneParametersFieldInfo(&blktune) + + num, _ = typedParamsUnpack(params, cnparams, blktuneInfo) + if num > 0 { + eventDetails.BlkdevTune = &blktune + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventTunableCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventAgentLifecycleCallback +func domainEventAgentLifecycleCallback(c C.virConnectPtr, d C.virDomainPtr, state C.int, reason C.int, goCallbackId int) { + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventAgentLifecycle{ + State: ConnectDomainEventAgentLifecycleState(state), + Reason: ConnectDomainEventAgentLifecycleReason(reason), + } + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventAgentLifecycleCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventDeviceAddedCallback +func domainEventDeviceAddedCallback(c C.virConnectPtr, d C.virDomainPtr, devalias *C.char, goCallbackId int) { + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventDeviceAdded{ + DevAlias: C.GoString(devalias), + } + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventDeviceAddedCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventMigrationIterationCallback +func domainEventMigrationIterationCallback(c C.virConnectPtr, d C.virDomainPtr, iteration C.int, goCallbackId int) { + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventMigrationIteration{ + Iteration: int(iteration), + } + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventMigrationIterationCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventJobCompletedCallback +func domainEventJobCompletedCallback(c C.virConnectPtr, d C.virDomainPtr, params C.virTypedParameterPtr, cnparams C.int, goCallbackId int) { + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventJobCompleted{} + info := getDomainJobInfoFieldInfo(&eventDetails.Info) + + typedParamsUnpack(params, cnparams, info) + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventJobCompletedCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventDeviceRemovalFailedCallback +func domainEventDeviceRemovalFailedCallback(c C.virConnectPtr, d C.virDomainPtr, devalias *C.char, goCallbackId int) { + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventDeviceRemovalFailed{ + DevAlias: C.GoString(devalias), + } + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventDeviceRemovalFailedCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventBlockThresholdCallback +func domainEventBlockThresholdCallback(c C.virConnectPtr, d C.virDomainPtr, dev *C.char, path *C.char, threshold C.ulonglong, excess C.ulonglong, goCallbackId int) { + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventBlockThreshold{ + Dev: C.GoString(dev), + Path: C.GoString(path), + Threshold: uint64(threshold), + Excess: uint64(excess), + } + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventBlockThresholdCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventMemoryFailureCallback +func domainEventMemoryFailureCallback(c C.virConnectPtr, d C.virDomainPtr, recipient C.int, action C.int, flags C.uint, goCallbackId int) { + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventMemoryFailure{ + Recipient: DomainMemoryFailureRecipientType(recipient), + Action: DomainMemoryFailureActionType(action), + Flags: DomainMemoryFailureFlags(flags), + } + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventMemoryFailureCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +//export domainEventMemoryDeviceSizeChangeCallback +func domainEventMemoryDeviceSizeChangeCallback(c C.virConnectPtr, d C.virDomainPtr, alias *C.char, size C.ulonglong, goCallbackId int) { + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainEventMemoryDeviceSizeChange{ + Alias: C.GoString(alias), + Size: uint64(size), + } + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainEventMemoryDeviceSizeChangeCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +func (c *Connect) DomainEventLifecycleRegister(dom *Domain, callback DomainEventLifecycleCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventLifecycleCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyHelper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_LIFECYCLE, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventRebootRegister(dom *Domain, callback DomainEventGenericCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventGenericCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyHelper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_REBOOT, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventRTCChangeRegister(dom *Domain, callback DomainEventRTCChangeCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventRTCChangeCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyHelper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_RTC_CHANGE, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventWatchdogRegister(dom *Domain, callback DomainEventWatchdogCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventWatchdogCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyHelper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_WATCHDOG, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventIOErrorRegister(dom *Domain, callback DomainEventIOErrorCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventIOErrorCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyHelper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_IO_ERROR, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventGraphicsRegister(dom *Domain, callback DomainEventGraphicsCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventGraphicsCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyHelper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_GRAPHICS, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventIOErrorReasonRegister(dom *Domain, callback DomainEventIOErrorReasonCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventIOErrorReasonCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyHelper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventControlErrorRegister(dom *Domain, callback DomainEventGenericCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventGenericCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyHelper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_CONTROL_ERROR, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventBlockJobRegister(dom *Domain, callback DomainEventBlockJobCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventBlockJobCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyHelper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_BLOCK_JOB, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventDiskChangeRegister(dom *Domain, callback DomainEventDiskChangeCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventDiskChangeCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyHelper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_DISK_CHANGE, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventTrayChangeRegister(dom *Domain, callback DomainEventTrayChangeCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventTrayChangeCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyHelper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_TRAY_CHANGE, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventPMWakeupRegister(dom *Domain, callback DomainEventPMWakeupCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventPMWakeupCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyHelper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_PMWAKEUP, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventPMSuspendRegister(dom *Domain, callback DomainEventPMSuspendCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventPMSuspendCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyHelper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_PMSUSPEND, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventBalloonChangeRegister(dom *Domain, callback DomainEventBalloonChangeCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventBalloonChangeCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyHelper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventPMSuspendDiskRegister(dom *Domain, callback DomainEventPMSuspendDiskCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventPMSuspendDiskCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyHelper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_PMSUSPEND_DISK, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventDeviceRemovedRegister(dom *Domain, callback DomainEventDeviceRemovedCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventDeviceRemovedCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyHelper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventBlockJob2Register(dom *Domain, callback DomainEventBlockJobCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventBlockJobCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyHelper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventTunableRegister(dom *Domain, callback DomainEventTunableCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventTunableCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyHelper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_TUNABLE, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventAgentLifecycleRegister(dom *Domain, callback DomainEventAgentLifecycleCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventAgentLifecycleCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyHelper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_AGENT_LIFECYCLE, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventDeviceAddedRegister(dom *Domain, callback DomainEventDeviceAddedCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventDeviceAddedCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyHelper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_DEVICE_ADDED, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventMigrationIterationRegister(dom *Domain, callback DomainEventMigrationIterationCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventMigrationIterationCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyHelper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_MIGRATION_ITERATION, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventJobCompletedRegister(dom *Domain, callback DomainEventJobCompletedCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventJobCompletedCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyHelper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_JOB_COMPLETED, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventDeviceRemovalFailedRegister(dom *Domain, callback DomainEventDeviceRemovalFailedCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventDeviceRemovalFailedCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyHelper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventMetadataChangeRegister(dom *Domain, callback DomainEventMetadataChangeCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventMetadataChangeCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyHelper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_METADATA_CHANGE, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventBlockThresholdRegister(dom *Domain, callback DomainEventBlockThresholdCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventBlockThresholdCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyHelper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventMemoryFailureRegister(dom *Domain, callback DomainEventMemoryFailureCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventMemoryFailureCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyHelper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_MEMORY_FAILURE, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventMemoryDeviceSizeChangeRegister(dom *Domain, callback DomainEventMemoryDeviceSizeChangeCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.domainEventMemoryDeviceSizeChangeCallbackHelper) + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainEventRegisterAnyHelper(c.ptr, cdom, + C.VIR_DOMAIN_EVENT_ID_MEMORY_DEVICE_SIZE_CHANGE, + C.virConnectDomainEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) DomainEventDeregister(callbackId int) error { + // Deregister the callback + var err C.virError + ret := int(C.virConnectDomainEventDeregisterAnyWrapper(c.ptr, C.int(callbackId), &err)) + if ret < 0 { + return makeError(&err) + } + return nil +} + +func (e DomainEventLifecycle) String() string { + var detail, event string + switch e.Event { + case DOMAIN_EVENT_DEFINED: + event = "defined" + switch DomainEventDefinedDetailType(e.Detail) { + case DOMAIN_EVENT_DEFINED_ADDED: + detail = "added" + case DOMAIN_EVENT_DEFINED_UPDATED: + detail = "updated" + default: + detail = "unknown" + } + + case DOMAIN_EVENT_UNDEFINED: + event = "undefined" + switch DomainEventUndefinedDetailType(e.Detail) { + case DOMAIN_EVENT_UNDEFINED_REMOVED: + detail = "removed" + default: + detail = "unknown" + } + + case DOMAIN_EVENT_STARTED: + event = "started" + switch DomainEventStartedDetailType(e.Detail) { + case DOMAIN_EVENT_STARTED_BOOTED: + detail = "booted" + case DOMAIN_EVENT_STARTED_MIGRATED: + detail = "migrated" + case DOMAIN_EVENT_STARTED_RESTORED: + detail = "restored" + case DOMAIN_EVENT_STARTED_FROM_SNAPSHOT: + detail = "snapshot" + default: + detail = "unknown" + } + + case DOMAIN_EVENT_SUSPENDED: + event = "suspended" + switch DomainEventSuspendedDetailType(e.Detail) { + case DOMAIN_EVENT_SUSPENDED_PAUSED: + detail = "paused" + case DOMAIN_EVENT_SUSPENDED_MIGRATED: + detail = "migrated" + case DOMAIN_EVENT_SUSPENDED_IOERROR: + detail = "I/O error" + case DOMAIN_EVENT_SUSPENDED_WATCHDOG: + detail = "watchdog" + case DOMAIN_EVENT_SUSPENDED_RESTORED: + detail = "restored" + case DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT: + detail = "snapshot" + default: + detail = "unknown" + } + + case DOMAIN_EVENT_RESUMED: + event = "resumed" + switch DomainEventResumedDetailType(e.Detail) { + case DOMAIN_EVENT_RESUMED_UNPAUSED: + detail = "unpaused" + case DOMAIN_EVENT_RESUMED_MIGRATED: + detail = "migrated" + case DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT: + detail = "snapshot" + default: + detail = "unknown" + } + + case DOMAIN_EVENT_STOPPED: + event = "stopped" + switch DomainEventStoppedDetailType(e.Detail) { + case DOMAIN_EVENT_STOPPED_SHUTDOWN: + detail = "shutdown" + case DOMAIN_EVENT_STOPPED_DESTROYED: + detail = "destroyed" + case DOMAIN_EVENT_STOPPED_CRASHED: + detail = "crashed" + case DOMAIN_EVENT_STOPPED_MIGRATED: + detail = "migrated" + case DOMAIN_EVENT_STOPPED_SAVED: + detail = "saved" + case DOMAIN_EVENT_STOPPED_FAILED: + detail = "failed" + case DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT: + detail = "snapshot" + default: + detail = "unknown" + } + + case DOMAIN_EVENT_SHUTDOWN: + event = "shutdown" + switch DomainEventShutdownDetailType(e.Detail) { + case DOMAIN_EVENT_SHUTDOWN_FINISHED: + detail = "finished" + default: + detail = "unknown" + } + + default: + event = "unknown" + } + + return fmt.Sprintf("Domain event=%q detail=%q", event, detail) +} + +func (e DomainEventRTCChange) String() string { + return fmt.Sprintf("RTC change offset=%d", e.Utcoffset) +} + +func (e DomainEventWatchdog) String() string { + return fmt.Sprintf("Watchdog action=%d", e.Action) +} + +func (e DomainEventIOError) String() string { + return fmt.Sprintf("I/O error path=%q alias=%q action=%d", + e.SrcPath, e.DevAlias, e.Action) +} + +func (e DomainEventGraphics) String() string { + var phase string + switch e.Phase { + case DOMAIN_EVENT_GRAPHICS_CONNECT: + phase = "connected" + case DOMAIN_EVENT_GRAPHICS_INITIALIZE: + phase = "initialized" + case DOMAIN_EVENT_GRAPHICS_DISCONNECT: + phase = "disconnected" + default: + phase = "unknown" + } + + return fmt.Sprintf("Graphics phase=%q", phase) +} + +func (e DomainEventIOErrorReason) String() string { + return fmt.Sprintf("IO error path=%q alias=%q action=%d reason=%q", + e.SrcPath, e.DevAlias, e.Action, e.Reason) +} + +func (e DomainEventBlockJob) String() string { + return fmt.Sprintf("Block job disk=%q status=%d type=%d", + e.Disk, e.Status, e.Type) +} + +func (e DomainEventDiskChange) String() string { + return fmt.Sprintf("Disk change old=%q new=%q alias=%q reason=%d", + e.OldSrcPath, e.NewSrcPath, e.DevAlias, e.Reason) +} + +func (e DomainEventTrayChange) String() string { + return fmt.Sprintf("Tray change dev=%q reason=%d", + e.DevAlias, e.Reason) +} + +func (e DomainEventBalloonChange) String() string { + return fmt.Sprintf("Ballon change %d", e.Actual) +} + +func (e DomainEventDeviceRemoved) String() string { + return fmt.Sprintf("Device %q removed ", e.DevAlias) +} diff --git a/vendor/libvirt.org/go/libvirt/domain_events_helper.go b/vendor/libvirt.org/go/libvirt/domain_events_helper.go new file mode 100644 index 000000000..3e3948eb4 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/domain_events_helper.go @@ -0,0 +1,290 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include +#include "domain_events_helper.h" +#include "callbacks_helper.h" + +extern void domainEventLifecycleCallback(virConnectPtr, virDomainPtr, int, int, int); +void domainEventLifecycleCallbackHelper(virConnectPtr conn, virDomainPtr dom, + int event, int detail, void *data) +{ + domainEventLifecycleCallback(conn, dom, event, detail, (int)(intptr_t)data); +} + + +extern void domainEventGenericCallback(virConnectPtr, virDomainPtr, int); +void domainEventGenericCallbackHelper(virConnectPtr conn, virDomainPtr dom, void *data) +{ + domainEventGenericCallback(conn, dom, (int)(intptr_t)data); +} + + +extern void domainEventRTCChangeCallback(virConnectPtr, virDomainPtr, long long, int); +void domainEventRTCChangeCallbackHelper(virConnectPtr conn, virDomainPtr dom, + long long utcoffset, void *data) +{ + domainEventRTCChangeCallback(conn, dom, utcoffset, (int)(intptr_t)data); +} + + +extern void domainEventWatchdogCallback(virConnectPtr, virDomainPtr, int, int); +void domainEventWatchdogCallbackHelper(virConnectPtr conn, virDomainPtr dom, + int action, void *data) +{ + domainEventWatchdogCallback(conn, dom, action, (int)(intptr_t)data); +} + + +extern void domainEventIOErrorCallback(virConnectPtr, virDomainPtr, const char *, const char *, int, int); +void domainEventIOErrorCallbackHelper(virConnectPtr conn, virDomainPtr dom, + const char *srcPath, const char *devAlias, + int action, void *data) +{ + domainEventIOErrorCallback(conn, dom, srcPath, devAlias, action, (int)(intptr_t)data); +} + + +extern void domainEventGraphicsCallback(virConnectPtr, virDomainPtr, int, const virDomainEventGraphicsAddress *, + const virDomainEventGraphicsAddress *, const char *, + const virDomainEventGraphicsSubject *, int); +void domainEventGraphicsCallbackHelper(virConnectPtr conn, virDomainPtr dom, + int phase, const virDomainEventGraphicsAddress *local, + const virDomainEventGraphicsAddress *remote, + const char *authScheme, + const virDomainEventGraphicsSubject *subject, void *data) +{ + domainEventGraphicsCallback(conn, dom, phase, local, remote, authScheme, subject, (int)(intptr_t)data); +} + + +extern void domainEventIOErrorReasonCallback(virConnectPtr, virDomainPtr, const char *, const char *, + int, const char *, int); +void domainEventIOErrorReasonCallbackHelper(virConnectPtr conn, virDomainPtr dom, + const char *srcPath, const char *devAlias, + int action, const char *reason, void *data) +{ + domainEventIOErrorReasonCallback(conn, dom, srcPath, devAlias, action, reason, (int)(intptr_t)data); +} + + +extern void domainEventBlockJobCallback(virConnectPtr, virDomainPtr, const char *, int, int, int); +void domainEventBlockJobCallbackHelper(virConnectPtr conn, virDomainPtr dom, + const char *disk, int type, int status, void *data) +{ + domainEventBlockJobCallback(conn, dom, disk, type, status, (int)(intptr_t)data); +} + + +extern void domainEventDiskChangeCallback(virConnectPtr, virDomainPtr, const char *, const char *, + const char *, int, int); +void domainEventDiskChangeCallbackHelper(virConnectPtr conn, virDomainPtr dom, + const char *oldSrcPath, const char *newSrcPath, + const char *devAlias, int reason, void *data) +{ + domainEventDiskChangeCallback(conn, dom, oldSrcPath, newSrcPath, devAlias, reason, (int)(intptr_t)data); +} + + +extern void domainEventTrayChangeCallback(virConnectPtr, virDomainPtr, const char *, int, int); +void domainEventTrayChangeCallbackHelper(virConnectPtr conn, virDomainPtr dom, + const char *devAlias, int reason, void *data) +{ + domainEventTrayChangeCallback(conn, dom, devAlias, reason, (int)(intptr_t)data); +} + + +extern void domainEventPMSuspendCallback(virConnectPtr, virDomainPtr, int, int); +void domainEventPMSuspendCallbackHelper(virConnectPtr conn, virDomainPtr dom, + int reason, void *data) +{ + domainEventPMSuspendCallback(conn, dom, reason, (int)(intptr_t)data); +} + + +extern void domainEventPMWakeupCallback(virConnectPtr, virDomainPtr, int, int); +void domainEventPMWakeupCallbackHelper(virConnectPtr conn, virDomainPtr dom, + int reason, void *data) +{ + domainEventPMWakeupCallback(conn, dom, reason, (int)(intptr_t)data); +} + + +extern void domainEventPMSuspendDiskCallback(virConnectPtr, virDomainPtr, int, int); +void domainEventPMSuspendDiskCallbackHelper(virConnectPtr conn, virDomainPtr dom, + int reason, void *data) +{ + domainEventPMSuspendDiskCallback(conn, dom, reason, (int)(intptr_t)data); +} + + +extern void domainEventBalloonChangeCallback(virConnectPtr, virDomainPtr, unsigned long long, int); +void domainEventBalloonChangeCallbackHelper(virConnectPtr conn, virDomainPtr dom, + unsigned long long actual, void *data) +{ + domainEventBalloonChangeCallback(conn, dom, actual, (int)(intptr_t)data); +} + + +extern void domainEventDeviceRemovedCallback(virConnectPtr, virDomainPtr, const char *, int); +void domainEventDeviceRemovedCallbackHelper(virConnectPtr conn, virDomainPtr dom, + const char *devAlias, void *data) +{ + domainEventDeviceRemovedCallback(conn, dom, devAlias, (int)(intptr_t)data); +} + + +extern void domainEventTunableCallback(virConnectPtr, virDomainPtr, virTypedParameterPtr, int, int); +void domainEventTunableCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + virTypedParameterPtr params, + int nparams, + void *opaque) +{ + domainEventTunableCallback(conn, dom, params, nparams, (int)(intptr_t)opaque); +} + + +extern void domainEventAgentLifecycleCallback(virConnectPtr, virDomainPtr, int, int, int); +void domainEventAgentLifecycleCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + int state, + int reason, + void *opaque) +{ + domainEventAgentLifecycleCallback(conn, dom, state, reason, (int)(intptr_t)opaque); +} + + +extern void domainEventDeviceAddedCallback(virConnectPtr, virDomainPtr, const char *, int); +void domainEventDeviceAddedCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + const char *devAlias, + void *opaque) +{ + domainEventDeviceAddedCallback(conn, dom, devAlias, (int)(intptr_t)opaque); +} + + +extern void domainEventMigrationIterationCallback(virConnectPtr, virDomainPtr, int, int); +void domainEventMigrationIterationCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + int iteration, + void *opaque) +{ + domainEventMigrationIterationCallback(conn, dom, iteration, (int)(intptr_t)opaque); +} + + +extern void domainEventJobCompletedCallback(virConnectPtr, virDomainPtr, virTypedParameterPtr, int, int); +void domainEventJobCompletedCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + virTypedParameterPtr params, + int nparams, + void *opaque) +{ + domainEventJobCompletedCallback(conn, dom, params, nparams, (int)(intptr_t)opaque); +} + + +extern void domainEventDeviceRemovalFailedCallback(virConnectPtr, virDomainPtr, const char *, int); +void domainEventDeviceRemovalFailedCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + const char *devAlias, + void *opaque) +{ + domainEventDeviceRemovalFailedCallback(conn, dom, devAlias, (int)(intptr_t)opaque); +} + + +extern void domainEventMetadataChangeCallback(virConnectPtr, virDomainPtr, int, const char *, int); +void domainEventMetadataChangeCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + int type, + const char *nsuri, + void *opaque) +{ + domainEventMetadataChangeCallback(conn, dom, type, nsuri, (int)(intptr_t)opaque); +} + + +extern void domainEventBlockThresholdCallback(virConnectPtr, virDomainPtr, const char *, const char *, unsigned long long, unsigned long long, int); +void domainEventBlockThresholdCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + const char *dev, + const char *path, + unsigned long long threshold, + unsigned long long excess, + void *opaque) +{ + domainEventBlockThresholdCallback(conn, dom, dev, path, threshold, excess, (int)(intptr_t)opaque); +} + + +extern void domainEventMemoryFailureCallback(virConnectPtr, virDomainPtr, int, int, unsigned int, int); +void domainEventMemoryFailureCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + int recipient, + int action, + unsigned int flags, + void *opaque) +{ + domainEventMemoryFailureCallback(conn, dom, recipient, action, flags, (int)(intptr_t)opaque); +} + +extern void domainEventMemoryDeviceSizeChangeCallback(virConnectPtr, virDomainPtr, const char *, unsigned long long, int); +void domainEventMemoryDeviceSizeChangeCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + const char *alias, + unsigned long long size, + void *opaque) +{ + domainEventMemoryDeviceSizeChangeCallback(conn, dom, alias, size, (int)(intptr_t)opaque); +} + + +int +virConnectDomainEventRegisterAnyHelper(virConnectPtr conn, + virDomainPtr dom, + int eventID, + virConnectDomainEventGenericCallback cb, + long goCallbackId, + virErrorPtr err) +{ + void *id = (void *)goCallbackId; + return virConnectDomainEventRegisterAnyWrapper(conn, dom, eventID, cb, id, + freeGoCallbackHelper, err); +} + + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/domain_events_helper.h b/vendor/libvirt.org/go/libvirt/domain_events_helper.h new file mode 100644 index 000000000..c6272e3da --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/domain_events_helper.h @@ -0,0 +1,242 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_DOMAIN_EVENTS_HELPER_H__ +#define LIBVIRT_GO_DOMAIN_EVENTS_HELPER_H__ + +#include "libvirt_generated.h" + + +void +domainEventLifecycleCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + int event, + int detail, + void *data); + + +void +domainEventGenericCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + void *data); + + +void +domainEventRTCChangeCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + long long utcoffset, + void *data); + + +void +domainEventWatchdogCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + int action, + void *data); + + +void +domainEventIOErrorCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + const char *srcPath, + const char *devAlias, + int action, + void *data); + + +void +domainEventGraphicsCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + int phase, + const virDomainEventGraphicsAddress *local, + const virDomainEventGraphicsAddress *remote, + const char *authScheme, + const virDomainEventGraphicsSubject *subject, + void *data); + + +void +domainEventIOErrorReasonCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + const char *srcPath, + const char *devAlias, + int action, + const char *reason, + void *data); + + +void +domainEventBlockJobCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + const char *disk, + int type, + int status, + void *data); + + +void +domainEventDiskChangeCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + const char *oldSrcPath, + const char *newSrcPath, + const char *devAlias, + int reason, + void *data); + + +void +domainEventTrayChangeCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + const char *devAlias, + int reason, + void *data); + + +void +domainEventPMSuspendCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + int reason, + void *data); + + +void +domainEventPMWakeupCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + int reason, + void *data); + + +void +domainEventPMSuspendDiskCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + int reason, + void *data); + + +void +domainEventBalloonChangeCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + unsigned long long actual, + void *data); + + +void +domainEventDeviceRemovedCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + const char *devAlias, + void *data); + + +void +domainEventTunableCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + virTypedParameterPtr params, + int nparams, + void *opaque); + + +void +domainEventAgentLifecycleCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + int state, + int reason, + void *opaque); + + +void +domainEventDeviceAddedCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + const char *devAlias, + void *opaque); + + +void +domainEventMigrationIterationCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + int iteration, + void *opaque); + + +void +domainEventJobCompletedCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + virTypedParameterPtr params, + int nparams, + void *opaque); + + +void +domainEventDeviceRemovalFailedCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + const char *devAlias, + void *opaque); + + +void +domainEventMetadataChangeCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + int type, + const char *nsuri, + void *opaque); + + +void +domainEventBlockThresholdCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + const char *dev, + const char *path, + unsigned long long threshold, + unsigned long long excess, + void *opaque); + + +void +domainEventMemoryFailureCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + int recipient, + int action, + unsigned int flags, + void *opaque); + + +void +domainEventMemoryDeviceSizeChangeCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + const char *alias, + unsigned long long size, + void *opaque); + + +int +virConnectDomainEventRegisterAnyHelper(virConnectPtr conn, + virDomainPtr dom, + int eventID, + virConnectDomainEventGenericCallback cb, + long goCallbackId, + virErrorPtr err); + + +#endif /* LIBVIRT_GO_DOMAIN_EVENTS_HELPER_H__ */ diff --git a/vendor/libvirt.org/go/libvirt/domain_snapshot.go b/vendor/libvirt.org/go/libvirt/domain_snapshot.go new file mode 100644 index 000000000..e63bae904 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/domain_snapshot.go @@ -0,0 +1,251 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include +#include "libvirt_generated.h" +*/ +import "C" + +import ( + "reflect" + "unsafe" +) + +type DomainSnapshotCreateFlags uint + +const ( + DOMAIN_SNAPSHOT_CREATE_REDEFINE = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE) + DOMAIN_SNAPSHOT_CREATE_CURRENT = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT) + DOMAIN_SNAPSHOT_CREATE_NO_METADATA = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA) + DOMAIN_SNAPSHOT_CREATE_HALT = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_HALT) + DOMAIN_SNAPSHOT_CREATE_DISK_ONLY = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY) + DOMAIN_SNAPSHOT_CREATE_REUSE_EXT = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT) + DOMAIN_SNAPSHOT_CREATE_QUIESCE = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE) + DOMAIN_SNAPSHOT_CREATE_ATOMIC = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC) + DOMAIN_SNAPSHOT_CREATE_LIVE = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_LIVE) + DOMAIN_SNAPSHOT_CREATE_VALIDATE = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_VALIDATE) +) + +type DomainSnapshotListFlags uint + +const ( + DOMAIN_SNAPSHOT_LIST_ROOTS = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_ROOTS) + DOMAIN_SNAPSHOT_LIST_DESCENDANTS = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS) + DOMAIN_SNAPSHOT_LIST_LEAVES = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_LEAVES) + DOMAIN_SNAPSHOT_LIST_NO_LEAVES = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_NO_LEAVES) + DOMAIN_SNAPSHOT_LIST_METADATA = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_METADATA) + DOMAIN_SNAPSHOT_LIST_NO_METADATA = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_NO_METADATA) + DOMAIN_SNAPSHOT_LIST_INACTIVE = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_INACTIVE) + DOMAIN_SNAPSHOT_LIST_ACTIVE = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_ACTIVE) + DOMAIN_SNAPSHOT_LIST_DISK_ONLY = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_DISK_ONLY) + DOMAIN_SNAPSHOT_LIST_INTERNAL = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_INTERNAL) + DOMAIN_SNAPSHOT_LIST_EXTERNAL = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_EXTERNAL) + DOMAIN_SNAPSHOT_LIST_TOPOLOGICAL = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_TOPOLOGICAL) +) + +type DomainSnapshotRevertFlags uint + +const ( + DOMAIN_SNAPSHOT_REVERT_RUNNING = DomainSnapshotRevertFlags(C.VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING) + DOMAIN_SNAPSHOT_REVERT_PAUSED = DomainSnapshotRevertFlags(C.VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED) + DOMAIN_SNAPSHOT_REVERT_FORCE = DomainSnapshotRevertFlags(C.VIR_DOMAIN_SNAPSHOT_REVERT_FORCE) + DOMAIN_SNAPSHOT_REVERT_RESET_NVRAM = DomainSnapshotRevertFlags(C.VIR_DOMAIN_SNAPSHOT_REVERT_RESET_NVRAM) +) + +type DomainSnapshotDeleteFlags uint + +const ( + DOMAIN_SNAPSHOT_DELETE_CHILDREN = DomainSnapshotDeleteFlags(C.VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN) + DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY = DomainSnapshotDeleteFlags(C.VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY) + DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY = DomainSnapshotDeleteFlags(C.VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY) +) + +type DomainSnapshotXMLFlags uint + +const ( + DOMAIN_SNAPSHOT_XML_SECURE = DomainSnapshotXMLFlags(C.VIR_DOMAIN_SNAPSHOT_XML_SECURE) +) + +type DomainSnapshot struct { + ptr C.virDomainSnapshotPtr +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotFree +func (s *DomainSnapshot) Free() error { + var err C.virError + ret := C.virDomainSnapshotFreeWrapper(s.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotRef +func (c *DomainSnapshot) Ref() error { + var err C.virError + ret := C.virDomainSnapshotRefWrapper(c.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotDelete +func (s *DomainSnapshot) Delete(flags DomainSnapshotDeleteFlags) error { + var err C.virError + result := C.virDomainSnapshotDeleteWrapper(s.ptr, C.uint(flags), &err) + if result != 0 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainRevertToSnapshot +func (s *DomainSnapshot) RevertToSnapshot(flags DomainSnapshotRevertFlags) error { + var err C.virError + result := C.virDomainRevertToSnapshotWrapper(s.ptr, C.uint(flags), &err) + if result != 0 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotIsCurrent +func (s *DomainSnapshot) IsCurrent(flags uint32) (bool, error) { + var err C.virError + result := C.virDomainSnapshotIsCurrentWrapper(s.ptr, C.uint(flags), &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotHasMetadata +func (s *DomainSnapshot) HasMetadata(flags uint32) (bool, error) { + var err C.virError + result := C.virDomainSnapshotHasMetadataWrapper(s.ptr, C.uint(flags), &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotGetXMLDesc +func (s *DomainSnapshot) GetXMLDesc(flags DomainSnapshotXMLFlags) (string, error) { + var err C.virError + result := C.virDomainSnapshotGetXMLDescWrapper(s.ptr, C.uint(flags), &err) + if result == nil { + return "", makeError(&err) + } + xml := C.GoString(result) + C.free(unsafe.Pointer(result)) + return xml, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotGetName +func (s *DomainSnapshot) GetName() (string, error) { + var err C.virError + name := C.virDomainSnapshotGetNameWrapper(s.ptr, &err) + if name == nil { + return "", makeError(&err) + } + return C.GoString(name), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotGetParent +func (s *DomainSnapshot) GetParent(flags uint32) (*DomainSnapshot, error) { + var err C.virError + ptr := C.virDomainSnapshotGetParentWrapper(s.ptr, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &DomainSnapshot{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotNumChildren +func (s *DomainSnapshot) NumChildren(flags DomainSnapshotListFlags) (int, error) { + var err C.virError + result := int(C.virDomainSnapshotNumChildrenWrapper(s.ptr, C.uint(flags), &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotListChildrenNames +func (s *DomainSnapshot) ListChildrenNames(flags DomainSnapshotListFlags) ([]string, error) { + const maxNames = 1024 + var names [maxNames](*C.char) + namesPtr := unsafe.Pointer(&names) + var err C.virError + numNames := C.virDomainSnapshotListChildrenNamesWrapper( + s.ptr, + (**C.char)(namesPtr), + maxNames, C.uint(flags), &err) + if numNames == -1 { + return nil, makeError(&err) + } + goNames := make([]string, numNames) + for k := 0; k < int(numNames); k++ { + goNames[k] = C.GoString(names[k]) + C.free(unsafe.Pointer(names[k])) + } + return goNames, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-domain-snapshot.html#virDomainSnapshotListAllChildren +func (d *DomainSnapshot) ListAllChildren(flags DomainSnapshotListFlags) ([]DomainSnapshot, error) { + var cList *C.virDomainSnapshotPtr + var err C.virError + numVols := C.virDomainSnapshotListAllChildrenWrapper(d.ptr, (**C.virDomainSnapshotPtr)(&cList), C.uint(flags), &err) + if numVols == -1 { + return nil, makeError(&err) + } + hdr := reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(cList)), + Len: int(numVols), + Cap: int(numVols), + } + var pools []DomainSnapshot + slice := *(*[]C.virDomainSnapshotPtr)(unsafe.Pointer(&hdr)) + for _, ptr := range slice { + pools = append(pools, DomainSnapshot{ptr}) + } + C.free(unsafe.Pointer(cList)) + return pools, nil +} diff --git a/vendor/libvirt.org/go/libvirt/error.go b/vendor/libvirt.org/go/libvirt/error.go new file mode 100644 index 000000000..f420d794a --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/error.go @@ -0,0 +1,652 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include "libvirt_generated.h" + +void ignoreErrorFunc(void *userData, virErrorPtr error) { + // no-op +} +*/ +import "C" + +import ( + "fmt" +) + +func init() { + C.virSetErrorFuncWrapper(nil, (C.virErrorFunc)(C.ignoreErrorFunc)) +} + +type ErrorLevel int + +const ( + ERR_NONE = ErrorLevel(C.VIR_ERR_NONE) + ERR_WARNING = ErrorLevel(C.VIR_ERR_WARNING) + ERR_ERROR = ErrorLevel(C.VIR_ERR_ERROR) +) + +type ErrorNumber int + +func (err ErrorNumber) Error() string { + return fmt.Sprintf("virErrCode(%d)", err) +} + +const ( + ERR_OK = ErrorNumber(C.VIR_ERR_OK) + + // internal error + ERR_INTERNAL_ERROR = ErrorNumber(C.VIR_ERR_INTERNAL_ERROR) + + // memory allocation failure + ERR_NO_MEMORY = ErrorNumber(C.VIR_ERR_NO_MEMORY) + + // no support for this function + ERR_NO_SUPPORT = ErrorNumber(C.VIR_ERR_NO_SUPPORT) + + // could not resolve hostname + ERR_UNKNOWN_HOST = ErrorNumber(C.VIR_ERR_UNKNOWN_HOST) + + // can't connect to hypervisor + ERR_NO_CONNECT = ErrorNumber(C.VIR_ERR_NO_CONNECT) + + // invalid connection object + ERR_INVALID_CONN = ErrorNumber(C.VIR_ERR_INVALID_CONN) + + // invalid domain object + ERR_INVALID_DOMAIN = ErrorNumber(C.VIR_ERR_INVALID_DOMAIN) + + // invalid function argument + ERR_INVALID_ARG = ErrorNumber(C.VIR_ERR_INVALID_ARG) + + // a command to hypervisor failed + ERR_OPERATION_FAILED = ErrorNumber(C.VIR_ERR_OPERATION_FAILED) + + // a HTTP GET command to failed + ERR_GET_FAILED = ErrorNumber(C.VIR_ERR_GET_FAILED) + + // a HTTP POST command to failed + ERR_POST_FAILED = ErrorNumber(C.VIR_ERR_POST_FAILED) + + // unexpected HTTP error code + ERR_HTTP_ERROR = ErrorNumber(C.VIR_ERR_HTTP_ERROR) + + // failure to serialize an S-Expr + ERR_SEXPR_SERIAL = ErrorNumber(C.VIR_ERR_SEXPR_SERIAL) + + // could not open Xen hypervisor control + ERR_NO_XEN = ErrorNumber(C.VIR_ERR_NO_XEN) + + // failure doing an hypervisor call + ERR_XEN_CALL = ErrorNumber(C.VIR_ERR_XEN_CALL) + + // unknown OS type + ERR_OS_TYPE = ErrorNumber(C.VIR_ERR_OS_TYPE) + + // missing kernel information + ERR_NO_KERNEL = ErrorNumber(C.VIR_ERR_NO_KERNEL) + + // missing root device information + ERR_NO_ROOT = ErrorNumber(C.VIR_ERR_NO_ROOT) + + // missing source device information + ERR_NO_SOURCE = ErrorNumber(C.VIR_ERR_NO_SOURCE) + + // missing target device information + ERR_NO_TARGET = ErrorNumber(C.VIR_ERR_NO_TARGET) + + // missing domain name information + ERR_NO_NAME = ErrorNumber(C.VIR_ERR_NO_NAME) + + // missing domain OS information + ERR_NO_OS = ErrorNumber(C.VIR_ERR_NO_OS) + + // missing domain devices information + ERR_NO_DEVICE = ErrorNumber(C.VIR_ERR_NO_DEVICE) + + // could not open Xen Store control + ERR_NO_XENSTORE = ErrorNumber(C.VIR_ERR_NO_XENSTORE) + + // too many drivers registered + ERR_DRIVER_FULL = ErrorNumber(C.VIR_ERR_DRIVER_FULL) + + // not supported by the drivers (DEPRECATED) + ERR_CALL_FAILED = ErrorNumber(C.VIR_ERR_CALL_FAILED) + + // an XML description is not well formed or broken + ERR_XML_ERROR = ErrorNumber(C.VIR_ERR_XML_ERROR) + + // the domain already exist + ERR_DOM_EXIST = ErrorNumber(C.VIR_ERR_DOM_EXIST) + + // operation forbidden on read-only connections + ERR_OPERATION_DENIED = ErrorNumber(C.VIR_ERR_OPERATION_DENIED) + + // failed to open a conf file + ERR_OPEN_FAILED = ErrorNumber(C.VIR_ERR_OPEN_FAILED) + + // failed to read a conf file + ERR_READ_FAILED = ErrorNumber(C.VIR_ERR_READ_FAILED) + + // failed to parse a conf file + ERR_PARSE_FAILED = ErrorNumber(C.VIR_ERR_PARSE_FAILED) + + // failed to parse the syntax of a conf file + ERR_CONF_SYNTAX = ErrorNumber(C.VIR_ERR_CONF_SYNTAX) + + // failed to write a conf file + ERR_WRITE_FAILED = ErrorNumber(C.VIR_ERR_WRITE_FAILED) + + // detail of an XML error + ERR_XML_DETAIL = ErrorNumber(C.VIR_ERR_XML_DETAIL) + + // invalid network object + ERR_INVALID_NETWORK = ErrorNumber(C.VIR_ERR_INVALID_NETWORK) + + // the network already exist + ERR_NETWORK_EXIST = ErrorNumber(C.VIR_ERR_NETWORK_EXIST) + + // general system call failure + ERR_SYSTEM_ERROR = ErrorNumber(C.VIR_ERR_SYSTEM_ERROR) + + // some sort of RPC error + ERR_RPC = ErrorNumber(C.VIR_ERR_RPC) + + // error from a GNUTLS call + ERR_GNUTLS_ERROR = ErrorNumber(C.VIR_ERR_GNUTLS_ERROR) + + // failed to start network + WAR_NO_NETWORK = ErrorNumber(C.VIR_WAR_NO_NETWORK) + + // domain not found or unexpectedly disappeared + ERR_NO_DOMAIN = ErrorNumber(C.VIR_ERR_NO_DOMAIN) + + // network not found + ERR_NO_NETWORK = ErrorNumber(C.VIR_ERR_NO_NETWORK) + + // invalid MAC address + ERR_INVALID_MAC = ErrorNumber(C.VIR_ERR_INVALID_MAC) + + // authentication failed + ERR_AUTH_FAILED = ErrorNumber(C.VIR_ERR_AUTH_FAILED) + + // invalid storage pool object + ERR_INVALID_STORAGE_POOL = ErrorNumber(C.VIR_ERR_INVALID_STORAGE_POOL) + + // invalid storage vol object + ERR_INVALID_STORAGE_VOL = ErrorNumber(C.VIR_ERR_INVALID_STORAGE_VOL) + + // failed to start storage + WAR_NO_STORAGE = ErrorNumber(C.VIR_WAR_NO_STORAGE) + + // storage pool not found + ERR_NO_STORAGE_POOL = ErrorNumber(C.VIR_ERR_NO_STORAGE_POOL) + + // storage volume not found + ERR_NO_STORAGE_VOL = ErrorNumber(C.VIR_ERR_NO_STORAGE_VOL) + + // failed to start node driver + WAR_NO_NODE = ErrorNumber(C.VIR_WAR_NO_NODE) + + // invalid node device object + ERR_INVALID_NODE_DEVICE = ErrorNumber(C.VIR_ERR_INVALID_NODE_DEVICE) + + // node device not found + ERR_NO_NODE_DEVICE = ErrorNumber(C.VIR_ERR_NO_NODE_DEVICE) + + // security model not found + ERR_NO_SECURITY_MODEL = ErrorNumber(C.VIR_ERR_NO_SECURITY_MODEL) + + // operation is not applicable at this time + ERR_OPERATION_INVALID = ErrorNumber(C.VIR_ERR_OPERATION_INVALID) + + // failed to start interface driver + WAR_NO_INTERFACE = ErrorNumber(C.VIR_WAR_NO_INTERFACE) + + // interface driver not running + ERR_NO_INTERFACE = ErrorNumber(C.VIR_ERR_NO_INTERFACE) + + // invalid interface object + ERR_INVALID_INTERFACE = ErrorNumber(C.VIR_ERR_INVALID_INTERFACE) + + // more than one matching interface found + ERR_MULTIPLE_INTERFACES = ErrorNumber(C.VIR_ERR_MULTIPLE_INTERFACES) + + // failed to start nwfilter driver + WAR_NO_NWFILTER = ErrorNumber(C.VIR_WAR_NO_NWFILTER) + + // invalid nwfilter object + ERR_INVALID_NWFILTER = ErrorNumber(C.VIR_ERR_INVALID_NWFILTER) + + // nw filter pool not found + ERR_NO_NWFILTER = ErrorNumber(C.VIR_ERR_NO_NWFILTER) + + // nw filter pool not found + ERR_BUILD_FIREWALL = ErrorNumber(C.VIR_ERR_BUILD_FIREWALL) + + // failed to start secret storage + WAR_NO_SECRET = ErrorNumber(C.VIR_WAR_NO_SECRET) + + // invalid secret + ERR_INVALID_SECRET = ErrorNumber(C.VIR_ERR_INVALID_SECRET) + + // secret not found + ERR_NO_SECRET = ErrorNumber(C.VIR_ERR_NO_SECRET) + + // unsupported configuration construct + ERR_CONFIG_UNSUPPORTED = ErrorNumber(C.VIR_ERR_CONFIG_UNSUPPORTED) + + // timeout occurred during operation + ERR_OPERATION_TIMEOUT = ErrorNumber(C.VIR_ERR_OPERATION_TIMEOUT) + + // a migration worked, but making the VM persist on the dest host failed + ERR_MIGRATE_PERSIST_FAILED = ErrorNumber(C.VIR_ERR_MIGRATE_PERSIST_FAILED) + + // a synchronous hook script failed + ERR_HOOK_SCRIPT_FAILED = ErrorNumber(C.VIR_ERR_HOOK_SCRIPT_FAILED) + + // invalid domain snapshot + ERR_INVALID_DOMAIN_SNAPSHOT = ErrorNumber(C.VIR_ERR_INVALID_DOMAIN_SNAPSHOT) + + // domain snapshot not found + ERR_NO_DOMAIN_SNAPSHOT = ErrorNumber(C.VIR_ERR_NO_DOMAIN_SNAPSHOT) + + // stream pointer not valid + ERR_INVALID_STREAM = ErrorNumber(C.VIR_ERR_INVALID_STREAM) + + // valid API use but unsupported by the given driver + ERR_ARGUMENT_UNSUPPORTED = ErrorNumber(C.VIR_ERR_ARGUMENT_UNSUPPORTED) + + // storage pool probe failed + ERR_STORAGE_PROBE_FAILED = ErrorNumber(C.VIR_ERR_STORAGE_PROBE_FAILED) + + // storage pool already built + ERR_STORAGE_POOL_BUILT = ErrorNumber(C.VIR_ERR_STORAGE_POOL_BUILT) + + // force was not requested for a risky domain snapshot revert + ERR_SNAPSHOT_REVERT_RISKY = ErrorNumber(C.VIR_ERR_SNAPSHOT_REVERT_RISKY) + + // operation on a domain was canceled/aborted by user + ERR_OPERATION_ABORTED = ErrorNumber(C.VIR_ERR_OPERATION_ABORTED) + + // authentication cancelled + ERR_AUTH_CANCELLED = ErrorNumber(C.VIR_ERR_AUTH_CANCELLED) + + // The metadata is not present + ERR_NO_DOMAIN_METADATA = ErrorNumber(C.VIR_ERR_NO_DOMAIN_METADATA) + + // Migration is not safe + ERR_MIGRATE_UNSAFE = ErrorNumber(C.VIR_ERR_MIGRATE_UNSAFE) + + // integer overflow + ERR_OVERFLOW = ErrorNumber(C.VIR_ERR_OVERFLOW) + + // action prevented by block copy job + ERR_BLOCK_COPY_ACTIVE = ErrorNumber(C.VIR_ERR_BLOCK_COPY_ACTIVE) + + // The requested operation is not supported + ERR_OPERATION_UNSUPPORTED = ErrorNumber(C.VIR_ERR_OPERATION_UNSUPPORTED) + + // error in ssh transport driver + ERR_SSH = ErrorNumber(C.VIR_ERR_SSH) + + // guest agent is unresponsive, not running or not usable + ERR_AGENT_UNRESPONSIVE = ErrorNumber(C.VIR_ERR_AGENT_UNRESPONSIVE) + + // resource is already in use + ERR_RESOURCE_BUSY = ErrorNumber(C.VIR_ERR_RESOURCE_BUSY) + + // operation on the object/resource was denied + ERR_ACCESS_DENIED = ErrorNumber(C.VIR_ERR_ACCESS_DENIED) + + // error from a dbus service + ERR_DBUS_SERVICE = ErrorNumber(C.VIR_ERR_DBUS_SERVICE) + + // the storage vol already exists + ERR_STORAGE_VOL_EXIST = ErrorNumber(C.VIR_ERR_STORAGE_VOL_EXIST) + + // given CPU is incompatible with host CPU + ERR_CPU_INCOMPATIBLE = ErrorNumber(C.VIR_ERR_CPU_INCOMPATIBLE) + + // XML document doesn't validate against schema + ERR_XML_INVALID_SCHEMA = ErrorNumber(C.VIR_ERR_XML_INVALID_SCHEMA) + + // Finish API succeeded but it is expected to return NULL */ + ERR_MIGRATE_FINISH_OK = ErrorNumber(C.VIR_ERR_MIGRATE_FINISH_OK) + + // authentication unavailable + ERR_AUTH_UNAVAILABLE = ErrorNumber(C.VIR_ERR_AUTH_UNAVAILABLE) + + // Server was not found + ERR_NO_SERVER = ErrorNumber(C.VIR_ERR_NO_SERVER) + + // Client was not found + ERR_NO_CLIENT = ErrorNumber(C.VIR_ERR_NO_CLIENT) + + // guest agent replies with wrong id to guest sync command + ERR_AGENT_UNSYNCED = ErrorNumber(C.VIR_ERR_AGENT_UNSYNCED) + + // error in libssh transport driver + ERR_LIBSSH = ErrorNumber(C.VIR_ERR_LIBSSH) + + // libvirt fail to find the desired device + ERR_DEVICE_MISSING = ErrorNumber(C.VIR_ERR_DEVICE_MISSING) + + // Invalid nwfilter binding object + ERR_INVALID_NWFILTER_BINDING = ErrorNumber(C.VIR_ERR_INVALID_NWFILTER_BINDING) + + // Requested nwfilter binding does not exist + ERR_NO_NWFILTER_BINDING = ErrorNumber(C.VIR_ERR_NO_NWFILTER_BINDING) + + // invalid domain checkpoint + ERR_INVALID_DOMAIN_CHECKPOINT = ErrorNumber(C.VIR_ERR_INVALID_DOMAIN_CHECKPOINT) + + // domain checkpoint not found + ERR_NO_DOMAIN_CHECKPOINT = ErrorNumber(C.VIR_ERR_NO_DOMAIN_CHECKPOINT) + + // domain backup job id not found * + ERR_NO_DOMAIN_BACKUP = ErrorNumber(C.VIR_ERR_NO_DOMAIN_BACKUP) + + // invalid network port object + ERR_INVALID_NETWORK_PORT = ErrorNumber(C.VIR_ERR_INVALID_NETWORK_PORT) + + // network port already exists + ERR_NETWORK_PORT_EXIST = ErrorNumber(C.VIR_ERR_NETWORK_PORT_EXIST) + + // network port not found + ERR_NO_NETWORK_PORT = ErrorNumber(C.VIR_ERR_NO_NETWORK_PORT) + + // no domain's hostname found + ERR_NO_HOSTNAME = ErrorNumber(C.VIR_ERR_NO_HOSTNAME) + + // checkpoint is inconsistent + ERR_CHECKPOINT_INCONSISTENT = ErrorNumber(C.VIR_ERR_CHECKPOINT_INCONSISTENT) + + // more than one matching domain found + ERR_MULTIPLE_DOMAINS = ErrorNumber(C.VIR_ERR_MULTIPLE_DOMAINS) + + // The metadata is not present + ERR_NO_NETWORK_METADATA = ErrorNumber(C.VIR_ERR_NO_NETWORK_METADATA) +) + +type ErrorDomain int + +const ( + FROM_NONE = ErrorDomain(C.VIR_FROM_NONE) + + // Error at Xen hypervisor layer + FROM_XEN = ErrorDomain(C.VIR_FROM_XEN) + + // Error at connection with xend daemon + FROM_XEND = ErrorDomain(C.VIR_FROM_XEND) + + // Error at connection with xen store + FROM_XENSTORE = ErrorDomain(C.VIR_FROM_XENSTORE) + + // Error in the S-Expression code + FROM_SEXPR = ErrorDomain(C.VIR_FROM_SEXPR) + + // Error in the XML code + FROM_XML = ErrorDomain(C.VIR_FROM_XML) + + // Error when operating on a domain + FROM_DOM = ErrorDomain(C.VIR_FROM_DOM) + + // Error in the XML-RPC code + FROM_RPC = ErrorDomain(C.VIR_FROM_RPC) + + // Error in the proxy code; unused since 0.8.6 + FROM_PROXY = ErrorDomain(C.VIR_FROM_PROXY) + + // Error in the configuration file handling + FROM_CONF = ErrorDomain(C.VIR_FROM_CONF) + + // Error at the QEMU daemon + FROM_QEMU = ErrorDomain(C.VIR_FROM_QEMU) + + // Error when operating on a network + FROM_NET = ErrorDomain(C.VIR_FROM_NET) + + // Error from test driver + FROM_TEST = ErrorDomain(C.VIR_FROM_TEST) + + // Error from remote driver + FROM_REMOTE = ErrorDomain(C.VIR_FROM_REMOTE) + + // Error from OpenVZ driver + FROM_OPENVZ = ErrorDomain(C.VIR_FROM_OPENVZ) + + // Error at Xen XM layer + FROM_XENXM = ErrorDomain(C.VIR_FROM_XENXM) + + // Error in the Linux Stats code + FROM_STATS_LINUX = ErrorDomain(C.VIR_FROM_STATS_LINUX) + + // Error from Linux Container driver + FROM_LXC = ErrorDomain(C.VIR_FROM_LXC) + + // Error from storage driver + FROM_STORAGE = ErrorDomain(C.VIR_FROM_STORAGE) + + // Error from network config + FROM_NETWORK = ErrorDomain(C.VIR_FROM_NETWORK) + + // Error from domain config + FROM_DOMAIN = ErrorDomain(C.VIR_FROM_DOMAIN) + + // Error at the UML driver + FROM_UML = ErrorDomain(C.VIR_FROM_UML) + + // Error from node device monitor + FROM_NODEDEV = ErrorDomain(C.VIR_FROM_NODEDEV) + + // Error from xen inotify layer + FROM_XEN_INOTIFY = ErrorDomain(C.VIR_FROM_XEN_INOTIFY) + + // Error from security framework + FROM_SECURITY = ErrorDomain(C.VIR_FROM_SECURITY) + + // Error from VirtualBox driver + FROM_VBOX = ErrorDomain(C.VIR_FROM_VBOX) + + // Error when operating on an interface + FROM_INTERFACE = ErrorDomain(C.VIR_FROM_INTERFACE) + + // The OpenNebula driver no longer exists. Retained for ABI/API compat only + FROM_ONE = ErrorDomain(C.VIR_FROM_ONE) + + // Error from ESX driver + FROM_ESX = ErrorDomain(C.VIR_FROM_ESX) + + // Error from IBM power hypervisor + FROM_PHYP = ErrorDomain(C.VIR_FROM_PHYP) + + // Error from secret storage + FROM_SECRET = ErrorDomain(C.VIR_FROM_SECRET) + + // Error from CPU driver + FROM_CPU = ErrorDomain(C.VIR_FROM_CPU) + + // Error from XenAPI + FROM_XENAPI = ErrorDomain(C.VIR_FROM_XENAPI) + + // Error from network filter driver + FROM_NWFILTER = ErrorDomain(C.VIR_FROM_NWFILTER) + + // Error from Synchronous hooks + FROM_HOOK = ErrorDomain(C.VIR_FROM_HOOK) + + // Error from domain snapshot + FROM_DOMAIN_SNAPSHOT = ErrorDomain(C.VIR_FROM_DOMAIN_SNAPSHOT) + + // Error from auditing subsystem + FROM_AUDIT = ErrorDomain(C.VIR_FROM_AUDIT) + + // Error from sysinfo/SMBIOS + FROM_SYSINFO = ErrorDomain(C.VIR_FROM_SYSINFO) + + // Error from I/O streams + FROM_STREAMS = ErrorDomain(C.VIR_FROM_STREAMS) + + // Error from VMware driver + FROM_VMWARE = ErrorDomain(C.VIR_FROM_VMWARE) + + // Error from event loop impl + FROM_EVENT = ErrorDomain(C.VIR_FROM_EVENT) + + // Error from libxenlight driver + FROM_LIBXL = ErrorDomain(C.VIR_FROM_LIBXL) + + // Error from lock manager + FROM_LOCKING = ErrorDomain(C.VIR_FROM_LOCKING) + + // Error from Hyper-V driver + FROM_HYPERV = ErrorDomain(C.VIR_FROM_HYPERV) + + // Error from capabilities + FROM_CAPABILITIES = ErrorDomain(C.VIR_FROM_CAPABILITIES) + + // Error from URI handling + FROM_URI = ErrorDomain(C.VIR_FROM_URI) + + // Error from auth handling + FROM_AUTH = ErrorDomain(C.VIR_FROM_AUTH) + + // Error from DBus + FROM_DBUS = ErrorDomain(C.VIR_FROM_DBUS) + + // Error from Parallels + FROM_PARALLELS = ErrorDomain(C.VIR_FROM_PARALLELS) + + // Error from Device + FROM_DEVICE = ErrorDomain(C.VIR_FROM_DEVICE) + + // Error from libssh2 connection transport + FROM_SSH = ErrorDomain(C.VIR_FROM_SSH) + + // Error from lockspace + FROM_LOCKSPACE = ErrorDomain(C.VIR_FROM_LOCKSPACE) + + // Error from initctl device communication + FROM_INITCTL = ErrorDomain(C.VIR_FROM_INITCTL) + + // Error from identity code + FROM_IDENTITY = ErrorDomain(C.VIR_FROM_IDENTITY) + + // Error from cgroups + FROM_CGROUP = ErrorDomain(C.VIR_FROM_CGROUP) + + // Error from access control manager + FROM_ACCESS = ErrorDomain(C.VIR_FROM_ACCESS) + + // Error from systemd code + FROM_SYSTEMD = ErrorDomain(C.VIR_FROM_SYSTEMD) + + // Error from bhyve driver + FROM_BHYVE = ErrorDomain(C.VIR_FROM_BHYVE) + + // Error from crypto code + FROM_CRYPTO = ErrorDomain(C.VIR_FROM_CRYPTO) + + // Error from firewall + FROM_FIREWALL = ErrorDomain(C.VIR_FROM_FIREWALL) + + // Erorr from polkit code + FROM_POLKIT = ErrorDomain(C.VIR_FROM_POLKIT) + + // Error from thread utils + FROM_THREAD = ErrorDomain(C.VIR_FROM_THREAD) + + // Error from admin backend + FROM_ADMIN = ErrorDomain(C.VIR_FROM_ADMIN) + + // Error from log manager + FROM_LOGGING = ErrorDomain(C.VIR_FROM_LOGGING) + + // Error from Xen xl config code + FROM_XENXL = ErrorDomain(C.VIR_FROM_XENXL) + + // Error from perf + FROM_PERF = ErrorDomain(C.VIR_FROM_PERF) + + // Error from libssh + FROM_LIBSSH = ErrorDomain(C.VIR_FROM_LIBSSH) + + // Error from resoruce control + FROM_RESCTRL = ErrorDomain(C.VIR_FROM_RESCTRL) + + // Error from firewalld + FROM_FIREWALLD = ErrorDomain(C.VIR_FROM_FIREWALLD) + + // Error from domain checkpoint + FROM_DOMAIN_CHECKPOINT = ErrorDomain(C.VIR_FROM_DOMAIN_CHECKPOINT) + + // Error from TPM + FROM_TPM = ErrorDomain(C.VIR_FROM_TPM) + + // Error from BPF + FROM_BPF = ErrorDomain(C.VIR_FROM_BPF) + + // Error from Cloud Hypervisor + FROM_CH = ErrorDomain(C.VIR_FROM_CH) +) + +type Error struct { + Code ErrorNumber + Domain ErrorDomain + Message string + Level ErrorLevel +} + +func (err Error) Error() string { + return fmt.Sprintf("virError(Code=%d, Domain=%d, Message='%s')", + err.Code, err.Domain, err.Message) +} + +func (err Error) Is(target error) bool { + n, ok := target.(ErrorNumber) + if !ok { + return false + } + + return err.Code == n +} + +func makeError(err *C.virError) Error { + ret := Error{ + Code: ErrorNumber(err.code), + Domain: ErrorDomain(err.domain), + Message: C.GoString(err.message), + Level: ErrorLevel(err.level), + } + C.virResetErrorWrapper(err) + return ret +} diff --git a/vendor/libvirt.org/go/libvirt/error_helper.go b/vendor/libvirt.org/go/libvirt/error_helper.go new file mode 100644 index 000000000..11881f078 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/error_helper.go @@ -0,0 +1,51 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include +#include "libvirt_generated.h" + +void +setVirError(virErrorPtr err, const char *message) +{ + if (err == NULL) { + return; + } + memset(err, 0, sizeof(*err)); + + err->code = VIR_ERR_INTERNAL_ERROR; + err->domain = VIR_FROM_NONE; + err->message = strdup(message); + err->level = VIR_ERR_ERROR; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/error_helper.h b/vendor/libvirt.org/go/libvirt/error_helper.h new file mode 100644 index 000000000..3fb01c921 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/error_helper.h @@ -0,0 +1,33 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_ERROR_HELPER_H__ +#define LIBVIRT_GO_ERROR_HELPER_H__ + +void +setVirError(virErrorPtr err, const char *message); + +#endif /* LIBVIRT_GO_ERROR_HELPER_H__ */ diff --git a/vendor/libvirt.org/go/libvirt/events.go b/vendor/libvirt.org/go/libvirt/events.go new file mode 100644 index 000000000..12d1707f7 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/events.go @@ -0,0 +1,274 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include +#include "events_helper.h" +*/ +import "C" + +type EventHandleType int + +const ( + EVENT_HANDLE_READABLE = EventHandleType(C.VIR_EVENT_HANDLE_READABLE) + EVENT_HANDLE_WRITABLE = EventHandleType(C.VIR_EVENT_HANDLE_WRITABLE) + EVENT_HANDLE_ERROR = EventHandleType(C.VIR_EVENT_HANDLE_ERROR) + EVENT_HANDLE_HANGUP = EventHandleType(C.VIR_EVENT_HANDLE_HANGUP) +) + +// See also https://libvirt.org/html/libvirt-libvirt-event.html#virEventRegisterDefaultImpl +// +// Note that registering an event loop implementation must be +// done before creating any Connect object instance +func EventRegisterDefaultImpl() error { + var err C.virError + if C.virInitializeWrapper(&err) < 0 { + return makeError(&err) + } + if i := int(C.virEventRegisterDefaultImplWrapper(&err)); i != 0 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-event.html#virEventRunDefaultImpl +func EventRunDefaultImpl() error { + var err C.virError + if i := int(C.virEventRunDefaultImplWrapper(&err)); i != 0 { + return makeError(&err) + } + return nil +} + +type EventHandleCallback func(watch int, file int, events EventHandleType) + +//export eventHandleCallback +func eventHandleCallback(watch int, fd int, events int, callbackID int) { + callbackFunc := getCallbackId(callbackID) + + callback, ok := callbackFunc.(EventHandleCallback) + if !ok { + panic("Incorrect event handle callback data") + } + + callback(watch, fd, (EventHandleType)(events)) +} + +// See also https://libvirt.org/html/libvirt-libvirt-event.html#virEventAddHandle +func EventAddHandle(fd int, events EventHandleType, callback EventHandleCallback) (int, error) { + callbackID := registerCallbackId(callback) + + var err C.virError + ret := C.virEventAddHandleHelper((C.int)(fd), (C.int)(events), (C.int)(callbackID), &err) + if ret == -1 { + return 0, makeError(&err) + } + + return int(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-event.html#virEventUpdateHandle +func EventUpdateHandle(watch int, events EventHandleType) { + C.virEventUpdateHandleWrapper((C.int)(watch), (C.int)(events)) +} + +// See also https://libvirt.org/html/libvirt-libvirt-event.html#virEventRemoveHandle +func EventRemoveHandle(watch int) error { + var err C.virError + ret := C.virEventRemoveHandleWrapper((C.int)(watch), &err) + if ret < 0 { + return makeError(&err) + } + + return nil +} + +type EventTimeoutCallback func(timer int) + +//export eventTimeoutCallback +func eventTimeoutCallback(timer int, callbackID int) { + callbackFunc := getCallbackId(callbackID) + + callback, ok := callbackFunc.(EventTimeoutCallback) + if !ok { + panic("Incorrect event timeout callback data") + } + + callback(timer) +} + +// See also https://libvirt.org/html/libvirt-libvirt-event.html#virEventAddTimeout +func EventAddTimeout(freq int, callback EventTimeoutCallback) (int, error) { + callbackID := registerCallbackId(callback) + + var err C.virError + ret := C.virEventAddTimeoutHelper((C.int)(freq), (C.int)(callbackID), &err) + if ret == -1 { + return 0, makeError(&err) + } + + return int(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-event.html#virEventUpdateTimeout +func EventUpdateTimeout(timer int, freq int) { + C.virEventUpdateTimeoutWrapper((C.int)(timer), (C.int)(freq)) +} + +// See also https://libvirt.org/html/libvirt-libvirt-event.html#virEventRemoveTimeout +func EventRemoveTimeout(timer int) error { + var err C.virError + ret := C.virEventRemoveTimeoutWrapper((C.int)(timer), &err) + if ret < 0 { + return makeError(&err) + } + + return nil +} + +type EventHandleCallbackInfo struct { + callback uintptr + opaque uintptr + free uintptr +} + +type EventTimeoutCallbackInfo struct { + callback uintptr + opaque uintptr + free uintptr +} + +func (i *EventHandleCallbackInfo) Invoke(watch int, fd int, event EventHandleType) { + C.eventHandleCallbackInvoke(C.int(watch), C.int(fd), C.int(event), C.uintptr_t(i.callback), C.uintptr_t(i.opaque)) +} + +func (i *EventTimeoutCallbackInfo) Invoke(timer int) { + C.eventTimeoutCallbackInvoke(C.int(timer), C.uintptr_t(i.callback), C.uintptr_t(i.opaque)) +} + +func (i *EventHandleCallbackInfo) Free() { + C.eventHandleCallbackFree(C.uintptr_t(i.free), C.uintptr_t(i.opaque)) +} + +func (i *EventTimeoutCallbackInfo) Free() { + C.eventTimeoutCallbackFree(C.uintptr_t(i.free), C.uintptr_t(i.opaque)) +} + +type EventLoop interface { + AddHandleFunc(fd int, event EventHandleType, callback *EventHandleCallbackInfo) int + UpdateHandleFunc(watch int, event EventHandleType) + RemoveHandleFunc(watch int) int + AddTimeoutFunc(freq int, callback *EventTimeoutCallbackInfo) int + UpdateTimeoutFunc(timer int, freq int) + RemoveTimeoutFunc(timer int) int +} + +var eventLoopImpl EventLoop + +// See also https://libvirt.org/html/libvirt-libvirt-event.html#virEventRegisterImpl +// +// Note that registering an event loop implementation must be +// done before creating any Connect object instance +func EventRegisterImpl(impl EventLoop) error { + var err C.virError + eventLoopImpl = impl + if C.virInitializeWrapper(&err) < 0 { + return makeError(&err) + } + C.virEventRegisterImplHelper() + return nil +} + +//export eventAddHandleFunc +func eventAddHandleFunc(fd C.int, event C.int, callback uintptr, opaque uintptr, free uintptr) C.int { + if eventLoopImpl == nil { + panic("Event loop impl is missing") + } + + cbinfo := &EventHandleCallbackInfo{ + callback: callback, + opaque: opaque, + free: free, + } + + return C.int(eventLoopImpl.AddHandleFunc(int(fd), EventHandleType(event), cbinfo)) +} + +//export eventUpdateHandleFunc +func eventUpdateHandleFunc(watch C.int, event C.int) { + if eventLoopImpl == nil { + panic("Event loop impl is missing") + } + + eventLoopImpl.UpdateHandleFunc(int(watch), EventHandleType(event)) +} + +//export eventRemoveHandleFunc +func eventRemoveHandleFunc(watch C.int) { + if eventLoopImpl == nil { + panic("Event loop impl is missing") + } + + eventLoopImpl.RemoveHandleFunc(int(watch)) +} + +//export eventAddTimeoutFunc +func eventAddTimeoutFunc(freq C.int, callback uintptr, opaque uintptr, free uintptr) C.int { + if eventLoopImpl == nil { + panic("Event loop impl is missing") + } + + cbinfo := &EventTimeoutCallbackInfo{ + callback: callback, + opaque: opaque, + free: free, + } + + return C.int(eventLoopImpl.AddTimeoutFunc(int(freq), cbinfo)) +} + +//export eventUpdateTimeoutFunc +func eventUpdateTimeoutFunc(timer C.int, freq C.int) { + if eventLoopImpl == nil { + panic("Event loop impl is missing") + } + + eventLoopImpl.UpdateTimeoutFunc(int(timer), int(freq)) +} + +//export eventRemoveTimeoutFunc +func eventRemoveTimeoutFunc(timer C.int) { + if eventLoopImpl == nil { + panic("Event loop impl is missing") + } + + eventLoopImpl.RemoveTimeoutFunc(int(timer)) +} diff --git a/vendor/libvirt.org/go/libvirt/events_helper.go b/vendor/libvirt.org/go/libvirt/events_helper.go new file mode 100644 index 000000000..313b4de57 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/events_helper.go @@ -0,0 +1,154 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include +#include "events_helper.h" + + +void eventHandleCallback(int watch, int fd, int events, int callbackID); + +static void eventAddHandleHelper(int watch, int fd, int events, void *opaque) +{ + eventHandleCallback(watch, fd, events, (int)(intptr_t)opaque); +} + + +void eventTimeoutCallback(int timer, int callbackID); + +static void eventAddTimeoutHelper(int timer, void *opaque) +{ + eventTimeoutCallback(timer, (int)(intptr_t)opaque); +} + + +int eventAddHandleFunc(int fd, int event, uintptr_t callback, uintptr_t opaque, uintptr_t freecb); +void eventUpdateHandleFunc(int watch, int event); +int eventRemoveHandleFunc(int watch); +int eventAddTimeoutFunc(int freq, uintptr_t callback, uintptr_t opaque, uintptr_t freecb); +void eventUpdateTimeoutFunc(int timer, int freq); +int eventRemoveTimeoutFunc(int timer); + + +int eventAddHandleFuncHelper(int fd, int event, virEventHandleCallback callback, void *opaque, virFreeCallback freecb) +{ + return eventAddHandleFunc(fd, event, (uintptr_t)callback, (uintptr_t)opaque, (uintptr_t)freecb); +} + + +void eventUpdateHandleFuncHelper(int watch, int event) +{ + eventUpdateHandleFunc(watch, event); +} + + +int eventRemoveHandleFuncHelper(int watch) +{ + return eventRemoveHandleFunc(watch); +} + + +int eventAddTimeoutFuncHelper(int freq, virEventTimeoutCallback callback, void *opaque, virFreeCallback freecb) +{ + return eventAddTimeoutFunc(freq, (uintptr_t)callback, (uintptr_t)opaque, (uintptr_t)freecb); +} + + +void eventUpdateTimeoutFuncHelper(int timer, int freq) +{ + eventUpdateTimeoutFunc(timer, freq); +} + + +int eventRemoveTimeoutFuncHelper(int timer) +{ + return eventRemoveTimeoutFunc(timer); +} + + +void virEventRegisterImplHelper(void) +{ + virEventRegisterImplWrapper(eventAddHandleFuncHelper, + eventUpdateHandleFuncHelper, + eventRemoveHandleFuncHelper, + eventAddTimeoutFuncHelper, + eventUpdateTimeoutFuncHelper, + eventRemoveTimeoutFuncHelper); +} + + +void eventHandleCallbackInvoke(int watch, int fd, int events, uintptr_t callback, uintptr_t opaque) +{ + ((virEventHandleCallback)callback)(watch, fd, events, (void *)opaque); +} + + +void eventTimeoutCallbackInvoke(int timer, uintptr_t callback, uintptr_t opaque) +{ + ((virEventTimeoutCallback)callback)(timer, (void *)opaque); +} + + +void eventHandleCallbackFree(uintptr_t callback, uintptr_t opaque) +{ + ((virFreeCallback)callback)((void *)opaque); +} + + +void eventTimeoutCallbackFree(uintptr_t callback, uintptr_t opaque) +{ + ((virFreeCallback)callback)((void *)opaque); +} + + +int +virEventAddHandleHelper(int fd, + int events, + int callbackID, + virErrorPtr err) +{ + return virEventAddHandleWrapper(fd, events, eventAddHandleHelper, + (void *)(intptr_t)callbackID, NULL, err); +} + + +int +virEventAddTimeoutHelper(int timeout, + int callbackID, + virErrorPtr err) +{ + return virEventAddTimeoutWrapper(timeout, eventAddTimeoutHelper, + (void *)(intptr_t)callbackID, NULL, err); +} + + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/events_helper.h b/vendor/libvirt.org/go/libvirt/events_helper.h new file mode 100644 index 000000000..70b2e2870 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/events_helper.h @@ -0,0 +1,74 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_EVENTS_HELPER_H__ +#define LIBVIRT_GO_EVENTS_HELPER_H__ + +#include "libvirt_generated.h" + + +void +virEventRegisterImplHelper(void); + + +void +eventHandleCallbackInvoke(int watch, + int fd, + int events, + uintptr_t callback, + uintptr_t opaque); + + +void +eventTimeoutCallbackInvoke(int timer, + uintptr_t callback, + uintptr_t opaque); + + +void +eventHandleCallbackFree(uintptr_t callback, + uintptr_t opaque); + + +void +eventTimeoutCallbackFree(uintptr_t callback, + uintptr_t opaque); + + +int +virEventAddHandleHelper(int fd, + int events, + int callbackID, + virErrorPtr err); + + +int +virEventAddTimeoutHelper(int timeout, + int callbackID, + virErrorPtr err); + + +#endif /* LIBVIRT_GO_EVENTS_HELPER_H__ */ diff --git a/vendor/libvirt.org/go/libvirt/interface.go b/vendor/libvirt.org/go/libvirt/interface.go new file mode 100644 index 000000000..7829940bb --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/interface.go @@ -0,0 +1,153 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include +#include "libvirt_generated.h" +*/ +import "C" + +import ( + "unsafe" +) + +type InterfaceXMLFlags uint + +const ( + INTERFACE_XML_INACTIVE = InterfaceXMLFlags(C.VIR_INTERFACE_XML_INACTIVE) +) + +type InterfaceDefineFlags uint + +const ( + INTERFACE_DEFINE_VALIDATE = InterfaceDefineFlags(C.VIR_INTERFACE_DEFINE_VALIDATE) +) + +type Interface struct { + ptr C.virInterfacePtr +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceCreate +func (n *Interface) Create(flags uint32) error { + var err C.virError + result := C.virInterfaceCreateWrapper(n.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceDestroy +func (n *Interface) Destroy(flags uint32) error { + var err C.virError + result := C.virInterfaceDestroyWrapper(n.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceIsActive +func (n *Interface) IsActive() (bool, error) { + var err C.virError + result := C.virInterfaceIsActiveWrapper(n.ptr, &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceGetMACString +func (n *Interface) GetMACString() (string, error) { + var err C.virError + result := C.virInterfaceGetMACStringWrapper(n.ptr, &err) + if result == nil { + return "", makeError(&err) + } + mac := C.GoString(result) + return mac, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceGetName +func (n *Interface) GetName() (string, error) { + var err C.virError + result := C.virInterfaceGetNameWrapper(n.ptr, &err) + if result == nil { + return "", makeError(&err) + } + name := C.GoString(result) + return name, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceGetXMLDesc +func (n *Interface) GetXMLDesc(flags InterfaceXMLFlags) (string, error) { + var err C.virError + result := C.virInterfaceGetXMLDescWrapper(n.ptr, C.uint(flags), &err) + if result == nil { + return "", makeError(&err) + } + xml := C.GoString(result) + C.free(unsafe.Pointer(result)) + return xml, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceUndefine +func (n *Interface) Undefine() error { + var err C.virError + result := C.virInterfaceUndefineWrapper(n.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceFree +func (n *Interface) Free() error { + var err C.virError + ret := C.virInterfaceFreeWrapper(n.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceRef +func (c *Interface) Ref() error { + var err C.virError + ret := C.virInterfaceRefWrapper(c.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated.h b/vendor/libvirt.org/go/libvirt/libvirt_generated.h new file mode 100644 index 000000000..6cf77ca36 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated.h @@ -0,0 +1,45 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +#pragma once + +#ifdef LIBVIRT_DLOPEN +#define LIBVIR_CHECK_VERSION(a,b,c) 0 +#include +#else +#include +#include +#endif + +#include "libvirt_generated_macros.h" +#include "libvirt_generated_enums.h" +#include "libvirt_generated_typedefs.h" +#include "libvirt_generated_callbacks.h" +#include "libvirt_generated_structs.h" +#include "libvirt_generated_variables.h" +#include "libvirt_generated_functions.h" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_callbacks.h b/vendor/libvirt.org/go/libvirt/libvirt_generated_callbacks.h new file mode 100644 index 000000000..c1183a8c6 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_callbacks.h @@ -0,0 +1,398 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +#pragma once + +#if !LIBVIR_CHECK_VERSION(0, 5, 0) +typedef void (*virFreeCallback)(void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(0, 5, 0) +typedef void (*virEventTimeoutCallback)(int timer, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(0, 5, 0) +typedef void (*virEventHandleCallback)(int watch, + int fd, + int events, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(0, 4, 1) +typedef int (*virConnectAuthCallbackPtr)(virConnectCredentialPtr cred, + unsigned int ncred, + void * cbdata); +#endif + +#if !LIBVIR_CHECK_VERSION(0, 10, 0) +typedef void (*virConnectCloseFunc)(virConnectPtr conn, + int reason, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 11) +typedef void (*virConnectDomainEventAgentLifecycleCallback)(virConnectPtr conn, + virDomainPtr dom, + int state, + int reason, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(0, 10, 0) +typedef void (*virConnectDomainEventBalloonChangeCallback)(virConnectPtr conn, + virDomainPtr dom, + unsigned long long actual, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 4) +typedef void (*virConnectDomainEventBlockJobCallback)(virConnectPtr conn, + virDomainPtr dom, + const char * disk, + int type, + int status, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(3, 2, 0) +typedef void (*virConnectDomainEventBlockThresholdCallback)(virConnectPtr conn, + virDomainPtr dom, + const char * dev, + const char * path, + unsigned long long threshold, + unsigned long long excess, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(0, 5, 0) +typedef int (*virConnectDomainEventCallback)(virConnectPtr conn, + virDomainPtr dom, + int event, + int detail, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 15) +typedef void (*virConnectDomainEventDeviceAddedCallback)(virConnectPtr conn, + virDomainPtr dom, + const char * devAlias, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(1, 3, 4) +typedef void (*virConnectDomainEventDeviceRemovalFailedCallback)(virConnectPtr conn, + virDomainPtr dom, + const char * devAlias, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(1, 1, 1) +typedef void (*virConnectDomainEventDeviceRemovedCallback)(virConnectPtr conn, + virDomainPtr dom, + const char * devAlias, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 7) +typedef void (*virConnectDomainEventDiskChangeCallback)(virConnectPtr conn, + virDomainPtr dom, + const char * oldSrcPath, + const char * newSrcPath, + const char * devAlias, + int reason, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 0) +typedef void (*virConnectDomainEventGenericCallback)(virConnectPtr conn, + virDomainPtr dom, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 0) +typedef void (*virConnectDomainEventGraphicsCallback)(virConnectPtr conn, + virDomainPtr dom, + int phase, + const virDomainEventGraphicsAddress * local, + const virDomainEventGraphicsAddress * remote, + const char * authScheme, + const virDomainEventGraphicsSubject * subject, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 0) +typedef void (*virConnectDomainEventIOErrorCallback)(virConnectPtr conn, + virDomainPtr dom, + const char * srcPath, + const char * devAlias, + int action, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 1) +typedef void (*virConnectDomainEventIOErrorReasonCallback)(virConnectPtr conn, + virDomainPtr dom, + const char * srcPath, + const char * devAlias, + int action, + const char * reason, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(1, 3, 3) +typedef void (*virConnectDomainEventJobCompletedCallback)(virConnectPtr conn, + virDomainPtr dom, + virTypedParameterPtr params, + int nparams, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(7, 9, 0) +typedef void (*virConnectDomainEventMemoryDeviceSizeChangeCallback)(virConnectPtr conn, + virDomainPtr dom, + const char * alias, + unsigned long long size, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(6, 9, 0) +typedef void (*virConnectDomainEventMemoryFailureCallback)(virConnectPtr conn, + virDomainPtr dom, + int recipient, + int action, + unsigned int flags, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(3, 0, 0) +typedef void (*virConnectDomainEventMetadataChangeCallback)(virConnectPtr conn, + virDomainPtr dom, + int type, + const char * nsuri, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(1, 3, 2) +typedef void (*virConnectDomainEventMigrationIterationCallback)(virConnectPtr conn, + virDomainPtr dom, + int iteration, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 11) +typedef void (*virConnectDomainEventPMSuspendCallback)(virConnectPtr conn, + virDomainPtr dom, + int reason, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(1, 0, 0) +typedef void (*virConnectDomainEventPMSuspendDiskCallback)(virConnectPtr conn, + virDomainPtr dom, + int reason, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 11) +typedef void (*virConnectDomainEventPMWakeupCallback)(virConnectPtr conn, + virDomainPtr dom, + int reason, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 0) +typedef void (*virConnectDomainEventRTCChangeCallback)(virConnectPtr conn, + virDomainPtr dom, + long long utcoffset, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 11) +typedef void (*virConnectDomainEventTrayChangeCallback)(virConnectPtr conn, + virDomainPtr dom, + const char * devAlias, + int reason, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 9) +typedef void (*virConnectDomainEventTunableCallback)(virConnectPtr conn, + virDomainPtr dom, + virTypedParameterPtr params, + int nparams, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 0) +typedef void (*virConnectDomainEventWatchdogCallback)(virConnectPtr conn, + virDomainPtr dom, + int action, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 1) +typedef void (*virConnectNetworkEventGenericCallback)(virConnectPtr conn, + virNetworkPtr net, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 1) +typedef void (*virConnectNetworkEventLifecycleCallback)(virConnectPtr conn, + virNetworkPtr net, + int event, + int detail, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(9, 8, 0) +typedef void (*virConnectNetworkEventMetadataChangeCallback)(virConnectPtr conn, + virNetworkPtr net, + int type, + const char * nsuri, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(2, 2, 0) +typedef void (*virConnectNodeDeviceEventGenericCallback)(virConnectPtr conn, + virNodeDevicePtr dev, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(2, 2, 0) +typedef void (*virConnectNodeDeviceEventLifecycleCallback)(virConnectPtr conn, + virNodeDevicePtr dev, + int event, + int detail, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(3, 0, 0) +typedef void (*virConnectSecretEventGenericCallback)(virConnectPtr conn, + virSecretPtr secret, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(3, 0, 0) +typedef void (*virConnectSecretEventLifecycleCallback)(virConnectPtr conn, + virSecretPtr secret, + int event, + int detail, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(2, 0, 0) +typedef void (*virConnectStoragePoolEventGenericCallback)(virConnectPtr conn, + virStoragePoolPtr pool, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(2, 0, 0) +typedef void (*virConnectStoragePoolEventLifecycleCallback)(virConnectPtr conn, + virStoragePoolPtr pool, + int event, + int detail, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(0, 1, 0) +typedef void (*virErrorFunc)(void * userData, + virErrorPtr error); +#endif + +#if !LIBVIR_CHECK_VERSION(0, 5, 0) +typedef int (*virEventAddHandleFunc)(int fd, + int event, + virEventHandleCallback cb, + void * opaque, + virFreeCallback ff); +#endif + +#if !LIBVIR_CHECK_VERSION(0, 5, 0) +typedef int (*virEventAddTimeoutFunc)(int timeout, + virEventTimeoutCallback cb, + void * opaque, + virFreeCallback ff); +#endif + +#if !LIBVIR_CHECK_VERSION(0, 5, 0) +typedef int (*virEventRemoveHandleFunc)(int watch); +#endif + +#if !LIBVIR_CHECK_VERSION(0, 5, 0) +typedef int (*virEventRemoveTimeoutFunc)(int timer); +#endif + +#if !LIBVIR_CHECK_VERSION(0, 5, 0) +typedef void (*virEventUpdateHandleFunc)(int watch, + int event); +#endif + +#if !LIBVIR_CHECK_VERSION(0, 5, 0) +typedef void (*virEventUpdateTimeoutFunc)(int timer, + int timeout); +#endif + +#if !LIBVIR_CHECK_VERSION(0, 7, 2) +typedef void (*virStreamEventCallback)(virStreamPtr stream, + int events, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(0, 7, 2) +typedef int (*virStreamSinkFunc)(virStreamPtr st, + const char * data, + size_t nbytes, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(3, 4, 0) +typedef int (*virStreamSinkHoleFunc)(virStreamPtr st, + long long length, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(0, 7, 2) +typedef int (*virStreamSourceFunc)(virStreamPtr st, + char * data, + size_t nbytes, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(3, 4, 0) +typedef int (*virStreamSourceHoleFunc)(virStreamPtr st, + int * inData, + long long * length, + void * opaque); +#endif + +#if !LIBVIR_CHECK_VERSION(3, 4, 0) +typedef int (*virStreamSourceSkipFunc)(virStreamPtr st, + long long length, + void * opaque); +#endif diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_dlopen.go b/vendor/libvirt.org/go/libvirt/libvirt_generated_dlopen.go new file mode 100644 index 000000000..834de90ed --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_dlopen.go @@ -0,0 +1,113 @@ +//go:build libvirt_dlopen +// +build libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include +#include +#include +#include "libvirt_generated_dlopen.h" +#include "error_helper.h" + +static void *handle; +static bool once; + +virConnectAuthPtr *virConnectAuthPtrDefaultVar; + +static void * +libvirtLoad(virErrorPtr err) +{ + char *errMsg; + + if (once) { + if (handle == NULL) { + setVirError(err, "Failed to open libvirt.so.0"); + } + return handle; + } + handle = dlopen("libvirt.so.0", RTLD_NOW|RTLD_LOCAL); + once = true; + if (handle == NULL) { + setVirError(err, dlerror()); + return handle; + } + virConnectAuthPtrDefaultVar = dlsym(handle, "virConnectAuthPtrDefault"); + if ((errMsg = dlerror()) != NULL) { + setVirError(err, errMsg); + dlclose(handle); + return NULL; + } + return handle; +} + + +bool +libvirtSymbol(const char *name, + void **symbol, + bool *once, + bool *success, + virErrorPtr err) +{ + char *errMsg; + + if (!libvirtLoad(err)) { + return *success; + } + + if (*once) { + if (!*success) { + // Set error for successive calls + char msg[100]; + snprintf(msg, 100, "Failed to load %s", name); + setVirError(err, msg); + } + return *success; + } + + // Documentation of dlsym says we should use dlerror() to check for failure + // in dlsym() as a NULL might be the right address for a given symbol. + // This is also the reason to have the @success argument. + *symbol = dlsym(handle, name); + if ((errMsg = dlerror()) != NULL) { + setVirError(err, errMsg); + *once = true; + return *success; + } + *once = true; + *success = true; + return *success; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_dlopen.h b/vendor/libvirt.org/go/libvirt/libvirt_generated_dlopen.h new file mode 100644 index 000000000..aae11a5ad --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_dlopen.h @@ -0,0 +1,41 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +#pragma once + +#include "libvirt_generated.h" + +bool +libvirtSymbol(const char *name, + void **symbol, + bool *once, + bool *success, + virErrorPtr err); + +extern int +virCopyLastErrorWrapper(virErrorPtr err); diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_enums.h b/vendor/libvirt.org/go/libvirt/libvirt_generated_enums.h new file mode 100644 index 000000000..1745a3865 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_enums.h @@ -0,0 +1,3512 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +#pragma once + +/* enum virBlkioParameterType */ +# if !LIBVIR_CHECK_VERSION(0, 9, 0) +# define VIR_DOMAIN_BLKIO_PARAM_INT VIR_TYPED_PARAM_INT +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 0) +# define VIR_DOMAIN_BLKIO_PARAM_UINT VIR_TYPED_PARAM_UINT +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 0) +# define VIR_DOMAIN_BLKIO_PARAM_LLONG VIR_TYPED_PARAM_LLONG +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 0) +# define VIR_DOMAIN_BLKIO_PARAM_ULLONG VIR_TYPED_PARAM_ULLONG +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 0) +# define VIR_DOMAIN_BLKIO_PARAM_DOUBLE VIR_TYPED_PARAM_DOUBLE +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 0) +# define VIR_DOMAIN_BLKIO_PARAM_BOOLEAN VIR_TYPED_PARAM_BOOLEAN +# endif + +/* enum virCPUCompareResult */ +# if !LIBVIR_CHECK_VERSION(0, 7, 5) +# define VIR_CPU_COMPARE_ERROR -1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 5) +# define VIR_CPU_COMPARE_INCOMPATIBLE 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 5) +# define VIR_CPU_COMPARE_IDENTICAL 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 5) +# define VIR_CPU_COMPARE_SUPERSET 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_CPU_COMPARE_LAST 3 +# endif + +/* enum virConnectBaselineCPUFlags */ +# if !LIBVIR_CHECK_VERSION(1, 1, 2) +# define VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 14) +# define VIR_CONNECT_BASELINE_CPU_MIGRATABLE (1 << 1) +# endif + +/* enum virConnectCloseReason */ +# if !LIBVIR_CHECK_VERSION(0, 10, 0) +# define VIR_CONNECT_CLOSE_REASON_ERROR 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 0) +# define VIR_CONNECT_CLOSE_REASON_EOF 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 0) +# define VIR_CONNECT_CLOSE_REASON_KEEPALIVE 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 0) +# define VIR_CONNECT_CLOSE_REASON_CLIENT 3 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 0) +# define VIR_CONNECT_CLOSE_REASON_LAST 4 +# endif + +/* enum virConnectCompareCPUFlags */ +# if !LIBVIR_CHECK_VERSION(1, 2, 6) +# define VIR_CONNECT_COMPARE_CPU_FAIL_INCOMPATIBLE (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(6, 9, 0) +# define VIR_CONNECT_COMPARE_CPU_VALIDATE_XML (1 << 1) +# endif + +/* enum virConnectCredentialType */ +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_CRED_USERNAME 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_CRED_AUTHNAME 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_CRED_LANGUAGE 3 +# endif +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_CRED_CNONCE 4 +# endif +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_CRED_PASSPHRASE 5 +# endif +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_CRED_ECHOPROMPT 6 +# endif +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_CRED_NOECHOPROMPT 7 +# endif +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_CRED_REALM 8 +# endif +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_CRED_EXTERNAL 9 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_CRED_LAST 10 +# endif + +/* enum virConnectDomainEventAgentLifecycleReason */ +# if !LIBVIR_CHECK_VERSION(1, 2, 11) +# define VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_UNKNOWN 0 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 11) +# define VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_DOMAIN_STARTED 1 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 11) +# define VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_CHANNEL 2 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 11) +# define VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_LAST 3 +# endif + +/* enum virConnectDomainEventAgentLifecycleState */ +# if !LIBVIR_CHECK_VERSION(1, 2, 11) +# define VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_CONNECTED 1 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 11) +# define VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_DISCONNECTED 2 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 11) +# define VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_LAST 3 +# endif + +/* enum virConnectDomainEventBlockJobStatus */ +# if !LIBVIR_CHECK_VERSION(0, 9, 4) +# define VIR_DOMAIN_BLOCK_JOB_COMPLETED 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 4) +# define VIR_DOMAIN_BLOCK_JOB_FAILED 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 12) +# define VIR_DOMAIN_BLOCK_JOB_CANCELED 2 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 0) +# define VIR_DOMAIN_BLOCK_JOB_READY 3 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_BLOCK_JOB_LAST 4 +# endif + +/* enum virConnectDomainEventDiskChangeReason */ +# if !LIBVIR_CHECK_VERSION(0, 9, 7) +# define VIR_DOMAIN_EVENT_DISK_CHANGE_MISSING_ON_START 0 +# endif +# if !LIBVIR_CHECK_VERSION(1, 1, 2) +# define VIR_DOMAIN_EVENT_DISK_DROP_MISSING_ON_START 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_EVENT_DISK_CHANGE_LAST 2 +# endif + +/* enum virConnectFlags */ +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_CONNECT_RO (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 7) +# define VIR_CONNECT_NO_ALIASES (1 << 1) +# endif + +/* enum virConnectGetAllDomainStatsFlags */ +# if !LIBVIR_CHECK_VERSION(1, 2, 8) +# define VIR_CONNECT_GET_ALL_DOMAINS_STATS_ACTIVE VIR_CONNECT_LIST_DOMAINS_ACTIVE +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 8) +# define VIR_CONNECT_GET_ALL_DOMAINS_STATS_INACTIVE VIR_CONNECT_LIST_DOMAINS_INACTIVE +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 8) +# define VIR_CONNECT_GET_ALL_DOMAINS_STATS_PERSISTENT VIR_CONNECT_LIST_DOMAINS_PERSISTENT +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 8) +# define VIR_CONNECT_GET_ALL_DOMAINS_STATS_TRANSIENT VIR_CONNECT_LIST_DOMAINS_TRANSIENT +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 8) +# define VIR_CONNECT_GET_ALL_DOMAINS_STATS_RUNNING VIR_CONNECT_LIST_DOMAINS_RUNNING +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 8) +# define VIR_CONNECT_GET_ALL_DOMAINS_STATS_PAUSED VIR_CONNECT_LIST_DOMAINS_PAUSED +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 8) +# define VIR_CONNECT_GET_ALL_DOMAINS_STATS_SHUTOFF VIR_CONNECT_LIST_DOMAINS_SHUTOFF +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 8) +# define VIR_CONNECT_GET_ALL_DOMAINS_STATS_OTHER VIR_CONNECT_LIST_DOMAINS_OTHER +# endif +# if !LIBVIR_CHECK_VERSION(4, 5, 0) +# define VIR_CONNECT_GET_ALL_DOMAINS_STATS_NOWAIT (1 << 29) +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 12) +# define VIR_CONNECT_GET_ALL_DOMAINS_STATS_BACKING (1 << 30) +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 8) +# define VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS (1U << 31) +# endif + +/* enum virConnectListAllDomainsFlags */ +# if !LIBVIR_CHECK_VERSION(0, 9, 13) +# define VIR_CONNECT_LIST_DOMAINS_ACTIVE (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 13) +# define VIR_CONNECT_LIST_DOMAINS_INACTIVE (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 13) +# define VIR_CONNECT_LIST_DOMAINS_PERSISTENT (1 << 2) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 13) +# define VIR_CONNECT_LIST_DOMAINS_TRANSIENT (1 << 3) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 13) +# define VIR_CONNECT_LIST_DOMAINS_RUNNING (1 << 4) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 13) +# define VIR_CONNECT_LIST_DOMAINS_PAUSED (1 << 5) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 13) +# define VIR_CONNECT_LIST_DOMAINS_SHUTOFF (1 << 6) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 13) +# define VIR_CONNECT_LIST_DOMAINS_OTHER (1 << 7) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 13) +# define VIR_CONNECT_LIST_DOMAINS_MANAGEDSAVE (1 << 8) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 13) +# define VIR_CONNECT_LIST_DOMAINS_NO_MANAGEDSAVE (1 << 9) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 13) +# define VIR_CONNECT_LIST_DOMAINS_AUTOSTART (1 << 10) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 13) +# define VIR_CONNECT_LIST_DOMAINS_NO_AUTOSTART (1 << 11) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 13) +# define VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT (1 << 12) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 13) +# define VIR_CONNECT_LIST_DOMAINS_NO_SNAPSHOT (1 << 13) +# endif +# if !LIBVIR_CHECK_VERSION(5, 6, 0) +# define VIR_CONNECT_LIST_DOMAINS_HAS_CHECKPOINT (1 << 14) +# endif +# if !LIBVIR_CHECK_VERSION(5, 6, 0) +# define VIR_CONNECT_LIST_DOMAINS_NO_CHECKPOINT (1 << 15) +# endif + +/* enum virConnectListAllInterfacesFlags */ +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_INTERFACES_INACTIVE (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_INTERFACES_ACTIVE (1 << 1) +# endif + +/* enum virConnectListAllNetworksFlags */ +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_NETWORKS_INACTIVE (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_NETWORKS_ACTIVE (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_NETWORKS_PERSISTENT (1 << 2) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_NETWORKS_TRANSIENT (1 << 3) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_NETWORKS_AUTOSTART (1 << 4) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_NETWORKS_NO_AUTOSTART (1 << 5) +# endif + +/* enum virConnectListAllNodeDeviceFlags */ +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_NODE_DEVICES_CAP_SYSTEM (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_NODE_DEVICES_CAP_PCI_DEV (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_NODE_DEVICES_CAP_USB_DEV (1 << 2) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_NODE_DEVICES_CAP_USB_INTERFACE (1 << 3) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_NODE_DEVICES_CAP_NET (1 << 4) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_HOST (1 << 5) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_TARGET (1 << 6) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI (1 << 7) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_NODE_DEVICES_CAP_STORAGE (1 << 8) +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 4) +# define VIR_CONNECT_LIST_NODE_DEVICES_CAP_FC_HOST (1 << 9) +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 4) +# define VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPORTS (1 << 10) +# endif +# if !LIBVIR_CHECK_VERSION(1, 1, 0) +# define VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_GENERIC (1 << 11) +# endif +# if !LIBVIR_CHECK_VERSION(3, 1, 0) +# define VIR_CONNECT_LIST_NODE_DEVICES_CAP_DRM (1 << 12) +# endif +# if !LIBVIR_CHECK_VERSION(3, 4, 0) +# define VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV_TYPES (1 << 13) +# endif +# if !LIBVIR_CHECK_VERSION(3, 4, 0) +# define VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV (1 << 14) +# endif +# if !LIBVIR_CHECK_VERSION(3, 4, 0) +# define VIR_CONNECT_LIST_NODE_DEVICES_CAP_CCW_DEV (1 << 15) +# endif +# if !LIBVIR_CHECK_VERSION(6, 8, 0) +# define VIR_CONNECT_LIST_NODE_DEVICES_CAP_CSS_DEV (1 << 16) +# endif +# if !LIBVIR_CHECK_VERSION(6, 9, 0) +# define VIR_CONNECT_LIST_NODE_DEVICES_CAP_VDPA (1 << 17) +# endif +# if !LIBVIR_CHECK_VERSION(7, 0, 0) +# define VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_CARD (1 << 18) +# endif +# if !LIBVIR_CHECK_VERSION(7, 0, 0) +# define VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_QUEUE (1 << 19) +# endif +# if !LIBVIR_CHECK_VERSION(7, 0, 0) +# define VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_MATRIX (1 << 20) +# endif +# if !LIBVIR_CHECK_VERSION(7, 9, 0) +# define VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPD (1 << 21) +# endif +# if !LIBVIR_CHECK_VERSION(10, 1, 0) +# define VIR_CONNECT_LIST_NODE_DEVICES_PERSISTENT (1 << 28) +# endif +# if !LIBVIR_CHECK_VERSION(10, 1, 0) +# define VIR_CONNECT_LIST_NODE_DEVICES_TRANSIENT (1 << 29) +# endif +# if !LIBVIR_CHECK_VERSION(7, 3, 0) +# define VIR_CONNECT_LIST_NODE_DEVICES_INACTIVE (1 << 30) +# endif +# if !LIBVIR_CHECK_VERSION(7, 3, 0) +# define VIR_CONNECT_LIST_NODE_DEVICES_ACTIVE (1U << 31) +# endif + +/* enum virConnectListAllSecretsFlags */ +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_SECRETS_EPHEMERAL (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_SECRETS_NO_EPHEMERAL (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_SECRETS_PRIVATE (1 << 2) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_SECRETS_NO_PRIVATE (1 << 3) +# endif + +/* enum virConnectListAllStoragePoolsFlags */ +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_STORAGE_POOLS_INACTIVE (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_STORAGE_POOLS_ACTIVE (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_STORAGE_POOLS_PERSISTENT (1 << 2) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_STORAGE_POOLS_TRANSIENT (1 << 3) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_STORAGE_POOLS_AUTOSTART (1 << 4) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_STORAGE_POOLS_NO_AUTOSTART (1 << 5) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_STORAGE_POOLS_DIR (1 << 6) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_STORAGE_POOLS_FS (1 << 7) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_STORAGE_POOLS_NETFS (1 << 8) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_STORAGE_POOLS_LOGICAL (1 << 9) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_STORAGE_POOLS_DISK (1 << 10) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_STORAGE_POOLS_ISCSI (1 << 11) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_STORAGE_POOLS_SCSI (1 << 12) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_STORAGE_POOLS_MPATH (1 << 13) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_STORAGE_POOLS_RBD (1 << 14) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_CONNECT_LIST_STORAGE_POOLS_SHEEPDOG (1 << 15) +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 1) +# define VIR_CONNECT_LIST_STORAGE_POOLS_GLUSTER (1 << 16) +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 8) +# define VIR_CONNECT_LIST_STORAGE_POOLS_ZFS (1 << 17) +# endif +# if !LIBVIR_CHECK_VERSION(3, 1, 0) +# define VIR_CONNECT_LIST_STORAGE_POOLS_VSTORAGE (1 << 18) +# endif +# if !LIBVIR_CHECK_VERSION(5, 6, 0) +# define VIR_CONNECT_LIST_STORAGE_POOLS_ISCSI_DIRECT (1 << 19) +# endif + +/* enum virDomainAbortJobFlagsValues */ +# if !LIBVIR_CHECK_VERSION(8, 5, 0) +# define VIR_DOMAIN_ABORT_JOB_POSTCOPY (1 << 0) +# endif + +/* enum virDomainAgentResponseTimeoutValues */ +# if !LIBVIR_CHECK_VERSION(5, 10, 0) +# define VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_BLOCK -2 +# endif +# if !LIBVIR_CHECK_VERSION(5, 10, 0) +# define VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_DEFAULT -1 +# endif +# if !LIBVIR_CHECK_VERSION(5, 10, 0) +# define VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_NOWAIT 0 +# endif + +/* enum virDomainAuthorizedSSHKeysSetFlags */ +# if !LIBVIR_CHECK_VERSION(6, 10, 0) +# define VIR_DOMAIN_AUTHORIZED_SSH_KEYS_SET_APPEND (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(6, 10, 0) +# define VIR_DOMAIN_AUTHORIZED_SSH_KEYS_SET_REMOVE (1 << 1) +# endif + +/* enum virDomainBackupBeginFlags */ +# if !LIBVIR_CHECK_VERSION(6, 0, 0) +# define VIR_DOMAIN_BACKUP_BEGIN_REUSE_EXTERNAL (1 << 0) +# endif + +/* enum virDomainBlockCommitFlags */ +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_DOMAIN_BLOCK_COMMIT_SHALLOW (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_DOMAIN_BLOCK_COMMIT_DELETE (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 6) +# define VIR_DOMAIN_BLOCK_COMMIT_ACTIVE (1 << 2) +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 7) +# define VIR_DOMAIN_BLOCK_COMMIT_RELATIVE (1 << 3) +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES (1 << 4) +# endif + +/* enum virDomainBlockCopyFlags */ +# if !LIBVIR_CHECK_VERSION(1, 2, 8) +# define VIR_DOMAIN_BLOCK_COPY_SHALLOW (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 8) +# define VIR_DOMAIN_BLOCK_COPY_REUSE_EXT (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(3, 5, 0) +# define VIR_DOMAIN_BLOCK_COPY_TRANSIENT_JOB (1 << 2) +# endif +# if !LIBVIR_CHECK_VERSION(8, 0, 0) +# define VIR_DOMAIN_BLOCK_COPY_SYNCHRONOUS_WRITES (1 << 3) +# endif + +/* enum virDomainBlockJobAbortFlags */ +# if !LIBVIR_CHECK_VERSION(0, 9, 12) +# define VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 12) +# define VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT (1 << 1) +# endif + +/* enum virDomainBlockJobInfoFlags */ +# if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_BLOCK_JOB_INFO_BANDWIDTH_BYTES (1 << 0) +# endif + +/* enum virDomainBlockJobSetSpeedFlags */ +# if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_BLOCK_JOB_SPEED_BANDWIDTH_BYTES (1 << 0) +# endif + +/* enum virDomainBlockJobType */ +# if !LIBVIR_CHECK_VERSION(0, 9, 4) +# define VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 4) +# define VIR_DOMAIN_BLOCK_JOB_TYPE_PULL 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 12) +# define VIR_DOMAIN_BLOCK_JOB_TYPE_COPY 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT 3 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 6) +# define VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT 4 +# endif +# if !LIBVIR_CHECK_VERSION(6, 0, 0) +# define VIR_DOMAIN_BLOCK_JOB_TYPE_BACKUP 5 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_BLOCK_JOB_TYPE_LAST 6 +# endif + +/* enum virDomainBlockPullFlags */ +# if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_BLOCK_PULL_BANDWIDTH_BYTES (1 << 6) +# endif + +/* enum virDomainBlockRebaseFlags */ +# if !LIBVIR_CHECK_VERSION(0, 9, 12) +# define VIR_DOMAIN_BLOCK_REBASE_SHALLOW (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 12) +# define VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 12) +# define VIR_DOMAIN_BLOCK_REBASE_COPY_RAW (1 << 2) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 12) +# define VIR_DOMAIN_BLOCK_REBASE_COPY (1 << 3) +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 7) +# define VIR_DOMAIN_BLOCK_REBASE_RELATIVE (1 << 4) +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_BLOCK_REBASE_COPY_DEV (1 << 5) +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_BLOCK_REBASE_BANDWIDTH_BYTES (1 << 6) +# endif + +/* enum virDomainBlockResizeFlags */ +# if !LIBVIR_CHECK_VERSION(0, 9, 11) +# define VIR_DOMAIN_BLOCK_RESIZE_BYTES (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(10, 0, 0) +# define VIR_DOMAIN_BLOCK_RESIZE_CAPACITY (1 << 1) +# endif + +/* enum virDomainBlockedReason */ +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_BLOCKED_UNKNOWN 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_BLOCKED_LAST 1 +# endif + +/* enum virDomainChannelFlags */ +# if !LIBVIR_CHECK_VERSION(1, 0, 2) +# define VIR_DOMAIN_CHANNEL_FORCE (1 << 0) +# endif + +/* enum virDomainCheckpointCreateFlags */ +# if !LIBVIR_CHECK_VERSION(5, 6, 0) +# define VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(5, 6, 0) +# define VIR_DOMAIN_CHECKPOINT_CREATE_QUIESCE (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(6, 10, 0) +# define VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE_VALIDATE (1 << 2) +# endif + +/* enum virDomainCheckpointDeleteFlags */ +# if !LIBVIR_CHECK_VERSION(5, 6, 0) +# define VIR_DOMAIN_CHECKPOINT_DELETE_CHILDREN (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(5, 6, 0) +# define VIR_DOMAIN_CHECKPOINT_DELETE_METADATA_ONLY (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(5, 6, 0) +# define VIR_DOMAIN_CHECKPOINT_DELETE_CHILDREN_ONLY (1 << 2) +# endif + +/* enum virDomainCheckpointListFlags */ +# if !LIBVIR_CHECK_VERSION(5, 6, 0) +# define VIR_DOMAIN_CHECKPOINT_LIST_DESCENDANTS (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(5, 6, 0) +# define VIR_DOMAIN_CHECKPOINT_LIST_ROOTS (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(5, 6, 0) +# define VIR_DOMAIN_CHECKPOINT_LIST_TOPOLOGICAL (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(5, 6, 0) +# define VIR_DOMAIN_CHECKPOINT_LIST_LEAVES (1 << 2) +# endif +# if !LIBVIR_CHECK_VERSION(5, 6, 0) +# define VIR_DOMAIN_CHECKPOINT_LIST_NO_LEAVES (1 << 3) +# endif + +/* enum virDomainCheckpointXMLFlags */ +# if !LIBVIR_CHECK_VERSION(5, 6, 0) +# define VIR_DOMAIN_CHECKPOINT_XML_SECURE (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(5, 6, 0) +# define VIR_DOMAIN_CHECKPOINT_XML_NO_DOMAIN (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(5, 6, 0) +# define VIR_DOMAIN_CHECKPOINT_XML_SIZE (1 << 2) +# endif + +/* enum virDomainConsoleFlags */ +# if !LIBVIR_CHECK_VERSION(0, 9, 11) +# define VIR_DOMAIN_CONSOLE_FORCE (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 11) +# define VIR_DOMAIN_CONSOLE_SAFE (1 << 1) +# endif + +/* enum virDomainControlErrorReason */ +# if !LIBVIR_CHECK_VERSION(1, 2, 14) +# define VIR_DOMAIN_CONTROL_ERROR_REASON_NONE 0 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 14) +# define VIR_DOMAIN_CONTROL_ERROR_REASON_UNKNOWN 1 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 14) +# define VIR_DOMAIN_CONTROL_ERROR_REASON_MONITOR 2 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 14) +# define VIR_DOMAIN_CONTROL_ERROR_REASON_INTERNAL 3 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 14) +# define VIR_DOMAIN_CONTROL_ERROR_REASON_LAST 4 +# endif + +/* enum virDomainControlState */ +# if !LIBVIR_CHECK_VERSION(0, 9, 3) +# define VIR_DOMAIN_CONTROL_OK 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 3) +# define VIR_DOMAIN_CONTROL_JOB 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 3) +# define VIR_DOMAIN_CONTROL_OCCUPIED 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 3) +# define VIR_DOMAIN_CONTROL_ERROR 3 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_CONTROL_LAST 4 +# endif + +/* enum virDomainCoreDumpFlags */ +# if !LIBVIR_CHECK_VERSION(0, 7, 5) +# define VIR_DUMP_CRASH (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 5) +# define VIR_DUMP_LIVE (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 4) +# define VIR_DUMP_BYPASS_CACHE (1 << 2) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 7) +# define VIR_DUMP_RESET (1 << 3) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 13) +# define VIR_DUMP_MEMORY_ONLY (1 << 4) +# endif + +/* enum virDomainCoreDumpFormat */ +# if !LIBVIR_CHECK_VERSION(1, 2, 3) +# define VIR_DOMAIN_CORE_DUMP_FORMAT_RAW 0 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 3) +# define VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_ZLIB 1 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 3) +# define VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_LZO 2 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 3) +# define VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_SNAPPY 3 +# endif +# if !LIBVIR_CHECK_VERSION(7, 4, 0) +# define VIR_DOMAIN_CORE_DUMP_FORMAT_WIN_DMP 4 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 3) +# define VIR_DOMAIN_CORE_DUMP_FORMAT_LAST 5 +# endif + +/* enum virDomainCrashedReason */ +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_CRASHED_UNKNOWN 0 +# endif +# if !LIBVIR_CHECK_VERSION(1, 1, 1) +# define VIR_DOMAIN_CRASHED_PANICKED 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_CRASHED_LAST 2 +# endif + +/* enum virDomainCreateFlags */ +# if !LIBVIR_CHECK_VERSION(0, 0, 1) +# define VIR_DOMAIN_NONE 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 2) +# define VIR_DOMAIN_START_PAUSED (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 3) +# define VIR_DOMAIN_START_AUTODESTROY (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 4) +# define VIR_DOMAIN_START_BYPASS_CACHE (1 << 2) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_START_FORCE_BOOT (1 << 3) +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 12) +# define VIR_DOMAIN_START_VALIDATE (1 << 4) +# endif +# if !LIBVIR_CHECK_VERSION(8, 1, 0) +# define VIR_DOMAIN_START_RESET_NVRAM (1 << 5) +# endif + +/* enum virDomainDefineFlags */ +# if !LIBVIR_CHECK_VERSION(1, 2, 12) +# define VIR_DOMAIN_DEFINE_VALIDATE (1 << 0) +# endif + +/* enum virDomainDestroyFlagsValues */ +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_DESTROY_DEFAULT 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_DESTROY_GRACEFUL (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(8, 3, 0) +# define VIR_DOMAIN_DESTROY_REMOVE_LOGS (1 << 1) +# endif + +/* enum virDomainDeviceModifyFlags */ +# if !LIBVIR_CHECK_VERSION(0, 7, 7) +# define VIR_DOMAIN_DEVICE_MODIFY_CURRENT VIR_DOMAIN_AFFECT_CURRENT +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 7) +# define VIR_DOMAIN_DEVICE_MODIFY_LIVE VIR_DOMAIN_AFFECT_LIVE +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 7) +# define VIR_DOMAIN_DEVICE_MODIFY_CONFIG VIR_DOMAIN_AFFECT_CONFIG +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 6) +# define VIR_DOMAIN_DEVICE_MODIFY_FORCE (1 << 2) +# endif + +/* enum virDomainDirtyRateCalcFlags */ +# if !LIBVIR_CHECK_VERSION(8, 1, 0) +# define VIR_DOMAIN_DIRTYRATE_MODE_PAGE_SAMPLING 0 +# endif +# if !LIBVIR_CHECK_VERSION(8, 1, 0) +# define VIR_DOMAIN_DIRTYRATE_MODE_DIRTY_BITMAP (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(8, 1, 0) +# define VIR_DOMAIN_DIRTYRATE_MODE_DIRTY_RING (1 << 1) +# endif + +/* enum virDomainDirtyRateStatus */ +# if !LIBVIR_CHECK_VERSION(7, 2, 0) +# define VIR_DOMAIN_DIRTYRATE_UNSTARTED 0 +# endif +# if !LIBVIR_CHECK_VERSION(7, 2, 0) +# define VIR_DOMAIN_DIRTYRATE_MEASURING 1 +# endif +# if !LIBVIR_CHECK_VERSION(7, 2, 0) +# define VIR_DOMAIN_DIRTYRATE_MEASURED 2 +# endif +# if !LIBVIR_CHECK_VERSION(7, 2, 0) +# define VIR_DOMAIN_DIRTYRATE_LAST 3 +# endif + +/* enum virDomainDiskErrorCode */ +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_DISK_ERROR_NONE 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_DISK_ERROR_UNSPEC 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_DISK_ERROR_NO_SPACE 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_DISK_ERROR_LAST 3 +# endif + +/* enum virDomainEventCrashedDetailType */ +# if !LIBVIR_CHECK_VERSION(1, 1, 1) +# define VIR_DOMAIN_EVENT_CRASHED_PANICKED 0 +# endif +# if !LIBVIR_CHECK_VERSION(6, 1, 0) +# define VIR_DOMAIN_EVENT_CRASHED_CRASHLOADED 1 +# endif +# if !LIBVIR_CHECK_VERSION(1, 1, 1) +# define VIR_DOMAIN_EVENT_CRASHED_LAST 2 +# endif + +/* enum virDomainEventDefinedDetailType */ +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_DOMAIN_EVENT_DEFINED_ADDED 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_DOMAIN_EVENT_DEFINED_UPDATED 1 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 19) +# define VIR_DOMAIN_EVENT_DEFINED_RENAMED 2 +# endif +# if !LIBVIR_CHECK_VERSION(1, 3, 3) +# define VIR_DOMAIN_EVENT_DEFINED_FROM_SNAPSHOT 3 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_EVENT_DEFINED_LAST 4 +# endif + +/* enum virDomainEventGraphicsAddressType */ +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 7) +# define VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_UNIX 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_LAST 3 +# endif + +/* enum virDomainEventGraphicsPhase */ +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_DOMAIN_EVENT_GRAPHICS_CONNECT 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_DOMAIN_EVENT_GRAPHICS_INITIALIZE 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_EVENT_GRAPHICS_LAST 3 +# endif + +/* enum virDomainEventID */ +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_DOMAIN_EVENT_ID_LIFECYCLE 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_DOMAIN_EVENT_ID_REBOOT 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_DOMAIN_EVENT_ID_RTC_CHANGE 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_DOMAIN_EVENT_ID_WATCHDOG 3 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_DOMAIN_EVENT_ID_IO_ERROR 4 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_DOMAIN_EVENT_ID_GRAPHICS 5 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 1) +# define VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON 6 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_EVENT_ID_CONTROL_ERROR 7 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 4) +# define VIR_DOMAIN_EVENT_ID_BLOCK_JOB 8 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 7) +# define VIR_DOMAIN_EVENT_ID_DISK_CHANGE 9 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 11) +# define VIR_DOMAIN_EVENT_ID_TRAY_CHANGE 10 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 11) +# define VIR_DOMAIN_EVENT_ID_PMWAKEUP 11 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 11) +# define VIR_DOMAIN_EVENT_ID_PMSUSPEND 12 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 0) +# define VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE 13 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 0) +# define VIR_DOMAIN_EVENT_ID_PMSUSPEND_DISK 14 +# endif +# if !LIBVIR_CHECK_VERSION(1, 1, 1) +# define VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED 15 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 6) +# define VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2 16 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_EVENT_ID_TUNABLE 17 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 11) +# define VIR_DOMAIN_EVENT_ID_AGENT_LIFECYCLE 18 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 15) +# define VIR_DOMAIN_EVENT_ID_DEVICE_ADDED 19 +# endif +# if !LIBVIR_CHECK_VERSION(1, 3, 2) +# define VIR_DOMAIN_EVENT_ID_MIGRATION_ITERATION 20 +# endif +# if !LIBVIR_CHECK_VERSION(1, 3, 3) +# define VIR_DOMAIN_EVENT_ID_JOB_COMPLETED 21 +# endif +# if !LIBVIR_CHECK_VERSION(1, 3, 4) +# define VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED 22 +# endif +# if !LIBVIR_CHECK_VERSION(3, 0, 0) +# define VIR_DOMAIN_EVENT_ID_METADATA_CHANGE 23 +# endif +# if !LIBVIR_CHECK_VERSION(3, 2, 0) +# define VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD 24 +# endif +# if !LIBVIR_CHECK_VERSION(6, 9, 0) +# define VIR_DOMAIN_EVENT_ID_MEMORY_FAILURE 25 +# endif +# if !LIBVIR_CHECK_VERSION(7, 9, 0) +# define VIR_DOMAIN_EVENT_ID_MEMORY_DEVICE_SIZE_CHANGE 26 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_DOMAIN_EVENT_ID_LAST 27 +# endif + +/* enum virDomainEventIOErrorAction */ +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_DOMAIN_EVENT_IO_ERROR_NONE 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_DOMAIN_EVENT_IO_ERROR_PAUSE 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_DOMAIN_EVENT_IO_ERROR_REPORT 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_EVENT_IO_ERROR_LAST 3 +# endif + +/* enum virDomainEventPMSuspendedDetailType */ +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_DOMAIN_EVENT_PMSUSPENDED_MEMORY 0 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 0) +# define VIR_DOMAIN_EVENT_PMSUSPENDED_DISK 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_DOMAIN_EVENT_PMSUSPENDED_LAST 2 +# endif + +/* enum virDomainEventResumedDetailType */ +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_DOMAIN_EVENT_RESUMED_UNPAUSED 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_DOMAIN_EVENT_RESUMED_MIGRATED 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT 2 +# endif +# if !LIBVIR_CHECK_VERSION(1, 3, 3) +# define VIR_DOMAIN_EVENT_RESUMED_POSTCOPY 3 +# endif +# if !LIBVIR_CHECK_VERSION(8, 5, 0) +# define VIR_DOMAIN_EVENT_RESUMED_POSTCOPY_FAILED 4 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_EVENT_RESUMED_LAST 5 +# endif + +/* enum virDomainEventShutdownDetailType */ +# if !LIBVIR_CHECK_VERSION(0, 9, 8) +# define VIR_DOMAIN_EVENT_SHUTDOWN_FINISHED 0 +# endif +# if !LIBVIR_CHECK_VERSION(3, 4, 0) +# define VIR_DOMAIN_EVENT_SHUTDOWN_GUEST 1 +# endif +# if !LIBVIR_CHECK_VERSION(3, 4, 0) +# define VIR_DOMAIN_EVENT_SHUTDOWN_HOST 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_EVENT_SHUTDOWN_LAST 3 +# endif + +/* enum virDomainEventStartedDetailType */ +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_DOMAIN_EVENT_STARTED_BOOTED 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_DOMAIN_EVENT_STARTED_MIGRATED 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_DOMAIN_EVENT_STARTED_RESTORED 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_DOMAIN_EVENT_STARTED_FROM_SNAPSHOT 3 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 11) +# define VIR_DOMAIN_EVENT_STARTED_WAKEUP 4 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_EVENT_STARTED_LAST 5 +# endif + +/* enum virDomainEventStoppedDetailType */ +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_DOMAIN_EVENT_STOPPED_DESTROYED 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_DOMAIN_EVENT_STOPPED_CRASHED 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_DOMAIN_EVENT_STOPPED_MIGRATED 3 +# endif +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_DOMAIN_EVENT_STOPPED_SAVED 4 +# endif +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_DOMAIN_EVENT_STOPPED_FAILED 5 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT 6 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_EVENT_STOPPED_LAST 7 +# endif + +/* enum virDomainEventSuspendedDetailType */ +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_DOMAIN_EVENT_SUSPENDED_PAUSED 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_DOMAIN_EVENT_SUSPENDED_IOERROR 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_DOMAIN_EVENT_SUSPENDED_WATCHDOG 3 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_EVENT_SUSPENDED_RESTORED 4 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT 5 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR 6 +# endif +# if !LIBVIR_CHECK_VERSION(1, 3, 3) +# define VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY 7 +# endif +# if !LIBVIR_CHECK_VERSION(1, 3, 3) +# define VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY_FAILED 8 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_EVENT_SUSPENDED_LAST 9 +# endif + +/* enum virDomainEventTrayChangeReason */ +# if !LIBVIR_CHECK_VERSION(0, 9, 11) +# define VIR_DOMAIN_EVENT_TRAY_CHANGE_OPEN 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 11) +# define VIR_DOMAIN_EVENT_TRAY_CHANGE_CLOSE 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 11) +# define VIR_DOMAIN_EVENT_TRAY_CHANGE_LAST 2 +# endif + +/* enum virDomainEventType */ +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_DOMAIN_EVENT_DEFINED 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_DOMAIN_EVENT_UNDEFINED 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_DOMAIN_EVENT_STARTED 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_DOMAIN_EVENT_SUSPENDED 3 +# endif +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_DOMAIN_EVENT_RESUMED 4 +# endif +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_DOMAIN_EVENT_STOPPED 5 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 8) +# define VIR_DOMAIN_EVENT_SHUTDOWN 6 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_DOMAIN_EVENT_PMSUSPENDED 7 +# endif +# if !LIBVIR_CHECK_VERSION(1, 1, 1) +# define VIR_DOMAIN_EVENT_CRASHED 8 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_EVENT_LAST 9 +# endif + +/* enum virDomainEventUndefinedDetailType */ +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_DOMAIN_EVENT_UNDEFINED_REMOVED 0 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 19) +# define VIR_DOMAIN_EVENT_UNDEFINED_RENAMED 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_EVENT_UNDEFINED_LAST 2 +# endif + +/* enum virDomainEventWatchdogAction */ +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_DOMAIN_EVENT_WATCHDOG_NONE 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_DOMAIN_EVENT_WATCHDOG_PAUSE 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_DOMAIN_EVENT_WATCHDOG_RESET 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_DOMAIN_EVENT_WATCHDOG_POWEROFF 3 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_DOMAIN_EVENT_WATCHDOG_SHUTDOWN 4 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_DOMAIN_EVENT_WATCHDOG_DEBUG 5 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 17) +# define VIR_DOMAIN_EVENT_WATCHDOG_INJECTNMI 6 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_EVENT_WATCHDOG_LAST 7 +# endif + +/* enum virDomainFDAssociateFlags */ +# if !LIBVIR_CHECK_VERSION(9, 0, 0) +# define VIR_DOMAIN_FD_ASSOCIATE_SECLABEL_RESTORE (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(9, 0, 0) +# define VIR_DOMAIN_FD_ASSOCIATE_SECLABEL_WRITABLE (1 << 1) +# endif + +/* enum virDomainGetHostnameFlags */ +# if !LIBVIR_CHECK_VERSION(6, 1, 0) +# define VIR_DOMAIN_GET_HOSTNAME_LEASE (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(6, 1, 0) +# define VIR_DOMAIN_GET_HOSTNAME_AGENT (1 << 1) +# endif + +/* enum virDomainGetJobStatsFlags */ +# if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_JOB_STATS_COMPLETED (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(6, 0, 0) +# define VIR_DOMAIN_JOB_STATS_KEEP_COMPLETED (1 << 1) +# endif + +/* enum virDomainGraphicsReloadType */ +# if !LIBVIR_CHECK_VERSION(10, 2, 0) +# define VIR_DOMAIN_GRAPHICS_RELOAD_TYPE_ANY 0 +# endif +# if !LIBVIR_CHECK_VERSION(10, 2, 0) +# define VIR_DOMAIN_GRAPHICS_RELOAD_TYPE_VNC 1 +# endif +# if !LIBVIR_CHECK_VERSION(10, 2, 0) +# define VIR_DOMAIN_GRAPHICS_RELOAD_TYPE_LAST 2 +# endif + +/* enum virDomainGuestInfoTypes */ +# if !LIBVIR_CHECK_VERSION(5, 7, 0) +# define VIR_DOMAIN_GUEST_INFO_USERS (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(5, 7, 0) +# define VIR_DOMAIN_GUEST_INFO_OS (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(5, 7, 0) +# define VIR_DOMAIN_GUEST_INFO_TIMEZONE (1 << 2) +# endif +# if !LIBVIR_CHECK_VERSION(5, 7, 0) +# define VIR_DOMAIN_GUEST_INFO_HOSTNAME (1 << 3) +# endif +# if !LIBVIR_CHECK_VERSION(5, 7, 0) +# define VIR_DOMAIN_GUEST_INFO_FILESYSTEM (1 << 4) +# endif +# if !LIBVIR_CHECK_VERSION(7, 0, 0) +# define VIR_DOMAIN_GUEST_INFO_DISKS (1 << 5) +# endif +# if !LIBVIR_CHECK_VERSION(7, 10, 0) +# define VIR_DOMAIN_GUEST_INFO_INTERFACES (1 << 6) +# endif + +/* enum virDomainInterfaceAddressesSource */ +# if !LIBVIR_CHECK_VERSION(1, 2, 14) +# define VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE 0 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 14) +# define VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_AGENT 1 +# endif +# if !LIBVIR_CHECK_VERSION(4, 2, 0) +# define VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_ARP 2 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 14) +# define VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LAST 3 +# endif + +/* enum virDomainJobOperation */ +# if !LIBVIR_CHECK_VERSION(3, 3, 0) +# define VIR_DOMAIN_JOB_OPERATION_UNKNOWN 0 +# endif +# if !LIBVIR_CHECK_VERSION(3, 3, 0) +# define VIR_DOMAIN_JOB_OPERATION_START 1 +# endif +# if !LIBVIR_CHECK_VERSION(3, 3, 0) +# define VIR_DOMAIN_JOB_OPERATION_SAVE 2 +# endif +# if !LIBVIR_CHECK_VERSION(3, 3, 0) +# define VIR_DOMAIN_JOB_OPERATION_RESTORE 3 +# endif +# if !LIBVIR_CHECK_VERSION(3, 3, 0) +# define VIR_DOMAIN_JOB_OPERATION_MIGRATION_IN 4 +# endif +# if !LIBVIR_CHECK_VERSION(3, 3, 0) +# define VIR_DOMAIN_JOB_OPERATION_MIGRATION_OUT 5 +# endif +# if !LIBVIR_CHECK_VERSION(3, 3, 0) +# define VIR_DOMAIN_JOB_OPERATION_SNAPSHOT 6 +# endif +# if !LIBVIR_CHECK_VERSION(3, 3, 0) +# define VIR_DOMAIN_JOB_OPERATION_SNAPSHOT_REVERT 7 +# endif +# if !LIBVIR_CHECK_VERSION(3, 3, 0) +# define VIR_DOMAIN_JOB_OPERATION_DUMP 8 +# endif +# if !LIBVIR_CHECK_VERSION(6, 0, 0) +# define VIR_DOMAIN_JOB_OPERATION_BACKUP 9 +# endif +# if !LIBVIR_CHECK_VERSION(9, 0, 0) +# define VIR_DOMAIN_JOB_OPERATION_SNAPSHOT_DELETE 10 +# endif +# if !LIBVIR_CHECK_VERSION(3, 3, 0) +# define VIR_DOMAIN_JOB_OPERATION_LAST 11 +# endif + +/* enum virDomainJobType */ +# if !LIBVIR_CHECK_VERSION(0, 7, 7) +# define VIR_DOMAIN_JOB_NONE 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 7) +# define VIR_DOMAIN_JOB_BOUNDED 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 7) +# define VIR_DOMAIN_JOB_UNBOUNDED 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 7) +# define VIR_DOMAIN_JOB_COMPLETED 3 +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 7) +# define VIR_DOMAIN_JOB_FAILED 4 +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 7) +# define VIR_DOMAIN_JOB_CANCELLED 5 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_JOB_LAST 6 +# endif + +/* enum virDomainLifecycle */ +# if !LIBVIR_CHECK_VERSION(3, 9, 0) +# define VIR_DOMAIN_LIFECYCLE_POWEROFF 0 +# endif +# if !LIBVIR_CHECK_VERSION(3, 9, 0) +# define VIR_DOMAIN_LIFECYCLE_REBOOT 1 +# endif +# if !LIBVIR_CHECK_VERSION(3, 9, 0) +# define VIR_DOMAIN_LIFECYCLE_CRASH 2 +# endif +# if !LIBVIR_CHECK_VERSION(3, 9, 0) +# define VIR_DOMAIN_LIFECYCLE_LAST 3 +# endif + +/* enum virDomainLifecycleAction */ +# if !LIBVIR_CHECK_VERSION(3, 9, 0) +# define VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY 0 +# endif +# if !LIBVIR_CHECK_VERSION(3, 9, 0) +# define VIR_DOMAIN_LIFECYCLE_ACTION_RESTART 1 +# endif +# if !LIBVIR_CHECK_VERSION(3, 9, 0) +# define VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME 2 +# endif +# if !LIBVIR_CHECK_VERSION(3, 9, 0) +# define VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE 3 +# endif +# if !LIBVIR_CHECK_VERSION(3, 9, 0) +# define VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_DESTROY 4 +# endif +# if !LIBVIR_CHECK_VERSION(3, 9, 0) +# define VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_RESTART 5 +# endif +# if !LIBVIR_CHECK_VERSION(3, 9, 0) +# define VIR_DOMAIN_LIFECYCLE_ACTION_LAST 6 +# endif + +/* enum virDomainMemoryFailureActionType */ +# if !LIBVIR_CHECK_VERSION(6, 9, 0) +# define VIR_DOMAIN_EVENT_MEMORY_FAILURE_ACTION_IGNORE 0 +# endif +# if !LIBVIR_CHECK_VERSION(6, 9, 0) +# define VIR_DOMAIN_EVENT_MEMORY_FAILURE_ACTION_INJECT 1 +# endif +# if !LIBVIR_CHECK_VERSION(6, 9, 0) +# define VIR_DOMAIN_EVENT_MEMORY_FAILURE_ACTION_FATAL 2 +# endif +# if !LIBVIR_CHECK_VERSION(6, 9, 0) +# define VIR_DOMAIN_EVENT_MEMORY_FAILURE_ACTION_RESET 3 +# endif +# if !LIBVIR_CHECK_VERSION(6, 9, 0) +# define VIR_DOMAIN_EVENT_MEMORY_FAILURE_ACTION_LAST 4 +# endif + +/* enum virDomainMemoryFailureFlags */ +# if !LIBVIR_CHECK_VERSION(6, 9, 0) +# define VIR_DOMAIN_MEMORY_FAILURE_ACTION_REQUIRED (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(6, 9, 0) +# define VIR_DOMAIN_MEMORY_FAILURE_RECURSIVE (1 << 1) +# endif + +/* enum virDomainMemoryFailureRecipientType */ +# if !LIBVIR_CHECK_VERSION(6, 9, 0) +# define VIR_DOMAIN_EVENT_MEMORY_FAILURE_RECIPIENT_HYPERVISOR 0 +# endif +# if !LIBVIR_CHECK_VERSION(6, 9, 0) +# define VIR_DOMAIN_EVENT_MEMORY_FAILURE_RECIPIENT_GUEST 1 +# endif +# if !LIBVIR_CHECK_VERSION(6, 9, 0) +# define VIR_DOMAIN_EVENT_MEMORY_FAILURE_RECIPIENT_LAST 2 +# endif + +/* enum virDomainMemoryFlags */ +# if !LIBVIR_CHECK_VERSION(0, 4, 4) +# define VIR_MEMORY_VIRTUAL (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 0) +# define VIR_MEMORY_PHYSICAL (1 << 1) +# endif + +/* enum virDomainMemoryModFlags */ +# if !LIBVIR_CHECK_VERSION(0, 9, 1) +# define VIR_DOMAIN_MEM_CURRENT VIR_DOMAIN_AFFECT_CURRENT +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 0) +# define VIR_DOMAIN_MEM_LIVE VIR_DOMAIN_AFFECT_LIVE +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 0) +# define VIR_DOMAIN_MEM_CONFIG VIR_DOMAIN_AFFECT_CONFIG +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 1) +# define VIR_DOMAIN_MEM_MAXIMUM (1 << 2) +# endif + +/* enum virDomainMemoryStatTags */ +# if !LIBVIR_CHECK_VERSION(0, 7, 5) +# define VIR_DOMAIN_MEMORY_STAT_SWAP_IN 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 5) +# define VIR_DOMAIN_MEMORY_STAT_SWAP_OUT 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 5) +# define VIR_DOMAIN_MEMORY_STAT_MAJOR_FAULT 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 5) +# define VIR_DOMAIN_MEMORY_STAT_MINOR_FAULT 3 +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 5) +# define VIR_DOMAIN_MEMORY_STAT_UNUSED 4 +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 5) +# define VIR_DOMAIN_MEMORY_STAT_AVAILABLE 5 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 3) +# define VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON 6 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_MEMORY_STAT_RSS 7 +# endif +# if !LIBVIR_CHECK_VERSION(2, 1, 0) +# define VIR_DOMAIN_MEMORY_STAT_USABLE 8 +# endif +# if !LIBVIR_CHECK_VERSION(2, 1, 0) +# define VIR_DOMAIN_MEMORY_STAT_LAST_UPDATE 9 +# endif +# if !LIBVIR_CHECK_VERSION(4, 6, 0) +# define VIR_DOMAIN_MEMORY_STAT_DISK_CACHES 10 +# endif +# if !LIBVIR_CHECK_VERSION(5, 4, 0) +# define VIR_DOMAIN_MEMORY_STAT_HUGETLB_PGALLOC 11 +# endif +# if !LIBVIR_CHECK_VERSION(5, 4, 0) +# define VIR_DOMAIN_MEMORY_STAT_HUGETLB_PGFAIL 12 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_MEMORY_STAT_LAST VIR_DOMAIN_MEMORY_STAT_NR +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 5) +# define VIR_DOMAIN_MEMORY_STAT_NR 13 +# endif + +/* enum virDomainMessageType */ +# if !LIBVIR_CHECK_VERSION(7, 1, 0) +# define VIR_DOMAIN_MESSAGE_DEPRECATION (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(7, 1, 0) +# define VIR_DOMAIN_MESSAGE_TAINTING (1 << 1) +# endif + +/* enum virDomainMetadataType */ +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_METADATA_DESCRIPTION 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_METADATA_TITLE 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_METADATA_ELEMENT 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_METADATA_LAST 3 +# endif + +/* enum virDomainMigrateFlags */ +# if !LIBVIR_CHECK_VERSION(0, 3, 2) +# define VIR_MIGRATE_LIVE (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 2) +# define VIR_MIGRATE_PEER2PEER (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 2) +# define VIR_MIGRATE_TUNNELLED (1 << 2) +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 3) +# define VIR_MIGRATE_PERSIST_DEST (1 << 3) +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 3) +# define VIR_MIGRATE_UNDEFINE_SOURCE (1 << 4) +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 5) +# define VIR_MIGRATE_PAUSED (1 << 5) +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 2) +# define VIR_MIGRATE_NON_SHARED_DISK (1 << 6) +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 2) +# define VIR_MIGRATE_NON_SHARED_INC (1 << 7) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 4) +# define VIR_MIGRATE_CHANGE_PROTECTION (1 << 8) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 11) +# define VIR_MIGRATE_UNSAFE (1 << 9) +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_MIGRATE_OFFLINE (1 << 10) +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 3) +# define VIR_MIGRATE_COMPRESSED (1 << 11) +# endif +# if !LIBVIR_CHECK_VERSION(1, 1, 0) +# define VIR_MIGRATE_ABORT_ON_ERROR (1 << 12) +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 3) +# define VIR_MIGRATE_AUTO_CONVERGE (1 << 13) +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_MIGRATE_RDMA_PIN_ALL (1 << 14) +# endif +# if !LIBVIR_CHECK_VERSION(1, 3, 3) +# define VIR_MIGRATE_POSTCOPY (1 << 15) +# endif +# if !LIBVIR_CHECK_VERSION(3, 2, 0) +# define VIR_MIGRATE_TLS (1 << 16) +# endif +# if !LIBVIR_CHECK_VERSION(5, 2, 0) +# define VIR_MIGRATE_PARALLEL (1 << 17) +# endif +# if !LIBVIR_CHECK_VERSION(8, 0, 0) +# define VIR_MIGRATE_NON_SHARED_SYNCHRONOUS_WRITES (1 << 18) +# endif +# if !LIBVIR_CHECK_VERSION(8, 5, 0) +# define VIR_MIGRATE_POSTCOPY_RESUME (1 << 19) +# endif +# if !LIBVIR_CHECK_VERSION(8, 5, 0) +# define VIR_MIGRATE_ZEROCOPY (1 << 20) +# endif + +/* enum virDomainMigrateMaxSpeedFlags */ +# if !LIBVIR_CHECK_VERSION(5, 1, 0) +# define VIR_DOMAIN_MIGRATE_MAX_SPEED_POSTCOPY (1 << 0) +# endif + +/* enum virDomainModificationImpact */ +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_AFFECT_CURRENT 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_AFFECT_LIVE (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_AFFECT_CONFIG (1 << 1) +# endif + +/* enum virDomainNostateReason */ +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_NOSTATE_UNKNOWN 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_NOSTATE_LAST 1 +# endif + +/* enum virDomainNumatuneMemMode */ +# if !LIBVIR_CHECK_VERSION(0, 9, 9) +# define VIR_DOMAIN_NUMATUNE_MEM_STRICT 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 9) +# define VIR_DOMAIN_NUMATUNE_MEM_PREFERRED 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 9) +# define VIR_DOMAIN_NUMATUNE_MEM_INTERLEAVE 2 +# endif +# if !LIBVIR_CHECK_VERSION(7, 3, 0) +# define VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE 3 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 9) +# define VIR_DOMAIN_NUMATUNE_MEM_LAST 4 +# endif + +/* enum virDomainOpenGraphicsFlags */ +# if !LIBVIR_CHECK_VERSION(0, 9, 7) +# define VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH (1 << 0) +# endif + +/* enum virDomainPMSuspendedDiskReason */ +# if !LIBVIR_CHECK_VERSION(1, 0, 0) +# define VIR_DOMAIN_PMSUSPENDED_DISK_UNKNOWN 0 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 0) +# define VIR_DOMAIN_PMSUSPENDED_DISK_LAST 1 +# endif + +/* enum virDomainPMSuspendedReason */ +# if !LIBVIR_CHECK_VERSION(0, 9, 11) +# define VIR_DOMAIN_PMSUSPENDED_UNKNOWN 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 11) +# define VIR_DOMAIN_PMSUSPENDED_LAST 1 +# endif + +/* enum virDomainPausedReason */ +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_PAUSED_UNKNOWN 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_PAUSED_USER 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_PAUSED_MIGRATION 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_PAUSED_SAVE 3 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_PAUSED_DUMP 4 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_PAUSED_IOERROR 5 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_PAUSED_WATCHDOG 6 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_PAUSED_FROM_SNAPSHOT 7 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_PAUSED_SHUTTING_DOWN 8 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PAUSED_SNAPSHOT 9 +# endif +# if !LIBVIR_CHECK_VERSION(1, 1, 1) +# define VIR_DOMAIN_PAUSED_CRASHED 10 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 14) +# define VIR_DOMAIN_PAUSED_STARTING_UP 11 +# endif +# if !LIBVIR_CHECK_VERSION(1, 3, 3) +# define VIR_DOMAIN_PAUSED_POSTCOPY 12 +# endif +# if !LIBVIR_CHECK_VERSION(1, 3, 3) +# define VIR_DOMAIN_PAUSED_POSTCOPY_FAILED 13 +# endif +# if !LIBVIR_CHECK_VERSION(9, 2, 0) +# define VIR_DOMAIN_PAUSED_API_ERROR 14 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_PAUSED_LAST 15 +# endif + +/* enum virDomainProcessSignal */ +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_NOP 0 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_HUP 1 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_INT 2 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_QUIT 3 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_ILL 4 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_TRAP 5 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_ABRT 6 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_BUS 7 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_FPE 8 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_KILL 9 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_USR1 10 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_SEGV 11 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_USR2 12 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_PIPE 13 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_ALRM 14 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_TERM 15 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_STKFLT 16 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_CHLD 17 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_CONT 18 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_STOP 19 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_TSTP 20 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_TTIN 21 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_TTOU 22 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_URG 23 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_XCPU 24 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_XFSZ 25 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_VTALRM 26 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_PROF 27 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_WINCH 28 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_POLL 29 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_PWR 30 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_SYS 31 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT0 32 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT1 33 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT2 34 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT3 35 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT4 36 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT5 37 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT6 38 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT7 39 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT8 40 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT9 41 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT10 42 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT11 43 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT12 44 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT13 45 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT14 46 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT15 47 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT16 48 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT17 49 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT18 50 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT19 51 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT20 52 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT21 53 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT22 54 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT23 55 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT24 56 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT25 57 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT26 58 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT27 59 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT28 60 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT29 61 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT30 62 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT31 63 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_RT32 64 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_PROCESS_SIGNAL_LAST 65 +# endif + +/* enum virDomainRebootFlagValues */ +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_REBOOT_DEFAULT 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_REBOOT_ACPI_POWER_BTN (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_REBOOT_GUEST_AGENT (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_REBOOT_INITCTL (1 << 2) +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_REBOOT_SIGNAL (1 << 3) +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 5) +# define VIR_DOMAIN_REBOOT_PARAVIRT (1 << 4) +# endif + +/* enum virDomainRunningReason */ +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_RUNNING_UNKNOWN 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_RUNNING_BOOTED 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_RUNNING_MIGRATED 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_RUNNING_RESTORED 3 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_RUNNING_FROM_SNAPSHOT 4 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_RUNNING_UNPAUSED 5 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_RUNNING_MIGRATION_CANCELED 6 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_RUNNING_SAVE_CANCELED 7 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 11) +# define VIR_DOMAIN_RUNNING_WAKEUP 8 +# endif +# if !LIBVIR_CHECK_VERSION(1, 1, 1) +# define VIR_DOMAIN_RUNNING_CRASHED 9 +# endif +# if !LIBVIR_CHECK_VERSION(1, 3, 3) +# define VIR_DOMAIN_RUNNING_POSTCOPY 10 +# endif +# if !LIBVIR_CHECK_VERSION(8, 5, 0) +# define VIR_DOMAIN_RUNNING_POSTCOPY_FAILED 11 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_RUNNING_LAST 12 +# endif + +/* enum virDomainSaveImageXMLFlags */ +# if !LIBVIR_CHECK_VERSION(5, 1, 0) +# define VIR_DOMAIN_SAVE_IMAGE_XML_SECURE VIR_DOMAIN_XML_SECURE +# endif + +/* enum virDomainSaveRestoreFlags */ +# if !LIBVIR_CHECK_VERSION(0, 9, 4) +# define VIR_DOMAIN_SAVE_BYPASS_CACHE (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_SAVE_RUNNING (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_SAVE_PAUSED (1 << 2) +# endif +# if !LIBVIR_CHECK_VERSION(8, 1, 0) +# define VIR_DOMAIN_SAVE_RESET_NVRAM (1 << 3) +# endif + +/* enum virDomainSetTimeFlags */ +# if !LIBVIR_CHECK_VERSION(1, 2, 5) +# define VIR_DOMAIN_TIME_SYNC (1 << 0) +# endif + +/* enum virDomainSetUserPasswordFlags */ +# if !LIBVIR_CHECK_VERSION(1, 2, 16) +# define VIR_DOMAIN_PASSWORD_ENCRYPTED (1 << 0) +# endif + +/* enum virDomainShutdownFlagValues */ +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_SHUTDOWN_DEFAULT 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_SHUTDOWN_GUEST_AGENT (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_SHUTDOWN_INITCTL (1 << 2) +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_SHUTDOWN_SIGNAL (1 << 3) +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 5) +# define VIR_DOMAIN_SHUTDOWN_PARAVIRT (1 << 4) +# endif + +/* enum virDomainShutdownReason */ +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_SHUTDOWN_UNKNOWN 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_SHUTDOWN_USER 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_SHUTDOWN_LAST 2 +# endif + +/* enum virDomainShutoffReason */ +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_SHUTOFF_UNKNOWN 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_SHUTOFF_SHUTDOWN 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_SHUTOFF_DESTROYED 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_SHUTOFF_CRASHED 3 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_SHUTOFF_MIGRATED 4 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_SHUTOFF_SAVED 5 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_SHUTOFF_FAILED 6 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT 7 +# endif +# if !LIBVIR_CHECK_VERSION(4, 10, 0) +# define VIR_DOMAIN_SHUTOFF_DAEMON 8 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_SHUTOFF_LAST 9 +# endif + +/* enum virDomainSnapshotCreateFlags */ +# if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA (1 << 2) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_SNAPSHOT_CREATE_HALT (1 << 3) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY (1 << 4) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT (1 << 5) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE (1 << 6) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 11) +# define VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC (1 << 7) +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_SNAPSHOT_CREATE_LIVE (1 << 8) +# endif +# if !LIBVIR_CHECK_VERSION(5, 6, 0) +# define VIR_DOMAIN_SNAPSHOT_CREATE_VALIDATE (1 << 9) +# endif + +/* enum virDomainSnapshotDeleteFlags */ +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY (1 << 2) +# endif + +/* enum virDomainSnapshotListFlags */ +# if !LIBVIR_CHECK_VERSION(0, 9, 7) +# define VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_SNAPSHOT_LIST_ROOTS (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_SNAPSHOT_LIST_METADATA (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 7) +# define VIR_DOMAIN_SNAPSHOT_LIST_LEAVES (1 << 2) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 13) +# define VIR_DOMAIN_SNAPSHOT_LIST_NO_LEAVES (1 << 3) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 13) +# define VIR_DOMAIN_SNAPSHOT_LIST_NO_METADATA (1 << 4) +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_SNAPSHOT_LIST_INACTIVE (1 << 5) +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_SNAPSHOT_LIST_ACTIVE (1 << 6) +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_SNAPSHOT_LIST_DISK_ONLY (1 << 7) +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_SNAPSHOT_LIST_INTERNAL (1 << 8) +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_DOMAIN_SNAPSHOT_LIST_EXTERNAL (1 << 9) +# endif +# if !LIBVIR_CHECK_VERSION(5, 2, 0) +# define VIR_DOMAIN_SNAPSHOT_LIST_TOPOLOGICAL (1 << 10) +# endif + +/* enum virDomainSnapshotRevertFlags */ +# if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 7) +# define VIR_DOMAIN_SNAPSHOT_REVERT_FORCE (1 << 2) +# endif +# if !LIBVIR_CHECK_VERSION(8, 1, 0) +# define VIR_DOMAIN_SNAPSHOT_REVERT_RESET_NVRAM (1 << 3) +# endif + +/* enum virDomainSnapshotXMLFlags */ +# if !LIBVIR_CHECK_VERSION(5, 1, 0) +# define VIR_DOMAIN_SNAPSHOT_XML_SECURE VIR_DOMAIN_XML_SECURE +# endif + +/* enum virDomainState */ +# if !LIBVIR_CHECK_VERSION(0, 0, 1) +# define VIR_DOMAIN_NOSTATE 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 0, 1) +# define VIR_DOMAIN_RUNNING 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 0, 1) +# define VIR_DOMAIN_BLOCKED 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 0, 1) +# define VIR_DOMAIN_PAUSED 3 +# endif +# if !LIBVIR_CHECK_VERSION(0, 0, 1) +# define VIR_DOMAIN_SHUTDOWN 4 +# endif +# if !LIBVIR_CHECK_VERSION(0, 0, 1) +# define VIR_DOMAIN_SHUTOFF 5 +# endif +# if !LIBVIR_CHECK_VERSION(0, 0, 2) +# define VIR_DOMAIN_CRASHED 6 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 11) +# define VIR_DOMAIN_PMSUSPENDED 7 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_LAST 8 +# endif + +/* enum virDomainStatsTypes */ +# if !LIBVIR_CHECK_VERSION(1, 2, 8) +# define VIR_DOMAIN_STATS_STATE (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_STATS_CPU_TOTAL (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_STATS_BALLOON (1 << 2) +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_STATS_VCPU (1 << 3) +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_STATS_INTERFACE (1 << 4) +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_STATS_BLOCK (1 << 5) +# endif +# if !LIBVIR_CHECK_VERSION(1, 3, 3) +# define VIR_DOMAIN_STATS_PERF (1 << 6) +# endif +# if !LIBVIR_CHECK_VERSION(4, 10, 0) +# define VIR_DOMAIN_STATS_IOTHREAD (1 << 7) +# endif +# if !LIBVIR_CHECK_VERSION(6, 0, 0) +# define VIR_DOMAIN_STATS_MEMORY (1 << 8) +# endif +# if !LIBVIR_CHECK_VERSION(7, 2, 0) +# define VIR_DOMAIN_STATS_DIRTYRATE (1 << 9) +# endif +# if !LIBVIR_CHECK_VERSION(8, 9, 0) +# define VIR_DOMAIN_STATS_VM (1 << 10) +# endif + +/* enum virDomainUndefineFlagsValues */ +# if !LIBVIR_CHECK_VERSION(0, 9, 4) +# define VIR_DOMAIN_UNDEFINE_MANAGED_SAVE (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_UNDEFINE_NVRAM (1 << 2) +# endif +# if !LIBVIR_CHECK_VERSION(2, 3, 0) +# define VIR_DOMAIN_UNDEFINE_KEEP_NVRAM (1 << 3) +# endif +# if !LIBVIR_CHECK_VERSION(5, 6, 0) +# define VIR_DOMAIN_UNDEFINE_CHECKPOINTS_METADATA (1 << 4) +# endif +# if !LIBVIR_CHECK_VERSION(8, 9, 0) +# define VIR_DOMAIN_UNDEFINE_TPM (1 << 5) +# endif +# if !LIBVIR_CHECK_VERSION(8, 9, 0) +# define VIR_DOMAIN_UNDEFINE_KEEP_TPM (1 << 6) +# endif + +/* enum virDomainVcpuFlags */ +# if !LIBVIR_CHECK_VERSION(0, 9, 4) +# define VIR_DOMAIN_VCPU_CURRENT VIR_DOMAIN_AFFECT_CURRENT +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 5) +# define VIR_DOMAIN_VCPU_LIVE VIR_DOMAIN_AFFECT_LIVE +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 5) +# define VIR_DOMAIN_VCPU_CONFIG VIR_DOMAIN_AFFECT_CONFIG +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 5) +# define VIR_DOMAIN_VCPU_MAXIMUM (1 << 2) +# endif +# if !LIBVIR_CHECK_VERSION(1, 1, 0) +# define VIR_DOMAIN_VCPU_GUEST (1 << 3) +# endif +# if !LIBVIR_CHECK_VERSION(2, 4, 0) +# define VIR_DOMAIN_VCPU_HOTPLUGGABLE (1 << 4) +# endif + +/* enum virDomainXMLFlags */ +# if !LIBVIR_CHECK_VERSION(0, 3, 3) +# define VIR_DOMAIN_XML_SECURE (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 3, 3) +# define VIR_DOMAIN_XML_INACTIVE (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_DOMAIN_XML_UPDATE_CPU (1 << 2) +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 0) +# define VIR_DOMAIN_XML_MIGRATABLE (1 << 3) +# endif + +/* enum virErrorDomain */ +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_FROM_NONE 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_FROM_XEN 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_FROM_XEND 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_FROM_XENSTORE 3 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_FROM_SEXPR 4 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_FROM_XML 5 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_FROM_DOM 6 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 1) +# define VIR_FROM_RPC 7 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 3) +# define VIR_FROM_PROXY 8 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 6) +# define VIR_FROM_CONF 9 +# endif +# if !LIBVIR_CHECK_VERSION(0, 2, 0) +# define VIR_FROM_QEMU 10 +# endif +# if !LIBVIR_CHECK_VERSION(0, 2, 0) +# define VIR_FROM_NET 11 +# endif +# if !LIBVIR_CHECK_VERSION(0, 2, 3) +# define VIR_FROM_TEST 12 +# endif +# if !LIBVIR_CHECK_VERSION(0, 2, 3) +# define VIR_FROM_REMOTE 13 +# endif +# if !LIBVIR_CHECK_VERSION(0, 3, 1) +# define VIR_FROM_OPENVZ 14 +# endif +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_FROM_XENXM 15 +# endif +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_FROM_STATS_LINUX 16 +# endif +# if !LIBVIR_CHECK_VERSION(0, 4, 2) +# define VIR_FROM_LXC 17 +# endif +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_FROM_STORAGE 18 +# endif +# if !LIBVIR_CHECK_VERSION(0, 4, 6) +# define VIR_FROM_NETWORK 19 +# endif +# if !LIBVIR_CHECK_VERSION(0, 4, 6) +# define VIR_FROM_DOMAIN 20 +# endif +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_FROM_UML 21 +# endif +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_FROM_NODEDEV 22 +# endif +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_FROM_XEN_INOTIFY 23 +# endif +# if !LIBVIR_CHECK_VERSION(0, 6, 1) +# define VIR_FROM_SECURITY 24 +# endif +# if !LIBVIR_CHECK_VERSION(0, 6, 3) +# define VIR_FROM_VBOX 25 +# endif +# if !LIBVIR_CHECK_VERSION(0, 6, 4) +# define VIR_FROM_INTERFACE 26 +# endif +# if !LIBVIR_CHECK_VERSION(0, 6, 4) +# define VIR_FROM_ONE 27 +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 0) +# define VIR_FROM_ESX 28 +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 0) +# define VIR_FROM_PHYP 29 +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 1) +# define VIR_FROM_SECRET 30 +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 5) +# define VIR_FROM_CPU 31 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_FROM_XENAPI 32 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_FROM_NWFILTER 33 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_FROM_HOOK 34 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_FROM_DOMAIN_SNAPSHOT 35 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 5) +# define VIR_FROM_AUDIT 36 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 6) +# define VIR_FROM_SYSINFO 37 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 6) +# define VIR_FROM_STREAMS 38 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 7) +# define VIR_FROM_VMWARE 39 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 0) +# define VIR_FROM_EVENT 40 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 0) +# define VIR_FROM_LIBXL 41 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_FROM_LOCKING 42 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_FROM_HYPERV 43 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 8) +# define VIR_FROM_CAPABILITIES 44 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 11) +# define VIR_FROM_URI 45 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 11) +# define VIR_FROM_AUTH 46 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 12) +# define VIR_FROM_DBUS 47 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 0) +# define VIR_FROM_PARALLELS 48 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 0) +# define VIR_FROM_DEVICE 49 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 0) +# define VIR_FROM_SSH 50 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 0) +# define VIR_FROM_LOCKSPACE 51 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_FROM_INITCTL 52 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 4) +# define VIR_FROM_IDENTITY 53 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 5) +# define VIR_FROM_CGROUP 54 +# endif +# if !LIBVIR_CHECK_VERSION(1, 1, 0) +# define VIR_FROM_ACCESS 55 +# endif +# if !LIBVIR_CHECK_VERSION(1, 1, 1) +# define VIR_FROM_SYSTEMD 56 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 2) +# define VIR_FROM_BHYVE 57 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 3) +# define VIR_FROM_CRYPTO 58 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 4) +# define VIR_FROM_FIREWALL 59 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_FROM_POLKIT 60 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 14) +# define VIR_FROM_THREAD 61 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 17) +# define VIR_FROM_ADMIN 62 +# endif +# if !LIBVIR_CHECK_VERSION(1, 3, 0) +# define VIR_FROM_LOGGING 63 +# endif +# if !LIBVIR_CHECK_VERSION(1, 3, 2) +# define VIR_FROM_XENXL 64 +# endif +# if !LIBVIR_CHECK_VERSION(1, 3, 3) +# define VIR_FROM_PERF 65 +# endif +# if !LIBVIR_CHECK_VERSION(2, 5, 0) +# define VIR_FROM_LIBSSH 66 +# endif +# if !LIBVIR_CHECK_VERSION(3, 7, 0) +# define VIR_FROM_RESCTRL 67 +# endif +# if !LIBVIR_CHECK_VERSION(5, 1, 0) +# define VIR_FROM_FIREWALLD 68 +# endif +# if !LIBVIR_CHECK_VERSION(5, 2, 0) +# define VIR_FROM_DOMAIN_CHECKPOINT 69 +# endif +# if !LIBVIR_CHECK_VERSION(5, 6, 0) +# define VIR_FROM_TPM 70 +# endif +# if !LIBVIR_CHECK_VERSION(5, 10, 0) +# define VIR_FROM_BPF 71 +# endif +# if !LIBVIR_CHECK_VERSION(7, 5, 0) +# define VIR_FROM_CH 72 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 13) +# define VIR_ERR_DOMAIN_LAST 73 +# endif + +/* enum virErrorLevel */ +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_NONE 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_WARNING 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_ERROR 2 +# endif + +/* enum virErrorNumber */ +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_OK 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_INTERNAL_ERROR 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_NO_MEMORY 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_NO_SUPPORT 3 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_UNKNOWN_HOST 4 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_NO_CONNECT 5 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_INVALID_CONN 6 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_INVALID_DOMAIN 7 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_INVALID_ARG 8 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_OPERATION_FAILED 9 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_GET_FAILED 10 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_POST_FAILED 11 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_HTTP_ERROR 12 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_SEXPR_SERIAL 13 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_NO_XEN 14 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_XEN_CALL 15 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_OS_TYPE 16 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_NO_KERNEL 17 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_NO_ROOT 18 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_NO_SOURCE 19 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_NO_TARGET 20 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_NO_NAME 21 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_NO_OS 22 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_NO_DEVICE 23 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_NO_XENSTORE 24 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_DRIVER_FULL 25 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 0) +# define VIR_ERR_CALL_FAILED 26 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 1) +# define VIR_ERR_XML_ERROR 27 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 1) +# define VIR_ERR_DOM_EXIST 28 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 4) +# define VIR_ERR_OPERATION_DENIED 29 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 6) +# define VIR_ERR_OPEN_FAILED 30 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 6) +# define VIR_ERR_READ_FAILED 31 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 6) +# define VIR_ERR_PARSE_FAILED 32 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 6) +# define VIR_ERR_CONF_SYNTAX 33 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 6) +# define VIR_ERR_WRITE_FAILED 34 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 9) +# define VIR_ERR_XML_DETAIL 35 +# endif +# if !LIBVIR_CHECK_VERSION(0, 2, 0) +# define VIR_ERR_INVALID_NETWORK 36 +# endif +# if !LIBVIR_CHECK_VERSION(0, 2, 0) +# define VIR_ERR_NETWORK_EXIST 37 +# endif +# if !LIBVIR_CHECK_VERSION(0, 2, 1) +# define VIR_ERR_SYSTEM_ERROR 38 +# endif +# if !LIBVIR_CHECK_VERSION(0, 2, 3) +# define VIR_ERR_RPC 39 +# endif +# if !LIBVIR_CHECK_VERSION(0, 2, 3) +# define VIR_ERR_GNUTLS_ERROR 40 +# endif +# if !LIBVIR_CHECK_VERSION(0, 2, 3) +# define VIR_WAR_NO_NETWORK 41 +# endif +# if !LIBVIR_CHECK_VERSION(0, 3, 0) +# define VIR_ERR_NO_DOMAIN 42 +# endif +# if !LIBVIR_CHECK_VERSION(0, 3, 0) +# define VIR_ERR_NO_NETWORK 43 +# endif +# if !LIBVIR_CHECK_VERSION(0, 3, 1) +# define VIR_ERR_INVALID_MAC 44 +# endif +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_ERR_AUTH_FAILED 45 +# endif +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_ERR_INVALID_STORAGE_POOL 46 +# endif +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_ERR_INVALID_STORAGE_VOL 47 +# endif +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_WAR_NO_STORAGE 48 +# endif +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_ERR_NO_STORAGE_POOL 49 +# endif +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_ERR_NO_STORAGE_VOL 50 +# endif +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_WAR_NO_NODE 51 +# endif +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_ERR_INVALID_NODE_DEVICE 52 +# endif +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_ERR_NO_NODE_DEVICE 53 +# endif +# if !LIBVIR_CHECK_VERSION(0, 6, 1) +# define VIR_ERR_NO_SECURITY_MODEL 54 +# endif +# if !LIBVIR_CHECK_VERSION(0, 6, 4) +# define VIR_ERR_OPERATION_INVALID 55 +# endif +# if !LIBVIR_CHECK_VERSION(0, 6, 4) +# define VIR_WAR_NO_INTERFACE 56 +# endif +# if !LIBVIR_CHECK_VERSION(0, 6, 4) +# define VIR_ERR_NO_INTERFACE 57 +# endif +# if !LIBVIR_CHECK_VERSION(0, 6, 4) +# define VIR_ERR_INVALID_INTERFACE 58 +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 0) +# define VIR_ERR_MULTIPLE_INTERFACES 59 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_WAR_NO_NWFILTER 60 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_ERR_INVALID_NWFILTER 61 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_ERR_NO_NWFILTER 62 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_ERR_BUILD_FIREWALL 63 +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 1) +# define VIR_WAR_NO_SECRET 64 +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 1) +# define VIR_ERR_INVALID_SECRET 65 +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 1) +# define VIR_ERR_NO_SECRET 66 +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 3) +# define VIR_ERR_CONFIG_UNSUPPORTED 67 +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 3) +# define VIR_ERR_OPERATION_TIMEOUT 68 +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 3) +# define VIR_ERR_MIGRATE_PERSIST_FAILED 69 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_ERR_HOOK_SCRIPT_FAILED 70 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_ERR_INVALID_DOMAIN_SNAPSHOT 71 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 0) +# define VIR_ERR_NO_DOMAIN_SNAPSHOT 72 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 0) +# define VIR_ERR_INVALID_STREAM 73 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 4) +# define VIR_ERR_ARGUMENT_UNSUPPORTED 74 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_ERR_STORAGE_PROBE_FAILED 75 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_ERR_STORAGE_POOL_BUILT 76 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 7) +# define VIR_ERR_SNAPSHOT_REVERT_RISKY 77 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 9) +# define VIR_ERR_OPERATION_ABORTED 78 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_ERR_AUTH_CANCELLED 79 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_ERR_NO_DOMAIN_METADATA 80 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 11) +# define VIR_ERR_MIGRATE_UNSAFE 81 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 11) +# define VIR_ERR_OVERFLOW 82 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 12) +# define VIR_ERR_BLOCK_COPY_ACTIVE 83 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 0) +# define VIR_ERR_OPERATION_UNSUPPORTED 84 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 0) +# define VIR_ERR_SSH 85 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 0) +# define VIR_ERR_AGENT_UNRESPONSIVE 86 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 0) +# define VIR_ERR_RESOURCE_BUSY 87 +# endif +# if !LIBVIR_CHECK_VERSION(1, 1, 0) +# define VIR_ERR_ACCESS_DENIED 88 +# endif +# if !LIBVIR_CHECK_VERSION(1, 1, 1) +# define VIR_ERR_DBUS_SERVICE 89 +# endif +# if !LIBVIR_CHECK_VERSION(1, 1, 4) +# define VIR_ERR_STORAGE_VOL_EXIST 90 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 6) +# define VIR_ERR_CPU_INCOMPATIBLE 91 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 12) +# define VIR_ERR_XML_INVALID_SCHEMA 92 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 18) +# define VIR_ERR_MIGRATE_FINISH_OK 93 +# endif +# if !LIBVIR_CHECK_VERSION(1, 3, 3) +# define VIR_ERR_AUTH_UNAVAILABLE 94 +# endif +# if !LIBVIR_CHECK_VERSION(1, 3, 3) +# define VIR_ERR_NO_SERVER 95 +# endif +# if !LIBVIR_CHECK_VERSION(1, 3, 5) +# define VIR_ERR_NO_CLIENT 96 +# endif +# if !LIBVIR_CHECK_VERSION(2, 3, 0) +# define VIR_ERR_AGENT_UNSYNCED 97 +# endif +# if !LIBVIR_CHECK_VERSION(2, 5, 0) +# define VIR_ERR_LIBSSH 98 +# endif +# if !LIBVIR_CHECK_VERSION(4, 1, 0) +# define VIR_ERR_DEVICE_MISSING 99 +# endif +# if !LIBVIR_CHECK_VERSION(4, 5, 0) +# define VIR_ERR_INVALID_NWFILTER_BINDING 100 +# endif +# if !LIBVIR_CHECK_VERSION(4, 5, 0) +# define VIR_ERR_NO_NWFILTER_BINDING 101 +# endif +# if !LIBVIR_CHECK_VERSION(5, 2, 0) +# define VIR_ERR_INVALID_DOMAIN_CHECKPOINT 102 +# endif +# if !LIBVIR_CHECK_VERSION(5, 2, 0) +# define VIR_ERR_NO_DOMAIN_CHECKPOINT 103 +# endif +# if !LIBVIR_CHECK_VERSION(5, 2, 0) +# define VIR_ERR_NO_DOMAIN_BACKUP 104 +# endif +# if !LIBVIR_CHECK_VERSION(5, 5, 0) +# define VIR_ERR_INVALID_NETWORK_PORT 105 +# endif +# if !LIBVIR_CHECK_VERSION(5, 5, 0) +# define VIR_ERR_NETWORK_PORT_EXIST 106 +# endif +# if !LIBVIR_CHECK_VERSION(5, 5, 0) +# define VIR_ERR_NO_NETWORK_PORT 107 +# endif +# if !LIBVIR_CHECK_VERSION(6, 1, 0) +# define VIR_ERR_NO_HOSTNAME 108 +# endif +# if !LIBVIR_CHECK_VERSION(6, 10, 0) +# define VIR_ERR_CHECKPOINT_INCONSISTENT 109 +# endif +# if !LIBVIR_CHECK_VERSION(7, 1, 0) +# define VIR_ERR_MULTIPLE_DOMAINS 110 +# endif +# if !LIBVIR_CHECK_VERSION(9, 7, 0) +# define VIR_ERR_NO_NETWORK_METADATA 111 +# endif +# if !LIBVIR_CHECK_VERSION(5, 0, 0) +# define VIR_ERR_NUMBER_LAST 112 +# endif + +/* enum virEventHandleType */ +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_EVENT_HANDLE_READABLE (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_EVENT_HANDLE_WRITABLE (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_EVENT_HANDLE_ERROR (1 << 2) +# endif +# if !LIBVIR_CHECK_VERSION(0, 5, 0) +# define VIR_EVENT_HANDLE_HANGUP (1 << 3) +# endif + +/* enum virIPAddrType */ +# if !LIBVIR_CHECK_VERSION(1, 2, 6) +# define VIR_IP_ADDR_TYPE_IPV4 0 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 6) +# define VIR_IP_ADDR_TYPE_IPV6 1 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 6) +# define VIR_IP_ADDR_TYPE_LAST 2 +# endif + +/* enum virInterfaceDefineFlags */ +# if !LIBVIR_CHECK_VERSION(7, 7, 0) +# define VIR_INTERFACE_DEFINE_VALIDATE (1 << 0) +# endif + +/* enum virInterfaceXMLFlags */ +# if !LIBVIR_CHECK_VERSION(0, 7, 3) +# define VIR_INTERFACE_XML_INACTIVE (1 << 0) +# endif + +/* enum virKeycodeSet */ +# if !LIBVIR_CHECK_VERSION(0, 9, 3) +# define VIR_KEYCODE_SET_LINUX 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 3) +# define VIR_KEYCODE_SET_XT 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 3) +# define VIR_KEYCODE_SET_ATSET1 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 3) +# define VIR_KEYCODE_SET_ATSET2 3 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 3) +# define VIR_KEYCODE_SET_ATSET3 4 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 4) +# define VIR_KEYCODE_SET_OSX 5 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 4) +# define VIR_KEYCODE_SET_XT_KBD 6 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 4) +# define VIR_KEYCODE_SET_USB 7 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 4) +# define VIR_KEYCODE_SET_WIN32 8 +# endif +# if !LIBVIR_CHECK_VERSION(4, 2, 0) +# define VIR_KEYCODE_SET_QNUM 9 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 4) +# define VIR_KEYCODE_SET_LAST 10 +# endif + +/* enum virMemoryParameterType */ +# if !LIBVIR_CHECK_VERSION(0, 8, 5) +# define VIR_DOMAIN_MEMORY_PARAM_INT VIR_TYPED_PARAM_INT +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 5) +# define VIR_DOMAIN_MEMORY_PARAM_UINT VIR_TYPED_PARAM_UINT +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 5) +# define VIR_DOMAIN_MEMORY_PARAM_LLONG VIR_TYPED_PARAM_LLONG +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 5) +# define VIR_DOMAIN_MEMORY_PARAM_ULLONG VIR_TYPED_PARAM_ULLONG +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 5) +# define VIR_DOMAIN_MEMORY_PARAM_DOUBLE VIR_TYPED_PARAM_DOUBLE +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 5) +# define VIR_DOMAIN_MEMORY_PARAM_BOOLEAN VIR_TYPED_PARAM_BOOLEAN +# endif + +/* enum virNWFilterBindingCreateFlags */ +# if !LIBVIR_CHECK_VERSION(7, 8, 0) +# define VIR_NWFILTER_BINDING_CREATE_VALIDATE (1 << 0) +# endif + +/* enum virNWFilterDefineFlags */ +# if !LIBVIR_CHECK_VERSION(7, 7, 0) +# define VIR_NWFILTER_DEFINE_VALIDATE (1 << 0) +# endif + +/* enum virNetworkCreateFlags */ +# if !LIBVIR_CHECK_VERSION(7, 8, 0) +# define VIR_NETWORK_CREATE_VALIDATE (1 << 0) +# endif + +/* enum virNetworkDefineFlags */ +# if !LIBVIR_CHECK_VERSION(7, 7, 0) +# define VIR_NETWORK_DEFINE_VALIDATE (1 << 0) +# endif + +/* enum virNetworkEventID */ +# if !LIBVIR_CHECK_VERSION(1, 2, 1) +# define VIR_NETWORK_EVENT_ID_LIFECYCLE 0 +# endif +# if !LIBVIR_CHECK_VERSION(9, 8, 0) +# define VIR_NETWORK_EVENT_ID_METADATA_CHANGE 1 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 1) +# define VIR_NETWORK_EVENT_ID_LAST 2 +# endif + +/* enum virNetworkEventLifecycleType */ +# if !LIBVIR_CHECK_VERSION(1, 2, 1) +# define VIR_NETWORK_EVENT_DEFINED 0 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 1) +# define VIR_NETWORK_EVENT_UNDEFINED 1 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 1) +# define VIR_NETWORK_EVENT_STARTED 2 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 1) +# define VIR_NETWORK_EVENT_STOPPED 3 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 1) +# define VIR_NETWORK_EVENT_LAST 4 +# endif + +/* enum virNetworkMetadataType */ +# if !LIBVIR_CHECK_VERSION(9, 7, 0) +# define VIR_NETWORK_METADATA_DESCRIPTION 0 +# endif +# if !LIBVIR_CHECK_VERSION(9, 7, 0) +# define VIR_NETWORK_METADATA_TITLE 1 +# endif +# if !LIBVIR_CHECK_VERSION(9, 7, 0) +# define VIR_NETWORK_METADATA_ELEMENT 2 +# endif +# if !LIBVIR_CHECK_VERSION(9, 7, 0) +# define VIR_NETWORK_METADATA_LAST 3 +# endif + +/* enum virNetworkPortCreateFlags */ +# if !LIBVIR_CHECK_VERSION(5, 5, 0) +# define VIR_NETWORK_PORT_CREATE_RECLAIM (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(7, 8, 0) +# define VIR_NETWORK_PORT_CREATE_VALIDATE (1 << 1) +# endif + +/* enum virNetworkUpdateCommand */ +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NETWORK_UPDATE_COMMAND_NONE 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NETWORK_UPDATE_COMMAND_MODIFY 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NETWORK_UPDATE_COMMAND_DELETE 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NETWORK_UPDATE_COMMAND_ADD_LAST 3 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NETWORK_UPDATE_COMMAND_ADD_FIRST 4 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NETWORK_UPDATE_COMMAND_LAST 5 +# endif + +/* enum virNetworkUpdateFlags */ +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NETWORK_UPDATE_AFFECT_CURRENT 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NETWORK_UPDATE_AFFECT_LIVE (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NETWORK_UPDATE_AFFECT_CONFIG (1 << 1) +# endif + +/* enum virNetworkUpdateSection */ +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NETWORK_SECTION_NONE 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NETWORK_SECTION_BRIDGE 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NETWORK_SECTION_DOMAIN 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NETWORK_SECTION_IP 3 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NETWORK_SECTION_IP_DHCP_HOST 4 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NETWORK_SECTION_IP_DHCP_RANGE 5 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NETWORK_SECTION_FORWARD 6 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NETWORK_SECTION_FORWARD_INTERFACE 7 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NETWORK_SECTION_FORWARD_PF 8 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NETWORK_SECTION_PORTGROUP 9 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NETWORK_SECTION_DNS_HOST 10 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NETWORK_SECTION_DNS_TXT 11 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NETWORK_SECTION_DNS_SRV 12 +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NETWORK_SECTION_LAST 13 +# endif + +/* enum virNetworkXMLFlags */ +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_NETWORK_XML_INACTIVE (1 << 0) +# endif + +/* enum virNodeAllocPagesFlags */ +# if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_NODE_ALLOC_PAGES_ADD 0 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_NODE_ALLOC_PAGES_SET (1 << 0) +# endif + +/* enum virNodeDeviceCreateXMLFlags */ +# if !LIBVIR_CHECK_VERSION(8, 10, 0) +# define VIR_NODE_DEVICE_CREATE_XML_VALIDATE (1 << 0) +# endif + +/* enum virNodeDeviceDefineXMLFlags */ +# if !LIBVIR_CHECK_VERSION(8, 10, 0) +# define VIR_NODE_DEVICE_DEFINE_XML_VALIDATE (1 << 0) +# endif + +/* enum virNodeDeviceEventID */ +# if !LIBVIR_CHECK_VERSION(2, 2, 0) +# define VIR_NODE_DEVICE_EVENT_ID_LIFECYCLE 0 +# endif +# if !LIBVIR_CHECK_VERSION(2, 2, 0) +# define VIR_NODE_DEVICE_EVENT_ID_UPDATE 1 +# endif +# if !LIBVIR_CHECK_VERSION(2, 2, 0) +# define VIR_NODE_DEVICE_EVENT_ID_LAST 2 +# endif + +/* enum virNodeDeviceEventLifecycleType */ +# if !LIBVIR_CHECK_VERSION(2, 2, 0) +# define VIR_NODE_DEVICE_EVENT_CREATED 0 +# endif +# if !LIBVIR_CHECK_VERSION(2, 2, 0) +# define VIR_NODE_DEVICE_EVENT_DELETED 1 +# endif +# if !LIBVIR_CHECK_VERSION(7, 3, 0) +# define VIR_NODE_DEVICE_EVENT_DEFINED 2 +# endif +# if !LIBVIR_CHECK_VERSION(7, 3, 0) +# define VIR_NODE_DEVICE_EVENT_UNDEFINED 3 +# endif +# if !LIBVIR_CHECK_VERSION(2, 2, 0) +# define VIR_NODE_DEVICE_EVENT_LAST 4 +# endif + +/* enum virNodeDeviceUpdateFlags */ +# if !LIBVIR_CHECK_VERSION(10, 1, 0) +# define VIR_NODE_DEVICE_UPDATE_AFFECT_CURRENT 0 +# endif +# if !LIBVIR_CHECK_VERSION(10, 1, 0) +# define VIR_NODE_DEVICE_UPDATE_AFFECT_LIVE (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(10, 1, 0) +# define VIR_NODE_DEVICE_UPDATE_AFFECT_CONFIG (1 << 1) +# endif + +/* enum virNodeDeviceXMLFlags */ +# if !LIBVIR_CHECK_VERSION(10, 1, 0) +# define VIR_NODE_DEVICE_XML_INACTIVE (1 << 0) +# endif + +/* enum virNodeGetCPUStatsAllCPUs */ +# if !LIBVIR_CHECK_VERSION(0, 9, 3) +# define VIR_NODE_CPU_STATS_ALL_CPUS -1 +# endif + +/* enum virNodeGetMemoryStatsAllCells */ +# if !LIBVIR_CHECK_VERSION(0, 9, 3) +# define VIR_NODE_MEMORY_STATS_ALL_CELLS -1 +# endif + +/* enum virNodeSuspendTarget */ +# if !LIBVIR_CHECK_VERSION(0, 9, 8) +# define VIR_NODE_SUSPEND_TARGET_MEM 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 8) +# define VIR_NODE_SUSPEND_TARGET_DISK 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 8) +# define VIR_NODE_SUSPEND_TARGET_HYBRID 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 8) +# define VIR_NODE_SUSPEND_TARGET_LAST 3 +# endif + +/* enum virSchedParameterType */ +# if !LIBVIR_CHECK_VERSION(0, 2, 3) +# define VIR_DOMAIN_SCHED_FIELD_INT VIR_TYPED_PARAM_INT +# endif +# if !LIBVIR_CHECK_VERSION(0, 2, 3) +# define VIR_DOMAIN_SCHED_FIELD_UINT VIR_TYPED_PARAM_UINT +# endif +# if !LIBVIR_CHECK_VERSION(0, 2, 3) +# define VIR_DOMAIN_SCHED_FIELD_LLONG VIR_TYPED_PARAM_LLONG +# endif +# if !LIBVIR_CHECK_VERSION(0, 2, 3) +# define VIR_DOMAIN_SCHED_FIELD_ULLONG VIR_TYPED_PARAM_ULLONG +# endif +# if !LIBVIR_CHECK_VERSION(0, 2, 3) +# define VIR_DOMAIN_SCHED_FIELD_DOUBLE VIR_TYPED_PARAM_DOUBLE +# endif +# if !LIBVIR_CHECK_VERSION(0, 2, 3) +# define VIR_DOMAIN_SCHED_FIELD_BOOLEAN VIR_TYPED_PARAM_BOOLEAN +# endif + +/* enum virSecretDefineFlags */ +# if !LIBVIR_CHECK_VERSION(7, 7, 0) +# define VIR_SECRET_DEFINE_VALIDATE (1 << 0) +# endif + +/* enum virSecretEventID */ +# if !LIBVIR_CHECK_VERSION(3, 0, 0) +# define VIR_SECRET_EVENT_ID_LIFECYCLE 0 +# endif +# if !LIBVIR_CHECK_VERSION(3, 0, 0) +# define VIR_SECRET_EVENT_ID_VALUE_CHANGED 1 +# endif +# if !LIBVIR_CHECK_VERSION(3, 0, 0) +# define VIR_SECRET_EVENT_ID_LAST 2 +# endif + +/* enum virSecretEventLifecycleType */ +# if !LIBVIR_CHECK_VERSION(3, 0, 0) +# define VIR_SECRET_EVENT_DEFINED 0 +# endif +# if !LIBVIR_CHECK_VERSION(3, 0, 0) +# define VIR_SECRET_EVENT_UNDEFINED 1 +# endif +# if !LIBVIR_CHECK_VERSION(3, 0, 0) +# define VIR_SECRET_EVENT_LAST 2 +# endif + +/* enum virSecretUsageType */ +# if !LIBVIR_CHECK_VERSION(0, 7, 1) +# define VIR_SECRET_USAGE_TYPE_NONE 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 1) +# define VIR_SECRET_USAGE_TYPE_VOLUME 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 7) +# define VIR_SECRET_USAGE_TYPE_CEPH 2 +# endif +# if !LIBVIR_CHECK_VERSION(1, 0, 4) +# define VIR_SECRET_USAGE_TYPE_ISCSI 3 +# endif +# if !LIBVIR_CHECK_VERSION(2, 3, 0) +# define VIR_SECRET_USAGE_TYPE_TLS 4 +# endif +# if !LIBVIR_CHECK_VERSION(5, 6, 0) +# define VIR_SECRET_USAGE_TYPE_VTPM 5 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 7) +# define VIR_SECRET_USAGE_TYPE_LAST 6 +# endif + +/* enum virStoragePoolBuildFlags */ +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_STORAGE_POOL_BUILD_NEW 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_STORAGE_POOL_BUILD_REPAIR (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_STORAGE_POOL_BUILD_RESIZE (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_STORAGE_POOL_BUILD_NO_OVERWRITE (1 << 2) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_STORAGE_POOL_BUILD_OVERWRITE (1 << 3) +# endif + +/* enum virStoragePoolCreateFlags */ +# if !LIBVIR_CHECK_VERSION(1, 3, 1) +# define VIR_STORAGE_POOL_CREATE_NORMAL 0 +# endif +# if !LIBVIR_CHECK_VERSION(1, 3, 1) +# define VIR_STORAGE_POOL_CREATE_WITH_BUILD (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(1, 3, 1) +# define VIR_STORAGE_POOL_CREATE_WITH_BUILD_OVERWRITE (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(1, 3, 1) +# define VIR_STORAGE_POOL_CREATE_WITH_BUILD_NO_OVERWRITE (1 << 2) +# endif + +/* enum virStoragePoolDefineFlags */ +# if !LIBVIR_CHECK_VERSION(7, 7, 0) +# define VIR_STORAGE_POOL_DEFINE_VALIDATE (1 << 0) +# endif + +/* enum virStoragePoolDeleteFlags */ +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_STORAGE_POOL_DELETE_NORMAL 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_STORAGE_POOL_DELETE_ZEROED (1 << 0) +# endif + +/* enum virStoragePoolEventID */ +# if !LIBVIR_CHECK_VERSION(2, 0, 0) +# define VIR_STORAGE_POOL_EVENT_ID_LIFECYCLE 0 +# endif +# if !LIBVIR_CHECK_VERSION(2, 0, 0) +# define VIR_STORAGE_POOL_EVENT_ID_REFRESH 1 +# endif +# if !LIBVIR_CHECK_VERSION(2, 0, 0) +# define VIR_STORAGE_POOL_EVENT_ID_LAST 2 +# endif + +/* enum virStoragePoolEventLifecycleType */ +# if !LIBVIR_CHECK_VERSION(2, 0, 0) +# define VIR_STORAGE_POOL_EVENT_DEFINED 0 +# endif +# if !LIBVIR_CHECK_VERSION(2, 0, 0) +# define VIR_STORAGE_POOL_EVENT_UNDEFINED 1 +# endif +# if !LIBVIR_CHECK_VERSION(2, 0, 0) +# define VIR_STORAGE_POOL_EVENT_STARTED 2 +# endif +# if !LIBVIR_CHECK_VERSION(2, 0, 0) +# define VIR_STORAGE_POOL_EVENT_STOPPED 3 +# endif +# if !LIBVIR_CHECK_VERSION(3, 8, 0) +# define VIR_STORAGE_POOL_EVENT_CREATED 4 +# endif +# if !LIBVIR_CHECK_VERSION(3, 8, 0) +# define VIR_STORAGE_POOL_EVENT_DELETED 5 +# endif +# if !LIBVIR_CHECK_VERSION(2, 0, 0) +# define VIR_STORAGE_POOL_EVENT_LAST 6 +# endif + +/* enum virStoragePoolState */ +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_STORAGE_POOL_INACTIVE 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_STORAGE_POOL_BUILDING 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_STORAGE_POOL_RUNNING 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_STORAGE_POOL_DEGRADED 3 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 2) +# define VIR_STORAGE_POOL_INACCESSIBLE 4 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_STORAGE_POOL_STATE_LAST 5 +# endif + +/* enum virStorageVolCreateFlags */ +# if !LIBVIR_CHECK_VERSION(1, 0, 1) +# define VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 13) +# define VIR_STORAGE_VOL_CREATE_REFLINK (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(8, 10, 0) +# define VIR_STORAGE_VOL_CREATE_VALIDATE (1 << 2) +# endif + +/* enum virStorageVolDeleteFlags */ +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_STORAGE_VOL_DELETE_NORMAL 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_STORAGE_VOL_DELETE_ZEROED (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 21) +# define VIR_STORAGE_VOL_DELETE_WITH_SNAPSHOTS (1 << 1) +# endif + +/* enum virStorageVolDownloadFlags */ +# if !LIBVIR_CHECK_VERSION(3, 4, 0) +# define VIR_STORAGE_VOL_DOWNLOAD_SPARSE_STREAM (1 << 0) +# endif + +/* enum virStorageVolInfoFlags */ +# if !LIBVIR_CHECK_VERSION(3, 0, 0) +# define VIR_STORAGE_VOL_USE_ALLOCATION 0 +# endif +# if !LIBVIR_CHECK_VERSION(3, 0, 0) +# define VIR_STORAGE_VOL_GET_PHYSICAL (1 << 0) +# endif + +/* enum virStorageVolResizeFlags */ +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_STORAGE_VOL_RESIZE_ALLOCATE (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_STORAGE_VOL_RESIZE_DELTA (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_STORAGE_VOL_RESIZE_SHRINK (1 << 2) +# endif + +/* enum virStorageVolType */ +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_STORAGE_VOL_FILE 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 4, 1) +# define VIR_STORAGE_VOL_BLOCK 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_STORAGE_VOL_DIR 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 13) +# define VIR_STORAGE_VOL_NETWORK 3 +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 0) +# define VIR_STORAGE_VOL_NETDIR 4 +# endif +# if !LIBVIR_CHECK_VERSION(1, 3, 4) +# define VIR_STORAGE_VOL_PLOOP 5 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_STORAGE_VOL_LAST 6 +# endif + +/* enum virStorageVolUploadFlags */ +# if !LIBVIR_CHECK_VERSION(3, 4, 0) +# define VIR_STORAGE_VOL_UPLOAD_SPARSE_STREAM (1 << 0) +# endif + +/* enum virStorageVolWipeAlgorithm */ +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_STORAGE_VOL_WIPE_ALG_ZERO 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_STORAGE_VOL_WIPE_ALG_NNSA 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_STORAGE_VOL_WIPE_ALG_DOD 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_STORAGE_VOL_WIPE_ALG_BSI 3 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_STORAGE_VOL_WIPE_ALG_GUTMANN 4 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_STORAGE_VOL_WIPE_ALG_SCHNEIER 5 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_STORAGE_VOL_WIPE_ALG_PFITZNER7 6 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_STORAGE_VOL_WIPE_ALG_PFITZNER33 7 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_STORAGE_VOL_WIPE_ALG_RANDOM 8 +# endif +# if !LIBVIR_CHECK_VERSION(1, 3, 2) +# define VIR_STORAGE_VOL_WIPE_ALG_TRIM 9 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_STORAGE_VOL_WIPE_ALG_LAST 10 +# endif + +/* enum virStorageXMLFlags */ +# if !LIBVIR_CHECK_VERSION(0, 9, 13) +# define VIR_STORAGE_XML_INACTIVE (1 << 0) +# endif + +/* enum virStreamEventType */ +# if !LIBVIR_CHECK_VERSION(0, 7, 2) +# define VIR_STREAM_EVENT_READABLE (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 2) +# define VIR_STREAM_EVENT_WRITABLE (1 << 1) +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 2) +# define VIR_STREAM_EVENT_ERROR (1 << 2) +# endif +# if !LIBVIR_CHECK_VERSION(0, 7, 2) +# define VIR_STREAM_EVENT_HANGUP (1 << 3) +# endif + +/* enum virStreamFlags */ +# if !LIBVIR_CHECK_VERSION(0, 7, 2) +# define VIR_STREAM_NONBLOCK (1 << 0) +# endif + +/* enum virStreamRecvFlagsValues */ +# if !LIBVIR_CHECK_VERSION(3, 4, 0) +# define VIR_STREAM_RECV_STOP_AT_HOLE (1 << 0) +# endif + +/* enum virTypedParameterFlags */ +# if !LIBVIR_CHECK_VERSION(0, 9, 8) +# define VIR_TYPED_PARAM_STRING_OKAY (1 << 2) +# endif + +/* enum virTypedParameterType */ +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_TYPED_PARAM_INT 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_TYPED_PARAM_UINT 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_TYPED_PARAM_LLONG 3 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_TYPED_PARAM_ULLONG 4 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_TYPED_PARAM_DOUBLE 5 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_TYPED_PARAM_BOOLEAN 6 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 8) +# define VIR_TYPED_PARAM_STRING 7 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_TYPED_PARAM_LAST 8 +# endif + +/* enum virVcpuHostCpuState */ +# if !LIBVIR_CHECK_VERSION(6, 10, 0) +# define VIR_VCPU_INFO_CPU_UNAVAILABLE -2 +# endif +# if !LIBVIR_CHECK_VERSION(6, 10, 0) +# define VIR_VCPU_INFO_CPU_OFFLINE -1 +# endif + +/* enum virVcpuState */ +# if !LIBVIR_CHECK_VERSION(0, 1, 4) +# define VIR_VCPU_OFFLINE 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 4) +# define VIR_VCPU_RUNNING 1 +# endif +# if !LIBVIR_CHECK_VERSION(0, 1, 4) +# define VIR_VCPU_BLOCKED 2 +# endif +# if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_VCPU_LAST 3 +# endif + diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_functions.h b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions.h new file mode 100644 index 000000000..210bcdcc6 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions.h @@ -0,0 +1,2939 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +#pragma once + +int +virConnCopyLastErrorWrapper(virConnectPtr conn, + virErrorPtr to, + virErrorPtr err); + +virErrorPtr +virConnGetLastErrorWrapper(virConnectPtr conn, + virErrorPtr err); + +void +virConnResetLastErrorWrapper(virConnectPtr conn); + +void +virConnSetErrorFuncWrapper(virConnectPtr conn, + void * userData, + virErrorFunc handler); + +char * +virConnectBaselineCPUWrapper(virConnectPtr conn, + const char ** xmlCPUs, + unsigned int ncpus, + unsigned int flags, + virErrorPtr err); + +char * +virConnectBaselineHypervisorCPUWrapper(virConnectPtr conn, + const char * emulator, + const char * arch, + const char * machine, + const char * virttype, + const char ** xmlCPUs, + unsigned int ncpus, + unsigned int flags, + virErrorPtr err); + +int +virConnectCloseWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectCompareCPUWrapper(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err); + +int +virConnectCompareHypervisorCPUWrapper(virConnectPtr conn, + const char * emulator, + const char * arch, + const char * machine, + const char * virttype, + const char * xmlCPU, + unsigned int flags, + virErrorPtr err); + +int +virConnectDomainEventDeregisterWrapper(virConnectPtr conn, + virConnectDomainEventCallback cb, + virErrorPtr err); + +int +virConnectDomainEventDeregisterAnyWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err); + +int +virConnectDomainEventRegisterWrapper(virConnectPtr conn, + virConnectDomainEventCallback cb, + void * opaque, + virFreeCallback freecb, + virErrorPtr err); + +int +virConnectDomainEventRegisterAnyWrapper(virConnectPtr conn, + virDomainPtr dom, + int eventID, + virConnectDomainEventGenericCallback cb, + void * opaque, + virFreeCallback freecb, + virErrorPtr err); + +char * +virConnectDomainXMLFromNativeWrapper(virConnectPtr conn, + const char * nativeFormat, + const char * nativeConfig, + unsigned int flags, + virErrorPtr err); + +char * +virConnectDomainXMLToNativeWrapper(virConnectPtr conn, + const char * nativeFormat, + const char * domainXml, + unsigned int flags, + virErrorPtr err); + +char * +virConnectFindStoragePoolSourcesWrapper(virConnectPtr conn, + const char * type, + const char * srcSpec, + unsigned int flags, + virErrorPtr err); + +int +virConnectGetAllDomainStatsWrapper(virConnectPtr conn, + unsigned int stats, + virDomainStatsRecordPtr ** retStats, + unsigned int flags, + virErrorPtr err); + +int +virConnectGetCPUModelNamesWrapper(virConnectPtr conn, + const char * arch, + char *** models, + unsigned int flags, + virErrorPtr err); + +char * +virConnectGetCapabilitiesWrapper(virConnectPtr conn, + virErrorPtr err); + +char * +virConnectGetDomainCapabilitiesWrapper(virConnectPtr conn, + const char * emulatorbin, + const char * arch, + const char * machine, + const char * virttype, + unsigned int flags, + virErrorPtr err); + +char * +virConnectGetHostnameWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectGetLibVersionWrapper(virConnectPtr conn, + unsigned long * libVer, + virErrorPtr err); + +int +virConnectGetMaxVcpusWrapper(virConnectPtr conn, + const char * type, + virErrorPtr err); + +char * +virConnectGetStoragePoolCapabilitiesWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err); + +char * +virConnectGetSysinfoWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err); + +const char * +virConnectGetTypeWrapper(virConnectPtr conn, + virErrorPtr err); + +char * +virConnectGetURIWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectGetVersionWrapper(virConnectPtr conn, + unsigned long * hvVer, + virErrorPtr err); + +int +virConnectIsAliveWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectIsEncryptedWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectIsSecureWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectListAllDomainsWrapper(virConnectPtr conn, + virDomainPtr ** domains, + unsigned int flags, + virErrorPtr err); + +int +virConnectListAllInterfacesWrapper(virConnectPtr conn, + virInterfacePtr ** ifaces, + unsigned int flags, + virErrorPtr err); + +int +virConnectListAllNWFilterBindingsWrapper(virConnectPtr conn, + virNWFilterBindingPtr ** bindings, + unsigned int flags, + virErrorPtr err); + +int +virConnectListAllNWFiltersWrapper(virConnectPtr conn, + virNWFilterPtr ** filters, + unsigned int flags, + virErrorPtr err); + +int +virConnectListAllNetworksWrapper(virConnectPtr conn, + virNetworkPtr ** nets, + unsigned int flags, + virErrorPtr err); + +int +virConnectListAllNodeDevicesWrapper(virConnectPtr conn, + virNodeDevicePtr ** devices, + unsigned int flags, + virErrorPtr err); + +int +virConnectListAllSecretsWrapper(virConnectPtr conn, + virSecretPtr ** secrets, + unsigned int flags, + virErrorPtr err); + +int +virConnectListAllStoragePoolsWrapper(virConnectPtr conn, + virStoragePoolPtr ** pools, + unsigned int flags, + virErrorPtr err); + +int +virConnectListDefinedDomainsWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err); + +int +virConnectListDefinedInterfacesWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err); + +int +virConnectListDefinedNetworksWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err); + +int +virConnectListDefinedStoragePoolsWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err); + +int +virConnectListDomainsWrapper(virConnectPtr conn, + int * ids, + int maxids, + virErrorPtr err); + +int +virConnectListInterfacesWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err); + +int +virConnectListNWFiltersWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err); + +int +virConnectListNetworksWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err); + +int +virConnectListSecretsWrapper(virConnectPtr conn, + char ** uuids, + int maxuuids, + virErrorPtr err); + +int +virConnectListStoragePoolsWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err); + +int +virConnectNetworkEventDeregisterAnyWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err); + +int +virConnectNetworkEventRegisterAnyWrapper(virConnectPtr conn, + virNetworkPtr net, + int eventID, + virConnectNetworkEventGenericCallback cb, + void * opaque, + virFreeCallback freecb, + virErrorPtr err); + +int +virConnectNodeDeviceEventDeregisterAnyWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err); + +int +virConnectNodeDeviceEventRegisterAnyWrapper(virConnectPtr conn, + virNodeDevicePtr dev, + int eventID, + virConnectNodeDeviceEventGenericCallback cb, + void * opaque, + virFreeCallback freecb, + virErrorPtr err); + +int +virConnectNumOfDefinedDomainsWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectNumOfDefinedInterfacesWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectNumOfDefinedNetworksWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectNumOfDefinedStoragePoolsWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectNumOfDomainsWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectNumOfInterfacesWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectNumOfNWFiltersWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectNumOfNetworksWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectNumOfSecretsWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectNumOfStoragePoolsWrapper(virConnectPtr conn, + virErrorPtr err); + +virConnectPtr +virConnectOpenWrapper(const char * name, + virErrorPtr err); + +virConnectPtr +virConnectOpenAuthWrapper(const char * name, + virConnectAuthPtr auth, + unsigned int flags, + virErrorPtr err); + +virConnectPtr +virConnectOpenReadOnlyWrapper(const char * name, + virErrorPtr err); + +int +virConnectRefWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virConnectRegisterCloseCallbackWrapper(virConnectPtr conn, + virConnectCloseFunc cb, + void * opaque, + virFreeCallback freecb, + virErrorPtr err); + +int +virConnectSecretEventDeregisterAnyWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err); + +int +virConnectSecretEventRegisterAnyWrapper(virConnectPtr conn, + virSecretPtr secret, + int eventID, + virConnectSecretEventGenericCallback cb, + void * opaque, + virFreeCallback freecb, + virErrorPtr err); + +int +virConnectSetIdentityWrapper(virConnectPtr conn, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err); + +int +virConnectSetKeepAliveWrapper(virConnectPtr conn, + int interval, + unsigned int count, + virErrorPtr err); + +int +virConnectStoragePoolEventDeregisterAnyWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err); + +int +virConnectStoragePoolEventRegisterAnyWrapper(virConnectPtr conn, + virStoragePoolPtr pool, + int eventID, + virConnectStoragePoolEventGenericCallback cb, + void * opaque, + virFreeCallback freecb, + virErrorPtr err); + +int +virConnectUnregisterCloseCallbackWrapper(virConnectPtr conn, + virConnectCloseFunc cb, + virErrorPtr err); + +void +virDefaultErrorFuncWrapper(virErrorPtr err); + +int +virDomainAbortJobWrapper(virDomainPtr domain, + virErrorPtr err); + +int +virDomainAbortJobFlagsWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +int +virDomainAddIOThreadWrapper(virDomainPtr domain, + unsigned int iothread_id, + unsigned int flags, + virErrorPtr err); + +int +virDomainAgentSetResponseTimeoutWrapper(virDomainPtr domain, + int timeout, + unsigned int flags, + virErrorPtr err); + +int +virDomainAttachDeviceWrapper(virDomainPtr domain, + const char * xml, + virErrorPtr err); + +int +virDomainAttachDeviceFlagsWrapper(virDomainPtr domain, + const char * xml, + unsigned int flags, + virErrorPtr err); + +int +virDomainAuthorizedSSHKeysGetWrapper(virDomainPtr domain, + const char * user, + char *** keys, + unsigned int flags, + virErrorPtr err); + +int +virDomainAuthorizedSSHKeysSetWrapper(virDomainPtr domain, + const char * user, + const char ** keys, + unsigned int nkeys, + unsigned int flags, + virErrorPtr err); + +int +virDomainBackupBeginWrapper(virDomainPtr domain, + const char * backupXML, + const char * checkpointXML, + unsigned int flags, + virErrorPtr err); + +char * +virDomainBackupGetXMLDescWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +int +virDomainBlockCommitWrapper(virDomainPtr dom, + const char * disk, + const char * base, + const char * top, + unsigned long bandwidth, + unsigned int flags, + virErrorPtr err); + +int +virDomainBlockCopyWrapper(virDomainPtr dom, + const char * disk, + const char * destxml, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainBlockJobAbortWrapper(virDomainPtr dom, + const char * disk, + unsigned int flags, + virErrorPtr err); + +int +virDomainBlockJobSetSpeedWrapper(virDomainPtr dom, + const char * disk, + unsigned long bandwidth, + unsigned int flags, + virErrorPtr err); + +int +virDomainBlockPeekWrapper(virDomainPtr dom, + const char * disk, + unsigned long long offset, + size_t size, + void * buffer, + unsigned int flags, + virErrorPtr err); + +int +virDomainBlockPullWrapper(virDomainPtr dom, + const char * disk, + unsigned long bandwidth, + unsigned int flags, + virErrorPtr err); + +int +virDomainBlockRebaseWrapper(virDomainPtr dom, + const char * disk, + const char * base, + unsigned long bandwidth, + unsigned int flags, + virErrorPtr err); + +int +virDomainBlockResizeWrapper(virDomainPtr dom, + const char * disk, + unsigned long long size, + unsigned int flags, + virErrorPtr err); + +int +virDomainBlockStatsWrapper(virDomainPtr dom, + const char * disk, + virDomainBlockStatsPtr stats, + size_t size, + virErrorPtr err); + +int +virDomainBlockStatsFlagsWrapper(virDomainPtr dom, + const char * disk, + virTypedParameterPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err); + +virDomainCheckpointPtr +virDomainCheckpointCreateXMLWrapper(virDomainPtr domain, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err); + +int +virDomainCheckpointDeleteWrapper(virDomainCheckpointPtr checkpoint, + unsigned int flags, + virErrorPtr err); + +int +virDomainCheckpointFreeWrapper(virDomainCheckpointPtr checkpoint, + virErrorPtr err); + +virConnectPtr +virDomainCheckpointGetConnectWrapper(virDomainCheckpointPtr checkpoint, + virErrorPtr err); + +virDomainPtr +virDomainCheckpointGetDomainWrapper(virDomainCheckpointPtr checkpoint, + virErrorPtr err); + +const char * +virDomainCheckpointGetNameWrapper(virDomainCheckpointPtr checkpoint, + virErrorPtr err); + +virDomainCheckpointPtr +virDomainCheckpointGetParentWrapper(virDomainCheckpointPtr checkpoint, + unsigned int flags, + virErrorPtr err); + +char * +virDomainCheckpointGetXMLDescWrapper(virDomainCheckpointPtr checkpoint, + unsigned int flags, + virErrorPtr err); + +int +virDomainCheckpointListAllChildrenWrapper(virDomainCheckpointPtr checkpoint, + virDomainCheckpointPtr ** children, + unsigned int flags, + virErrorPtr err); + +virDomainCheckpointPtr +virDomainCheckpointLookupByNameWrapper(virDomainPtr domain, + const char * name, + unsigned int flags, + virErrorPtr err); + +int +virDomainCheckpointRefWrapper(virDomainCheckpointPtr checkpoint, + virErrorPtr err); + +int +virDomainCoreDumpWrapper(virDomainPtr domain, + const char * to, + unsigned int flags, + virErrorPtr err); + +int +virDomainCoreDumpWithFormatWrapper(virDomainPtr domain, + const char * to, + unsigned int dumpformat, + unsigned int flags, + virErrorPtr err); + +int +virDomainCreateWrapper(virDomainPtr domain, + virErrorPtr err); + +virDomainPtr +virDomainCreateLinuxWrapper(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err); + +int +virDomainCreateWithFilesWrapper(virDomainPtr domain, + unsigned int nfiles, + int * files, + unsigned int flags, + virErrorPtr err); + +int +virDomainCreateWithFlagsWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +virDomainPtr +virDomainCreateXMLWrapper(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err); + +virDomainPtr +virDomainCreateXMLWithFilesWrapper(virConnectPtr conn, + const char * xmlDesc, + unsigned int nfiles, + int * files, + unsigned int flags, + virErrorPtr err); + +virDomainPtr +virDomainDefineXMLWrapper(virConnectPtr conn, + const char * xml, + virErrorPtr err); + +virDomainPtr +virDomainDefineXMLFlagsWrapper(virConnectPtr conn, + const char * xml, + unsigned int flags, + virErrorPtr err); + +int +virDomainDelIOThreadWrapper(virDomainPtr domain, + unsigned int iothread_id, + unsigned int flags, + virErrorPtr err); + +int +virDomainDestroyWrapper(virDomainPtr domain, + virErrorPtr err); + +int +virDomainDestroyFlagsWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +int +virDomainDetachDeviceWrapper(virDomainPtr domain, + const char * xml, + virErrorPtr err); + +int +virDomainDetachDeviceAliasWrapper(virDomainPtr domain, + const char * alias, + unsigned int flags, + virErrorPtr err); + +int +virDomainDetachDeviceFlagsWrapper(virDomainPtr domain, + const char * xml, + unsigned int flags, + virErrorPtr err); + +int +virDomainFDAssociateWrapper(virDomainPtr domain, + const char * name, + unsigned int nfds, + int * fds, + unsigned int flags, + virErrorPtr err); + +int +virDomainFSFreezeWrapper(virDomainPtr dom, + const char ** mountpoints, + unsigned int nmountpoints, + unsigned int flags, + virErrorPtr err); + +void +virDomainFSInfoFreeWrapper(virDomainFSInfoPtr info); + +int +virDomainFSThawWrapper(virDomainPtr dom, + const char ** mountpoints, + unsigned int nmountpoints, + unsigned int flags, + virErrorPtr err); + +int +virDomainFSTrimWrapper(virDomainPtr dom, + const char * mountPoint, + unsigned long long minimum, + unsigned int flags, + virErrorPtr err); + +int +virDomainFreeWrapper(virDomainPtr domain, + virErrorPtr err); + +int +virDomainGetAutostartWrapper(virDomainPtr domain, + int * autostart, + virErrorPtr err); + +int +virDomainGetBlkioParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetBlockInfoWrapper(virDomainPtr domain, + const char * disk, + virDomainBlockInfoPtr info, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetBlockIoTuneWrapper(virDomainPtr dom, + const char * disk, + virTypedParameterPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetBlockJobInfoWrapper(virDomainPtr dom, + const char * disk, + virDomainBlockJobInfoPtr info, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetCPUStatsWrapper(virDomainPtr domain, + virTypedParameterPtr params, + unsigned int nparams, + int start_cpu, + unsigned int ncpus, + unsigned int flags, + virErrorPtr err); + +virConnectPtr +virDomainGetConnectWrapper(virDomainPtr dom, + virErrorPtr err); + +int +virDomainGetControlInfoWrapper(virDomainPtr domain, + virDomainControlInfoPtr info, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetDiskErrorsWrapper(virDomainPtr dom, + virDomainDiskErrorPtr errors, + unsigned int maxerrors, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetEmulatorPinInfoWrapper(virDomainPtr domain, + unsigned char * cpumap, + int maplen, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetFSInfoWrapper(virDomainPtr dom, + virDomainFSInfoPtr ** info, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetGuestInfoWrapper(virDomainPtr domain, + unsigned int types, + virTypedParameterPtr * params, + int * nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetGuestVcpusWrapper(virDomainPtr domain, + virTypedParameterPtr * params, + unsigned int * nparams, + unsigned int flags, + virErrorPtr err); + +char * +virDomainGetHostnameWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +unsigned int +virDomainGetIDWrapper(virDomainPtr domain, + virErrorPtr err); + +int +virDomainGetIOThreadInfoWrapper(virDomainPtr dom, + virDomainIOThreadInfoPtr ** info, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetInfoWrapper(virDomainPtr domain, + virDomainInfoPtr info, + virErrorPtr err); + +int +virDomainGetInterfaceParametersWrapper(virDomainPtr domain, + const char * device, + virTypedParameterPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetJobInfoWrapper(virDomainPtr domain, + virDomainJobInfoPtr info, + virErrorPtr err); + +int +virDomainGetJobStatsWrapper(virDomainPtr domain, + int * type, + virTypedParameterPtr * params, + int * nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetLaunchSecurityInfoWrapper(virDomainPtr domain, + virTypedParameterPtr * params, + int * nparams, + unsigned int flags, + virErrorPtr err); + +unsigned long +virDomainGetMaxMemoryWrapper(virDomainPtr domain, + virErrorPtr err); + +int +virDomainGetMaxVcpusWrapper(virDomainPtr domain, + virErrorPtr err); + +int +virDomainGetMemoryParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetMessagesWrapper(virDomainPtr domain, + char *** msgs, + unsigned int flags, + virErrorPtr err); + +char * +virDomainGetMetadataWrapper(virDomainPtr domain, + int type, + const char * uri, + unsigned int flags, + virErrorPtr err); + +const char * +virDomainGetNameWrapper(virDomainPtr domain, + virErrorPtr err); + +int +virDomainGetNumaParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err); + +char * +virDomainGetOSTypeWrapper(virDomainPtr domain, + virErrorPtr err); + +int +virDomainGetPerfEventsWrapper(virDomainPtr domain, + virTypedParameterPtr * params, + int * nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetSchedulerParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int * nparams, + virErrorPtr err); + +int +virDomainGetSchedulerParametersFlagsWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err); + +char * +virDomainGetSchedulerTypeWrapper(virDomainPtr domain, + int * nparams, + virErrorPtr err); + +int +virDomainGetSecurityLabelWrapper(virDomainPtr domain, + virSecurityLabelPtr seclabel, + virErrorPtr err); + +int +virDomainGetSecurityLabelListWrapper(virDomainPtr domain, + virSecurityLabelPtr * seclabels, + virErrorPtr err); + +int +virDomainGetStateWrapper(virDomainPtr domain, + int * state, + int * reason, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetTimeWrapper(virDomainPtr dom, + long long * seconds, + unsigned int * nseconds, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetUUIDWrapper(virDomainPtr domain, + unsigned char * uuid, + virErrorPtr err); + +int +virDomainGetUUIDStringWrapper(virDomainPtr domain, + char * buf, + virErrorPtr err); + +int +virDomainGetVcpuPinInfoWrapper(virDomainPtr domain, + int ncpumaps, + unsigned char * cpumaps, + int maplen, + unsigned int flags, + virErrorPtr err); + +int +virDomainGetVcpusWrapper(virDomainPtr domain, + virVcpuInfoPtr info, + int maxinfo, + unsigned char * cpumaps, + int maplen, + virErrorPtr err); + +int +virDomainGetVcpusFlagsWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +char * +virDomainGetXMLDescWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +int +virDomainGraphicsReloadWrapper(virDomainPtr domain, + unsigned int type, + unsigned int flags, + virErrorPtr err); + +int +virDomainHasCurrentSnapshotWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +int +virDomainHasManagedSaveImageWrapper(virDomainPtr dom, + unsigned int flags, + virErrorPtr err); + +void +virDomainIOThreadInfoFreeWrapper(virDomainIOThreadInfoPtr info); + +int +virDomainInjectNMIWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +int +virDomainInterfaceAddressesWrapper(virDomainPtr dom, + virDomainInterfacePtr ** ifaces, + unsigned int source, + unsigned int flags, + virErrorPtr err); + +void +virDomainInterfaceFreeWrapper(virDomainInterfacePtr iface); + +int +virDomainInterfaceStatsWrapper(virDomainPtr dom, + const char * device, + virDomainInterfaceStatsPtr stats, + size_t size, + virErrorPtr err); + +int +virDomainIsActiveWrapper(virDomainPtr dom, + virErrorPtr err); + +int +virDomainIsPersistentWrapper(virDomainPtr dom, + virErrorPtr err); + +int +virDomainIsUpdatedWrapper(virDomainPtr dom, + virErrorPtr err); + +int +virDomainListAllCheckpointsWrapper(virDomainPtr domain, + virDomainCheckpointPtr ** checkpoints, + unsigned int flags, + virErrorPtr err); + +int +virDomainListAllSnapshotsWrapper(virDomainPtr domain, + virDomainSnapshotPtr ** snaps, + unsigned int flags, + virErrorPtr err); + +int +virDomainListGetStatsWrapper(virDomainPtr * doms, + unsigned int stats, + virDomainStatsRecordPtr ** retStats, + unsigned int flags, + virErrorPtr err); + +virDomainPtr +virDomainLookupByIDWrapper(virConnectPtr conn, + int id, + virErrorPtr err); + +virDomainPtr +virDomainLookupByNameWrapper(virConnectPtr conn, + const char * name, + virErrorPtr err); + +virDomainPtr +virDomainLookupByUUIDWrapper(virConnectPtr conn, + const unsigned char * uuid, + virErrorPtr err); + +virDomainPtr +virDomainLookupByUUIDStringWrapper(virConnectPtr conn, + const char * uuidstr, + virErrorPtr err); + +int +virDomainManagedSaveWrapper(virDomainPtr dom, + unsigned int flags, + virErrorPtr err); + +int +virDomainManagedSaveDefineXMLWrapper(virDomainPtr domain, + const char * dxml, + unsigned int flags, + virErrorPtr err); + +char * +virDomainManagedSaveGetXMLDescWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +int +virDomainManagedSaveRemoveWrapper(virDomainPtr dom, + unsigned int flags, + virErrorPtr err); + +int +virDomainMemoryPeekWrapper(virDomainPtr dom, + unsigned long long start, + size_t size, + void * buffer, + unsigned int flags, + virErrorPtr err); + +int +virDomainMemoryStatsWrapper(virDomainPtr dom, + virDomainMemoryStatPtr stats, + unsigned int nr_stats, + unsigned int flags, + virErrorPtr err); + +virDomainPtr +virDomainMigrateWrapper(virDomainPtr domain, + virConnectPtr dconn, + unsigned long flags, + const char * dname, + const char * uri, + unsigned long bandwidth, + virErrorPtr err); + +virDomainPtr +virDomainMigrate2Wrapper(virDomainPtr domain, + virConnectPtr dconn, + const char * dxml, + unsigned long flags, + const char * dname, + const char * uri, + unsigned long bandwidth, + virErrorPtr err); + +virDomainPtr +virDomainMigrate3Wrapper(virDomainPtr domain, + virConnectPtr dconn, + virTypedParameterPtr params, + unsigned int nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainMigrateGetCompressionCacheWrapper(virDomainPtr domain, + unsigned long long * cacheSize, + unsigned int flags, + virErrorPtr err); + +int +virDomainMigrateGetMaxDowntimeWrapper(virDomainPtr domain, + unsigned long long * downtime, + unsigned int flags, + virErrorPtr err); + +int +virDomainMigrateGetMaxSpeedWrapper(virDomainPtr domain, + unsigned long * bandwidth, + unsigned int flags, + virErrorPtr err); + +int +virDomainMigrateSetCompressionCacheWrapper(virDomainPtr domain, + unsigned long long cacheSize, + unsigned int flags, + virErrorPtr err); + +int +virDomainMigrateSetMaxDowntimeWrapper(virDomainPtr domain, + unsigned long long downtime, + unsigned int flags, + virErrorPtr err); + +int +virDomainMigrateSetMaxSpeedWrapper(virDomainPtr domain, + unsigned long bandwidth, + unsigned int flags, + virErrorPtr err); + +int +virDomainMigrateStartPostCopyWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +int +virDomainMigrateToURIWrapper(virDomainPtr domain, + const char * duri, + unsigned long flags, + const char * dname, + unsigned long bandwidth, + virErrorPtr err); + +int +virDomainMigrateToURI2Wrapper(virDomainPtr domain, + const char * dconnuri, + const char * miguri, + const char * dxml, + unsigned long flags, + const char * dname, + unsigned long bandwidth, + virErrorPtr err); + +int +virDomainMigrateToURI3Wrapper(virDomainPtr domain, + const char * dconnuri, + virTypedParameterPtr params, + unsigned int nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainOpenChannelWrapper(virDomainPtr dom, + const char * name, + virStreamPtr st, + unsigned int flags, + virErrorPtr err); + +int +virDomainOpenConsoleWrapper(virDomainPtr dom, + const char * dev_name, + virStreamPtr st, + unsigned int flags, + virErrorPtr err); + +int +virDomainOpenGraphicsWrapper(virDomainPtr dom, + unsigned int idx, + int fd, + unsigned int flags, + virErrorPtr err); + +int +virDomainOpenGraphicsFDWrapper(virDomainPtr dom, + unsigned int idx, + unsigned int flags, + virErrorPtr err); + +int +virDomainPMSuspendForDurationWrapper(virDomainPtr dom, + unsigned int target, + unsigned long long duration, + unsigned int flags, + virErrorPtr err); + +int +virDomainPMWakeupWrapper(virDomainPtr dom, + unsigned int flags, + virErrorPtr err); + +int +virDomainPinEmulatorWrapper(virDomainPtr domain, + unsigned char * cpumap, + int maplen, + unsigned int flags, + virErrorPtr err); + +int +virDomainPinIOThreadWrapper(virDomainPtr domain, + unsigned int iothread_id, + unsigned char * cpumap, + int maplen, + unsigned int flags, + virErrorPtr err); + +int +virDomainPinVcpuWrapper(virDomainPtr domain, + unsigned int vcpu, + unsigned char * cpumap, + int maplen, + virErrorPtr err); + +int +virDomainPinVcpuFlagsWrapper(virDomainPtr domain, + unsigned int vcpu, + unsigned char * cpumap, + int maplen, + unsigned int flags, + virErrorPtr err); + +int +virDomainRebootWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +int +virDomainRefWrapper(virDomainPtr domain, + virErrorPtr err); + +int +virDomainRenameWrapper(virDomainPtr dom, + const char * new_name, + unsigned int flags, + virErrorPtr err); + +int +virDomainResetWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +int +virDomainRestoreWrapper(virConnectPtr conn, + const char * from, + virErrorPtr err); + +int +virDomainRestoreFlagsWrapper(virConnectPtr conn, + const char * from, + const char * dxml, + unsigned int flags, + virErrorPtr err); + +int +virDomainRestoreParamsWrapper(virConnectPtr conn, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainResumeWrapper(virDomainPtr domain, + virErrorPtr err); + +int +virDomainRevertToSnapshotWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err); + +int +virDomainSaveWrapper(virDomainPtr domain, + const char * to, + virErrorPtr err); + +int +virDomainSaveFlagsWrapper(virDomainPtr domain, + const char * to, + const char * dxml, + unsigned int flags, + virErrorPtr err); + +int +virDomainSaveImageDefineXMLWrapper(virConnectPtr conn, + const char * file, + const char * dxml, + unsigned int flags, + virErrorPtr err); + +char * +virDomainSaveImageGetXMLDescWrapper(virConnectPtr conn, + const char * file, + unsigned int flags, + virErrorPtr err); + +int +virDomainSaveParamsWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err); + +char * +virDomainScreenshotWrapper(virDomainPtr domain, + virStreamPtr stream, + unsigned int screen, + unsigned int flags, + virErrorPtr err); + +int +virDomainSendKeyWrapper(virDomainPtr domain, + unsigned int codeset, + unsigned int holdtime, + unsigned int * keycodes, + int nkeycodes, + unsigned int flags, + virErrorPtr err); + +int +virDomainSendProcessSignalWrapper(virDomainPtr domain, + long long pid_value, + unsigned int signum, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetAutostartWrapper(virDomainPtr domain, + int autostart, + virErrorPtr err); + +int +virDomainSetBlkioParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetBlockIoTuneWrapper(virDomainPtr dom, + const char * disk, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetBlockThresholdWrapper(virDomainPtr domain, + const char * dev, + unsigned long long threshold, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetGuestVcpusWrapper(virDomainPtr domain, + const char * cpumap, + int state, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetIOThreadParamsWrapper(virDomainPtr domain, + unsigned int iothread_id, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetInterfaceParametersWrapper(virDomainPtr domain, + const char * device, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetLaunchSecurityStateWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetLifecycleActionWrapper(virDomainPtr domain, + unsigned int type, + unsigned int action, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetMaxMemoryWrapper(virDomainPtr domain, + unsigned long memory, + virErrorPtr err); + +int +virDomainSetMemoryWrapper(virDomainPtr domain, + unsigned long memory, + virErrorPtr err); + +int +virDomainSetMemoryFlagsWrapper(virDomainPtr domain, + unsigned long memory, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetMemoryParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetMemoryStatsPeriodWrapper(virDomainPtr domain, + int period, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetMetadataWrapper(virDomainPtr domain, + int type, + const char * metadata, + const char * key, + const char * uri, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetNumaParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetPerfEventsWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetSchedulerParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + virErrorPtr err); + +int +virDomainSetSchedulerParametersFlagsWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetTimeWrapper(virDomainPtr dom, + long long seconds, + unsigned int nseconds, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetUserPasswordWrapper(virDomainPtr dom, + const char * user, + const char * password, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetVcpuWrapper(virDomainPtr domain, + const char * vcpumap, + int state, + unsigned int flags, + virErrorPtr err); + +int +virDomainSetVcpusWrapper(virDomainPtr domain, + unsigned int nvcpus, + virErrorPtr err); + +int +virDomainSetVcpusFlagsWrapper(virDomainPtr domain, + unsigned int nvcpus, + unsigned int flags, + virErrorPtr err); + +int +virDomainShutdownWrapper(virDomainPtr domain, + virErrorPtr err); + +int +virDomainShutdownFlagsWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +virDomainSnapshotPtr +virDomainSnapshotCreateXMLWrapper(virDomainPtr domain, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err); + +virDomainSnapshotPtr +virDomainSnapshotCurrentWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +int +virDomainSnapshotDeleteWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err); + +int +virDomainSnapshotFreeWrapper(virDomainSnapshotPtr snapshot, + virErrorPtr err); + +virConnectPtr +virDomainSnapshotGetConnectWrapper(virDomainSnapshotPtr snapshot, + virErrorPtr err); + +virDomainPtr +virDomainSnapshotGetDomainWrapper(virDomainSnapshotPtr snapshot, + virErrorPtr err); + +const char * +virDomainSnapshotGetNameWrapper(virDomainSnapshotPtr snapshot, + virErrorPtr err); + +virDomainSnapshotPtr +virDomainSnapshotGetParentWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err); + +char * +virDomainSnapshotGetXMLDescWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err); + +int +virDomainSnapshotHasMetadataWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err); + +int +virDomainSnapshotIsCurrentWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err); + +int +virDomainSnapshotListAllChildrenWrapper(virDomainSnapshotPtr snapshot, + virDomainSnapshotPtr ** snaps, + unsigned int flags, + virErrorPtr err); + +int +virDomainSnapshotListChildrenNamesWrapper(virDomainSnapshotPtr snapshot, + char ** names, + int nameslen, + unsigned int flags, + virErrorPtr err); + +int +virDomainSnapshotListNamesWrapper(virDomainPtr domain, + char ** names, + int nameslen, + unsigned int flags, + virErrorPtr err); + +virDomainSnapshotPtr +virDomainSnapshotLookupByNameWrapper(virDomainPtr domain, + const char * name, + unsigned int flags, + virErrorPtr err); + +int +virDomainSnapshotNumWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +int +virDomainSnapshotNumChildrenWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err); + +int +virDomainSnapshotRefWrapper(virDomainSnapshotPtr snapshot, + virErrorPtr err); + +int +virDomainStartDirtyRateCalcWrapper(virDomainPtr domain, + int seconds, + unsigned int flags, + virErrorPtr err); + +void +virDomainStatsRecordListFreeWrapper(virDomainStatsRecordPtr * stats); + +int +virDomainSuspendWrapper(virDomainPtr domain, + virErrorPtr err); + +int +virDomainUndefineWrapper(virDomainPtr domain, + virErrorPtr err); + +int +virDomainUndefineFlagsWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +int +virDomainUpdateDeviceFlagsWrapper(virDomainPtr domain, + const char * xml, + unsigned int flags, + virErrorPtr err); + +int +virEventAddHandleWrapper(int fd, + int events, + virEventHandleCallback cb, + void * opaque, + virFreeCallback ff, + virErrorPtr err); + +int +virEventAddTimeoutWrapper(int timeout, + virEventTimeoutCallback cb, + void * opaque, + virFreeCallback ff, + virErrorPtr err); + +int +virEventRegisterDefaultImplWrapper(virErrorPtr err); + +void +virEventRegisterImplWrapper(virEventAddHandleFunc addHandle, + virEventUpdateHandleFunc updateHandle, + virEventRemoveHandleFunc removeHandle, + virEventAddTimeoutFunc addTimeout, + virEventUpdateTimeoutFunc updateTimeout, + virEventRemoveTimeoutFunc removeTimeout); + +int +virEventRemoveHandleWrapper(int watch, + virErrorPtr err); + +int +virEventRemoveTimeoutWrapper(int timer, + virErrorPtr err); + +int +virEventRunDefaultImplWrapper(virErrorPtr err); + +void +virEventUpdateHandleWrapper(int watch, + int events); + +void +virEventUpdateTimeoutWrapper(int timer, + int timeout); + +void +virFreeErrorWrapper(virErrorPtr err); + +virErrorPtr +virGetLastErrorWrapper(virErrorPtr err); + +int +virGetLastErrorCodeWrapper(virErrorPtr err); + +int +virGetLastErrorDomainWrapper(virErrorPtr err); + +const char * +virGetLastErrorMessageWrapper(virErrorPtr err); + +int +virGetVersionWrapper(unsigned long * libVer, + const char * type, + unsigned long * typeVer, + virErrorPtr err); + +int +virInitializeWrapper(virErrorPtr err); + +int +virInterfaceChangeBeginWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err); + +int +virInterfaceChangeCommitWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err); + +int +virInterfaceChangeRollbackWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err); + +int +virInterfaceCreateWrapper(virInterfacePtr iface, + unsigned int flags, + virErrorPtr err); + +virInterfacePtr +virInterfaceDefineXMLWrapper(virConnectPtr conn, + const char * xml, + unsigned int flags, + virErrorPtr err); + +int +virInterfaceDestroyWrapper(virInterfacePtr iface, + unsigned int flags, + virErrorPtr err); + +int +virInterfaceFreeWrapper(virInterfacePtr iface, + virErrorPtr err); + +virConnectPtr +virInterfaceGetConnectWrapper(virInterfacePtr iface, + virErrorPtr err); + +const char * +virInterfaceGetMACStringWrapper(virInterfacePtr iface, + virErrorPtr err); + +const char * +virInterfaceGetNameWrapper(virInterfacePtr iface, + virErrorPtr err); + +char * +virInterfaceGetXMLDescWrapper(virInterfacePtr iface, + unsigned int flags, + virErrorPtr err); + +int +virInterfaceIsActiveWrapper(virInterfacePtr iface, + virErrorPtr err); + +virInterfacePtr +virInterfaceLookupByMACStringWrapper(virConnectPtr conn, + const char * macstr, + virErrorPtr err); + +virInterfacePtr +virInterfaceLookupByNameWrapper(virConnectPtr conn, + const char * name, + virErrorPtr err); + +int +virInterfaceRefWrapper(virInterfacePtr iface, + virErrorPtr err); + +int +virInterfaceUndefineWrapper(virInterfacePtr iface, + virErrorPtr err); + +virNWFilterBindingPtr +virNWFilterBindingCreateXMLWrapper(virConnectPtr conn, + const char * xml, + unsigned int flags, + virErrorPtr err); + +int +virNWFilterBindingDeleteWrapper(virNWFilterBindingPtr binding, + virErrorPtr err); + +int +virNWFilterBindingFreeWrapper(virNWFilterBindingPtr binding, + virErrorPtr err); + +const char * +virNWFilterBindingGetFilterNameWrapper(virNWFilterBindingPtr binding, + virErrorPtr err); + +const char * +virNWFilterBindingGetPortDevWrapper(virNWFilterBindingPtr binding, + virErrorPtr err); + +char * +virNWFilterBindingGetXMLDescWrapper(virNWFilterBindingPtr binding, + unsigned int flags, + virErrorPtr err); + +virNWFilterBindingPtr +virNWFilterBindingLookupByPortDevWrapper(virConnectPtr conn, + const char * portdev, + virErrorPtr err); + +int +virNWFilterBindingRefWrapper(virNWFilterBindingPtr binding, + virErrorPtr err); + +virNWFilterPtr +virNWFilterDefineXMLWrapper(virConnectPtr conn, + const char * xmlDesc, + virErrorPtr err); + +virNWFilterPtr +virNWFilterDefineXMLFlagsWrapper(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err); + +int +virNWFilterFreeWrapper(virNWFilterPtr nwfilter, + virErrorPtr err); + +const char * +virNWFilterGetNameWrapper(virNWFilterPtr nwfilter, + virErrorPtr err); + +int +virNWFilterGetUUIDWrapper(virNWFilterPtr nwfilter, + unsigned char * uuid, + virErrorPtr err); + +int +virNWFilterGetUUIDStringWrapper(virNWFilterPtr nwfilter, + char * buf, + virErrorPtr err); + +char * +virNWFilterGetXMLDescWrapper(virNWFilterPtr nwfilter, + unsigned int flags, + virErrorPtr err); + +virNWFilterPtr +virNWFilterLookupByNameWrapper(virConnectPtr conn, + const char * name, + virErrorPtr err); + +virNWFilterPtr +virNWFilterLookupByUUIDWrapper(virConnectPtr conn, + const unsigned char * uuid, + virErrorPtr err); + +virNWFilterPtr +virNWFilterLookupByUUIDStringWrapper(virConnectPtr conn, + const char * uuidstr, + virErrorPtr err); + +int +virNWFilterRefWrapper(virNWFilterPtr nwfilter, + virErrorPtr err); + +int +virNWFilterUndefineWrapper(virNWFilterPtr nwfilter, + virErrorPtr err); + +int +virNetworkCreateWrapper(virNetworkPtr network, + virErrorPtr err); + +virNetworkPtr +virNetworkCreateXMLWrapper(virConnectPtr conn, + const char * xmlDesc, + virErrorPtr err); + +virNetworkPtr +virNetworkCreateXMLFlagsWrapper(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err); + +void +virNetworkDHCPLeaseFreeWrapper(virNetworkDHCPLeasePtr lease); + +virNetworkPtr +virNetworkDefineXMLWrapper(virConnectPtr conn, + const char * xml, + virErrorPtr err); + +virNetworkPtr +virNetworkDefineXMLFlagsWrapper(virConnectPtr conn, + const char * xml, + unsigned int flags, + virErrorPtr err); + +int +virNetworkDestroyWrapper(virNetworkPtr network, + virErrorPtr err); + +int +virNetworkFreeWrapper(virNetworkPtr network, + virErrorPtr err); + +int +virNetworkGetAutostartWrapper(virNetworkPtr network, + int * autostart, + virErrorPtr err); + +char * +virNetworkGetBridgeNameWrapper(virNetworkPtr network, + virErrorPtr err); + +virConnectPtr +virNetworkGetConnectWrapper(virNetworkPtr net, + virErrorPtr err); + +int +virNetworkGetDHCPLeasesWrapper(virNetworkPtr network, + const char * mac, + virNetworkDHCPLeasePtr ** leases, + unsigned int flags, + virErrorPtr err); + +char * +virNetworkGetMetadataWrapper(virNetworkPtr network, + int type, + const char * uri, + unsigned int flags, + virErrorPtr err); + +const char * +virNetworkGetNameWrapper(virNetworkPtr network, + virErrorPtr err); + +int +virNetworkGetUUIDWrapper(virNetworkPtr network, + unsigned char * uuid, + virErrorPtr err); + +int +virNetworkGetUUIDStringWrapper(virNetworkPtr network, + char * buf, + virErrorPtr err); + +char * +virNetworkGetXMLDescWrapper(virNetworkPtr network, + unsigned int flags, + virErrorPtr err); + +int +virNetworkIsActiveWrapper(virNetworkPtr net, + virErrorPtr err); + +int +virNetworkIsPersistentWrapper(virNetworkPtr net, + virErrorPtr err); + +int +virNetworkListAllPortsWrapper(virNetworkPtr network, + virNetworkPortPtr ** ports, + unsigned int flags, + virErrorPtr err); + +virNetworkPtr +virNetworkLookupByNameWrapper(virConnectPtr conn, + const char * name, + virErrorPtr err); + +virNetworkPtr +virNetworkLookupByUUIDWrapper(virConnectPtr conn, + const unsigned char * uuid, + virErrorPtr err); + +virNetworkPtr +virNetworkLookupByUUIDStringWrapper(virConnectPtr conn, + const char * uuidstr, + virErrorPtr err); + +virNetworkPortPtr +virNetworkPortCreateXMLWrapper(virNetworkPtr net, + const char * xmldesc, + unsigned int flags, + virErrorPtr err); + +int +virNetworkPortDeleteWrapper(virNetworkPortPtr port, + unsigned int flags, + virErrorPtr err); + +int +virNetworkPortFreeWrapper(virNetworkPortPtr port, + virErrorPtr err); + +virNetworkPtr +virNetworkPortGetNetworkWrapper(virNetworkPortPtr port, + virErrorPtr err); + +int +virNetworkPortGetParametersWrapper(virNetworkPortPtr port, + virTypedParameterPtr * params, + int * nparams, + unsigned int flags, + virErrorPtr err); + +int +virNetworkPortGetUUIDWrapper(virNetworkPortPtr port, + unsigned char * uuid, + virErrorPtr err); + +int +virNetworkPortGetUUIDStringWrapper(virNetworkPortPtr port, + char * buf, + virErrorPtr err); + +char * +virNetworkPortGetXMLDescWrapper(virNetworkPortPtr port, + unsigned int flags, + virErrorPtr err); + +virNetworkPortPtr +virNetworkPortLookupByUUIDWrapper(virNetworkPtr net, + const unsigned char * uuid, + virErrorPtr err); + +virNetworkPortPtr +virNetworkPortLookupByUUIDStringWrapper(virNetworkPtr net, + const char * uuidstr, + virErrorPtr err); + +int +virNetworkPortRefWrapper(virNetworkPortPtr port, + virErrorPtr err); + +int +virNetworkPortSetParametersWrapper(virNetworkPortPtr port, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err); + +int +virNetworkRefWrapper(virNetworkPtr network, + virErrorPtr err); + +int +virNetworkSetAutostartWrapper(virNetworkPtr network, + int autostart, + virErrorPtr err); + +int +virNetworkSetMetadataWrapper(virNetworkPtr network, + int type, + const char * metadata, + const char * key, + const char * uri, + unsigned int flags, + virErrorPtr err); + +int +virNetworkUndefineWrapper(virNetworkPtr network, + virErrorPtr err); + +int +virNetworkUpdateWrapper(virNetworkPtr network, + unsigned int command, + unsigned int section, + int parentIndex, + const char * xml, + unsigned int flags, + virErrorPtr err); + +int +virNodeAllocPagesWrapper(virConnectPtr conn, + unsigned int npages, + unsigned int * pageSizes, + unsigned long long * pageCounts, + int startCell, + unsigned int cellCount, + unsigned int flags, + virErrorPtr err); + +int +virNodeDeviceCreateWrapper(virNodeDevicePtr dev, + unsigned int flags, + virErrorPtr err); + +virNodeDevicePtr +virNodeDeviceCreateXMLWrapper(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err); + +virNodeDevicePtr +virNodeDeviceDefineXMLWrapper(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err); + +int +virNodeDeviceDestroyWrapper(virNodeDevicePtr dev, + virErrorPtr err); + +int +virNodeDeviceDetachFlagsWrapper(virNodeDevicePtr dev, + const char * driverName, + unsigned int flags, + virErrorPtr err); + +int +virNodeDeviceDettachWrapper(virNodeDevicePtr dev, + virErrorPtr err); + +int +virNodeDeviceFreeWrapper(virNodeDevicePtr dev, + virErrorPtr err); + +int +virNodeDeviceGetAutostartWrapper(virNodeDevicePtr dev, + int * autostart, + virErrorPtr err); + +const char * +virNodeDeviceGetNameWrapper(virNodeDevicePtr dev, + virErrorPtr err); + +const char * +virNodeDeviceGetParentWrapper(virNodeDevicePtr dev, + virErrorPtr err); + +char * +virNodeDeviceGetXMLDescWrapper(virNodeDevicePtr dev, + unsigned int flags, + virErrorPtr err); + +int +virNodeDeviceIsActiveWrapper(virNodeDevicePtr dev, + virErrorPtr err); + +int +virNodeDeviceIsPersistentWrapper(virNodeDevicePtr dev, + virErrorPtr err); + +int +virNodeDeviceListCapsWrapper(virNodeDevicePtr dev, + char ** const names, + int maxnames, + virErrorPtr err); + +virNodeDevicePtr +virNodeDeviceLookupByNameWrapper(virConnectPtr conn, + const char * name, + virErrorPtr err); + +virNodeDevicePtr +virNodeDeviceLookupSCSIHostByWWNWrapper(virConnectPtr conn, + const char * wwnn, + const char * wwpn, + unsigned int flags, + virErrorPtr err); + +int +virNodeDeviceNumOfCapsWrapper(virNodeDevicePtr dev, + virErrorPtr err); + +int +virNodeDeviceReAttachWrapper(virNodeDevicePtr dev, + virErrorPtr err); + +int +virNodeDeviceRefWrapper(virNodeDevicePtr dev, + virErrorPtr err); + +int +virNodeDeviceResetWrapper(virNodeDevicePtr dev, + virErrorPtr err); + +int +virNodeDeviceSetAutostartWrapper(virNodeDevicePtr dev, + int autostart, + virErrorPtr err); + +int +virNodeDeviceUndefineWrapper(virNodeDevicePtr dev, + unsigned int flags, + virErrorPtr err); + +int +virNodeDeviceUpdateWrapper(virNodeDevicePtr dev, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err); + +int +virNodeGetCPUMapWrapper(virConnectPtr conn, + unsigned char ** cpumap, + unsigned int * online, + unsigned int flags, + virErrorPtr err); + +int +virNodeGetCPUStatsWrapper(virConnectPtr conn, + int cpuNum, + virNodeCPUStatsPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err); + +int +virNodeGetCellsFreeMemoryWrapper(virConnectPtr conn, + unsigned long long * freeMems, + int startCell, + int maxCells, + virErrorPtr err); + +unsigned long long +virNodeGetFreeMemoryWrapper(virConnectPtr conn, + virErrorPtr err); + +int +virNodeGetFreePagesWrapper(virConnectPtr conn, + unsigned int npages, + unsigned int * pages, + int startCell, + unsigned int cellCount, + unsigned long long * counts, + unsigned int flags, + virErrorPtr err); + +int +virNodeGetInfoWrapper(virConnectPtr conn, + virNodeInfoPtr info, + virErrorPtr err); + +int +virNodeGetMemoryParametersWrapper(virConnectPtr conn, + virTypedParameterPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err); + +int +virNodeGetMemoryStatsWrapper(virConnectPtr conn, + int cellNum, + virNodeMemoryStatsPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err); + +int +virNodeGetSEVInfoWrapper(virConnectPtr conn, + virTypedParameterPtr * params, + int * nparams, + unsigned int flags, + virErrorPtr err); + +int +virNodeGetSecurityModelWrapper(virConnectPtr conn, + virSecurityModelPtr secmodel, + virErrorPtr err); + +int +virNodeListDevicesWrapper(virConnectPtr conn, + const char * cap, + char ** const names, + int maxnames, + unsigned int flags, + virErrorPtr err); + +int +virNodeNumOfDevicesWrapper(virConnectPtr conn, + const char * cap, + unsigned int flags, + virErrorPtr err); + +int +virNodeSetMemoryParametersWrapper(virConnectPtr conn, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err); + +int +virNodeSuspendForDurationWrapper(virConnectPtr conn, + unsigned int target, + unsigned long long duration, + unsigned int flags, + virErrorPtr err); + +void +virResetErrorWrapper(virErrorPtr err); + +void +virResetLastErrorWrapper(void); + +virErrorPtr +virSaveLastErrorWrapper(virErrorPtr err); + +virSecretPtr +virSecretDefineXMLWrapper(virConnectPtr conn, + const char * xml, + unsigned int flags, + virErrorPtr err); + +int +virSecretFreeWrapper(virSecretPtr secret, + virErrorPtr err); + +virConnectPtr +virSecretGetConnectWrapper(virSecretPtr secret, + virErrorPtr err); + +int +virSecretGetUUIDWrapper(virSecretPtr secret, + unsigned char * uuid, + virErrorPtr err); + +int +virSecretGetUUIDStringWrapper(virSecretPtr secret, + char * buf, + virErrorPtr err); + +const char * +virSecretGetUsageIDWrapper(virSecretPtr secret, + virErrorPtr err); + +int +virSecretGetUsageTypeWrapper(virSecretPtr secret, + virErrorPtr err); + +unsigned char * +virSecretGetValueWrapper(virSecretPtr secret, + size_t * value_size, + unsigned int flags, + virErrorPtr err); + +char * +virSecretGetXMLDescWrapper(virSecretPtr secret, + unsigned int flags, + virErrorPtr err); + +virSecretPtr +virSecretLookupByUUIDWrapper(virConnectPtr conn, + const unsigned char * uuid, + virErrorPtr err); + +virSecretPtr +virSecretLookupByUUIDStringWrapper(virConnectPtr conn, + const char * uuidstr, + virErrorPtr err); + +virSecretPtr +virSecretLookupByUsageWrapper(virConnectPtr conn, + int usageType, + const char * usageID, + virErrorPtr err); + +int +virSecretRefWrapper(virSecretPtr secret, + virErrorPtr err); + +int +virSecretSetValueWrapper(virSecretPtr secret, + const unsigned char * value, + size_t value_size, + unsigned int flags, + virErrorPtr err); + +int +virSecretUndefineWrapper(virSecretPtr secret, + virErrorPtr err); + +void +virSetErrorFuncWrapper(void * userData, + virErrorFunc handler); + +int +virStoragePoolBuildWrapper(virStoragePoolPtr pool, + unsigned int flags, + virErrorPtr err); + +int +virStoragePoolCreateWrapper(virStoragePoolPtr pool, + unsigned int flags, + virErrorPtr err); + +virStoragePoolPtr +virStoragePoolCreateXMLWrapper(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err); + +virStoragePoolPtr +virStoragePoolDefineXMLWrapper(virConnectPtr conn, + const char * xml, + unsigned int flags, + virErrorPtr err); + +int +virStoragePoolDeleteWrapper(virStoragePoolPtr pool, + unsigned int flags, + virErrorPtr err); + +int +virStoragePoolDestroyWrapper(virStoragePoolPtr pool, + virErrorPtr err); + +int +virStoragePoolFreeWrapper(virStoragePoolPtr pool, + virErrorPtr err); + +int +virStoragePoolGetAutostartWrapper(virStoragePoolPtr pool, + int * autostart, + virErrorPtr err); + +virConnectPtr +virStoragePoolGetConnectWrapper(virStoragePoolPtr pool, + virErrorPtr err); + +int +virStoragePoolGetInfoWrapper(virStoragePoolPtr pool, + virStoragePoolInfoPtr info, + virErrorPtr err); + +const char * +virStoragePoolGetNameWrapper(virStoragePoolPtr pool, + virErrorPtr err); + +int +virStoragePoolGetUUIDWrapper(virStoragePoolPtr pool, + unsigned char * uuid, + virErrorPtr err); + +int +virStoragePoolGetUUIDStringWrapper(virStoragePoolPtr pool, + char * buf, + virErrorPtr err); + +char * +virStoragePoolGetXMLDescWrapper(virStoragePoolPtr pool, + unsigned int flags, + virErrorPtr err); + +int +virStoragePoolIsActiveWrapper(virStoragePoolPtr pool, + virErrorPtr err); + +int +virStoragePoolIsPersistentWrapper(virStoragePoolPtr pool, + virErrorPtr err); + +int +virStoragePoolListAllVolumesWrapper(virStoragePoolPtr pool, + virStorageVolPtr ** vols, + unsigned int flags, + virErrorPtr err); + +int +virStoragePoolListVolumesWrapper(virStoragePoolPtr pool, + char ** const names, + int maxnames, + virErrorPtr err); + +virStoragePoolPtr +virStoragePoolLookupByNameWrapper(virConnectPtr conn, + const char * name, + virErrorPtr err); + +virStoragePoolPtr +virStoragePoolLookupByTargetPathWrapper(virConnectPtr conn, + const char * path, + virErrorPtr err); + +virStoragePoolPtr +virStoragePoolLookupByUUIDWrapper(virConnectPtr conn, + const unsigned char * uuid, + virErrorPtr err); + +virStoragePoolPtr +virStoragePoolLookupByUUIDStringWrapper(virConnectPtr conn, + const char * uuidstr, + virErrorPtr err); + +virStoragePoolPtr +virStoragePoolLookupByVolumeWrapper(virStorageVolPtr vol, + virErrorPtr err); + +int +virStoragePoolNumOfVolumesWrapper(virStoragePoolPtr pool, + virErrorPtr err); + +int +virStoragePoolRefWrapper(virStoragePoolPtr pool, + virErrorPtr err); + +int +virStoragePoolRefreshWrapper(virStoragePoolPtr pool, + unsigned int flags, + virErrorPtr err); + +int +virStoragePoolSetAutostartWrapper(virStoragePoolPtr pool, + int autostart, + virErrorPtr err); + +int +virStoragePoolUndefineWrapper(virStoragePoolPtr pool, + virErrorPtr err); + +virStorageVolPtr +virStorageVolCreateXMLWrapper(virStoragePoolPtr pool, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err); + +virStorageVolPtr +virStorageVolCreateXMLFromWrapper(virStoragePoolPtr pool, + const char * xmlDesc, + virStorageVolPtr clonevol, + unsigned int flags, + virErrorPtr err); + +int +virStorageVolDeleteWrapper(virStorageVolPtr vol, + unsigned int flags, + virErrorPtr err); + +int +virStorageVolDownloadWrapper(virStorageVolPtr vol, + virStreamPtr stream, + unsigned long long offset, + unsigned long long length, + unsigned int flags, + virErrorPtr err); + +int +virStorageVolFreeWrapper(virStorageVolPtr vol, + virErrorPtr err); + +virConnectPtr +virStorageVolGetConnectWrapper(virStorageVolPtr vol, + virErrorPtr err); + +int +virStorageVolGetInfoWrapper(virStorageVolPtr vol, + virStorageVolInfoPtr info, + virErrorPtr err); + +int +virStorageVolGetInfoFlagsWrapper(virStorageVolPtr vol, + virStorageVolInfoPtr info, + unsigned int flags, + virErrorPtr err); + +const char * +virStorageVolGetKeyWrapper(virStorageVolPtr vol, + virErrorPtr err); + +const char * +virStorageVolGetNameWrapper(virStorageVolPtr vol, + virErrorPtr err); + +char * +virStorageVolGetPathWrapper(virStorageVolPtr vol, + virErrorPtr err); + +char * +virStorageVolGetXMLDescWrapper(virStorageVolPtr vol, + unsigned int flags, + virErrorPtr err); + +virStorageVolPtr +virStorageVolLookupByKeyWrapper(virConnectPtr conn, + const char * key, + virErrorPtr err); + +virStorageVolPtr +virStorageVolLookupByNameWrapper(virStoragePoolPtr pool, + const char * name, + virErrorPtr err); + +virStorageVolPtr +virStorageVolLookupByPathWrapper(virConnectPtr conn, + const char * path, + virErrorPtr err); + +int +virStorageVolRefWrapper(virStorageVolPtr vol, + virErrorPtr err); + +int +virStorageVolResizeWrapper(virStorageVolPtr vol, + unsigned long long capacity, + unsigned int flags, + virErrorPtr err); + +int +virStorageVolUploadWrapper(virStorageVolPtr vol, + virStreamPtr stream, + unsigned long long offset, + unsigned long long length, + unsigned int flags, + virErrorPtr err); + +int +virStorageVolWipeWrapper(virStorageVolPtr vol, + unsigned int flags, + virErrorPtr err); + +int +virStorageVolWipePatternWrapper(virStorageVolPtr vol, + unsigned int algorithm, + unsigned int flags, + virErrorPtr err); + +int +virStreamAbortWrapper(virStreamPtr stream, + virErrorPtr err); + +int +virStreamEventAddCallbackWrapper(virStreamPtr stream, + int events, + virStreamEventCallback cb, + void * opaque, + virFreeCallback ff, + virErrorPtr err); + +int +virStreamEventRemoveCallbackWrapper(virStreamPtr stream, + virErrorPtr err); + +int +virStreamEventUpdateCallbackWrapper(virStreamPtr stream, + int events, + virErrorPtr err); + +int +virStreamFinishWrapper(virStreamPtr stream, + virErrorPtr err); + +int +virStreamFreeWrapper(virStreamPtr stream, + virErrorPtr err); + +virStreamPtr +virStreamNewWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err); + +int +virStreamRecvWrapper(virStreamPtr stream, + char * data, + size_t nbytes, + virErrorPtr err); + +int +virStreamRecvAllWrapper(virStreamPtr stream, + virStreamSinkFunc handler, + void * opaque, + virErrorPtr err); + +int +virStreamRecvFlagsWrapper(virStreamPtr stream, + char * data, + size_t nbytes, + unsigned int flags, + virErrorPtr err); + +int +virStreamRecvHoleWrapper(virStreamPtr stream, + long long * length, + unsigned int flags, + virErrorPtr err); + +int +virStreamRefWrapper(virStreamPtr stream, + virErrorPtr err); + +int +virStreamSendWrapper(virStreamPtr stream, + const char * data, + size_t nbytes, + virErrorPtr err); + +int +virStreamSendAllWrapper(virStreamPtr stream, + virStreamSourceFunc handler, + void * opaque, + virErrorPtr err); + +int +virStreamSendHoleWrapper(virStreamPtr stream, + long long length, + unsigned int flags, + virErrorPtr err); + +int +virStreamSparseRecvAllWrapper(virStreamPtr stream, + virStreamSinkFunc handler, + virStreamSinkHoleFunc holeHandler, + void * opaque, + virErrorPtr err); + +int +virStreamSparseSendAllWrapper(virStreamPtr stream, + virStreamSourceFunc handler, + virStreamSourceHoleFunc holeHandler, + virStreamSourceSkipFunc skipHandler, + void * opaque, + virErrorPtr err); + +int +virTypedParamsAddBooleanWrapper(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + int value, + virErrorPtr err); + +int +virTypedParamsAddDoubleWrapper(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + double value, + virErrorPtr err); + +int +virTypedParamsAddFromStringWrapper(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + int type, + const char * value, + virErrorPtr err); + +int +virTypedParamsAddIntWrapper(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + int value, + virErrorPtr err); + +int +virTypedParamsAddLLongWrapper(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + long long value, + virErrorPtr err); + +int +virTypedParamsAddStringWrapper(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + const char * value, + virErrorPtr err); + +int +virTypedParamsAddStringListWrapper(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + const char ** values, + virErrorPtr err); + +int +virTypedParamsAddUIntWrapper(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + unsigned int value, + virErrorPtr err); + +int +virTypedParamsAddULLongWrapper(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + unsigned long long value, + virErrorPtr err); + +void +virTypedParamsClearWrapper(virTypedParameterPtr params, + int nparams); + +void +virTypedParamsFreeWrapper(virTypedParameterPtr params, + int nparams); + +virTypedParameterPtr +virTypedParamsGetWrapper(virTypedParameterPtr params, + int nparams, + const char * name, + virErrorPtr err); + +int +virTypedParamsGetBooleanWrapper(virTypedParameterPtr params, + int nparams, + const char * name, + int * value, + virErrorPtr err); + +int +virTypedParamsGetDoubleWrapper(virTypedParameterPtr params, + int nparams, + const char * name, + double * value, + virErrorPtr err); + +int +virTypedParamsGetIntWrapper(virTypedParameterPtr params, + int nparams, + const char * name, + int * value, + virErrorPtr err); + +int +virTypedParamsGetLLongWrapper(virTypedParameterPtr params, + int nparams, + const char * name, + long long * value, + virErrorPtr err); + +int +virTypedParamsGetStringWrapper(virTypedParameterPtr params, + int nparams, + const char * name, + const char ** value, + virErrorPtr err); + +int +virTypedParamsGetUIntWrapper(virTypedParameterPtr params, + int nparams, + const char * name, + unsigned int * value, + virErrorPtr err); + +int +virTypedParamsGetULLongWrapper(virTypedParameterPtr params, + int nparams, + const char * name, + unsigned long long * value, + virErrorPtr err); diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_common.go b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_common.go new file mode 100644 index 000000000..f615634c2 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_common.go @@ -0,0 +1,716 @@ +//go:build libvirt_dlopen +// +build libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo LDFLAGS: -ldl +#cgo CFLAGS: -DLIBVIRT_DLOPEN +#include +#include +#include +#include +#include "libvirt_generated_dlopen.h" +#include "error_helper.h" + + +typedef int +(*virTypedParamsAddBooleanFuncType)(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + int value); + +int +virTypedParamsAddBooleanWrapper(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + int value, + virErrorPtr err) +{ + int ret = -1; + static virTypedParamsAddBooleanFuncType virTypedParamsAddBooleanSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virTypedParamsAddBoolean", + (void**)&virTypedParamsAddBooleanSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virTypedParamsAddBooleanSymbol(params, + nparams, + maxparams, + name, + value); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virTypedParamsAddDoubleFuncType)(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + double value); + +int +virTypedParamsAddDoubleWrapper(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + double value, + virErrorPtr err) +{ + int ret = -1; + static virTypedParamsAddDoubleFuncType virTypedParamsAddDoubleSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virTypedParamsAddDouble", + (void**)&virTypedParamsAddDoubleSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virTypedParamsAddDoubleSymbol(params, + nparams, + maxparams, + name, + value); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virTypedParamsAddFromStringFuncType)(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + int type, + const char * value); + +int +virTypedParamsAddFromStringWrapper(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + int type, + const char * value, + virErrorPtr err) +{ + int ret = -1; + static virTypedParamsAddFromStringFuncType virTypedParamsAddFromStringSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virTypedParamsAddFromString", + (void**)&virTypedParamsAddFromStringSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virTypedParamsAddFromStringSymbol(params, + nparams, + maxparams, + name, + type, + value); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virTypedParamsAddIntFuncType)(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + int value); + +int +virTypedParamsAddIntWrapper(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + int value, + virErrorPtr err) +{ + int ret = -1; + static virTypedParamsAddIntFuncType virTypedParamsAddIntSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virTypedParamsAddInt", + (void**)&virTypedParamsAddIntSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virTypedParamsAddIntSymbol(params, + nparams, + maxparams, + name, + value); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virTypedParamsAddLLongFuncType)(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + long long value); + +int +virTypedParamsAddLLongWrapper(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + long long value, + virErrorPtr err) +{ + int ret = -1; + static virTypedParamsAddLLongFuncType virTypedParamsAddLLongSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virTypedParamsAddLLong", + (void**)&virTypedParamsAddLLongSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virTypedParamsAddLLongSymbol(params, + nparams, + maxparams, + name, + value); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virTypedParamsAddStringFuncType)(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + const char * value); + +int +virTypedParamsAddStringWrapper(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + const char * value, + virErrorPtr err) +{ + int ret = -1; + static virTypedParamsAddStringFuncType virTypedParamsAddStringSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virTypedParamsAddString", + (void**)&virTypedParamsAddStringSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virTypedParamsAddStringSymbol(params, + nparams, + maxparams, + name, + value); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virTypedParamsAddStringListFuncType)(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + const char ** values); + +int +virTypedParamsAddStringListWrapper(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + const char ** values, + virErrorPtr err) +{ + int ret = -1; + static virTypedParamsAddStringListFuncType virTypedParamsAddStringListSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virTypedParamsAddStringList", + (void**)&virTypedParamsAddStringListSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virTypedParamsAddStringListSymbol(params, + nparams, + maxparams, + name, + values); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virTypedParamsAddUIntFuncType)(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + unsigned int value); + +int +virTypedParamsAddUIntWrapper(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + unsigned int value, + virErrorPtr err) +{ + int ret = -1; + static virTypedParamsAddUIntFuncType virTypedParamsAddUIntSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virTypedParamsAddUInt", + (void**)&virTypedParamsAddUIntSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virTypedParamsAddUIntSymbol(params, + nparams, + maxparams, + name, + value); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virTypedParamsAddULLongFuncType)(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + unsigned long long value); + +int +virTypedParamsAddULLongWrapper(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + unsigned long long value, + virErrorPtr err) +{ + int ret = -1; + static virTypedParamsAddULLongFuncType virTypedParamsAddULLongSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virTypedParamsAddULLong", + (void**)&virTypedParamsAddULLongSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virTypedParamsAddULLongSymbol(params, + nparams, + maxparams, + name, + value); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef void +(*virTypedParamsClearFuncType)(virTypedParameterPtr params, + int nparams); + +void +virTypedParamsClearWrapper(virTypedParameterPtr params, + int nparams) +{ + + static virTypedParamsClearFuncType virTypedParamsClearSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virTypedParamsClear", + (void**)&virTypedParamsClearSymbol, + &once, + &success, + NULL)) { + return; + } + virTypedParamsClearSymbol(params, + nparams); +} + +typedef void +(*virTypedParamsFreeFuncType)(virTypedParameterPtr params, + int nparams); + +void +virTypedParamsFreeWrapper(virTypedParameterPtr params, + int nparams) +{ + + static virTypedParamsFreeFuncType virTypedParamsFreeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virTypedParamsFree", + (void**)&virTypedParamsFreeSymbol, + &once, + &success, + NULL)) { + return; + } + virTypedParamsFreeSymbol(params, + nparams); +} + +typedef virTypedParameterPtr +(*virTypedParamsGetFuncType)(virTypedParameterPtr params, + int nparams, + const char * name); + +virTypedParameterPtr +virTypedParamsGetWrapper(virTypedParameterPtr params, + int nparams, + const char * name, + virErrorPtr err) +{ + virTypedParameterPtr ret = NULL; + static virTypedParamsGetFuncType virTypedParamsGetSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virTypedParamsGet", + (void**)&virTypedParamsGetSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virTypedParamsGetSymbol(params, + nparams, + name); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virTypedParamsGetBooleanFuncType)(virTypedParameterPtr params, + int nparams, + const char * name, + int * value); + +int +virTypedParamsGetBooleanWrapper(virTypedParameterPtr params, + int nparams, + const char * name, + int * value, + virErrorPtr err) +{ + int ret = -1; + static virTypedParamsGetBooleanFuncType virTypedParamsGetBooleanSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virTypedParamsGetBoolean", + (void**)&virTypedParamsGetBooleanSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virTypedParamsGetBooleanSymbol(params, + nparams, + name, + value); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virTypedParamsGetDoubleFuncType)(virTypedParameterPtr params, + int nparams, + const char * name, + double * value); + +int +virTypedParamsGetDoubleWrapper(virTypedParameterPtr params, + int nparams, + const char * name, + double * value, + virErrorPtr err) +{ + int ret = -1; + static virTypedParamsGetDoubleFuncType virTypedParamsGetDoubleSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virTypedParamsGetDouble", + (void**)&virTypedParamsGetDoubleSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virTypedParamsGetDoubleSymbol(params, + nparams, + name, + value); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virTypedParamsGetIntFuncType)(virTypedParameterPtr params, + int nparams, + const char * name, + int * value); + +int +virTypedParamsGetIntWrapper(virTypedParameterPtr params, + int nparams, + const char * name, + int * value, + virErrorPtr err) +{ + int ret = -1; + static virTypedParamsGetIntFuncType virTypedParamsGetIntSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virTypedParamsGetInt", + (void**)&virTypedParamsGetIntSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virTypedParamsGetIntSymbol(params, + nparams, + name, + value); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virTypedParamsGetLLongFuncType)(virTypedParameterPtr params, + int nparams, + const char * name, + long long * value); + +int +virTypedParamsGetLLongWrapper(virTypedParameterPtr params, + int nparams, + const char * name, + long long * value, + virErrorPtr err) +{ + int ret = -1; + static virTypedParamsGetLLongFuncType virTypedParamsGetLLongSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virTypedParamsGetLLong", + (void**)&virTypedParamsGetLLongSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virTypedParamsGetLLongSymbol(params, + nparams, + name, + value); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virTypedParamsGetStringFuncType)(virTypedParameterPtr params, + int nparams, + const char * name, + const char ** value); + +int +virTypedParamsGetStringWrapper(virTypedParameterPtr params, + int nparams, + const char * name, + const char ** value, + virErrorPtr err) +{ + int ret = -1; + static virTypedParamsGetStringFuncType virTypedParamsGetStringSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virTypedParamsGetString", + (void**)&virTypedParamsGetStringSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virTypedParamsGetStringSymbol(params, + nparams, + name, + value); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virTypedParamsGetUIntFuncType)(virTypedParameterPtr params, + int nparams, + const char * name, + unsigned int * value); + +int +virTypedParamsGetUIntWrapper(virTypedParameterPtr params, + int nparams, + const char * name, + unsigned int * value, + virErrorPtr err) +{ + int ret = -1; + static virTypedParamsGetUIntFuncType virTypedParamsGetUIntSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virTypedParamsGetUInt", + (void**)&virTypedParamsGetUIntSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virTypedParamsGetUIntSymbol(params, + nparams, + name, + value); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virTypedParamsGetULLongFuncType)(virTypedParameterPtr params, + int nparams, + const char * name, + unsigned long long * value); + +int +virTypedParamsGetULLongWrapper(virTypedParameterPtr params, + int nparams, + const char * name, + unsigned long long * value, + virErrorPtr err) +{ + int ret = -1; + static virTypedParamsGetULLongFuncType virTypedParamsGetULLongSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virTypedParamsGetULLong", + (void**)&virTypedParamsGetULLongSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virTypedParamsGetULLongSymbol(params, + nparams, + name, + value); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_domain.go b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_domain.go new file mode 100644 index 000000000..30e4f8f0a --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_domain.go @@ -0,0 +1,6238 @@ +//go:build libvirt_dlopen +// +build libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo LDFLAGS: -ldl +#cgo CFLAGS: -DLIBVIRT_DLOPEN +#include +#include +#include +#include +#include "libvirt_generated_dlopen.h" +#include "error_helper.h" + + +typedef int +(*virConnectDomainEventDeregisterFuncType)(virConnectPtr conn, + virConnectDomainEventCallback cb); + +int +virConnectDomainEventDeregisterWrapper(virConnectPtr conn, + virConnectDomainEventCallback cb, + virErrorPtr err) +{ + int ret = -1; + static virConnectDomainEventDeregisterFuncType virConnectDomainEventDeregisterSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectDomainEventDeregister", + (void**)&virConnectDomainEventDeregisterSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectDomainEventDeregisterSymbol(conn, + cb); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectDomainEventDeregisterAnyFuncType)(virConnectPtr conn, + int callbackID); + +int +virConnectDomainEventDeregisterAnyWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err) +{ + int ret = -1; + static virConnectDomainEventDeregisterAnyFuncType virConnectDomainEventDeregisterAnySymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectDomainEventDeregisterAny", + (void**)&virConnectDomainEventDeregisterAnySymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectDomainEventDeregisterAnySymbol(conn, + callbackID); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectDomainEventRegisterFuncType)(virConnectPtr conn, + virConnectDomainEventCallback cb, + void * opaque, + virFreeCallback freecb); + +int +virConnectDomainEventRegisterWrapper(virConnectPtr conn, + virConnectDomainEventCallback cb, + void * opaque, + virFreeCallback freecb, + virErrorPtr err) +{ + int ret = -1; + static virConnectDomainEventRegisterFuncType virConnectDomainEventRegisterSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectDomainEventRegister", + (void**)&virConnectDomainEventRegisterSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectDomainEventRegisterSymbol(conn, + cb, + opaque, + freecb); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectDomainEventRegisterAnyFuncType)(virConnectPtr conn, + virDomainPtr dom, + int eventID, + virConnectDomainEventGenericCallback cb, + void * opaque, + virFreeCallback freecb); + +int +virConnectDomainEventRegisterAnyWrapper(virConnectPtr conn, + virDomainPtr dom, + int eventID, + virConnectDomainEventGenericCallback cb, + void * opaque, + virFreeCallback freecb, + virErrorPtr err) +{ + int ret = -1; + static virConnectDomainEventRegisterAnyFuncType virConnectDomainEventRegisterAnySymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectDomainEventRegisterAny", + (void**)&virConnectDomainEventRegisterAnySymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectDomainEventRegisterAnySymbol(conn, + dom, + eventID, + cb, + opaque, + freecb); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virConnectDomainXMLFromNativeFuncType)(virConnectPtr conn, + const char * nativeFormat, + const char * nativeConfig, + unsigned int flags); + +char * +virConnectDomainXMLFromNativeWrapper(virConnectPtr conn, + const char * nativeFormat, + const char * nativeConfig, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; + static virConnectDomainXMLFromNativeFuncType virConnectDomainXMLFromNativeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectDomainXMLFromNative", + (void**)&virConnectDomainXMLFromNativeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectDomainXMLFromNativeSymbol(conn, + nativeFormat, + nativeConfig, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virConnectDomainXMLToNativeFuncType)(virConnectPtr conn, + const char * nativeFormat, + const char * domainXml, + unsigned int flags); + +char * +virConnectDomainXMLToNativeWrapper(virConnectPtr conn, + const char * nativeFormat, + const char * domainXml, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; + static virConnectDomainXMLToNativeFuncType virConnectDomainXMLToNativeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectDomainXMLToNative", + (void**)&virConnectDomainXMLToNativeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectDomainXMLToNativeSymbol(conn, + nativeFormat, + domainXml, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectGetAllDomainStatsFuncType)(virConnectPtr conn, + unsigned int stats, + virDomainStatsRecordPtr ** retStats, + unsigned int flags); + +int +virConnectGetAllDomainStatsWrapper(virConnectPtr conn, + unsigned int stats, + virDomainStatsRecordPtr ** retStats, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virConnectGetAllDomainStatsFuncType virConnectGetAllDomainStatsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectGetAllDomainStats", + (void**)&virConnectGetAllDomainStatsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectGetAllDomainStatsSymbol(conn, + stats, + retStats, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virConnectGetDomainCapabilitiesFuncType)(virConnectPtr conn, + const char * emulatorbin, + const char * arch, + const char * machine, + const char * virttype, + unsigned int flags); + +char * +virConnectGetDomainCapabilitiesWrapper(virConnectPtr conn, + const char * emulatorbin, + const char * arch, + const char * machine, + const char * virttype, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; + static virConnectGetDomainCapabilitiesFuncType virConnectGetDomainCapabilitiesSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectGetDomainCapabilities", + (void**)&virConnectGetDomainCapabilitiesSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectGetDomainCapabilitiesSymbol(conn, + emulatorbin, + arch, + machine, + virttype, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectListAllDomainsFuncType)(virConnectPtr conn, + virDomainPtr ** domains, + unsigned int flags); + +int +virConnectListAllDomainsWrapper(virConnectPtr conn, + virDomainPtr ** domains, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virConnectListAllDomainsFuncType virConnectListAllDomainsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectListAllDomains", + (void**)&virConnectListAllDomainsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectListAllDomainsSymbol(conn, + domains, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectListDefinedDomainsFuncType)(virConnectPtr conn, + char ** const names, + int maxnames); + +int +virConnectListDefinedDomainsWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = -1; + static virConnectListDefinedDomainsFuncType virConnectListDefinedDomainsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectListDefinedDomains", + (void**)&virConnectListDefinedDomainsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectListDefinedDomainsSymbol(conn, + names, + maxnames); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectListDomainsFuncType)(virConnectPtr conn, + int * ids, + int maxids); + +int +virConnectListDomainsWrapper(virConnectPtr conn, + int * ids, + int maxids, + virErrorPtr err) +{ + int ret = -1; + static virConnectListDomainsFuncType virConnectListDomainsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectListDomains", + (void**)&virConnectListDomainsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectListDomainsSymbol(conn, + ids, + maxids); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectNumOfDefinedDomainsFuncType)(virConnectPtr conn); + +int +virConnectNumOfDefinedDomainsWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; + static virConnectNumOfDefinedDomainsFuncType virConnectNumOfDefinedDomainsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectNumOfDefinedDomains", + (void**)&virConnectNumOfDefinedDomainsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectNumOfDefinedDomainsSymbol(conn); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectNumOfDomainsFuncType)(virConnectPtr conn); + +int +virConnectNumOfDomainsWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; + static virConnectNumOfDomainsFuncType virConnectNumOfDomainsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectNumOfDomains", + (void**)&virConnectNumOfDomainsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectNumOfDomainsSymbol(conn); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainAbortJobFuncType)(virDomainPtr domain); + +int +virDomainAbortJobWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = -1; + static virDomainAbortJobFuncType virDomainAbortJobSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainAbortJob", + (void**)&virDomainAbortJobSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainAbortJobSymbol(domain); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainAbortJobFlagsFuncType)(virDomainPtr domain, + unsigned int flags); + +int +virDomainAbortJobFlagsWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainAbortJobFlagsFuncType virDomainAbortJobFlagsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainAbortJobFlags", + (void**)&virDomainAbortJobFlagsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainAbortJobFlagsSymbol(domain, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainAddIOThreadFuncType)(virDomainPtr domain, + unsigned int iothread_id, + unsigned int flags); + +int +virDomainAddIOThreadWrapper(virDomainPtr domain, + unsigned int iothread_id, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainAddIOThreadFuncType virDomainAddIOThreadSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainAddIOThread", + (void**)&virDomainAddIOThreadSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainAddIOThreadSymbol(domain, + iothread_id, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainAgentSetResponseTimeoutFuncType)(virDomainPtr domain, + int timeout, + unsigned int flags); + +int +virDomainAgentSetResponseTimeoutWrapper(virDomainPtr domain, + int timeout, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainAgentSetResponseTimeoutFuncType virDomainAgentSetResponseTimeoutSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainAgentSetResponseTimeout", + (void**)&virDomainAgentSetResponseTimeoutSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainAgentSetResponseTimeoutSymbol(domain, + timeout, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainAttachDeviceFuncType)(virDomainPtr domain, + const char * xml); + +int +virDomainAttachDeviceWrapper(virDomainPtr domain, + const char * xml, + virErrorPtr err) +{ + int ret = -1; + static virDomainAttachDeviceFuncType virDomainAttachDeviceSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainAttachDevice", + (void**)&virDomainAttachDeviceSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainAttachDeviceSymbol(domain, + xml); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainAttachDeviceFlagsFuncType)(virDomainPtr domain, + const char * xml, + unsigned int flags); + +int +virDomainAttachDeviceFlagsWrapper(virDomainPtr domain, + const char * xml, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainAttachDeviceFlagsFuncType virDomainAttachDeviceFlagsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainAttachDeviceFlags", + (void**)&virDomainAttachDeviceFlagsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainAttachDeviceFlagsSymbol(domain, + xml, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainAuthorizedSSHKeysGetFuncType)(virDomainPtr domain, + const char * user, + char *** keys, + unsigned int flags); + +int +virDomainAuthorizedSSHKeysGetWrapper(virDomainPtr domain, + const char * user, + char *** keys, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainAuthorizedSSHKeysGetFuncType virDomainAuthorizedSSHKeysGetSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainAuthorizedSSHKeysGet", + (void**)&virDomainAuthorizedSSHKeysGetSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainAuthorizedSSHKeysGetSymbol(domain, + user, + keys, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainAuthorizedSSHKeysSetFuncType)(virDomainPtr domain, + const char * user, + const char ** keys, + unsigned int nkeys, + unsigned int flags); + +int +virDomainAuthorizedSSHKeysSetWrapper(virDomainPtr domain, + const char * user, + const char ** keys, + unsigned int nkeys, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainAuthorizedSSHKeysSetFuncType virDomainAuthorizedSSHKeysSetSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainAuthorizedSSHKeysSet", + (void**)&virDomainAuthorizedSSHKeysSetSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainAuthorizedSSHKeysSetSymbol(domain, + user, + keys, + nkeys, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainBackupBeginFuncType)(virDomainPtr domain, + const char * backupXML, + const char * checkpointXML, + unsigned int flags); + +int +virDomainBackupBeginWrapper(virDomainPtr domain, + const char * backupXML, + const char * checkpointXML, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainBackupBeginFuncType virDomainBackupBeginSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainBackupBegin", + (void**)&virDomainBackupBeginSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainBackupBeginSymbol(domain, + backupXML, + checkpointXML, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virDomainBackupGetXMLDescFuncType)(virDomainPtr domain, + unsigned int flags); + +char * +virDomainBackupGetXMLDescWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; + static virDomainBackupGetXMLDescFuncType virDomainBackupGetXMLDescSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainBackupGetXMLDesc", + (void**)&virDomainBackupGetXMLDescSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainBackupGetXMLDescSymbol(domain, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainBlockCommitFuncType)(virDomainPtr dom, + const char * disk, + const char * base, + const char * top, + unsigned long bandwidth, + unsigned int flags); + +int +virDomainBlockCommitWrapper(virDomainPtr dom, + const char * disk, + const char * base, + const char * top, + unsigned long bandwidth, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainBlockCommitFuncType virDomainBlockCommitSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainBlockCommit", + (void**)&virDomainBlockCommitSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainBlockCommitSymbol(dom, + disk, + base, + top, + bandwidth, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainBlockCopyFuncType)(virDomainPtr dom, + const char * disk, + const char * destxml, + virTypedParameterPtr params, + int nparams, + unsigned int flags); + +int +virDomainBlockCopyWrapper(virDomainPtr dom, + const char * disk, + const char * destxml, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainBlockCopyFuncType virDomainBlockCopySymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainBlockCopy", + (void**)&virDomainBlockCopySymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainBlockCopySymbol(dom, + disk, + destxml, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainBlockJobAbortFuncType)(virDomainPtr dom, + const char * disk, + unsigned int flags); + +int +virDomainBlockJobAbortWrapper(virDomainPtr dom, + const char * disk, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainBlockJobAbortFuncType virDomainBlockJobAbortSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainBlockJobAbort", + (void**)&virDomainBlockJobAbortSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainBlockJobAbortSymbol(dom, + disk, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainBlockJobSetSpeedFuncType)(virDomainPtr dom, + const char * disk, + unsigned long bandwidth, + unsigned int flags); + +int +virDomainBlockJobSetSpeedWrapper(virDomainPtr dom, + const char * disk, + unsigned long bandwidth, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainBlockJobSetSpeedFuncType virDomainBlockJobSetSpeedSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainBlockJobSetSpeed", + (void**)&virDomainBlockJobSetSpeedSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainBlockJobSetSpeedSymbol(dom, + disk, + bandwidth, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainBlockPeekFuncType)(virDomainPtr dom, + const char * disk, + unsigned long long offset, + size_t size, + void * buffer, + unsigned int flags); + +int +virDomainBlockPeekWrapper(virDomainPtr dom, + const char * disk, + unsigned long long offset, + size_t size, + void * buffer, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainBlockPeekFuncType virDomainBlockPeekSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainBlockPeek", + (void**)&virDomainBlockPeekSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainBlockPeekSymbol(dom, + disk, + offset, + size, + buffer, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainBlockPullFuncType)(virDomainPtr dom, + const char * disk, + unsigned long bandwidth, + unsigned int flags); + +int +virDomainBlockPullWrapper(virDomainPtr dom, + const char * disk, + unsigned long bandwidth, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainBlockPullFuncType virDomainBlockPullSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainBlockPull", + (void**)&virDomainBlockPullSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainBlockPullSymbol(dom, + disk, + bandwidth, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainBlockRebaseFuncType)(virDomainPtr dom, + const char * disk, + const char * base, + unsigned long bandwidth, + unsigned int flags); + +int +virDomainBlockRebaseWrapper(virDomainPtr dom, + const char * disk, + const char * base, + unsigned long bandwidth, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainBlockRebaseFuncType virDomainBlockRebaseSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainBlockRebase", + (void**)&virDomainBlockRebaseSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainBlockRebaseSymbol(dom, + disk, + base, + bandwidth, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainBlockResizeFuncType)(virDomainPtr dom, + const char * disk, + unsigned long long size, + unsigned int flags); + +int +virDomainBlockResizeWrapper(virDomainPtr dom, + const char * disk, + unsigned long long size, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainBlockResizeFuncType virDomainBlockResizeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainBlockResize", + (void**)&virDomainBlockResizeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainBlockResizeSymbol(dom, + disk, + size, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainBlockStatsFuncType)(virDomainPtr dom, + const char * disk, + virDomainBlockStatsPtr stats, + size_t size); + +int +virDomainBlockStatsWrapper(virDomainPtr dom, + const char * disk, + virDomainBlockStatsPtr stats, + size_t size, + virErrorPtr err) +{ + int ret = -1; + static virDomainBlockStatsFuncType virDomainBlockStatsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainBlockStats", + (void**)&virDomainBlockStatsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainBlockStatsSymbol(dom, + disk, + stats, + size); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainBlockStatsFlagsFuncType)(virDomainPtr dom, + const char * disk, + virTypedParameterPtr params, + int * nparams, + unsigned int flags); + +int +virDomainBlockStatsFlagsWrapper(virDomainPtr dom, + const char * disk, + virTypedParameterPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainBlockStatsFlagsFuncType virDomainBlockStatsFlagsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainBlockStatsFlags", + (void**)&virDomainBlockStatsFlagsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainBlockStatsFlagsSymbol(dom, + disk, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainCoreDumpFuncType)(virDomainPtr domain, + const char * to, + unsigned int flags); + +int +virDomainCoreDumpWrapper(virDomainPtr domain, + const char * to, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainCoreDumpFuncType virDomainCoreDumpSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainCoreDump", + (void**)&virDomainCoreDumpSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainCoreDumpSymbol(domain, + to, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainCoreDumpWithFormatFuncType)(virDomainPtr domain, + const char * to, + unsigned int dumpformat, + unsigned int flags); + +int +virDomainCoreDumpWithFormatWrapper(virDomainPtr domain, + const char * to, + unsigned int dumpformat, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainCoreDumpWithFormatFuncType virDomainCoreDumpWithFormatSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainCoreDumpWithFormat", + (void**)&virDomainCoreDumpWithFormatSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainCoreDumpWithFormatSymbol(domain, + to, + dumpformat, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainCreateFuncType)(virDomainPtr domain); + +int +virDomainCreateWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = -1; + static virDomainCreateFuncType virDomainCreateSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainCreate", + (void**)&virDomainCreateSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainCreateSymbol(domain); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virDomainPtr +(*virDomainCreateLinuxFuncType)(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags); + +virDomainPtr +virDomainCreateLinuxWrapper(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + virDomainPtr ret = NULL; + static virDomainCreateLinuxFuncType virDomainCreateLinuxSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainCreateLinux", + (void**)&virDomainCreateLinuxSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainCreateLinuxSymbol(conn, + xmlDesc, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainCreateWithFilesFuncType)(virDomainPtr domain, + unsigned int nfiles, + int * files, + unsigned int flags); + +int +virDomainCreateWithFilesWrapper(virDomainPtr domain, + unsigned int nfiles, + int * files, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainCreateWithFilesFuncType virDomainCreateWithFilesSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainCreateWithFiles", + (void**)&virDomainCreateWithFilesSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainCreateWithFilesSymbol(domain, + nfiles, + files, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainCreateWithFlagsFuncType)(virDomainPtr domain, + unsigned int flags); + +int +virDomainCreateWithFlagsWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainCreateWithFlagsFuncType virDomainCreateWithFlagsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainCreateWithFlags", + (void**)&virDomainCreateWithFlagsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainCreateWithFlagsSymbol(domain, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virDomainPtr +(*virDomainCreateXMLFuncType)(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags); + +virDomainPtr +virDomainCreateXMLWrapper(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + virDomainPtr ret = NULL; + static virDomainCreateXMLFuncType virDomainCreateXMLSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainCreateXML", + (void**)&virDomainCreateXMLSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainCreateXMLSymbol(conn, + xmlDesc, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virDomainPtr +(*virDomainCreateXMLWithFilesFuncType)(virConnectPtr conn, + const char * xmlDesc, + unsigned int nfiles, + int * files, + unsigned int flags); + +virDomainPtr +virDomainCreateXMLWithFilesWrapper(virConnectPtr conn, + const char * xmlDesc, + unsigned int nfiles, + int * files, + unsigned int flags, + virErrorPtr err) +{ + virDomainPtr ret = NULL; + static virDomainCreateXMLWithFilesFuncType virDomainCreateXMLWithFilesSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainCreateXMLWithFiles", + (void**)&virDomainCreateXMLWithFilesSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainCreateXMLWithFilesSymbol(conn, + xmlDesc, + nfiles, + files, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virDomainPtr +(*virDomainDefineXMLFuncType)(virConnectPtr conn, + const char * xml); + +virDomainPtr +virDomainDefineXMLWrapper(virConnectPtr conn, + const char * xml, + virErrorPtr err) +{ + virDomainPtr ret = NULL; + static virDomainDefineXMLFuncType virDomainDefineXMLSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainDefineXML", + (void**)&virDomainDefineXMLSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainDefineXMLSymbol(conn, + xml); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virDomainPtr +(*virDomainDefineXMLFlagsFuncType)(virConnectPtr conn, + const char * xml, + unsigned int flags); + +virDomainPtr +virDomainDefineXMLFlagsWrapper(virConnectPtr conn, + const char * xml, + unsigned int flags, + virErrorPtr err) +{ + virDomainPtr ret = NULL; + static virDomainDefineXMLFlagsFuncType virDomainDefineXMLFlagsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainDefineXMLFlags", + (void**)&virDomainDefineXMLFlagsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainDefineXMLFlagsSymbol(conn, + xml, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainDelIOThreadFuncType)(virDomainPtr domain, + unsigned int iothread_id, + unsigned int flags); + +int +virDomainDelIOThreadWrapper(virDomainPtr domain, + unsigned int iothread_id, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainDelIOThreadFuncType virDomainDelIOThreadSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainDelIOThread", + (void**)&virDomainDelIOThreadSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainDelIOThreadSymbol(domain, + iothread_id, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainDestroyFuncType)(virDomainPtr domain); + +int +virDomainDestroyWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = -1; + static virDomainDestroyFuncType virDomainDestroySymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainDestroy", + (void**)&virDomainDestroySymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainDestroySymbol(domain); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainDestroyFlagsFuncType)(virDomainPtr domain, + unsigned int flags); + +int +virDomainDestroyFlagsWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainDestroyFlagsFuncType virDomainDestroyFlagsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainDestroyFlags", + (void**)&virDomainDestroyFlagsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainDestroyFlagsSymbol(domain, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainDetachDeviceFuncType)(virDomainPtr domain, + const char * xml); + +int +virDomainDetachDeviceWrapper(virDomainPtr domain, + const char * xml, + virErrorPtr err) +{ + int ret = -1; + static virDomainDetachDeviceFuncType virDomainDetachDeviceSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainDetachDevice", + (void**)&virDomainDetachDeviceSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainDetachDeviceSymbol(domain, + xml); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainDetachDeviceAliasFuncType)(virDomainPtr domain, + const char * alias, + unsigned int flags); + +int +virDomainDetachDeviceAliasWrapper(virDomainPtr domain, + const char * alias, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainDetachDeviceAliasFuncType virDomainDetachDeviceAliasSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainDetachDeviceAlias", + (void**)&virDomainDetachDeviceAliasSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainDetachDeviceAliasSymbol(domain, + alias, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainDetachDeviceFlagsFuncType)(virDomainPtr domain, + const char * xml, + unsigned int flags); + +int +virDomainDetachDeviceFlagsWrapper(virDomainPtr domain, + const char * xml, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainDetachDeviceFlagsFuncType virDomainDetachDeviceFlagsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainDetachDeviceFlags", + (void**)&virDomainDetachDeviceFlagsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainDetachDeviceFlagsSymbol(domain, + xml, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainFDAssociateFuncType)(virDomainPtr domain, + const char * name, + unsigned int nfds, + int * fds, + unsigned int flags); + +int +virDomainFDAssociateWrapper(virDomainPtr domain, + const char * name, + unsigned int nfds, + int * fds, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainFDAssociateFuncType virDomainFDAssociateSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainFDAssociate", + (void**)&virDomainFDAssociateSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainFDAssociateSymbol(domain, + name, + nfds, + fds, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainFSFreezeFuncType)(virDomainPtr dom, + const char ** mountpoints, + unsigned int nmountpoints, + unsigned int flags); + +int +virDomainFSFreezeWrapper(virDomainPtr dom, + const char ** mountpoints, + unsigned int nmountpoints, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainFSFreezeFuncType virDomainFSFreezeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainFSFreeze", + (void**)&virDomainFSFreezeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainFSFreezeSymbol(dom, + mountpoints, + nmountpoints, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef void +(*virDomainFSInfoFreeFuncType)(virDomainFSInfoPtr info); + +void +virDomainFSInfoFreeWrapper(virDomainFSInfoPtr info) +{ + + static virDomainFSInfoFreeFuncType virDomainFSInfoFreeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainFSInfoFree", + (void**)&virDomainFSInfoFreeSymbol, + &once, + &success, + NULL)) { + return; + } + virDomainFSInfoFreeSymbol(info); +} + +typedef int +(*virDomainFSThawFuncType)(virDomainPtr dom, + const char ** mountpoints, + unsigned int nmountpoints, + unsigned int flags); + +int +virDomainFSThawWrapper(virDomainPtr dom, + const char ** mountpoints, + unsigned int nmountpoints, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainFSThawFuncType virDomainFSThawSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainFSThaw", + (void**)&virDomainFSThawSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainFSThawSymbol(dom, + mountpoints, + nmountpoints, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainFSTrimFuncType)(virDomainPtr dom, + const char * mountPoint, + unsigned long long minimum, + unsigned int flags); + +int +virDomainFSTrimWrapper(virDomainPtr dom, + const char * mountPoint, + unsigned long long minimum, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainFSTrimFuncType virDomainFSTrimSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainFSTrim", + (void**)&virDomainFSTrimSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainFSTrimSymbol(dom, + mountPoint, + minimum, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainFreeFuncType)(virDomainPtr domain); + +int +virDomainFreeWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = -1; + static virDomainFreeFuncType virDomainFreeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainFree", + (void**)&virDomainFreeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainFreeSymbol(domain); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetAutostartFuncType)(virDomainPtr domain, + int * autostart); + +int +virDomainGetAutostartWrapper(virDomainPtr domain, + int * autostart, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetAutostartFuncType virDomainGetAutostartSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetAutostart", + (void**)&virDomainGetAutostartSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetAutostartSymbol(domain, + autostart); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetBlkioParametersFuncType)(virDomainPtr domain, + virTypedParameterPtr params, + int * nparams, + unsigned int flags); + +int +virDomainGetBlkioParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetBlkioParametersFuncType virDomainGetBlkioParametersSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetBlkioParameters", + (void**)&virDomainGetBlkioParametersSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetBlkioParametersSymbol(domain, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetBlockInfoFuncType)(virDomainPtr domain, + const char * disk, + virDomainBlockInfoPtr info, + unsigned int flags); + +int +virDomainGetBlockInfoWrapper(virDomainPtr domain, + const char * disk, + virDomainBlockInfoPtr info, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetBlockInfoFuncType virDomainGetBlockInfoSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetBlockInfo", + (void**)&virDomainGetBlockInfoSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetBlockInfoSymbol(domain, + disk, + info, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetBlockIoTuneFuncType)(virDomainPtr dom, + const char * disk, + virTypedParameterPtr params, + int * nparams, + unsigned int flags); + +int +virDomainGetBlockIoTuneWrapper(virDomainPtr dom, + const char * disk, + virTypedParameterPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetBlockIoTuneFuncType virDomainGetBlockIoTuneSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetBlockIoTune", + (void**)&virDomainGetBlockIoTuneSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetBlockIoTuneSymbol(dom, + disk, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetBlockJobInfoFuncType)(virDomainPtr dom, + const char * disk, + virDomainBlockJobInfoPtr info, + unsigned int flags); + +int +virDomainGetBlockJobInfoWrapper(virDomainPtr dom, + const char * disk, + virDomainBlockJobInfoPtr info, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetBlockJobInfoFuncType virDomainGetBlockJobInfoSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetBlockJobInfo", + (void**)&virDomainGetBlockJobInfoSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetBlockJobInfoSymbol(dom, + disk, + info, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetCPUStatsFuncType)(virDomainPtr domain, + virTypedParameterPtr params, + unsigned int nparams, + int start_cpu, + unsigned int ncpus, + unsigned int flags); + +int +virDomainGetCPUStatsWrapper(virDomainPtr domain, + virTypedParameterPtr params, + unsigned int nparams, + int start_cpu, + unsigned int ncpus, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetCPUStatsFuncType virDomainGetCPUStatsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetCPUStats", + (void**)&virDomainGetCPUStatsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetCPUStatsSymbol(domain, + params, + nparams, + start_cpu, + ncpus, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virConnectPtr +(*virDomainGetConnectFuncType)(virDomainPtr dom); + +virConnectPtr +virDomainGetConnectWrapper(virDomainPtr dom, + virErrorPtr err) +{ + virConnectPtr ret = NULL; + static virDomainGetConnectFuncType virDomainGetConnectSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetConnect", + (void**)&virDomainGetConnectSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetConnectSymbol(dom); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetControlInfoFuncType)(virDomainPtr domain, + virDomainControlInfoPtr info, + unsigned int flags); + +int +virDomainGetControlInfoWrapper(virDomainPtr domain, + virDomainControlInfoPtr info, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetControlInfoFuncType virDomainGetControlInfoSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetControlInfo", + (void**)&virDomainGetControlInfoSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetControlInfoSymbol(domain, + info, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetDiskErrorsFuncType)(virDomainPtr dom, + virDomainDiskErrorPtr errors, + unsigned int maxerrors, + unsigned int flags); + +int +virDomainGetDiskErrorsWrapper(virDomainPtr dom, + virDomainDiskErrorPtr errors, + unsigned int maxerrors, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetDiskErrorsFuncType virDomainGetDiskErrorsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetDiskErrors", + (void**)&virDomainGetDiskErrorsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetDiskErrorsSymbol(dom, + errors, + maxerrors, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetEmulatorPinInfoFuncType)(virDomainPtr domain, + unsigned char * cpumap, + int maplen, + unsigned int flags); + +int +virDomainGetEmulatorPinInfoWrapper(virDomainPtr domain, + unsigned char * cpumap, + int maplen, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetEmulatorPinInfoFuncType virDomainGetEmulatorPinInfoSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetEmulatorPinInfo", + (void**)&virDomainGetEmulatorPinInfoSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetEmulatorPinInfoSymbol(domain, + cpumap, + maplen, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetFSInfoFuncType)(virDomainPtr dom, + virDomainFSInfoPtr ** info, + unsigned int flags); + +int +virDomainGetFSInfoWrapper(virDomainPtr dom, + virDomainFSInfoPtr ** info, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetFSInfoFuncType virDomainGetFSInfoSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetFSInfo", + (void**)&virDomainGetFSInfoSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetFSInfoSymbol(dom, + info, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetGuestInfoFuncType)(virDomainPtr domain, + unsigned int types, + virTypedParameterPtr * params, + int * nparams, + unsigned int flags); + +int +virDomainGetGuestInfoWrapper(virDomainPtr domain, + unsigned int types, + virTypedParameterPtr * params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetGuestInfoFuncType virDomainGetGuestInfoSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetGuestInfo", + (void**)&virDomainGetGuestInfoSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetGuestInfoSymbol(domain, + types, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetGuestVcpusFuncType)(virDomainPtr domain, + virTypedParameterPtr * params, + unsigned int * nparams, + unsigned int flags); + +int +virDomainGetGuestVcpusWrapper(virDomainPtr domain, + virTypedParameterPtr * params, + unsigned int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetGuestVcpusFuncType virDomainGetGuestVcpusSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetGuestVcpus", + (void**)&virDomainGetGuestVcpusSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetGuestVcpusSymbol(domain, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virDomainGetHostnameFuncType)(virDomainPtr domain, + unsigned int flags); + +char * +virDomainGetHostnameWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; + static virDomainGetHostnameFuncType virDomainGetHostnameSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetHostname", + (void**)&virDomainGetHostnameSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetHostnameSymbol(domain, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef unsigned int +(*virDomainGetIDFuncType)(virDomainPtr domain); + +unsigned int +virDomainGetIDWrapper(virDomainPtr domain, + virErrorPtr err) +{ + unsigned int ret = 0; + static virDomainGetIDFuncType virDomainGetIDSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetID", + (void**)&virDomainGetIDSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetIDSymbol(domain); + if (ret == 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetIOThreadInfoFuncType)(virDomainPtr dom, + virDomainIOThreadInfoPtr ** info, + unsigned int flags); + +int +virDomainGetIOThreadInfoWrapper(virDomainPtr dom, + virDomainIOThreadInfoPtr ** info, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetIOThreadInfoFuncType virDomainGetIOThreadInfoSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetIOThreadInfo", + (void**)&virDomainGetIOThreadInfoSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetIOThreadInfoSymbol(dom, + info, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetInfoFuncType)(virDomainPtr domain, + virDomainInfoPtr info); + +int +virDomainGetInfoWrapper(virDomainPtr domain, + virDomainInfoPtr info, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetInfoFuncType virDomainGetInfoSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetInfo", + (void**)&virDomainGetInfoSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetInfoSymbol(domain, + info); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetInterfaceParametersFuncType)(virDomainPtr domain, + const char * device, + virTypedParameterPtr params, + int * nparams, + unsigned int flags); + +int +virDomainGetInterfaceParametersWrapper(virDomainPtr domain, + const char * device, + virTypedParameterPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetInterfaceParametersFuncType virDomainGetInterfaceParametersSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetInterfaceParameters", + (void**)&virDomainGetInterfaceParametersSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetInterfaceParametersSymbol(domain, + device, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetJobInfoFuncType)(virDomainPtr domain, + virDomainJobInfoPtr info); + +int +virDomainGetJobInfoWrapper(virDomainPtr domain, + virDomainJobInfoPtr info, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetJobInfoFuncType virDomainGetJobInfoSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetJobInfo", + (void**)&virDomainGetJobInfoSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetJobInfoSymbol(domain, + info); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetJobStatsFuncType)(virDomainPtr domain, + int * type, + virTypedParameterPtr * params, + int * nparams, + unsigned int flags); + +int +virDomainGetJobStatsWrapper(virDomainPtr domain, + int * type, + virTypedParameterPtr * params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetJobStatsFuncType virDomainGetJobStatsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetJobStats", + (void**)&virDomainGetJobStatsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetJobStatsSymbol(domain, + type, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetLaunchSecurityInfoFuncType)(virDomainPtr domain, + virTypedParameterPtr * params, + int * nparams, + unsigned int flags); + +int +virDomainGetLaunchSecurityInfoWrapper(virDomainPtr domain, + virTypedParameterPtr * params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetLaunchSecurityInfoFuncType virDomainGetLaunchSecurityInfoSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetLaunchSecurityInfo", + (void**)&virDomainGetLaunchSecurityInfoSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetLaunchSecurityInfoSymbol(domain, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef unsigned long +(*virDomainGetMaxMemoryFuncType)(virDomainPtr domain); + +unsigned long +virDomainGetMaxMemoryWrapper(virDomainPtr domain, + virErrorPtr err) +{ + unsigned long ret = 0; + static virDomainGetMaxMemoryFuncType virDomainGetMaxMemorySymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetMaxMemory", + (void**)&virDomainGetMaxMemorySymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetMaxMemorySymbol(domain); + if (ret == 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetMaxVcpusFuncType)(virDomainPtr domain); + +int +virDomainGetMaxVcpusWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetMaxVcpusFuncType virDomainGetMaxVcpusSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetMaxVcpus", + (void**)&virDomainGetMaxVcpusSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetMaxVcpusSymbol(domain); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetMemoryParametersFuncType)(virDomainPtr domain, + virTypedParameterPtr params, + int * nparams, + unsigned int flags); + +int +virDomainGetMemoryParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetMemoryParametersFuncType virDomainGetMemoryParametersSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetMemoryParameters", + (void**)&virDomainGetMemoryParametersSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetMemoryParametersSymbol(domain, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetMessagesFuncType)(virDomainPtr domain, + char *** msgs, + unsigned int flags); + +int +virDomainGetMessagesWrapper(virDomainPtr domain, + char *** msgs, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetMessagesFuncType virDomainGetMessagesSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetMessages", + (void**)&virDomainGetMessagesSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetMessagesSymbol(domain, + msgs, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virDomainGetMetadataFuncType)(virDomainPtr domain, + int type, + const char * uri, + unsigned int flags); + +char * +virDomainGetMetadataWrapper(virDomainPtr domain, + int type, + const char * uri, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; + static virDomainGetMetadataFuncType virDomainGetMetadataSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetMetadata", + (void**)&virDomainGetMetadataSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetMetadataSymbol(domain, + type, + uri, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef const char * +(*virDomainGetNameFuncType)(virDomainPtr domain); + +const char * +virDomainGetNameWrapper(virDomainPtr domain, + virErrorPtr err) +{ + const char * ret = NULL; + static virDomainGetNameFuncType virDomainGetNameSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetName", + (void**)&virDomainGetNameSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetNameSymbol(domain); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetNumaParametersFuncType)(virDomainPtr domain, + virTypedParameterPtr params, + int * nparams, + unsigned int flags); + +int +virDomainGetNumaParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetNumaParametersFuncType virDomainGetNumaParametersSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetNumaParameters", + (void**)&virDomainGetNumaParametersSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetNumaParametersSymbol(domain, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virDomainGetOSTypeFuncType)(virDomainPtr domain); + +char * +virDomainGetOSTypeWrapper(virDomainPtr domain, + virErrorPtr err) +{ + char * ret = NULL; + static virDomainGetOSTypeFuncType virDomainGetOSTypeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetOSType", + (void**)&virDomainGetOSTypeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetOSTypeSymbol(domain); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetPerfEventsFuncType)(virDomainPtr domain, + virTypedParameterPtr * params, + int * nparams, + unsigned int flags); + +int +virDomainGetPerfEventsWrapper(virDomainPtr domain, + virTypedParameterPtr * params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetPerfEventsFuncType virDomainGetPerfEventsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetPerfEvents", + (void**)&virDomainGetPerfEventsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetPerfEventsSymbol(domain, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetSchedulerParametersFuncType)(virDomainPtr domain, + virTypedParameterPtr params, + int * nparams); + +int +virDomainGetSchedulerParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int * nparams, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetSchedulerParametersFuncType virDomainGetSchedulerParametersSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetSchedulerParameters", + (void**)&virDomainGetSchedulerParametersSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetSchedulerParametersSymbol(domain, + params, + nparams); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetSchedulerParametersFlagsFuncType)(virDomainPtr domain, + virTypedParameterPtr params, + int * nparams, + unsigned int flags); + +int +virDomainGetSchedulerParametersFlagsWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetSchedulerParametersFlagsFuncType virDomainGetSchedulerParametersFlagsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetSchedulerParametersFlags", + (void**)&virDomainGetSchedulerParametersFlagsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetSchedulerParametersFlagsSymbol(domain, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virDomainGetSchedulerTypeFuncType)(virDomainPtr domain, + int * nparams); + +char * +virDomainGetSchedulerTypeWrapper(virDomainPtr domain, + int * nparams, + virErrorPtr err) +{ + char * ret = NULL; + static virDomainGetSchedulerTypeFuncType virDomainGetSchedulerTypeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetSchedulerType", + (void**)&virDomainGetSchedulerTypeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetSchedulerTypeSymbol(domain, + nparams); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetSecurityLabelFuncType)(virDomainPtr domain, + virSecurityLabelPtr seclabel); + +int +virDomainGetSecurityLabelWrapper(virDomainPtr domain, + virSecurityLabelPtr seclabel, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetSecurityLabelFuncType virDomainGetSecurityLabelSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetSecurityLabel", + (void**)&virDomainGetSecurityLabelSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetSecurityLabelSymbol(domain, + seclabel); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetSecurityLabelListFuncType)(virDomainPtr domain, + virSecurityLabelPtr * seclabels); + +int +virDomainGetSecurityLabelListWrapper(virDomainPtr domain, + virSecurityLabelPtr * seclabels, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetSecurityLabelListFuncType virDomainGetSecurityLabelListSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetSecurityLabelList", + (void**)&virDomainGetSecurityLabelListSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetSecurityLabelListSymbol(domain, + seclabels); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetStateFuncType)(virDomainPtr domain, + int * state, + int * reason, + unsigned int flags); + +int +virDomainGetStateWrapper(virDomainPtr domain, + int * state, + int * reason, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetStateFuncType virDomainGetStateSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetState", + (void**)&virDomainGetStateSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetStateSymbol(domain, + state, + reason, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetTimeFuncType)(virDomainPtr dom, + long long * seconds, + unsigned int * nseconds, + unsigned int flags); + +int +virDomainGetTimeWrapper(virDomainPtr dom, + long long * seconds, + unsigned int * nseconds, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetTimeFuncType virDomainGetTimeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetTime", + (void**)&virDomainGetTimeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetTimeSymbol(dom, + seconds, + nseconds, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetUUIDFuncType)(virDomainPtr domain, + unsigned char * uuid); + +int +virDomainGetUUIDWrapper(virDomainPtr domain, + unsigned char * uuid, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetUUIDFuncType virDomainGetUUIDSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetUUID", + (void**)&virDomainGetUUIDSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetUUIDSymbol(domain, + uuid); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetUUIDStringFuncType)(virDomainPtr domain, + char * buf); + +int +virDomainGetUUIDStringWrapper(virDomainPtr domain, + char * buf, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetUUIDStringFuncType virDomainGetUUIDStringSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetUUIDString", + (void**)&virDomainGetUUIDStringSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetUUIDStringSymbol(domain, + buf); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetVcpuPinInfoFuncType)(virDomainPtr domain, + int ncpumaps, + unsigned char * cpumaps, + int maplen, + unsigned int flags); + +int +virDomainGetVcpuPinInfoWrapper(virDomainPtr domain, + int ncpumaps, + unsigned char * cpumaps, + int maplen, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetVcpuPinInfoFuncType virDomainGetVcpuPinInfoSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetVcpuPinInfo", + (void**)&virDomainGetVcpuPinInfoSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetVcpuPinInfoSymbol(domain, + ncpumaps, + cpumaps, + maplen, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetVcpusFuncType)(virDomainPtr domain, + virVcpuInfoPtr info, + int maxinfo, + unsigned char * cpumaps, + int maplen); + +int +virDomainGetVcpusWrapper(virDomainPtr domain, + virVcpuInfoPtr info, + int maxinfo, + unsigned char * cpumaps, + int maplen, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetVcpusFuncType virDomainGetVcpusSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetVcpus", + (void**)&virDomainGetVcpusSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetVcpusSymbol(domain, + info, + maxinfo, + cpumaps, + maplen); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGetVcpusFlagsFuncType)(virDomainPtr domain, + unsigned int flags); + +int +virDomainGetVcpusFlagsWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainGetVcpusFlagsFuncType virDomainGetVcpusFlagsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetVcpusFlags", + (void**)&virDomainGetVcpusFlagsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetVcpusFlagsSymbol(domain, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virDomainGetXMLDescFuncType)(virDomainPtr domain, + unsigned int flags); + +char * +virDomainGetXMLDescWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; + static virDomainGetXMLDescFuncType virDomainGetXMLDescSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGetXMLDesc", + (void**)&virDomainGetXMLDescSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGetXMLDescSymbol(domain, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainGraphicsReloadFuncType)(virDomainPtr domain, + unsigned int type, + unsigned int flags); + +int +virDomainGraphicsReloadWrapper(virDomainPtr domain, + unsigned int type, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainGraphicsReloadFuncType virDomainGraphicsReloadSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainGraphicsReload", + (void**)&virDomainGraphicsReloadSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainGraphicsReloadSymbol(domain, + type, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainHasManagedSaveImageFuncType)(virDomainPtr dom, + unsigned int flags); + +int +virDomainHasManagedSaveImageWrapper(virDomainPtr dom, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainHasManagedSaveImageFuncType virDomainHasManagedSaveImageSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainHasManagedSaveImage", + (void**)&virDomainHasManagedSaveImageSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainHasManagedSaveImageSymbol(dom, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef void +(*virDomainIOThreadInfoFreeFuncType)(virDomainIOThreadInfoPtr info); + +void +virDomainIOThreadInfoFreeWrapper(virDomainIOThreadInfoPtr info) +{ + + static virDomainIOThreadInfoFreeFuncType virDomainIOThreadInfoFreeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainIOThreadInfoFree", + (void**)&virDomainIOThreadInfoFreeSymbol, + &once, + &success, + NULL)) { + return; + } + virDomainIOThreadInfoFreeSymbol(info); +} + +typedef int +(*virDomainInjectNMIFuncType)(virDomainPtr domain, + unsigned int flags); + +int +virDomainInjectNMIWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainInjectNMIFuncType virDomainInjectNMISymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainInjectNMI", + (void**)&virDomainInjectNMISymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainInjectNMISymbol(domain, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainInterfaceAddressesFuncType)(virDomainPtr dom, + virDomainInterfacePtr ** ifaces, + unsigned int source, + unsigned int flags); + +int +virDomainInterfaceAddressesWrapper(virDomainPtr dom, + virDomainInterfacePtr ** ifaces, + unsigned int source, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainInterfaceAddressesFuncType virDomainInterfaceAddressesSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainInterfaceAddresses", + (void**)&virDomainInterfaceAddressesSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainInterfaceAddressesSymbol(dom, + ifaces, + source, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef void +(*virDomainInterfaceFreeFuncType)(virDomainInterfacePtr iface); + +void +virDomainInterfaceFreeWrapper(virDomainInterfacePtr iface) +{ + + static virDomainInterfaceFreeFuncType virDomainInterfaceFreeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainInterfaceFree", + (void**)&virDomainInterfaceFreeSymbol, + &once, + &success, + NULL)) { + return; + } + virDomainInterfaceFreeSymbol(iface); +} + +typedef int +(*virDomainInterfaceStatsFuncType)(virDomainPtr dom, + const char * device, + virDomainInterfaceStatsPtr stats, + size_t size); + +int +virDomainInterfaceStatsWrapper(virDomainPtr dom, + const char * device, + virDomainInterfaceStatsPtr stats, + size_t size, + virErrorPtr err) +{ + int ret = -1; + static virDomainInterfaceStatsFuncType virDomainInterfaceStatsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainInterfaceStats", + (void**)&virDomainInterfaceStatsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainInterfaceStatsSymbol(dom, + device, + stats, + size); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainIsActiveFuncType)(virDomainPtr dom); + +int +virDomainIsActiveWrapper(virDomainPtr dom, + virErrorPtr err) +{ + int ret = -1; + static virDomainIsActiveFuncType virDomainIsActiveSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainIsActive", + (void**)&virDomainIsActiveSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainIsActiveSymbol(dom); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainIsPersistentFuncType)(virDomainPtr dom); + +int +virDomainIsPersistentWrapper(virDomainPtr dom, + virErrorPtr err) +{ + int ret = -1; + static virDomainIsPersistentFuncType virDomainIsPersistentSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainIsPersistent", + (void**)&virDomainIsPersistentSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainIsPersistentSymbol(dom); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainIsUpdatedFuncType)(virDomainPtr dom); + +int +virDomainIsUpdatedWrapper(virDomainPtr dom, + virErrorPtr err) +{ + int ret = -1; + static virDomainIsUpdatedFuncType virDomainIsUpdatedSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainIsUpdated", + (void**)&virDomainIsUpdatedSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainIsUpdatedSymbol(dom); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainListGetStatsFuncType)(virDomainPtr * doms, + unsigned int stats, + virDomainStatsRecordPtr ** retStats, + unsigned int flags); + +int +virDomainListGetStatsWrapper(virDomainPtr * doms, + unsigned int stats, + virDomainStatsRecordPtr ** retStats, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainListGetStatsFuncType virDomainListGetStatsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainListGetStats", + (void**)&virDomainListGetStatsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainListGetStatsSymbol(doms, + stats, + retStats, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virDomainPtr +(*virDomainLookupByIDFuncType)(virConnectPtr conn, + int id); + +virDomainPtr +virDomainLookupByIDWrapper(virConnectPtr conn, + int id, + virErrorPtr err) +{ + virDomainPtr ret = NULL; + static virDomainLookupByIDFuncType virDomainLookupByIDSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainLookupByID", + (void**)&virDomainLookupByIDSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainLookupByIDSymbol(conn, + id); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virDomainPtr +(*virDomainLookupByNameFuncType)(virConnectPtr conn, + const char * name); + +virDomainPtr +virDomainLookupByNameWrapper(virConnectPtr conn, + const char * name, + virErrorPtr err) +{ + virDomainPtr ret = NULL; + static virDomainLookupByNameFuncType virDomainLookupByNameSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainLookupByName", + (void**)&virDomainLookupByNameSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainLookupByNameSymbol(conn, + name); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virDomainPtr +(*virDomainLookupByUUIDFuncType)(virConnectPtr conn, + const unsigned char * uuid); + +virDomainPtr +virDomainLookupByUUIDWrapper(virConnectPtr conn, + const unsigned char * uuid, + virErrorPtr err) +{ + virDomainPtr ret = NULL; + static virDomainLookupByUUIDFuncType virDomainLookupByUUIDSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainLookupByUUID", + (void**)&virDomainLookupByUUIDSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainLookupByUUIDSymbol(conn, + uuid); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virDomainPtr +(*virDomainLookupByUUIDStringFuncType)(virConnectPtr conn, + const char * uuidstr); + +virDomainPtr +virDomainLookupByUUIDStringWrapper(virConnectPtr conn, + const char * uuidstr, + virErrorPtr err) +{ + virDomainPtr ret = NULL; + static virDomainLookupByUUIDStringFuncType virDomainLookupByUUIDStringSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainLookupByUUIDString", + (void**)&virDomainLookupByUUIDStringSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainLookupByUUIDStringSymbol(conn, + uuidstr); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainManagedSaveFuncType)(virDomainPtr dom, + unsigned int flags); + +int +virDomainManagedSaveWrapper(virDomainPtr dom, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainManagedSaveFuncType virDomainManagedSaveSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainManagedSave", + (void**)&virDomainManagedSaveSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainManagedSaveSymbol(dom, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainManagedSaveDefineXMLFuncType)(virDomainPtr domain, + const char * dxml, + unsigned int flags); + +int +virDomainManagedSaveDefineXMLWrapper(virDomainPtr domain, + const char * dxml, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainManagedSaveDefineXMLFuncType virDomainManagedSaveDefineXMLSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainManagedSaveDefineXML", + (void**)&virDomainManagedSaveDefineXMLSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainManagedSaveDefineXMLSymbol(domain, + dxml, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virDomainManagedSaveGetXMLDescFuncType)(virDomainPtr domain, + unsigned int flags); + +char * +virDomainManagedSaveGetXMLDescWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; + static virDomainManagedSaveGetXMLDescFuncType virDomainManagedSaveGetXMLDescSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainManagedSaveGetXMLDesc", + (void**)&virDomainManagedSaveGetXMLDescSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainManagedSaveGetXMLDescSymbol(domain, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainManagedSaveRemoveFuncType)(virDomainPtr dom, + unsigned int flags); + +int +virDomainManagedSaveRemoveWrapper(virDomainPtr dom, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainManagedSaveRemoveFuncType virDomainManagedSaveRemoveSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainManagedSaveRemove", + (void**)&virDomainManagedSaveRemoveSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainManagedSaveRemoveSymbol(dom, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainMemoryPeekFuncType)(virDomainPtr dom, + unsigned long long start, + size_t size, + void * buffer, + unsigned int flags); + +int +virDomainMemoryPeekWrapper(virDomainPtr dom, + unsigned long long start, + size_t size, + void * buffer, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainMemoryPeekFuncType virDomainMemoryPeekSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainMemoryPeek", + (void**)&virDomainMemoryPeekSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainMemoryPeekSymbol(dom, + start, + size, + buffer, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainMemoryStatsFuncType)(virDomainPtr dom, + virDomainMemoryStatPtr stats, + unsigned int nr_stats, + unsigned int flags); + +int +virDomainMemoryStatsWrapper(virDomainPtr dom, + virDomainMemoryStatPtr stats, + unsigned int nr_stats, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainMemoryStatsFuncType virDomainMemoryStatsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainMemoryStats", + (void**)&virDomainMemoryStatsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainMemoryStatsSymbol(dom, + stats, + nr_stats, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virDomainPtr +(*virDomainMigrateFuncType)(virDomainPtr domain, + virConnectPtr dconn, + unsigned long flags, + const char * dname, + const char * uri, + unsigned long bandwidth); + +virDomainPtr +virDomainMigrateWrapper(virDomainPtr domain, + virConnectPtr dconn, + unsigned long flags, + const char * dname, + const char * uri, + unsigned long bandwidth, + virErrorPtr err) +{ + virDomainPtr ret = NULL; + static virDomainMigrateFuncType virDomainMigrateSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainMigrate", + (void**)&virDomainMigrateSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainMigrateSymbol(domain, + dconn, + flags, + dname, + uri, + bandwidth); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virDomainPtr +(*virDomainMigrate2FuncType)(virDomainPtr domain, + virConnectPtr dconn, + const char * dxml, + unsigned long flags, + const char * dname, + const char * uri, + unsigned long bandwidth); + +virDomainPtr +virDomainMigrate2Wrapper(virDomainPtr domain, + virConnectPtr dconn, + const char * dxml, + unsigned long flags, + const char * dname, + const char * uri, + unsigned long bandwidth, + virErrorPtr err) +{ + virDomainPtr ret = NULL; + static virDomainMigrate2FuncType virDomainMigrate2Symbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainMigrate2", + (void**)&virDomainMigrate2Symbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainMigrate2Symbol(domain, + dconn, + dxml, + flags, + dname, + uri, + bandwidth); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virDomainPtr +(*virDomainMigrate3FuncType)(virDomainPtr domain, + virConnectPtr dconn, + virTypedParameterPtr params, + unsigned int nparams, + unsigned int flags); + +virDomainPtr +virDomainMigrate3Wrapper(virDomainPtr domain, + virConnectPtr dconn, + virTypedParameterPtr params, + unsigned int nparams, + unsigned int flags, + virErrorPtr err) +{ + virDomainPtr ret = NULL; + static virDomainMigrate3FuncType virDomainMigrate3Symbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainMigrate3", + (void**)&virDomainMigrate3Symbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainMigrate3Symbol(domain, + dconn, + params, + nparams, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainMigrateGetCompressionCacheFuncType)(virDomainPtr domain, + unsigned long long * cacheSize, + unsigned int flags); + +int +virDomainMigrateGetCompressionCacheWrapper(virDomainPtr domain, + unsigned long long * cacheSize, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainMigrateGetCompressionCacheFuncType virDomainMigrateGetCompressionCacheSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainMigrateGetCompressionCache", + (void**)&virDomainMigrateGetCompressionCacheSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainMigrateGetCompressionCacheSymbol(domain, + cacheSize, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainMigrateGetMaxDowntimeFuncType)(virDomainPtr domain, + unsigned long long * downtime, + unsigned int flags); + +int +virDomainMigrateGetMaxDowntimeWrapper(virDomainPtr domain, + unsigned long long * downtime, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainMigrateGetMaxDowntimeFuncType virDomainMigrateGetMaxDowntimeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainMigrateGetMaxDowntime", + (void**)&virDomainMigrateGetMaxDowntimeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainMigrateGetMaxDowntimeSymbol(domain, + downtime, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainMigrateGetMaxSpeedFuncType)(virDomainPtr domain, + unsigned long * bandwidth, + unsigned int flags); + +int +virDomainMigrateGetMaxSpeedWrapper(virDomainPtr domain, + unsigned long * bandwidth, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainMigrateGetMaxSpeedFuncType virDomainMigrateGetMaxSpeedSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainMigrateGetMaxSpeed", + (void**)&virDomainMigrateGetMaxSpeedSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainMigrateGetMaxSpeedSymbol(domain, + bandwidth, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainMigrateSetCompressionCacheFuncType)(virDomainPtr domain, + unsigned long long cacheSize, + unsigned int flags); + +int +virDomainMigrateSetCompressionCacheWrapper(virDomainPtr domain, + unsigned long long cacheSize, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainMigrateSetCompressionCacheFuncType virDomainMigrateSetCompressionCacheSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainMigrateSetCompressionCache", + (void**)&virDomainMigrateSetCompressionCacheSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainMigrateSetCompressionCacheSymbol(domain, + cacheSize, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainMigrateSetMaxDowntimeFuncType)(virDomainPtr domain, + unsigned long long downtime, + unsigned int flags); + +int +virDomainMigrateSetMaxDowntimeWrapper(virDomainPtr domain, + unsigned long long downtime, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainMigrateSetMaxDowntimeFuncType virDomainMigrateSetMaxDowntimeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainMigrateSetMaxDowntime", + (void**)&virDomainMigrateSetMaxDowntimeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainMigrateSetMaxDowntimeSymbol(domain, + downtime, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainMigrateSetMaxSpeedFuncType)(virDomainPtr domain, + unsigned long bandwidth, + unsigned int flags); + +int +virDomainMigrateSetMaxSpeedWrapper(virDomainPtr domain, + unsigned long bandwidth, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainMigrateSetMaxSpeedFuncType virDomainMigrateSetMaxSpeedSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainMigrateSetMaxSpeed", + (void**)&virDomainMigrateSetMaxSpeedSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainMigrateSetMaxSpeedSymbol(domain, + bandwidth, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainMigrateStartPostCopyFuncType)(virDomainPtr domain, + unsigned int flags); + +int +virDomainMigrateStartPostCopyWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainMigrateStartPostCopyFuncType virDomainMigrateStartPostCopySymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainMigrateStartPostCopy", + (void**)&virDomainMigrateStartPostCopySymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainMigrateStartPostCopySymbol(domain, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainMigrateToURIFuncType)(virDomainPtr domain, + const char * duri, + unsigned long flags, + const char * dname, + unsigned long bandwidth); + +int +virDomainMigrateToURIWrapper(virDomainPtr domain, + const char * duri, + unsigned long flags, + const char * dname, + unsigned long bandwidth, + virErrorPtr err) +{ + int ret = -1; + static virDomainMigrateToURIFuncType virDomainMigrateToURISymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainMigrateToURI", + (void**)&virDomainMigrateToURISymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainMigrateToURISymbol(domain, + duri, + flags, + dname, + bandwidth); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainMigrateToURI2FuncType)(virDomainPtr domain, + const char * dconnuri, + const char * miguri, + const char * dxml, + unsigned long flags, + const char * dname, + unsigned long bandwidth); + +int +virDomainMigrateToURI2Wrapper(virDomainPtr domain, + const char * dconnuri, + const char * miguri, + const char * dxml, + unsigned long flags, + const char * dname, + unsigned long bandwidth, + virErrorPtr err) +{ + int ret = -1; + static virDomainMigrateToURI2FuncType virDomainMigrateToURI2Symbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainMigrateToURI2", + (void**)&virDomainMigrateToURI2Symbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainMigrateToURI2Symbol(domain, + dconnuri, + miguri, + dxml, + flags, + dname, + bandwidth); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainMigrateToURI3FuncType)(virDomainPtr domain, + const char * dconnuri, + virTypedParameterPtr params, + unsigned int nparams, + unsigned int flags); + +int +virDomainMigrateToURI3Wrapper(virDomainPtr domain, + const char * dconnuri, + virTypedParameterPtr params, + unsigned int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainMigrateToURI3FuncType virDomainMigrateToURI3Symbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainMigrateToURI3", + (void**)&virDomainMigrateToURI3Symbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainMigrateToURI3Symbol(domain, + dconnuri, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainOpenChannelFuncType)(virDomainPtr dom, + const char * name, + virStreamPtr st, + unsigned int flags); + +int +virDomainOpenChannelWrapper(virDomainPtr dom, + const char * name, + virStreamPtr st, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainOpenChannelFuncType virDomainOpenChannelSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainOpenChannel", + (void**)&virDomainOpenChannelSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainOpenChannelSymbol(dom, + name, + st, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainOpenConsoleFuncType)(virDomainPtr dom, + const char * dev_name, + virStreamPtr st, + unsigned int flags); + +int +virDomainOpenConsoleWrapper(virDomainPtr dom, + const char * dev_name, + virStreamPtr st, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainOpenConsoleFuncType virDomainOpenConsoleSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainOpenConsole", + (void**)&virDomainOpenConsoleSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainOpenConsoleSymbol(dom, + dev_name, + st, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainOpenGraphicsFuncType)(virDomainPtr dom, + unsigned int idx, + int fd, + unsigned int flags); + +int +virDomainOpenGraphicsWrapper(virDomainPtr dom, + unsigned int idx, + int fd, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainOpenGraphicsFuncType virDomainOpenGraphicsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainOpenGraphics", + (void**)&virDomainOpenGraphicsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainOpenGraphicsSymbol(dom, + idx, + fd, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainOpenGraphicsFDFuncType)(virDomainPtr dom, + unsigned int idx, + unsigned int flags); + +int +virDomainOpenGraphicsFDWrapper(virDomainPtr dom, + unsigned int idx, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainOpenGraphicsFDFuncType virDomainOpenGraphicsFDSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainOpenGraphicsFD", + (void**)&virDomainOpenGraphicsFDSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainOpenGraphicsFDSymbol(dom, + idx, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainPMSuspendForDurationFuncType)(virDomainPtr dom, + unsigned int target, + unsigned long long duration, + unsigned int flags); + +int +virDomainPMSuspendForDurationWrapper(virDomainPtr dom, + unsigned int target, + unsigned long long duration, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainPMSuspendForDurationFuncType virDomainPMSuspendForDurationSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainPMSuspendForDuration", + (void**)&virDomainPMSuspendForDurationSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainPMSuspendForDurationSymbol(dom, + target, + duration, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainPMWakeupFuncType)(virDomainPtr dom, + unsigned int flags); + +int +virDomainPMWakeupWrapper(virDomainPtr dom, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainPMWakeupFuncType virDomainPMWakeupSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainPMWakeup", + (void**)&virDomainPMWakeupSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainPMWakeupSymbol(dom, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainPinEmulatorFuncType)(virDomainPtr domain, + unsigned char * cpumap, + int maplen, + unsigned int flags); + +int +virDomainPinEmulatorWrapper(virDomainPtr domain, + unsigned char * cpumap, + int maplen, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainPinEmulatorFuncType virDomainPinEmulatorSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainPinEmulator", + (void**)&virDomainPinEmulatorSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainPinEmulatorSymbol(domain, + cpumap, + maplen, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainPinIOThreadFuncType)(virDomainPtr domain, + unsigned int iothread_id, + unsigned char * cpumap, + int maplen, + unsigned int flags); + +int +virDomainPinIOThreadWrapper(virDomainPtr domain, + unsigned int iothread_id, + unsigned char * cpumap, + int maplen, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainPinIOThreadFuncType virDomainPinIOThreadSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainPinIOThread", + (void**)&virDomainPinIOThreadSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainPinIOThreadSymbol(domain, + iothread_id, + cpumap, + maplen, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainPinVcpuFuncType)(virDomainPtr domain, + unsigned int vcpu, + unsigned char * cpumap, + int maplen); + +int +virDomainPinVcpuWrapper(virDomainPtr domain, + unsigned int vcpu, + unsigned char * cpumap, + int maplen, + virErrorPtr err) +{ + int ret = -1; + static virDomainPinVcpuFuncType virDomainPinVcpuSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainPinVcpu", + (void**)&virDomainPinVcpuSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainPinVcpuSymbol(domain, + vcpu, + cpumap, + maplen); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainPinVcpuFlagsFuncType)(virDomainPtr domain, + unsigned int vcpu, + unsigned char * cpumap, + int maplen, + unsigned int flags); + +int +virDomainPinVcpuFlagsWrapper(virDomainPtr domain, + unsigned int vcpu, + unsigned char * cpumap, + int maplen, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainPinVcpuFlagsFuncType virDomainPinVcpuFlagsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainPinVcpuFlags", + (void**)&virDomainPinVcpuFlagsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainPinVcpuFlagsSymbol(domain, + vcpu, + cpumap, + maplen, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainRebootFuncType)(virDomainPtr domain, + unsigned int flags); + +int +virDomainRebootWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainRebootFuncType virDomainRebootSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainReboot", + (void**)&virDomainRebootSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainRebootSymbol(domain, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainRefFuncType)(virDomainPtr domain); + +int +virDomainRefWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = -1; + static virDomainRefFuncType virDomainRefSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainRef", + (void**)&virDomainRefSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainRefSymbol(domain); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainRenameFuncType)(virDomainPtr dom, + const char * new_name, + unsigned int flags); + +int +virDomainRenameWrapper(virDomainPtr dom, + const char * new_name, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainRenameFuncType virDomainRenameSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainRename", + (void**)&virDomainRenameSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainRenameSymbol(dom, + new_name, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainResetFuncType)(virDomainPtr domain, + unsigned int flags); + +int +virDomainResetWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainResetFuncType virDomainResetSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainReset", + (void**)&virDomainResetSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainResetSymbol(domain, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainRestoreFuncType)(virConnectPtr conn, + const char * from); + +int +virDomainRestoreWrapper(virConnectPtr conn, + const char * from, + virErrorPtr err) +{ + int ret = -1; + static virDomainRestoreFuncType virDomainRestoreSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainRestore", + (void**)&virDomainRestoreSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainRestoreSymbol(conn, + from); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainRestoreFlagsFuncType)(virConnectPtr conn, + const char * from, + const char * dxml, + unsigned int flags); + +int +virDomainRestoreFlagsWrapper(virConnectPtr conn, + const char * from, + const char * dxml, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainRestoreFlagsFuncType virDomainRestoreFlagsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainRestoreFlags", + (void**)&virDomainRestoreFlagsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainRestoreFlagsSymbol(conn, + from, + dxml, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainRestoreParamsFuncType)(virConnectPtr conn, + virTypedParameterPtr params, + int nparams, + unsigned int flags); + +int +virDomainRestoreParamsWrapper(virConnectPtr conn, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainRestoreParamsFuncType virDomainRestoreParamsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainRestoreParams", + (void**)&virDomainRestoreParamsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainRestoreParamsSymbol(conn, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainResumeFuncType)(virDomainPtr domain); + +int +virDomainResumeWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = -1; + static virDomainResumeFuncType virDomainResumeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainResume", + (void**)&virDomainResumeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainResumeSymbol(domain); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSaveFuncType)(virDomainPtr domain, + const char * to); + +int +virDomainSaveWrapper(virDomainPtr domain, + const char * to, + virErrorPtr err) +{ + int ret = -1; + static virDomainSaveFuncType virDomainSaveSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSave", + (void**)&virDomainSaveSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSaveSymbol(domain, + to); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSaveFlagsFuncType)(virDomainPtr domain, + const char * to, + const char * dxml, + unsigned int flags); + +int +virDomainSaveFlagsWrapper(virDomainPtr domain, + const char * to, + const char * dxml, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSaveFlagsFuncType virDomainSaveFlagsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSaveFlags", + (void**)&virDomainSaveFlagsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSaveFlagsSymbol(domain, + to, + dxml, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSaveImageDefineXMLFuncType)(virConnectPtr conn, + const char * file, + const char * dxml, + unsigned int flags); + +int +virDomainSaveImageDefineXMLWrapper(virConnectPtr conn, + const char * file, + const char * dxml, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSaveImageDefineXMLFuncType virDomainSaveImageDefineXMLSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSaveImageDefineXML", + (void**)&virDomainSaveImageDefineXMLSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSaveImageDefineXMLSymbol(conn, + file, + dxml, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virDomainSaveImageGetXMLDescFuncType)(virConnectPtr conn, + const char * file, + unsigned int flags); + +char * +virDomainSaveImageGetXMLDescWrapper(virConnectPtr conn, + const char * file, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; + static virDomainSaveImageGetXMLDescFuncType virDomainSaveImageGetXMLDescSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSaveImageGetXMLDesc", + (void**)&virDomainSaveImageGetXMLDescSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSaveImageGetXMLDescSymbol(conn, + file, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSaveParamsFuncType)(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags); + +int +virDomainSaveParamsWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSaveParamsFuncType virDomainSaveParamsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSaveParams", + (void**)&virDomainSaveParamsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSaveParamsSymbol(domain, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virDomainScreenshotFuncType)(virDomainPtr domain, + virStreamPtr stream, + unsigned int screen, + unsigned int flags); + +char * +virDomainScreenshotWrapper(virDomainPtr domain, + virStreamPtr stream, + unsigned int screen, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; + static virDomainScreenshotFuncType virDomainScreenshotSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainScreenshot", + (void**)&virDomainScreenshotSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainScreenshotSymbol(domain, + stream, + screen, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSendKeyFuncType)(virDomainPtr domain, + unsigned int codeset, + unsigned int holdtime, + unsigned int * keycodes, + int nkeycodes, + unsigned int flags); + +int +virDomainSendKeyWrapper(virDomainPtr domain, + unsigned int codeset, + unsigned int holdtime, + unsigned int * keycodes, + int nkeycodes, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSendKeyFuncType virDomainSendKeySymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSendKey", + (void**)&virDomainSendKeySymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSendKeySymbol(domain, + codeset, + holdtime, + keycodes, + nkeycodes, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSendProcessSignalFuncType)(virDomainPtr domain, + long long pid_value, + unsigned int signum, + unsigned int flags); + +int +virDomainSendProcessSignalWrapper(virDomainPtr domain, + long long pid_value, + unsigned int signum, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSendProcessSignalFuncType virDomainSendProcessSignalSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSendProcessSignal", + (void**)&virDomainSendProcessSignalSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSendProcessSignalSymbol(domain, + pid_value, + signum, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSetAutostartFuncType)(virDomainPtr domain, + int autostart); + +int +virDomainSetAutostartWrapper(virDomainPtr domain, + int autostart, + virErrorPtr err) +{ + int ret = -1; + static virDomainSetAutostartFuncType virDomainSetAutostartSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSetAutostart", + (void**)&virDomainSetAutostartSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSetAutostartSymbol(domain, + autostart); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSetBlkioParametersFuncType)(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags); + +int +virDomainSetBlkioParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSetBlkioParametersFuncType virDomainSetBlkioParametersSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSetBlkioParameters", + (void**)&virDomainSetBlkioParametersSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSetBlkioParametersSymbol(domain, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSetBlockIoTuneFuncType)(virDomainPtr dom, + const char * disk, + virTypedParameterPtr params, + int nparams, + unsigned int flags); + +int +virDomainSetBlockIoTuneWrapper(virDomainPtr dom, + const char * disk, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSetBlockIoTuneFuncType virDomainSetBlockIoTuneSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSetBlockIoTune", + (void**)&virDomainSetBlockIoTuneSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSetBlockIoTuneSymbol(dom, + disk, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSetBlockThresholdFuncType)(virDomainPtr domain, + const char * dev, + unsigned long long threshold, + unsigned int flags); + +int +virDomainSetBlockThresholdWrapper(virDomainPtr domain, + const char * dev, + unsigned long long threshold, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSetBlockThresholdFuncType virDomainSetBlockThresholdSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSetBlockThreshold", + (void**)&virDomainSetBlockThresholdSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSetBlockThresholdSymbol(domain, + dev, + threshold, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSetGuestVcpusFuncType)(virDomainPtr domain, + const char * cpumap, + int state, + unsigned int flags); + +int +virDomainSetGuestVcpusWrapper(virDomainPtr domain, + const char * cpumap, + int state, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSetGuestVcpusFuncType virDomainSetGuestVcpusSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSetGuestVcpus", + (void**)&virDomainSetGuestVcpusSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSetGuestVcpusSymbol(domain, + cpumap, + state, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSetIOThreadParamsFuncType)(virDomainPtr domain, + unsigned int iothread_id, + virTypedParameterPtr params, + int nparams, + unsigned int flags); + +int +virDomainSetIOThreadParamsWrapper(virDomainPtr domain, + unsigned int iothread_id, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSetIOThreadParamsFuncType virDomainSetIOThreadParamsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSetIOThreadParams", + (void**)&virDomainSetIOThreadParamsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSetIOThreadParamsSymbol(domain, + iothread_id, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSetInterfaceParametersFuncType)(virDomainPtr domain, + const char * device, + virTypedParameterPtr params, + int nparams, + unsigned int flags); + +int +virDomainSetInterfaceParametersWrapper(virDomainPtr domain, + const char * device, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSetInterfaceParametersFuncType virDomainSetInterfaceParametersSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSetInterfaceParameters", + (void**)&virDomainSetInterfaceParametersSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSetInterfaceParametersSymbol(domain, + device, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSetLaunchSecurityStateFuncType)(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags); + +int +virDomainSetLaunchSecurityStateWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSetLaunchSecurityStateFuncType virDomainSetLaunchSecurityStateSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSetLaunchSecurityState", + (void**)&virDomainSetLaunchSecurityStateSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSetLaunchSecurityStateSymbol(domain, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSetLifecycleActionFuncType)(virDomainPtr domain, + unsigned int type, + unsigned int action, + unsigned int flags); + +int +virDomainSetLifecycleActionWrapper(virDomainPtr domain, + unsigned int type, + unsigned int action, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSetLifecycleActionFuncType virDomainSetLifecycleActionSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSetLifecycleAction", + (void**)&virDomainSetLifecycleActionSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSetLifecycleActionSymbol(domain, + type, + action, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSetMaxMemoryFuncType)(virDomainPtr domain, + unsigned long memory); + +int +virDomainSetMaxMemoryWrapper(virDomainPtr domain, + unsigned long memory, + virErrorPtr err) +{ + int ret = -1; + static virDomainSetMaxMemoryFuncType virDomainSetMaxMemorySymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSetMaxMemory", + (void**)&virDomainSetMaxMemorySymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSetMaxMemorySymbol(domain, + memory); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSetMemoryFuncType)(virDomainPtr domain, + unsigned long memory); + +int +virDomainSetMemoryWrapper(virDomainPtr domain, + unsigned long memory, + virErrorPtr err) +{ + int ret = -1; + static virDomainSetMemoryFuncType virDomainSetMemorySymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSetMemory", + (void**)&virDomainSetMemorySymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSetMemorySymbol(domain, + memory); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSetMemoryFlagsFuncType)(virDomainPtr domain, + unsigned long memory, + unsigned int flags); + +int +virDomainSetMemoryFlagsWrapper(virDomainPtr domain, + unsigned long memory, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSetMemoryFlagsFuncType virDomainSetMemoryFlagsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSetMemoryFlags", + (void**)&virDomainSetMemoryFlagsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSetMemoryFlagsSymbol(domain, + memory, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSetMemoryParametersFuncType)(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags); + +int +virDomainSetMemoryParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSetMemoryParametersFuncType virDomainSetMemoryParametersSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSetMemoryParameters", + (void**)&virDomainSetMemoryParametersSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSetMemoryParametersSymbol(domain, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSetMemoryStatsPeriodFuncType)(virDomainPtr domain, + int period, + unsigned int flags); + +int +virDomainSetMemoryStatsPeriodWrapper(virDomainPtr domain, + int period, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSetMemoryStatsPeriodFuncType virDomainSetMemoryStatsPeriodSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSetMemoryStatsPeriod", + (void**)&virDomainSetMemoryStatsPeriodSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSetMemoryStatsPeriodSymbol(domain, + period, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSetMetadataFuncType)(virDomainPtr domain, + int type, + const char * metadata, + const char * key, + const char * uri, + unsigned int flags); + +int +virDomainSetMetadataWrapper(virDomainPtr domain, + int type, + const char * metadata, + const char * key, + const char * uri, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSetMetadataFuncType virDomainSetMetadataSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSetMetadata", + (void**)&virDomainSetMetadataSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSetMetadataSymbol(domain, + type, + metadata, + key, + uri, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSetNumaParametersFuncType)(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags); + +int +virDomainSetNumaParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSetNumaParametersFuncType virDomainSetNumaParametersSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSetNumaParameters", + (void**)&virDomainSetNumaParametersSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSetNumaParametersSymbol(domain, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSetPerfEventsFuncType)(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags); + +int +virDomainSetPerfEventsWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSetPerfEventsFuncType virDomainSetPerfEventsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSetPerfEvents", + (void**)&virDomainSetPerfEventsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSetPerfEventsSymbol(domain, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSetSchedulerParametersFuncType)(virDomainPtr domain, + virTypedParameterPtr params, + int nparams); + +int +virDomainSetSchedulerParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + virErrorPtr err) +{ + int ret = -1; + static virDomainSetSchedulerParametersFuncType virDomainSetSchedulerParametersSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSetSchedulerParameters", + (void**)&virDomainSetSchedulerParametersSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSetSchedulerParametersSymbol(domain, + params, + nparams); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSetSchedulerParametersFlagsFuncType)(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags); + +int +virDomainSetSchedulerParametersFlagsWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSetSchedulerParametersFlagsFuncType virDomainSetSchedulerParametersFlagsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSetSchedulerParametersFlags", + (void**)&virDomainSetSchedulerParametersFlagsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSetSchedulerParametersFlagsSymbol(domain, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSetTimeFuncType)(virDomainPtr dom, + long long seconds, + unsigned int nseconds, + unsigned int flags); + +int +virDomainSetTimeWrapper(virDomainPtr dom, + long long seconds, + unsigned int nseconds, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSetTimeFuncType virDomainSetTimeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSetTime", + (void**)&virDomainSetTimeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSetTimeSymbol(dom, + seconds, + nseconds, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSetUserPasswordFuncType)(virDomainPtr dom, + const char * user, + const char * password, + unsigned int flags); + +int +virDomainSetUserPasswordWrapper(virDomainPtr dom, + const char * user, + const char * password, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSetUserPasswordFuncType virDomainSetUserPasswordSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSetUserPassword", + (void**)&virDomainSetUserPasswordSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSetUserPasswordSymbol(dom, + user, + password, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSetVcpuFuncType)(virDomainPtr domain, + const char * vcpumap, + int state, + unsigned int flags); + +int +virDomainSetVcpuWrapper(virDomainPtr domain, + const char * vcpumap, + int state, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSetVcpuFuncType virDomainSetVcpuSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSetVcpu", + (void**)&virDomainSetVcpuSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSetVcpuSymbol(domain, + vcpumap, + state, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSetVcpusFuncType)(virDomainPtr domain, + unsigned int nvcpus); + +int +virDomainSetVcpusWrapper(virDomainPtr domain, + unsigned int nvcpus, + virErrorPtr err) +{ + int ret = -1; + static virDomainSetVcpusFuncType virDomainSetVcpusSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSetVcpus", + (void**)&virDomainSetVcpusSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSetVcpusSymbol(domain, + nvcpus); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSetVcpusFlagsFuncType)(virDomainPtr domain, + unsigned int nvcpus, + unsigned int flags); + +int +virDomainSetVcpusFlagsWrapper(virDomainPtr domain, + unsigned int nvcpus, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSetVcpusFlagsFuncType virDomainSetVcpusFlagsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSetVcpusFlags", + (void**)&virDomainSetVcpusFlagsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSetVcpusFlagsSymbol(domain, + nvcpus, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainShutdownFuncType)(virDomainPtr domain); + +int +virDomainShutdownWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = -1; + static virDomainShutdownFuncType virDomainShutdownSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainShutdown", + (void**)&virDomainShutdownSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainShutdownSymbol(domain); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainShutdownFlagsFuncType)(virDomainPtr domain, + unsigned int flags); + +int +virDomainShutdownFlagsWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainShutdownFlagsFuncType virDomainShutdownFlagsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainShutdownFlags", + (void**)&virDomainShutdownFlagsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainShutdownFlagsSymbol(domain, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainStartDirtyRateCalcFuncType)(virDomainPtr domain, + int seconds, + unsigned int flags); + +int +virDomainStartDirtyRateCalcWrapper(virDomainPtr domain, + int seconds, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainStartDirtyRateCalcFuncType virDomainStartDirtyRateCalcSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainStartDirtyRateCalc", + (void**)&virDomainStartDirtyRateCalcSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainStartDirtyRateCalcSymbol(domain, + seconds, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef void +(*virDomainStatsRecordListFreeFuncType)(virDomainStatsRecordPtr * stats); + +void +virDomainStatsRecordListFreeWrapper(virDomainStatsRecordPtr * stats) +{ + + static virDomainStatsRecordListFreeFuncType virDomainStatsRecordListFreeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainStatsRecordListFree", + (void**)&virDomainStatsRecordListFreeSymbol, + &once, + &success, + NULL)) { + return; + } + virDomainStatsRecordListFreeSymbol(stats); +} + +typedef int +(*virDomainSuspendFuncType)(virDomainPtr domain); + +int +virDomainSuspendWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = -1; + static virDomainSuspendFuncType virDomainSuspendSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSuspend", + (void**)&virDomainSuspendSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSuspendSymbol(domain); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainUndefineFuncType)(virDomainPtr domain); + +int +virDomainUndefineWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = -1; + static virDomainUndefineFuncType virDomainUndefineSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainUndefine", + (void**)&virDomainUndefineSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainUndefineSymbol(domain); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainUndefineFlagsFuncType)(virDomainPtr domain, + unsigned int flags); + +int +virDomainUndefineFlagsWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainUndefineFlagsFuncType virDomainUndefineFlagsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainUndefineFlags", + (void**)&virDomainUndefineFlagsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainUndefineFlagsSymbol(domain, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainUpdateDeviceFlagsFuncType)(virDomainPtr domain, + const char * xml, + unsigned int flags); + +int +virDomainUpdateDeviceFlagsWrapper(virDomainPtr domain, + const char * xml, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainUpdateDeviceFlagsFuncType virDomainUpdateDeviceFlagsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainUpdateDeviceFlags", + (void**)&virDomainUpdateDeviceFlagsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainUpdateDeviceFlagsSymbol(domain, + xml, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_domain_checkpoint.go b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_domain_checkpoint.go new file mode 100644 index 000000000..24a713076 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_domain_checkpoint.go @@ -0,0 +1,391 @@ +//go:build libvirt_dlopen +// +build libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo LDFLAGS: -ldl +#cgo CFLAGS: -DLIBVIRT_DLOPEN +#include +#include +#include +#include +#include "libvirt_generated_dlopen.h" +#include "error_helper.h" + + +typedef virDomainCheckpointPtr +(*virDomainCheckpointCreateXMLFuncType)(virDomainPtr domain, + const char * xmlDesc, + unsigned int flags); + +virDomainCheckpointPtr +virDomainCheckpointCreateXMLWrapper(virDomainPtr domain, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + virDomainCheckpointPtr ret = NULL; + static virDomainCheckpointCreateXMLFuncType virDomainCheckpointCreateXMLSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainCheckpointCreateXML", + (void**)&virDomainCheckpointCreateXMLSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainCheckpointCreateXMLSymbol(domain, + xmlDesc, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainCheckpointDeleteFuncType)(virDomainCheckpointPtr checkpoint, + unsigned int flags); + +int +virDomainCheckpointDeleteWrapper(virDomainCheckpointPtr checkpoint, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainCheckpointDeleteFuncType virDomainCheckpointDeleteSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainCheckpointDelete", + (void**)&virDomainCheckpointDeleteSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainCheckpointDeleteSymbol(checkpoint, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainCheckpointFreeFuncType)(virDomainCheckpointPtr checkpoint); + +int +virDomainCheckpointFreeWrapper(virDomainCheckpointPtr checkpoint, + virErrorPtr err) +{ + int ret = -1; + static virDomainCheckpointFreeFuncType virDomainCheckpointFreeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainCheckpointFree", + (void**)&virDomainCheckpointFreeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainCheckpointFreeSymbol(checkpoint); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virConnectPtr +(*virDomainCheckpointGetConnectFuncType)(virDomainCheckpointPtr checkpoint); + +virConnectPtr +virDomainCheckpointGetConnectWrapper(virDomainCheckpointPtr checkpoint, + virErrorPtr err) +{ + virConnectPtr ret = NULL; + static virDomainCheckpointGetConnectFuncType virDomainCheckpointGetConnectSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainCheckpointGetConnect", + (void**)&virDomainCheckpointGetConnectSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainCheckpointGetConnectSymbol(checkpoint); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virDomainPtr +(*virDomainCheckpointGetDomainFuncType)(virDomainCheckpointPtr checkpoint); + +virDomainPtr +virDomainCheckpointGetDomainWrapper(virDomainCheckpointPtr checkpoint, + virErrorPtr err) +{ + virDomainPtr ret = NULL; + static virDomainCheckpointGetDomainFuncType virDomainCheckpointGetDomainSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainCheckpointGetDomain", + (void**)&virDomainCheckpointGetDomainSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainCheckpointGetDomainSymbol(checkpoint); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef const char * +(*virDomainCheckpointGetNameFuncType)(virDomainCheckpointPtr checkpoint); + +const char * +virDomainCheckpointGetNameWrapper(virDomainCheckpointPtr checkpoint, + virErrorPtr err) +{ + const char * ret = NULL; + static virDomainCheckpointGetNameFuncType virDomainCheckpointGetNameSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainCheckpointGetName", + (void**)&virDomainCheckpointGetNameSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainCheckpointGetNameSymbol(checkpoint); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virDomainCheckpointPtr +(*virDomainCheckpointGetParentFuncType)(virDomainCheckpointPtr checkpoint, + unsigned int flags); + +virDomainCheckpointPtr +virDomainCheckpointGetParentWrapper(virDomainCheckpointPtr checkpoint, + unsigned int flags, + virErrorPtr err) +{ + virDomainCheckpointPtr ret = NULL; + static virDomainCheckpointGetParentFuncType virDomainCheckpointGetParentSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainCheckpointGetParent", + (void**)&virDomainCheckpointGetParentSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainCheckpointGetParentSymbol(checkpoint, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virDomainCheckpointGetXMLDescFuncType)(virDomainCheckpointPtr checkpoint, + unsigned int flags); + +char * +virDomainCheckpointGetXMLDescWrapper(virDomainCheckpointPtr checkpoint, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; + static virDomainCheckpointGetXMLDescFuncType virDomainCheckpointGetXMLDescSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainCheckpointGetXMLDesc", + (void**)&virDomainCheckpointGetXMLDescSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainCheckpointGetXMLDescSymbol(checkpoint, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainCheckpointListAllChildrenFuncType)(virDomainCheckpointPtr checkpoint, + virDomainCheckpointPtr ** children, + unsigned int flags); + +int +virDomainCheckpointListAllChildrenWrapper(virDomainCheckpointPtr checkpoint, + virDomainCheckpointPtr ** children, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainCheckpointListAllChildrenFuncType virDomainCheckpointListAllChildrenSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainCheckpointListAllChildren", + (void**)&virDomainCheckpointListAllChildrenSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainCheckpointListAllChildrenSymbol(checkpoint, + children, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virDomainCheckpointPtr +(*virDomainCheckpointLookupByNameFuncType)(virDomainPtr domain, + const char * name, + unsigned int flags); + +virDomainCheckpointPtr +virDomainCheckpointLookupByNameWrapper(virDomainPtr domain, + const char * name, + unsigned int flags, + virErrorPtr err) +{ + virDomainCheckpointPtr ret = NULL; + static virDomainCheckpointLookupByNameFuncType virDomainCheckpointLookupByNameSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainCheckpointLookupByName", + (void**)&virDomainCheckpointLookupByNameSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainCheckpointLookupByNameSymbol(domain, + name, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainCheckpointRefFuncType)(virDomainCheckpointPtr checkpoint); + +int +virDomainCheckpointRefWrapper(virDomainCheckpointPtr checkpoint, + virErrorPtr err) +{ + int ret = -1; + static virDomainCheckpointRefFuncType virDomainCheckpointRefSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainCheckpointRef", + (void**)&virDomainCheckpointRefSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainCheckpointRefSymbol(checkpoint); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainListAllCheckpointsFuncType)(virDomainPtr domain, + virDomainCheckpointPtr ** checkpoints, + unsigned int flags); + +int +virDomainListAllCheckpointsWrapper(virDomainPtr domain, + virDomainCheckpointPtr ** checkpoints, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainListAllCheckpointsFuncType virDomainListAllCheckpointsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainListAllCheckpoints", + (void**)&virDomainListAllCheckpointsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainListAllCheckpointsSymbol(domain, + checkpoints, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_domain_snapshot.go b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_domain_snapshot.go new file mode 100644 index 000000000..76919f9d8 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_domain_snapshot.go @@ -0,0 +1,664 @@ +//go:build libvirt_dlopen +// +build libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo LDFLAGS: -ldl +#cgo CFLAGS: -DLIBVIRT_DLOPEN +#include +#include +#include +#include +#include "libvirt_generated_dlopen.h" +#include "error_helper.h" + + +typedef int +(*virDomainHasCurrentSnapshotFuncType)(virDomainPtr domain, + unsigned int flags); + +int +virDomainHasCurrentSnapshotWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainHasCurrentSnapshotFuncType virDomainHasCurrentSnapshotSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainHasCurrentSnapshot", + (void**)&virDomainHasCurrentSnapshotSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainHasCurrentSnapshotSymbol(domain, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainListAllSnapshotsFuncType)(virDomainPtr domain, + virDomainSnapshotPtr ** snaps, + unsigned int flags); + +int +virDomainListAllSnapshotsWrapper(virDomainPtr domain, + virDomainSnapshotPtr ** snaps, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainListAllSnapshotsFuncType virDomainListAllSnapshotsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainListAllSnapshots", + (void**)&virDomainListAllSnapshotsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainListAllSnapshotsSymbol(domain, + snaps, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainRevertToSnapshotFuncType)(virDomainSnapshotPtr snapshot, + unsigned int flags); + +int +virDomainRevertToSnapshotWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainRevertToSnapshotFuncType virDomainRevertToSnapshotSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainRevertToSnapshot", + (void**)&virDomainRevertToSnapshotSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainRevertToSnapshotSymbol(snapshot, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virDomainSnapshotPtr +(*virDomainSnapshotCreateXMLFuncType)(virDomainPtr domain, + const char * xmlDesc, + unsigned int flags); + +virDomainSnapshotPtr +virDomainSnapshotCreateXMLWrapper(virDomainPtr domain, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + virDomainSnapshotPtr ret = NULL; + static virDomainSnapshotCreateXMLFuncType virDomainSnapshotCreateXMLSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSnapshotCreateXML", + (void**)&virDomainSnapshotCreateXMLSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSnapshotCreateXMLSymbol(domain, + xmlDesc, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virDomainSnapshotPtr +(*virDomainSnapshotCurrentFuncType)(virDomainPtr domain, + unsigned int flags); + +virDomainSnapshotPtr +virDomainSnapshotCurrentWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + virDomainSnapshotPtr ret = NULL; + static virDomainSnapshotCurrentFuncType virDomainSnapshotCurrentSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSnapshotCurrent", + (void**)&virDomainSnapshotCurrentSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSnapshotCurrentSymbol(domain, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSnapshotDeleteFuncType)(virDomainSnapshotPtr snapshot, + unsigned int flags); + +int +virDomainSnapshotDeleteWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSnapshotDeleteFuncType virDomainSnapshotDeleteSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSnapshotDelete", + (void**)&virDomainSnapshotDeleteSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSnapshotDeleteSymbol(snapshot, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSnapshotFreeFuncType)(virDomainSnapshotPtr snapshot); + +int +virDomainSnapshotFreeWrapper(virDomainSnapshotPtr snapshot, + virErrorPtr err) +{ + int ret = -1; + static virDomainSnapshotFreeFuncType virDomainSnapshotFreeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSnapshotFree", + (void**)&virDomainSnapshotFreeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSnapshotFreeSymbol(snapshot); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virConnectPtr +(*virDomainSnapshotGetConnectFuncType)(virDomainSnapshotPtr snapshot); + +virConnectPtr +virDomainSnapshotGetConnectWrapper(virDomainSnapshotPtr snapshot, + virErrorPtr err) +{ + virConnectPtr ret = NULL; + static virDomainSnapshotGetConnectFuncType virDomainSnapshotGetConnectSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSnapshotGetConnect", + (void**)&virDomainSnapshotGetConnectSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSnapshotGetConnectSymbol(snapshot); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virDomainPtr +(*virDomainSnapshotGetDomainFuncType)(virDomainSnapshotPtr snapshot); + +virDomainPtr +virDomainSnapshotGetDomainWrapper(virDomainSnapshotPtr snapshot, + virErrorPtr err) +{ + virDomainPtr ret = NULL; + static virDomainSnapshotGetDomainFuncType virDomainSnapshotGetDomainSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSnapshotGetDomain", + (void**)&virDomainSnapshotGetDomainSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSnapshotGetDomainSymbol(snapshot); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef const char * +(*virDomainSnapshotGetNameFuncType)(virDomainSnapshotPtr snapshot); + +const char * +virDomainSnapshotGetNameWrapper(virDomainSnapshotPtr snapshot, + virErrorPtr err) +{ + const char * ret = NULL; + static virDomainSnapshotGetNameFuncType virDomainSnapshotGetNameSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSnapshotGetName", + (void**)&virDomainSnapshotGetNameSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSnapshotGetNameSymbol(snapshot); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virDomainSnapshotPtr +(*virDomainSnapshotGetParentFuncType)(virDomainSnapshotPtr snapshot, + unsigned int flags); + +virDomainSnapshotPtr +virDomainSnapshotGetParentWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err) +{ + virDomainSnapshotPtr ret = NULL; + static virDomainSnapshotGetParentFuncType virDomainSnapshotGetParentSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSnapshotGetParent", + (void**)&virDomainSnapshotGetParentSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSnapshotGetParentSymbol(snapshot, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virDomainSnapshotGetXMLDescFuncType)(virDomainSnapshotPtr snapshot, + unsigned int flags); + +char * +virDomainSnapshotGetXMLDescWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; + static virDomainSnapshotGetXMLDescFuncType virDomainSnapshotGetXMLDescSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSnapshotGetXMLDesc", + (void**)&virDomainSnapshotGetXMLDescSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSnapshotGetXMLDescSymbol(snapshot, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSnapshotHasMetadataFuncType)(virDomainSnapshotPtr snapshot, + unsigned int flags); + +int +virDomainSnapshotHasMetadataWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSnapshotHasMetadataFuncType virDomainSnapshotHasMetadataSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSnapshotHasMetadata", + (void**)&virDomainSnapshotHasMetadataSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSnapshotHasMetadataSymbol(snapshot, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSnapshotIsCurrentFuncType)(virDomainSnapshotPtr snapshot, + unsigned int flags); + +int +virDomainSnapshotIsCurrentWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSnapshotIsCurrentFuncType virDomainSnapshotIsCurrentSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSnapshotIsCurrent", + (void**)&virDomainSnapshotIsCurrentSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSnapshotIsCurrentSymbol(snapshot, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSnapshotListAllChildrenFuncType)(virDomainSnapshotPtr snapshot, + virDomainSnapshotPtr ** snaps, + unsigned int flags); + +int +virDomainSnapshotListAllChildrenWrapper(virDomainSnapshotPtr snapshot, + virDomainSnapshotPtr ** snaps, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSnapshotListAllChildrenFuncType virDomainSnapshotListAllChildrenSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSnapshotListAllChildren", + (void**)&virDomainSnapshotListAllChildrenSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSnapshotListAllChildrenSymbol(snapshot, + snaps, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSnapshotListChildrenNamesFuncType)(virDomainSnapshotPtr snapshot, + char ** names, + int nameslen, + unsigned int flags); + +int +virDomainSnapshotListChildrenNamesWrapper(virDomainSnapshotPtr snapshot, + char ** names, + int nameslen, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSnapshotListChildrenNamesFuncType virDomainSnapshotListChildrenNamesSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSnapshotListChildrenNames", + (void**)&virDomainSnapshotListChildrenNamesSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSnapshotListChildrenNamesSymbol(snapshot, + names, + nameslen, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSnapshotListNamesFuncType)(virDomainPtr domain, + char ** names, + int nameslen, + unsigned int flags); + +int +virDomainSnapshotListNamesWrapper(virDomainPtr domain, + char ** names, + int nameslen, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSnapshotListNamesFuncType virDomainSnapshotListNamesSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSnapshotListNames", + (void**)&virDomainSnapshotListNamesSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSnapshotListNamesSymbol(domain, + names, + nameslen, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virDomainSnapshotPtr +(*virDomainSnapshotLookupByNameFuncType)(virDomainPtr domain, + const char * name, + unsigned int flags); + +virDomainSnapshotPtr +virDomainSnapshotLookupByNameWrapper(virDomainPtr domain, + const char * name, + unsigned int flags, + virErrorPtr err) +{ + virDomainSnapshotPtr ret = NULL; + static virDomainSnapshotLookupByNameFuncType virDomainSnapshotLookupByNameSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSnapshotLookupByName", + (void**)&virDomainSnapshotLookupByNameSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSnapshotLookupByNameSymbol(domain, + name, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSnapshotNumFuncType)(virDomainPtr domain, + unsigned int flags); + +int +virDomainSnapshotNumWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSnapshotNumFuncType virDomainSnapshotNumSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSnapshotNum", + (void**)&virDomainSnapshotNumSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSnapshotNumSymbol(domain, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSnapshotNumChildrenFuncType)(virDomainSnapshotPtr snapshot, + unsigned int flags); + +int +virDomainSnapshotNumChildrenWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainSnapshotNumChildrenFuncType virDomainSnapshotNumChildrenSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSnapshotNumChildren", + (void**)&virDomainSnapshotNumChildrenSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSnapshotNumChildrenSymbol(snapshot, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainSnapshotRefFuncType)(virDomainSnapshotPtr snapshot); + +int +virDomainSnapshotRefWrapper(virDomainSnapshotPtr snapshot, + virErrorPtr err) +{ + int ret = -1; + static virDomainSnapshotRefFuncType virDomainSnapshotRefSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDomainSnapshotRef", + (void**)&virDomainSnapshotRefSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainSnapshotRefSymbol(snapshot); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_event.go b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_event.go new file mode 100644 index 000000000..247fe9ea9 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_event.go @@ -0,0 +1,305 @@ +//go:build libvirt_dlopen +// +build libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo LDFLAGS: -ldl +#cgo CFLAGS: -DLIBVIRT_DLOPEN +#include +#include +#include +#include +#include "libvirt_generated_dlopen.h" +#include "error_helper.h" + + +typedef int +(*virEventAddHandleFuncType)(int fd, + int events, + virEventHandleCallback cb, + void * opaque, + virFreeCallback ff); + +int +virEventAddHandleWrapper(int fd, + int events, + virEventHandleCallback cb, + void * opaque, + virFreeCallback ff, + virErrorPtr err) +{ + int ret = -1; + static virEventAddHandleFuncType virEventAddHandleSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virEventAddHandle", + (void**)&virEventAddHandleSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virEventAddHandleSymbol(fd, + events, + cb, + opaque, + ff); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virEventAddTimeoutFuncType)(int timeout, + virEventTimeoutCallback cb, + void * opaque, + virFreeCallback ff); + +int +virEventAddTimeoutWrapper(int timeout, + virEventTimeoutCallback cb, + void * opaque, + virFreeCallback ff, + virErrorPtr err) +{ + int ret = -1; + static virEventAddTimeoutFuncType virEventAddTimeoutSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virEventAddTimeout", + (void**)&virEventAddTimeoutSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virEventAddTimeoutSymbol(timeout, + cb, + opaque, + ff); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virEventRegisterDefaultImplFuncType)(void); + +int +virEventRegisterDefaultImplWrapper(virErrorPtr err) +{ + int ret = -1; + static virEventRegisterDefaultImplFuncType virEventRegisterDefaultImplSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virEventRegisterDefaultImpl", + (void**)&virEventRegisterDefaultImplSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virEventRegisterDefaultImplSymbol(); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef void +(*virEventRegisterImplFuncType)(virEventAddHandleFunc addHandle, + virEventUpdateHandleFunc updateHandle, + virEventRemoveHandleFunc removeHandle, + virEventAddTimeoutFunc addTimeout, + virEventUpdateTimeoutFunc updateTimeout, + virEventRemoveTimeoutFunc removeTimeout); + +void +virEventRegisterImplWrapper(virEventAddHandleFunc addHandle, + virEventUpdateHandleFunc updateHandle, + virEventRemoveHandleFunc removeHandle, + virEventAddTimeoutFunc addTimeout, + virEventUpdateTimeoutFunc updateTimeout, + virEventRemoveTimeoutFunc removeTimeout) +{ + + static virEventRegisterImplFuncType virEventRegisterImplSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virEventRegisterImpl", + (void**)&virEventRegisterImplSymbol, + &once, + &success, + NULL)) { + return; + } + virEventRegisterImplSymbol(addHandle, + updateHandle, + removeHandle, + addTimeout, + updateTimeout, + removeTimeout); +} + +typedef int +(*virEventRemoveHandleFuncType)(int watch); + +int +virEventRemoveHandleWrapper(int watch, + virErrorPtr err) +{ + int ret = -1; + static virEventRemoveHandleFuncType virEventRemoveHandleSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virEventRemoveHandle", + (void**)&virEventRemoveHandleSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virEventRemoveHandleSymbol(watch); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virEventRemoveTimeoutFuncType)(int timer); + +int +virEventRemoveTimeoutWrapper(int timer, + virErrorPtr err) +{ + int ret = -1; + static virEventRemoveTimeoutFuncType virEventRemoveTimeoutSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virEventRemoveTimeout", + (void**)&virEventRemoveTimeoutSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virEventRemoveTimeoutSymbol(timer); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virEventRunDefaultImplFuncType)(void); + +int +virEventRunDefaultImplWrapper(virErrorPtr err) +{ + int ret = -1; + static virEventRunDefaultImplFuncType virEventRunDefaultImplSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virEventRunDefaultImpl", + (void**)&virEventRunDefaultImplSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virEventRunDefaultImplSymbol(); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef void +(*virEventUpdateHandleFuncType)(int watch, + int events); + +void +virEventUpdateHandleWrapper(int watch, + int events) +{ + + static virEventUpdateHandleFuncType virEventUpdateHandleSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virEventUpdateHandle", + (void**)&virEventUpdateHandleSymbol, + &once, + &success, + NULL)) { + return; + } + virEventUpdateHandleSymbol(watch, + events); +} + +typedef void +(*virEventUpdateTimeoutFuncType)(int timer, + int timeout); + +void +virEventUpdateTimeoutWrapper(int timer, + int timeout) +{ + + static virEventUpdateTimeoutFuncType virEventUpdateTimeoutSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virEventUpdateTimeout", + (void**)&virEventUpdateTimeoutSymbol, + &once, + &success, + NULL)) { + return; + } + virEventUpdateTimeoutSymbol(timer, + timeout); +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_host.go b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_host.go new file mode 100644 index 000000000..8e64e91ba --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_host.go @@ -0,0 +1,1319 @@ +//go:build libvirt_dlopen +// +build libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo LDFLAGS: -ldl +#cgo CFLAGS: -DLIBVIRT_DLOPEN +#include +#include +#include +#include +#include "libvirt_generated_dlopen.h" +#include "error_helper.h" + + +typedef char * +(*virConnectBaselineCPUFuncType)(virConnectPtr conn, + const char ** xmlCPUs, + unsigned int ncpus, + unsigned int flags); + +char * +virConnectBaselineCPUWrapper(virConnectPtr conn, + const char ** xmlCPUs, + unsigned int ncpus, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; + static virConnectBaselineCPUFuncType virConnectBaselineCPUSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectBaselineCPU", + (void**)&virConnectBaselineCPUSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectBaselineCPUSymbol(conn, + xmlCPUs, + ncpus, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virConnectBaselineHypervisorCPUFuncType)(virConnectPtr conn, + const char * emulator, + const char * arch, + const char * machine, + const char * virttype, + const char ** xmlCPUs, + unsigned int ncpus, + unsigned int flags); + +char * +virConnectBaselineHypervisorCPUWrapper(virConnectPtr conn, + const char * emulator, + const char * arch, + const char * machine, + const char * virttype, + const char ** xmlCPUs, + unsigned int ncpus, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; + static virConnectBaselineHypervisorCPUFuncType virConnectBaselineHypervisorCPUSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectBaselineHypervisorCPU", + (void**)&virConnectBaselineHypervisorCPUSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectBaselineHypervisorCPUSymbol(conn, + emulator, + arch, + machine, + virttype, + xmlCPUs, + ncpus, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectCloseFuncType)(virConnectPtr conn); + +int +virConnectCloseWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; + static virConnectCloseFuncType virConnectCloseSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectClose", + (void**)&virConnectCloseSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectCloseSymbol(conn); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectCompareCPUFuncType)(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags); + +int +virConnectCompareCPUWrapper(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virConnectCompareCPUFuncType virConnectCompareCPUSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectCompareCPU", + (void**)&virConnectCompareCPUSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectCompareCPUSymbol(conn, + xmlDesc, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectCompareHypervisorCPUFuncType)(virConnectPtr conn, + const char * emulator, + const char * arch, + const char * machine, + const char * virttype, + const char * xmlCPU, + unsigned int flags); + +int +virConnectCompareHypervisorCPUWrapper(virConnectPtr conn, + const char * emulator, + const char * arch, + const char * machine, + const char * virttype, + const char * xmlCPU, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virConnectCompareHypervisorCPUFuncType virConnectCompareHypervisorCPUSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectCompareHypervisorCPU", + (void**)&virConnectCompareHypervisorCPUSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectCompareHypervisorCPUSymbol(conn, + emulator, + arch, + machine, + virttype, + xmlCPU, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectGetCPUModelNamesFuncType)(virConnectPtr conn, + const char * arch, + char *** models, + unsigned int flags); + +int +virConnectGetCPUModelNamesWrapper(virConnectPtr conn, + const char * arch, + char *** models, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virConnectGetCPUModelNamesFuncType virConnectGetCPUModelNamesSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectGetCPUModelNames", + (void**)&virConnectGetCPUModelNamesSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectGetCPUModelNamesSymbol(conn, + arch, + models, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virConnectGetCapabilitiesFuncType)(virConnectPtr conn); + +char * +virConnectGetCapabilitiesWrapper(virConnectPtr conn, + virErrorPtr err) +{ + char * ret = NULL; + static virConnectGetCapabilitiesFuncType virConnectGetCapabilitiesSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectGetCapabilities", + (void**)&virConnectGetCapabilitiesSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectGetCapabilitiesSymbol(conn); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virConnectGetHostnameFuncType)(virConnectPtr conn); + +char * +virConnectGetHostnameWrapper(virConnectPtr conn, + virErrorPtr err) +{ + char * ret = NULL; + static virConnectGetHostnameFuncType virConnectGetHostnameSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectGetHostname", + (void**)&virConnectGetHostnameSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectGetHostnameSymbol(conn); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectGetLibVersionFuncType)(virConnectPtr conn, + unsigned long * libVer); + +int +virConnectGetLibVersionWrapper(virConnectPtr conn, + unsigned long * libVer, + virErrorPtr err) +{ + int ret = -1; + static virConnectGetLibVersionFuncType virConnectGetLibVersionSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectGetLibVersion", + (void**)&virConnectGetLibVersionSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectGetLibVersionSymbol(conn, + libVer); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectGetMaxVcpusFuncType)(virConnectPtr conn, + const char * type); + +int +virConnectGetMaxVcpusWrapper(virConnectPtr conn, + const char * type, + virErrorPtr err) +{ + int ret = -1; + static virConnectGetMaxVcpusFuncType virConnectGetMaxVcpusSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectGetMaxVcpus", + (void**)&virConnectGetMaxVcpusSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectGetMaxVcpusSymbol(conn, + type); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virConnectGetSysinfoFuncType)(virConnectPtr conn, + unsigned int flags); + +char * +virConnectGetSysinfoWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; + static virConnectGetSysinfoFuncType virConnectGetSysinfoSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectGetSysinfo", + (void**)&virConnectGetSysinfoSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectGetSysinfoSymbol(conn, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef const char * +(*virConnectGetTypeFuncType)(virConnectPtr conn); + +const char * +virConnectGetTypeWrapper(virConnectPtr conn, + virErrorPtr err) +{ + const char * ret = NULL; + static virConnectGetTypeFuncType virConnectGetTypeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectGetType", + (void**)&virConnectGetTypeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectGetTypeSymbol(conn); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virConnectGetURIFuncType)(virConnectPtr conn); + +char * +virConnectGetURIWrapper(virConnectPtr conn, + virErrorPtr err) +{ + char * ret = NULL; + static virConnectGetURIFuncType virConnectGetURISymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectGetURI", + (void**)&virConnectGetURISymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectGetURISymbol(conn); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectGetVersionFuncType)(virConnectPtr conn, + unsigned long * hvVer); + +int +virConnectGetVersionWrapper(virConnectPtr conn, + unsigned long * hvVer, + virErrorPtr err) +{ + int ret = -1; + static virConnectGetVersionFuncType virConnectGetVersionSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectGetVersion", + (void**)&virConnectGetVersionSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectGetVersionSymbol(conn, + hvVer); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectIsAliveFuncType)(virConnectPtr conn); + +int +virConnectIsAliveWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; + static virConnectIsAliveFuncType virConnectIsAliveSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectIsAlive", + (void**)&virConnectIsAliveSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectIsAliveSymbol(conn); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectIsEncryptedFuncType)(virConnectPtr conn); + +int +virConnectIsEncryptedWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; + static virConnectIsEncryptedFuncType virConnectIsEncryptedSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectIsEncrypted", + (void**)&virConnectIsEncryptedSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectIsEncryptedSymbol(conn); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectIsSecureFuncType)(virConnectPtr conn); + +int +virConnectIsSecureWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; + static virConnectIsSecureFuncType virConnectIsSecureSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectIsSecure", + (void**)&virConnectIsSecureSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectIsSecureSymbol(conn); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virConnectPtr +(*virConnectOpenFuncType)(const char * name); + +virConnectPtr +virConnectOpenWrapper(const char * name, + virErrorPtr err) +{ + virConnectPtr ret = NULL; + static virConnectOpenFuncType virConnectOpenSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectOpen", + (void**)&virConnectOpenSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectOpenSymbol(name); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virConnectPtr +(*virConnectOpenAuthFuncType)(const char * name, + virConnectAuthPtr auth, + unsigned int flags); + +virConnectPtr +virConnectOpenAuthWrapper(const char * name, + virConnectAuthPtr auth, + unsigned int flags, + virErrorPtr err) +{ + virConnectPtr ret = NULL; + static virConnectOpenAuthFuncType virConnectOpenAuthSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectOpenAuth", + (void**)&virConnectOpenAuthSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectOpenAuthSymbol(name, + auth, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virConnectPtr +(*virConnectOpenReadOnlyFuncType)(const char * name); + +virConnectPtr +virConnectOpenReadOnlyWrapper(const char * name, + virErrorPtr err) +{ + virConnectPtr ret = NULL; + static virConnectOpenReadOnlyFuncType virConnectOpenReadOnlySymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectOpenReadOnly", + (void**)&virConnectOpenReadOnlySymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectOpenReadOnlySymbol(name); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectRefFuncType)(virConnectPtr conn); + +int +virConnectRefWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; + static virConnectRefFuncType virConnectRefSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectRef", + (void**)&virConnectRefSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectRefSymbol(conn); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectRegisterCloseCallbackFuncType)(virConnectPtr conn, + virConnectCloseFunc cb, + void * opaque, + virFreeCallback freecb); + +int +virConnectRegisterCloseCallbackWrapper(virConnectPtr conn, + virConnectCloseFunc cb, + void * opaque, + virFreeCallback freecb, + virErrorPtr err) +{ + int ret = -1; + static virConnectRegisterCloseCallbackFuncType virConnectRegisterCloseCallbackSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectRegisterCloseCallback", + (void**)&virConnectRegisterCloseCallbackSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectRegisterCloseCallbackSymbol(conn, + cb, + opaque, + freecb); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectSetIdentityFuncType)(virConnectPtr conn, + virTypedParameterPtr params, + int nparams, + unsigned int flags); + +int +virConnectSetIdentityWrapper(virConnectPtr conn, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virConnectSetIdentityFuncType virConnectSetIdentitySymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectSetIdentity", + (void**)&virConnectSetIdentitySymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectSetIdentitySymbol(conn, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectSetKeepAliveFuncType)(virConnectPtr conn, + int interval, + unsigned int count); + +int +virConnectSetKeepAliveWrapper(virConnectPtr conn, + int interval, + unsigned int count, + virErrorPtr err) +{ + int ret = -1; + static virConnectSetKeepAliveFuncType virConnectSetKeepAliveSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectSetKeepAlive", + (void**)&virConnectSetKeepAliveSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectSetKeepAliveSymbol(conn, + interval, + count); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectUnregisterCloseCallbackFuncType)(virConnectPtr conn, + virConnectCloseFunc cb); + +int +virConnectUnregisterCloseCallbackWrapper(virConnectPtr conn, + virConnectCloseFunc cb, + virErrorPtr err) +{ + int ret = -1; + static virConnectUnregisterCloseCallbackFuncType virConnectUnregisterCloseCallbackSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectUnregisterCloseCallback", + (void**)&virConnectUnregisterCloseCallbackSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectUnregisterCloseCallbackSymbol(conn, + cb); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virGetVersionFuncType)(unsigned long * libVer, + const char * type, + unsigned long * typeVer); + +int +virGetVersionWrapper(unsigned long * libVer, + const char * type, + unsigned long * typeVer, + virErrorPtr err) +{ + int ret = -1; + static virGetVersionFuncType virGetVersionSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virGetVersion", + (void**)&virGetVersionSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virGetVersionSymbol(libVer, + type, + typeVer); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virInitializeFuncType)(void); + +int +virInitializeWrapper(virErrorPtr err) +{ + int ret = -1; + static virInitializeFuncType virInitializeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virInitialize", + (void**)&virInitializeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virInitializeSymbol(); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeAllocPagesFuncType)(virConnectPtr conn, + unsigned int npages, + unsigned int * pageSizes, + unsigned long long * pageCounts, + int startCell, + unsigned int cellCount, + unsigned int flags); + +int +virNodeAllocPagesWrapper(virConnectPtr conn, + unsigned int npages, + unsigned int * pageSizes, + unsigned long long * pageCounts, + int startCell, + unsigned int cellCount, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virNodeAllocPagesFuncType virNodeAllocPagesSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeAllocPages", + (void**)&virNodeAllocPagesSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeAllocPagesSymbol(conn, + npages, + pageSizes, + pageCounts, + startCell, + cellCount, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeGetCPUMapFuncType)(virConnectPtr conn, + unsigned char ** cpumap, + unsigned int * online, + unsigned int flags); + +int +virNodeGetCPUMapWrapper(virConnectPtr conn, + unsigned char ** cpumap, + unsigned int * online, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virNodeGetCPUMapFuncType virNodeGetCPUMapSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeGetCPUMap", + (void**)&virNodeGetCPUMapSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeGetCPUMapSymbol(conn, + cpumap, + online, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeGetCPUStatsFuncType)(virConnectPtr conn, + int cpuNum, + virNodeCPUStatsPtr params, + int * nparams, + unsigned int flags); + +int +virNodeGetCPUStatsWrapper(virConnectPtr conn, + int cpuNum, + virNodeCPUStatsPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virNodeGetCPUStatsFuncType virNodeGetCPUStatsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeGetCPUStats", + (void**)&virNodeGetCPUStatsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeGetCPUStatsSymbol(conn, + cpuNum, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeGetCellsFreeMemoryFuncType)(virConnectPtr conn, + unsigned long long * freeMems, + int startCell, + int maxCells); + +int +virNodeGetCellsFreeMemoryWrapper(virConnectPtr conn, + unsigned long long * freeMems, + int startCell, + int maxCells, + virErrorPtr err) +{ + int ret = -1; + static virNodeGetCellsFreeMemoryFuncType virNodeGetCellsFreeMemorySymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeGetCellsFreeMemory", + (void**)&virNodeGetCellsFreeMemorySymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeGetCellsFreeMemorySymbol(conn, + freeMems, + startCell, + maxCells); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef unsigned long long +(*virNodeGetFreeMemoryFuncType)(virConnectPtr conn); + +unsigned long long +virNodeGetFreeMemoryWrapper(virConnectPtr conn, + virErrorPtr err) +{ + unsigned long long ret = 0; + static virNodeGetFreeMemoryFuncType virNodeGetFreeMemorySymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeGetFreeMemory", + (void**)&virNodeGetFreeMemorySymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeGetFreeMemorySymbol(conn); + if (ret == 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeGetFreePagesFuncType)(virConnectPtr conn, + unsigned int npages, + unsigned int * pages, + int startCell, + unsigned int cellCount, + unsigned long long * counts, + unsigned int flags); + +int +virNodeGetFreePagesWrapper(virConnectPtr conn, + unsigned int npages, + unsigned int * pages, + int startCell, + unsigned int cellCount, + unsigned long long * counts, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virNodeGetFreePagesFuncType virNodeGetFreePagesSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeGetFreePages", + (void**)&virNodeGetFreePagesSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeGetFreePagesSymbol(conn, + npages, + pages, + startCell, + cellCount, + counts, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeGetInfoFuncType)(virConnectPtr conn, + virNodeInfoPtr info); + +int +virNodeGetInfoWrapper(virConnectPtr conn, + virNodeInfoPtr info, + virErrorPtr err) +{ + int ret = -1; + static virNodeGetInfoFuncType virNodeGetInfoSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeGetInfo", + (void**)&virNodeGetInfoSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeGetInfoSymbol(conn, + info); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeGetMemoryParametersFuncType)(virConnectPtr conn, + virTypedParameterPtr params, + int * nparams, + unsigned int flags); + +int +virNodeGetMemoryParametersWrapper(virConnectPtr conn, + virTypedParameterPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virNodeGetMemoryParametersFuncType virNodeGetMemoryParametersSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeGetMemoryParameters", + (void**)&virNodeGetMemoryParametersSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeGetMemoryParametersSymbol(conn, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeGetMemoryStatsFuncType)(virConnectPtr conn, + int cellNum, + virNodeMemoryStatsPtr params, + int * nparams, + unsigned int flags); + +int +virNodeGetMemoryStatsWrapper(virConnectPtr conn, + int cellNum, + virNodeMemoryStatsPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virNodeGetMemoryStatsFuncType virNodeGetMemoryStatsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeGetMemoryStats", + (void**)&virNodeGetMemoryStatsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeGetMemoryStatsSymbol(conn, + cellNum, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeGetSEVInfoFuncType)(virConnectPtr conn, + virTypedParameterPtr * params, + int * nparams, + unsigned int flags); + +int +virNodeGetSEVInfoWrapper(virConnectPtr conn, + virTypedParameterPtr * params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virNodeGetSEVInfoFuncType virNodeGetSEVInfoSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeGetSEVInfo", + (void**)&virNodeGetSEVInfoSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeGetSEVInfoSymbol(conn, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeGetSecurityModelFuncType)(virConnectPtr conn, + virSecurityModelPtr secmodel); + +int +virNodeGetSecurityModelWrapper(virConnectPtr conn, + virSecurityModelPtr secmodel, + virErrorPtr err) +{ + int ret = -1; + static virNodeGetSecurityModelFuncType virNodeGetSecurityModelSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeGetSecurityModel", + (void**)&virNodeGetSecurityModelSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeGetSecurityModelSymbol(conn, + secmodel); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeSetMemoryParametersFuncType)(virConnectPtr conn, + virTypedParameterPtr params, + int nparams, + unsigned int flags); + +int +virNodeSetMemoryParametersWrapper(virConnectPtr conn, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virNodeSetMemoryParametersFuncType virNodeSetMemoryParametersSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeSetMemoryParameters", + (void**)&virNodeSetMemoryParametersSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeSetMemoryParametersSymbol(conn, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeSuspendForDurationFuncType)(virConnectPtr conn, + unsigned int target, + unsigned long long duration, + unsigned int flags); + +int +virNodeSuspendForDurationWrapper(virConnectPtr conn, + unsigned int target, + unsigned long long duration, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virNodeSuspendForDurationFuncType virNodeSuspendForDurationSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeSuspendForDuration", + (void**)&virNodeSuspendForDurationSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeSuspendForDurationSymbol(conn, + target, + duration, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_interface.go b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_interface.go new file mode 100644 index 000000000..99306806e --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_interface.go @@ -0,0 +1,640 @@ +//go:build libvirt_dlopen +// +build libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo LDFLAGS: -ldl +#cgo CFLAGS: -DLIBVIRT_DLOPEN +#include +#include +#include +#include +#include "libvirt_generated_dlopen.h" +#include "error_helper.h" + + +typedef int +(*virConnectListAllInterfacesFuncType)(virConnectPtr conn, + virInterfacePtr ** ifaces, + unsigned int flags); + +int +virConnectListAllInterfacesWrapper(virConnectPtr conn, + virInterfacePtr ** ifaces, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virConnectListAllInterfacesFuncType virConnectListAllInterfacesSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectListAllInterfaces", + (void**)&virConnectListAllInterfacesSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectListAllInterfacesSymbol(conn, + ifaces, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectListDefinedInterfacesFuncType)(virConnectPtr conn, + char ** const names, + int maxnames); + +int +virConnectListDefinedInterfacesWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = -1; + static virConnectListDefinedInterfacesFuncType virConnectListDefinedInterfacesSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectListDefinedInterfaces", + (void**)&virConnectListDefinedInterfacesSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectListDefinedInterfacesSymbol(conn, + names, + maxnames); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectListInterfacesFuncType)(virConnectPtr conn, + char ** const names, + int maxnames); + +int +virConnectListInterfacesWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = -1; + static virConnectListInterfacesFuncType virConnectListInterfacesSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectListInterfaces", + (void**)&virConnectListInterfacesSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectListInterfacesSymbol(conn, + names, + maxnames); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectNumOfDefinedInterfacesFuncType)(virConnectPtr conn); + +int +virConnectNumOfDefinedInterfacesWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; + static virConnectNumOfDefinedInterfacesFuncType virConnectNumOfDefinedInterfacesSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectNumOfDefinedInterfaces", + (void**)&virConnectNumOfDefinedInterfacesSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectNumOfDefinedInterfacesSymbol(conn); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectNumOfInterfacesFuncType)(virConnectPtr conn); + +int +virConnectNumOfInterfacesWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; + static virConnectNumOfInterfacesFuncType virConnectNumOfInterfacesSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectNumOfInterfaces", + (void**)&virConnectNumOfInterfacesSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectNumOfInterfacesSymbol(conn); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virInterfaceChangeBeginFuncType)(virConnectPtr conn, + unsigned int flags); + +int +virInterfaceChangeBeginWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virInterfaceChangeBeginFuncType virInterfaceChangeBeginSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virInterfaceChangeBegin", + (void**)&virInterfaceChangeBeginSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virInterfaceChangeBeginSymbol(conn, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virInterfaceChangeCommitFuncType)(virConnectPtr conn, + unsigned int flags); + +int +virInterfaceChangeCommitWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virInterfaceChangeCommitFuncType virInterfaceChangeCommitSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virInterfaceChangeCommit", + (void**)&virInterfaceChangeCommitSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virInterfaceChangeCommitSymbol(conn, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virInterfaceChangeRollbackFuncType)(virConnectPtr conn, + unsigned int flags); + +int +virInterfaceChangeRollbackWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virInterfaceChangeRollbackFuncType virInterfaceChangeRollbackSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virInterfaceChangeRollback", + (void**)&virInterfaceChangeRollbackSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virInterfaceChangeRollbackSymbol(conn, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virInterfaceCreateFuncType)(virInterfacePtr iface, + unsigned int flags); + +int +virInterfaceCreateWrapper(virInterfacePtr iface, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virInterfaceCreateFuncType virInterfaceCreateSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virInterfaceCreate", + (void**)&virInterfaceCreateSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virInterfaceCreateSymbol(iface, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virInterfacePtr +(*virInterfaceDefineXMLFuncType)(virConnectPtr conn, + const char * xml, + unsigned int flags); + +virInterfacePtr +virInterfaceDefineXMLWrapper(virConnectPtr conn, + const char * xml, + unsigned int flags, + virErrorPtr err) +{ + virInterfacePtr ret = NULL; + static virInterfaceDefineXMLFuncType virInterfaceDefineXMLSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virInterfaceDefineXML", + (void**)&virInterfaceDefineXMLSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virInterfaceDefineXMLSymbol(conn, + xml, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virInterfaceDestroyFuncType)(virInterfacePtr iface, + unsigned int flags); + +int +virInterfaceDestroyWrapper(virInterfacePtr iface, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virInterfaceDestroyFuncType virInterfaceDestroySymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virInterfaceDestroy", + (void**)&virInterfaceDestroySymbol, + &once, + &success, + err)) { + return ret; + } + ret = virInterfaceDestroySymbol(iface, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virInterfaceFreeFuncType)(virInterfacePtr iface); + +int +virInterfaceFreeWrapper(virInterfacePtr iface, + virErrorPtr err) +{ + int ret = -1; + static virInterfaceFreeFuncType virInterfaceFreeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virInterfaceFree", + (void**)&virInterfaceFreeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virInterfaceFreeSymbol(iface); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virConnectPtr +(*virInterfaceGetConnectFuncType)(virInterfacePtr iface); + +virConnectPtr +virInterfaceGetConnectWrapper(virInterfacePtr iface, + virErrorPtr err) +{ + virConnectPtr ret = NULL; + static virInterfaceGetConnectFuncType virInterfaceGetConnectSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virInterfaceGetConnect", + (void**)&virInterfaceGetConnectSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virInterfaceGetConnectSymbol(iface); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef const char * +(*virInterfaceGetMACStringFuncType)(virInterfacePtr iface); + +const char * +virInterfaceGetMACStringWrapper(virInterfacePtr iface, + virErrorPtr err) +{ + const char * ret = NULL; + static virInterfaceGetMACStringFuncType virInterfaceGetMACStringSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virInterfaceGetMACString", + (void**)&virInterfaceGetMACStringSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virInterfaceGetMACStringSymbol(iface); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef const char * +(*virInterfaceGetNameFuncType)(virInterfacePtr iface); + +const char * +virInterfaceGetNameWrapper(virInterfacePtr iface, + virErrorPtr err) +{ + const char * ret = NULL; + static virInterfaceGetNameFuncType virInterfaceGetNameSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virInterfaceGetName", + (void**)&virInterfaceGetNameSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virInterfaceGetNameSymbol(iface); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virInterfaceGetXMLDescFuncType)(virInterfacePtr iface, + unsigned int flags); + +char * +virInterfaceGetXMLDescWrapper(virInterfacePtr iface, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; + static virInterfaceGetXMLDescFuncType virInterfaceGetXMLDescSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virInterfaceGetXMLDesc", + (void**)&virInterfaceGetXMLDescSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virInterfaceGetXMLDescSymbol(iface, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virInterfaceIsActiveFuncType)(virInterfacePtr iface); + +int +virInterfaceIsActiveWrapper(virInterfacePtr iface, + virErrorPtr err) +{ + int ret = -1; + static virInterfaceIsActiveFuncType virInterfaceIsActiveSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virInterfaceIsActive", + (void**)&virInterfaceIsActiveSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virInterfaceIsActiveSymbol(iface); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virInterfacePtr +(*virInterfaceLookupByMACStringFuncType)(virConnectPtr conn, + const char * macstr); + +virInterfacePtr +virInterfaceLookupByMACStringWrapper(virConnectPtr conn, + const char * macstr, + virErrorPtr err) +{ + virInterfacePtr ret = NULL; + static virInterfaceLookupByMACStringFuncType virInterfaceLookupByMACStringSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virInterfaceLookupByMACString", + (void**)&virInterfaceLookupByMACStringSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virInterfaceLookupByMACStringSymbol(conn, + macstr); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virInterfacePtr +(*virInterfaceLookupByNameFuncType)(virConnectPtr conn, + const char * name); + +virInterfacePtr +virInterfaceLookupByNameWrapper(virConnectPtr conn, + const char * name, + virErrorPtr err) +{ + virInterfacePtr ret = NULL; + static virInterfaceLookupByNameFuncType virInterfaceLookupByNameSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virInterfaceLookupByName", + (void**)&virInterfaceLookupByNameSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virInterfaceLookupByNameSymbol(conn, + name); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virInterfaceRefFuncType)(virInterfacePtr iface); + +int +virInterfaceRefWrapper(virInterfacePtr iface, + virErrorPtr err) +{ + int ret = -1; + static virInterfaceRefFuncType virInterfaceRefSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virInterfaceRef", + (void**)&virInterfaceRefSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virInterfaceRefSymbol(iface); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virInterfaceUndefineFuncType)(virInterfacePtr iface); + +int +virInterfaceUndefineWrapper(virInterfacePtr iface, + virErrorPtr err) +{ + int ret = -1; + static virInterfaceUndefineFuncType virInterfaceUndefineSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virInterfaceUndefine", + (void**)&virInterfaceUndefineSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virInterfaceUndefineSymbol(iface); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_network.go b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_network.go new file mode 100644 index 000000000..4d6547e6b --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_network.go @@ -0,0 +1,1437 @@ +//go:build libvirt_dlopen +// +build libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo LDFLAGS: -ldl +#cgo CFLAGS: -DLIBVIRT_DLOPEN +#include +#include +#include +#include +#include "libvirt_generated_dlopen.h" +#include "error_helper.h" + + +typedef int +(*virConnectListAllNetworksFuncType)(virConnectPtr conn, + virNetworkPtr ** nets, + unsigned int flags); + +int +virConnectListAllNetworksWrapper(virConnectPtr conn, + virNetworkPtr ** nets, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virConnectListAllNetworksFuncType virConnectListAllNetworksSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectListAllNetworks", + (void**)&virConnectListAllNetworksSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectListAllNetworksSymbol(conn, + nets, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectListDefinedNetworksFuncType)(virConnectPtr conn, + char ** const names, + int maxnames); + +int +virConnectListDefinedNetworksWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = -1; + static virConnectListDefinedNetworksFuncType virConnectListDefinedNetworksSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectListDefinedNetworks", + (void**)&virConnectListDefinedNetworksSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectListDefinedNetworksSymbol(conn, + names, + maxnames); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectListNetworksFuncType)(virConnectPtr conn, + char ** const names, + int maxnames); + +int +virConnectListNetworksWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = -1; + static virConnectListNetworksFuncType virConnectListNetworksSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectListNetworks", + (void**)&virConnectListNetworksSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectListNetworksSymbol(conn, + names, + maxnames); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectNetworkEventDeregisterAnyFuncType)(virConnectPtr conn, + int callbackID); + +int +virConnectNetworkEventDeregisterAnyWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err) +{ + int ret = -1; + static virConnectNetworkEventDeregisterAnyFuncType virConnectNetworkEventDeregisterAnySymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectNetworkEventDeregisterAny", + (void**)&virConnectNetworkEventDeregisterAnySymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectNetworkEventDeregisterAnySymbol(conn, + callbackID); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectNetworkEventRegisterAnyFuncType)(virConnectPtr conn, + virNetworkPtr net, + int eventID, + virConnectNetworkEventGenericCallback cb, + void * opaque, + virFreeCallback freecb); + +int +virConnectNetworkEventRegisterAnyWrapper(virConnectPtr conn, + virNetworkPtr net, + int eventID, + virConnectNetworkEventGenericCallback cb, + void * opaque, + virFreeCallback freecb, + virErrorPtr err) +{ + int ret = -1; + static virConnectNetworkEventRegisterAnyFuncType virConnectNetworkEventRegisterAnySymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectNetworkEventRegisterAny", + (void**)&virConnectNetworkEventRegisterAnySymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectNetworkEventRegisterAnySymbol(conn, + net, + eventID, + cb, + opaque, + freecb); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectNumOfDefinedNetworksFuncType)(virConnectPtr conn); + +int +virConnectNumOfDefinedNetworksWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; + static virConnectNumOfDefinedNetworksFuncType virConnectNumOfDefinedNetworksSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectNumOfDefinedNetworks", + (void**)&virConnectNumOfDefinedNetworksSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectNumOfDefinedNetworksSymbol(conn); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectNumOfNetworksFuncType)(virConnectPtr conn); + +int +virConnectNumOfNetworksWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; + static virConnectNumOfNetworksFuncType virConnectNumOfNetworksSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectNumOfNetworks", + (void**)&virConnectNumOfNetworksSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectNumOfNetworksSymbol(conn); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNetworkCreateFuncType)(virNetworkPtr network); + +int +virNetworkCreateWrapper(virNetworkPtr network, + virErrorPtr err) +{ + int ret = -1; + static virNetworkCreateFuncType virNetworkCreateSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkCreate", + (void**)&virNetworkCreateSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkCreateSymbol(network); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virNetworkPtr +(*virNetworkCreateXMLFuncType)(virConnectPtr conn, + const char * xmlDesc); + +virNetworkPtr +virNetworkCreateXMLWrapper(virConnectPtr conn, + const char * xmlDesc, + virErrorPtr err) +{ + virNetworkPtr ret = NULL; + static virNetworkCreateXMLFuncType virNetworkCreateXMLSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkCreateXML", + (void**)&virNetworkCreateXMLSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkCreateXMLSymbol(conn, + xmlDesc); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virNetworkPtr +(*virNetworkCreateXMLFlagsFuncType)(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags); + +virNetworkPtr +virNetworkCreateXMLFlagsWrapper(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + virNetworkPtr ret = NULL; + static virNetworkCreateXMLFlagsFuncType virNetworkCreateXMLFlagsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkCreateXMLFlags", + (void**)&virNetworkCreateXMLFlagsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkCreateXMLFlagsSymbol(conn, + xmlDesc, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef void +(*virNetworkDHCPLeaseFreeFuncType)(virNetworkDHCPLeasePtr lease); + +void +virNetworkDHCPLeaseFreeWrapper(virNetworkDHCPLeasePtr lease) +{ + + static virNetworkDHCPLeaseFreeFuncType virNetworkDHCPLeaseFreeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkDHCPLeaseFree", + (void**)&virNetworkDHCPLeaseFreeSymbol, + &once, + &success, + NULL)) { + return; + } + virNetworkDHCPLeaseFreeSymbol(lease); +} + +typedef virNetworkPtr +(*virNetworkDefineXMLFuncType)(virConnectPtr conn, + const char * xml); + +virNetworkPtr +virNetworkDefineXMLWrapper(virConnectPtr conn, + const char * xml, + virErrorPtr err) +{ + virNetworkPtr ret = NULL; + static virNetworkDefineXMLFuncType virNetworkDefineXMLSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkDefineXML", + (void**)&virNetworkDefineXMLSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkDefineXMLSymbol(conn, + xml); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virNetworkPtr +(*virNetworkDefineXMLFlagsFuncType)(virConnectPtr conn, + const char * xml, + unsigned int flags); + +virNetworkPtr +virNetworkDefineXMLFlagsWrapper(virConnectPtr conn, + const char * xml, + unsigned int flags, + virErrorPtr err) +{ + virNetworkPtr ret = NULL; + static virNetworkDefineXMLFlagsFuncType virNetworkDefineXMLFlagsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkDefineXMLFlags", + (void**)&virNetworkDefineXMLFlagsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkDefineXMLFlagsSymbol(conn, + xml, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNetworkDestroyFuncType)(virNetworkPtr network); + +int +virNetworkDestroyWrapper(virNetworkPtr network, + virErrorPtr err) +{ + int ret = -1; + static virNetworkDestroyFuncType virNetworkDestroySymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkDestroy", + (void**)&virNetworkDestroySymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkDestroySymbol(network); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNetworkFreeFuncType)(virNetworkPtr network); + +int +virNetworkFreeWrapper(virNetworkPtr network, + virErrorPtr err) +{ + int ret = -1; + static virNetworkFreeFuncType virNetworkFreeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkFree", + (void**)&virNetworkFreeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkFreeSymbol(network); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNetworkGetAutostartFuncType)(virNetworkPtr network, + int * autostart); + +int +virNetworkGetAutostartWrapper(virNetworkPtr network, + int * autostart, + virErrorPtr err) +{ + int ret = -1; + static virNetworkGetAutostartFuncType virNetworkGetAutostartSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkGetAutostart", + (void**)&virNetworkGetAutostartSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkGetAutostartSymbol(network, + autostart); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virNetworkGetBridgeNameFuncType)(virNetworkPtr network); + +char * +virNetworkGetBridgeNameWrapper(virNetworkPtr network, + virErrorPtr err) +{ + char * ret = NULL; + static virNetworkGetBridgeNameFuncType virNetworkGetBridgeNameSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkGetBridgeName", + (void**)&virNetworkGetBridgeNameSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkGetBridgeNameSymbol(network); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virConnectPtr +(*virNetworkGetConnectFuncType)(virNetworkPtr net); + +virConnectPtr +virNetworkGetConnectWrapper(virNetworkPtr net, + virErrorPtr err) +{ + virConnectPtr ret = NULL; + static virNetworkGetConnectFuncType virNetworkGetConnectSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkGetConnect", + (void**)&virNetworkGetConnectSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkGetConnectSymbol(net); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNetworkGetDHCPLeasesFuncType)(virNetworkPtr network, + const char * mac, + virNetworkDHCPLeasePtr ** leases, + unsigned int flags); + +int +virNetworkGetDHCPLeasesWrapper(virNetworkPtr network, + const char * mac, + virNetworkDHCPLeasePtr ** leases, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virNetworkGetDHCPLeasesFuncType virNetworkGetDHCPLeasesSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkGetDHCPLeases", + (void**)&virNetworkGetDHCPLeasesSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkGetDHCPLeasesSymbol(network, + mac, + leases, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virNetworkGetMetadataFuncType)(virNetworkPtr network, + int type, + const char * uri, + unsigned int flags); + +char * +virNetworkGetMetadataWrapper(virNetworkPtr network, + int type, + const char * uri, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; + static virNetworkGetMetadataFuncType virNetworkGetMetadataSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkGetMetadata", + (void**)&virNetworkGetMetadataSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkGetMetadataSymbol(network, + type, + uri, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef const char * +(*virNetworkGetNameFuncType)(virNetworkPtr network); + +const char * +virNetworkGetNameWrapper(virNetworkPtr network, + virErrorPtr err) +{ + const char * ret = NULL; + static virNetworkGetNameFuncType virNetworkGetNameSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkGetName", + (void**)&virNetworkGetNameSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkGetNameSymbol(network); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNetworkGetUUIDFuncType)(virNetworkPtr network, + unsigned char * uuid); + +int +virNetworkGetUUIDWrapper(virNetworkPtr network, + unsigned char * uuid, + virErrorPtr err) +{ + int ret = -1; + static virNetworkGetUUIDFuncType virNetworkGetUUIDSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkGetUUID", + (void**)&virNetworkGetUUIDSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkGetUUIDSymbol(network, + uuid); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNetworkGetUUIDStringFuncType)(virNetworkPtr network, + char * buf); + +int +virNetworkGetUUIDStringWrapper(virNetworkPtr network, + char * buf, + virErrorPtr err) +{ + int ret = -1; + static virNetworkGetUUIDStringFuncType virNetworkGetUUIDStringSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkGetUUIDString", + (void**)&virNetworkGetUUIDStringSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkGetUUIDStringSymbol(network, + buf); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virNetworkGetXMLDescFuncType)(virNetworkPtr network, + unsigned int flags); + +char * +virNetworkGetXMLDescWrapper(virNetworkPtr network, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; + static virNetworkGetXMLDescFuncType virNetworkGetXMLDescSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkGetXMLDesc", + (void**)&virNetworkGetXMLDescSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkGetXMLDescSymbol(network, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNetworkIsActiveFuncType)(virNetworkPtr net); + +int +virNetworkIsActiveWrapper(virNetworkPtr net, + virErrorPtr err) +{ + int ret = -1; + static virNetworkIsActiveFuncType virNetworkIsActiveSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkIsActive", + (void**)&virNetworkIsActiveSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkIsActiveSymbol(net); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNetworkIsPersistentFuncType)(virNetworkPtr net); + +int +virNetworkIsPersistentWrapper(virNetworkPtr net, + virErrorPtr err) +{ + int ret = -1; + static virNetworkIsPersistentFuncType virNetworkIsPersistentSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkIsPersistent", + (void**)&virNetworkIsPersistentSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkIsPersistentSymbol(net); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNetworkListAllPortsFuncType)(virNetworkPtr network, + virNetworkPortPtr ** ports, + unsigned int flags); + +int +virNetworkListAllPortsWrapper(virNetworkPtr network, + virNetworkPortPtr ** ports, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virNetworkListAllPortsFuncType virNetworkListAllPortsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkListAllPorts", + (void**)&virNetworkListAllPortsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkListAllPortsSymbol(network, + ports, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virNetworkPtr +(*virNetworkLookupByNameFuncType)(virConnectPtr conn, + const char * name); + +virNetworkPtr +virNetworkLookupByNameWrapper(virConnectPtr conn, + const char * name, + virErrorPtr err) +{ + virNetworkPtr ret = NULL; + static virNetworkLookupByNameFuncType virNetworkLookupByNameSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkLookupByName", + (void**)&virNetworkLookupByNameSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkLookupByNameSymbol(conn, + name); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virNetworkPtr +(*virNetworkLookupByUUIDFuncType)(virConnectPtr conn, + const unsigned char * uuid); + +virNetworkPtr +virNetworkLookupByUUIDWrapper(virConnectPtr conn, + const unsigned char * uuid, + virErrorPtr err) +{ + virNetworkPtr ret = NULL; + static virNetworkLookupByUUIDFuncType virNetworkLookupByUUIDSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkLookupByUUID", + (void**)&virNetworkLookupByUUIDSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkLookupByUUIDSymbol(conn, + uuid); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virNetworkPtr +(*virNetworkLookupByUUIDStringFuncType)(virConnectPtr conn, + const char * uuidstr); + +virNetworkPtr +virNetworkLookupByUUIDStringWrapper(virConnectPtr conn, + const char * uuidstr, + virErrorPtr err) +{ + virNetworkPtr ret = NULL; + static virNetworkLookupByUUIDStringFuncType virNetworkLookupByUUIDStringSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkLookupByUUIDString", + (void**)&virNetworkLookupByUUIDStringSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkLookupByUUIDStringSymbol(conn, + uuidstr); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virNetworkPortPtr +(*virNetworkPortCreateXMLFuncType)(virNetworkPtr net, + const char * xmldesc, + unsigned int flags); + +virNetworkPortPtr +virNetworkPortCreateXMLWrapper(virNetworkPtr net, + const char * xmldesc, + unsigned int flags, + virErrorPtr err) +{ + virNetworkPortPtr ret = NULL; + static virNetworkPortCreateXMLFuncType virNetworkPortCreateXMLSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkPortCreateXML", + (void**)&virNetworkPortCreateXMLSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkPortCreateXMLSymbol(net, + xmldesc, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNetworkPortDeleteFuncType)(virNetworkPortPtr port, + unsigned int flags); + +int +virNetworkPortDeleteWrapper(virNetworkPortPtr port, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virNetworkPortDeleteFuncType virNetworkPortDeleteSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkPortDelete", + (void**)&virNetworkPortDeleteSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkPortDeleteSymbol(port, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNetworkPortFreeFuncType)(virNetworkPortPtr port); + +int +virNetworkPortFreeWrapper(virNetworkPortPtr port, + virErrorPtr err) +{ + int ret = -1; + static virNetworkPortFreeFuncType virNetworkPortFreeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkPortFree", + (void**)&virNetworkPortFreeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkPortFreeSymbol(port); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virNetworkPtr +(*virNetworkPortGetNetworkFuncType)(virNetworkPortPtr port); + +virNetworkPtr +virNetworkPortGetNetworkWrapper(virNetworkPortPtr port, + virErrorPtr err) +{ + virNetworkPtr ret = NULL; + static virNetworkPortGetNetworkFuncType virNetworkPortGetNetworkSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkPortGetNetwork", + (void**)&virNetworkPortGetNetworkSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkPortGetNetworkSymbol(port); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNetworkPortGetParametersFuncType)(virNetworkPortPtr port, + virTypedParameterPtr * params, + int * nparams, + unsigned int flags); + +int +virNetworkPortGetParametersWrapper(virNetworkPortPtr port, + virTypedParameterPtr * params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virNetworkPortGetParametersFuncType virNetworkPortGetParametersSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkPortGetParameters", + (void**)&virNetworkPortGetParametersSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkPortGetParametersSymbol(port, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNetworkPortGetUUIDFuncType)(virNetworkPortPtr port, + unsigned char * uuid); + +int +virNetworkPortGetUUIDWrapper(virNetworkPortPtr port, + unsigned char * uuid, + virErrorPtr err) +{ + int ret = -1; + static virNetworkPortGetUUIDFuncType virNetworkPortGetUUIDSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkPortGetUUID", + (void**)&virNetworkPortGetUUIDSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkPortGetUUIDSymbol(port, + uuid); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNetworkPortGetUUIDStringFuncType)(virNetworkPortPtr port, + char * buf); + +int +virNetworkPortGetUUIDStringWrapper(virNetworkPortPtr port, + char * buf, + virErrorPtr err) +{ + int ret = -1; + static virNetworkPortGetUUIDStringFuncType virNetworkPortGetUUIDStringSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkPortGetUUIDString", + (void**)&virNetworkPortGetUUIDStringSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkPortGetUUIDStringSymbol(port, + buf); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virNetworkPortGetXMLDescFuncType)(virNetworkPortPtr port, + unsigned int flags); + +char * +virNetworkPortGetXMLDescWrapper(virNetworkPortPtr port, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; + static virNetworkPortGetXMLDescFuncType virNetworkPortGetXMLDescSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkPortGetXMLDesc", + (void**)&virNetworkPortGetXMLDescSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkPortGetXMLDescSymbol(port, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virNetworkPortPtr +(*virNetworkPortLookupByUUIDFuncType)(virNetworkPtr net, + const unsigned char * uuid); + +virNetworkPortPtr +virNetworkPortLookupByUUIDWrapper(virNetworkPtr net, + const unsigned char * uuid, + virErrorPtr err) +{ + virNetworkPortPtr ret = NULL; + static virNetworkPortLookupByUUIDFuncType virNetworkPortLookupByUUIDSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkPortLookupByUUID", + (void**)&virNetworkPortLookupByUUIDSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkPortLookupByUUIDSymbol(net, + uuid); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virNetworkPortPtr +(*virNetworkPortLookupByUUIDStringFuncType)(virNetworkPtr net, + const char * uuidstr); + +virNetworkPortPtr +virNetworkPortLookupByUUIDStringWrapper(virNetworkPtr net, + const char * uuidstr, + virErrorPtr err) +{ + virNetworkPortPtr ret = NULL; + static virNetworkPortLookupByUUIDStringFuncType virNetworkPortLookupByUUIDStringSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkPortLookupByUUIDString", + (void**)&virNetworkPortLookupByUUIDStringSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkPortLookupByUUIDStringSymbol(net, + uuidstr); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNetworkPortRefFuncType)(virNetworkPortPtr port); + +int +virNetworkPortRefWrapper(virNetworkPortPtr port, + virErrorPtr err) +{ + int ret = -1; + static virNetworkPortRefFuncType virNetworkPortRefSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkPortRef", + (void**)&virNetworkPortRefSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkPortRefSymbol(port); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNetworkPortSetParametersFuncType)(virNetworkPortPtr port, + virTypedParameterPtr params, + int nparams, + unsigned int flags); + +int +virNetworkPortSetParametersWrapper(virNetworkPortPtr port, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virNetworkPortSetParametersFuncType virNetworkPortSetParametersSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkPortSetParameters", + (void**)&virNetworkPortSetParametersSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkPortSetParametersSymbol(port, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNetworkRefFuncType)(virNetworkPtr network); + +int +virNetworkRefWrapper(virNetworkPtr network, + virErrorPtr err) +{ + int ret = -1; + static virNetworkRefFuncType virNetworkRefSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkRef", + (void**)&virNetworkRefSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkRefSymbol(network); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNetworkSetAutostartFuncType)(virNetworkPtr network, + int autostart); + +int +virNetworkSetAutostartWrapper(virNetworkPtr network, + int autostart, + virErrorPtr err) +{ + int ret = -1; + static virNetworkSetAutostartFuncType virNetworkSetAutostartSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkSetAutostart", + (void**)&virNetworkSetAutostartSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkSetAutostartSymbol(network, + autostart); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNetworkSetMetadataFuncType)(virNetworkPtr network, + int type, + const char * metadata, + const char * key, + const char * uri, + unsigned int flags); + +int +virNetworkSetMetadataWrapper(virNetworkPtr network, + int type, + const char * metadata, + const char * key, + const char * uri, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virNetworkSetMetadataFuncType virNetworkSetMetadataSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkSetMetadata", + (void**)&virNetworkSetMetadataSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkSetMetadataSymbol(network, + type, + metadata, + key, + uri, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNetworkUndefineFuncType)(virNetworkPtr network); + +int +virNetworkUndefineWrapper(virNetworkPtr network, + virErrorPtr err) +{ + int ret = -1; + static virNetworkUndefineFuncType virNetworkUndefineSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkUndefine", + (void**)&virNetworkUndefineSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkUndefineSymbol(network); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNetworkUpdateFuncType)(virNetworkPtr network, + unsigned int command, + unsigned int section, + int parentIndex, + const char * xml, + unsigned int flags); + +int +virNetworkUpdateWrapper(virNetworkPtr network, + unsigned int command, + unsigned int section, + int parentIndex, + const char * xml, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virNetworkUpdateFuncType virNetworkUpdateSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNetworkUpdate", + (void**)&virNetworkUpdateSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNetworkUpdateSymbol(network, + command, + section, + parentIndex, + xml, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_nodedev.go b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_nodedev.go new file mode 100644 index 000000000..92a72dc79 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_nodedev.go @@ -0,0 +1,873 @@ +//go:build libvirt_dlopen +// +build libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo LDFLAGS: -ldl +#cgo CFLAGS: -DLIBVIRT_DLOPEN +#include +#include +#include +#include +#include "libvirt_generated_dlopen.h" +#include "error_helper.h" + + +typedef int +(*virConnectListAllNodeDevicesFuncType)(virConnectPtr conn, + virNodeDevicePtr ** devices, + unsigned int flags); + +int +virConnectListAllNodeDevicesWrapper(virConnectPtr conn, + virNodeDevicePtr ** devices, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virConnectListAllNodeDevicesFuncType virConnectListAllNodeDevicesSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectListAllNodeDevices", + (void**)&virConnectListAllNodeDevicesSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectListAllNodeDevicesSymbol(conn, + devices, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectNodeDeviceEventDeregisterAnyFuncType)(virConnectPtr conn, + int callbackID); + +int +virConnectNodeDeviceEventDeregisterAnyWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err) +{ + int ret = -1; + static virConnectNodeDeviceEventDeregisterAnyFuncType virConnectNodeDeviceEventDeregisterAnySymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectNodeDeviceEventDeregisterAny", + (void**)&virConnectNodeDeviceEventDeregisterAnySymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectNodeDeviceEventDeregisterAnySymbol(conn, + callbackID); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectNodeDeviceEventRegisterAnyFuncType)(virConnectPtr conn, + virNodeDevicePtr dev, + int eventID, + virConnectNodeDeviceEventGenericCallback cb, + void * opaque, + virFreeCallback freecb); + +int +virConnectNodeDeviceEventRegisterAnyWrapper(virConnectPtr conn, + virNodeDevicePtr dev, + int eventID, + virConnectNodeDeviceEventGenericCallback cb, + void * opaque, + virFreeCallback freecb, + virErrorPtr err) +{ + int ret = -1; + static virConnectNodeDeviceEventRegisterAnyFuncType virConnectNodeDeviceEventRegisterAnySymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectNodeDeviceEventRegisterAny", + (void**)&virConnectNodeDeviceEventRegisterAnySymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectNodeDeviceEventRegisterAnySymbol(conn, + dev, + eventID, + cb, + opaque, + freecb); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeDeviceCreateFuncType)(virNodeDevicePtr dev, + unsigned int flags); + +int +virNodeDeviceCreateWrapper(virNodeDevicePtr dev, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virNodeDeviceCreateFuncType virNodeDeviceCreateSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeDeviceCreate", + (void**)&virNodeDeviceCreateSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeDeviceCreateSymbol(dev, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virNodeDevicePtr +(*virNodeDeviceCreateXMLFuncType)(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags); + +virNodeDevicePtr +virNodeDeviceCreateXMLWrapper(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + virNodeDevicePtr ret = NULL; + static virNodeDeviceCreateXMLFuncType virNodeDeviceCreateXMLSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeDeviceCreateXML", + (void**)&virNodeDeviceCreateXMLSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeDeviceCreateXMLSymbol(conn, + xmlDesc, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virNodeDevicePtr +(*virNodeDeviceDefineXMLFuncType)(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags); + +virNodeDevicePtr +virNodeDeviceDefineXMLWrapper(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + virNodeDevicePtr ret = NULL; + static virNodeDeviceDefineXMLFuncType virNodeDeviceDefineXMLSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeDeviceDefineXML", + (void**)&virNodeDeviceDefineXMLSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeDeviceDefineXMLSymbol(conn, + xmlDesc, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeDeviceDestroyFuncType)(virNodeDevicePtr dev); + +int +virNodeDeviceDestroyWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + int ret = -1; + static virNodeDeviceDestroyFuncType virNodeDeviceDestroySymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeDeviceDestroy", + (void**)&virNodeDeviceDestroySymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeDeviceDestroySymbol(dev); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeDeviceDetachFlagsFuncType)(virNodeDevicePtr dev, + const char * driverName, + unsigned int flags); + +int +virNodeDeviceDetachFlagsWrapper(virNodeDevicePtr dev, + const char * driverName, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virNodeDeviceDetachFlagsFuncType virNodeDeviceDetachFlagsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeDeviceDetachFlags", + (void**)&virNodeDeviceDetachFlagsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeDeviceDetachFlagsSymbol(dev, + driverName, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeDeviceDettachFuncType)(virNodeDevicePtr dev); + +int +virNodeDeviceDettachWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + int ret = -1; + static virNodeDeviceDettachFuncType virNodeDeviceDettachSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeDeviceDettach", + (void**)&virNodeDeviceDettachSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeDeviceDettachSymbol(dev); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeDeviceFreeFuncType)(virNodeDevicePtr dev); + +int +virNodeDeviceFreeWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + int ret = -1; + static virNodeDeviceFreeFuncType virNodeDeviceFreeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeDeviceFree", + (void**)&virNodeDeviceFreeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeDeviceFreeSymbol(dev); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeDeviceGetAutostartFuncType)(virNodeDevicePtr dev, + int * autostart); + +int +virNodeDeviceGetAutostartWrapper(virNodeDevicePtr dev, + int * autostart, + virErrorPtr err) +{ + int ret = -1; + static virNodeDeviceGetAutostartFuncType virNodeDeviceGetAutostartSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeDeviceGetAutostart", + (void**)&virNodeDeviceGetAutostartSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeDeviceGetAutostartSymbol(dev, + autostart); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef const char * +(*virNodeDeviceGetNameFuncType)(virNodeDevicePtr dev); + +const char * +virNodeDeviceGetNameWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + const char * ret = NULL; + static virNodeDeviceGetNameFuncType virNodeDeviceGetNameSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeDeviceGetName", + (void**)&virNodeDeviceGetNameSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeDeviceGetNameSymbol(dev); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef const char * +(*virNodeDeviceGetParentFuncType)(virNodeDevicePtr dev); + +const char * +virNodeDeviceGetParentWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + const char * ret = NULL; + static virNodeDeviceGetParentFuncType virNodeDeviceGetParentSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeDeviceGetParent", + (void**)&virNodeDeviceGetParentSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeDeviceGetParentSymbol(dev); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virNodeDeviceGetXMLDescFuncType)(virNodeDevicePtr dev, + unsigned int flags); + +char * +virNodeDeviceGetXMLDescWrapper(virNodeDevicePtr dev, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; + static virNodeDeviceGetXMLDescFuncType virNodeDeviceGetXMLDescSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeDeviceGetXMLDesc", + (void**)&virNodeDeviceGetXMLDescSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeDeviceGetXMLDescSymbol(dev, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeDeviceIsActiveFuncType)(virNodeDevicePtr dev); + +int +virNodeDeviceIsActiveWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + int ret = -1; + static virNodeDeviceIsActiveFuncType virNodeDeviceIsActiveSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeDeviceIsActive", + (void**)&virNodeDeviceIsActiveSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeDeviceIsActiveSymbol(dev); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeDeviceIsPersistentFuncType)(virNodeDevicePtr dev); + +int +virNodeDeviceIsPersistentWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + int ret = -1; + static virNodeDeviceIsPersistentFuncType virNodeDeviceIsPersistentSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeDeviceIsPersistent", + (void**)&virNodeDeviceIsPersistentSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeDeviceIsPersistentSymbol(dev); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeDeviceListCapsFuncType)(virNodeDevicePtr dev, + char ** const names, + int maxnames); + +int +virNodeDeviceListCapsWrapper(virNodeDevicePtr dev, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = -1; + static virNodeDeviceListCapsFuncType virNodeDeviceListCapsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeDeviceListCaps", + (void**)&virNodeDeviceListCapsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeDeviceListCapsSymbol(dev, + names, + maxnames); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virNodeDevicePtr +(*virNodeDeviceLookupByNameFuncType)(virConnectPtr conn, + const char * name); + +virNodeDevicePtr +virNodeDeviceLookupByNameWrapper(virConnectPtr conn, + const char * name, + virErrorPtr err) +{ + virNodeDevicePtr ret = NULL; + static virNodeDeviceLookupByNameFuncType virNodeDeviceLookupByNameSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeDeviceLookupByName", + (void**)&virNodeDeviceLookupByNameSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeDeviceLookupByNameSymbol(conn, + name); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virNodeDevicePtr +(*virNodeDeviceLookupSCSIHostByWWNFuncType)(virConnectPtr conn, + const char * wwnn, + const char * wwpn, + unsigned int flags); + +virNodeDevicePtr +virNodeDeviceLookupSCSIHostByWWNWrapper(virConnectPtr conn, + const char * wwnn, + const char * wwpn, + unsigned int flags, + virErrorPtr err) +{ + virNodeDevicePtr ret = NULL; + static virNodeDeviceLookupSCSIHostByWWNFuncType virNodeDeviceLookupSCSIHostByWWNSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeDeviceLookupSCSIHostByWWN", + (void**)&virNodeDeviceLookupSCSIHostByWWNSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeDeviceLookupSCSIHostByWWNSymbol(conn, + wwnn, + wwpn, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeDeviceNumOfCapsFuncType)(virNodeDevicePtr dev); + +int +virNodeDeviceNumOfCapsWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + int ret = -1; + static virNodeDeviceNumOfCapsFuncType virNodeDeviceNumOfCapsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeDeviceNumOfCaps", + (void**)&virNodeDeviceNumOfCapsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeDeviceNumOfCapsSymbol(dev); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeDeviceReAttachFuncType)(virNodeDevicePtr dev); + +int +virNodeDeviceReAttachWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + int ret = -1; + static virNodeDeviceReAttachFuncType virNodeDeviceReAttachSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeDeviceReAttach", + (void**)&virNodeDeviceReAttachSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeDeviceReAttachSymbol(dev); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeDeviceRefFuncType)(virNodeDevicePtr dev); + +int +virNodeDeviceRefWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + int ret = -1; + static virNodeDeviceRefFuncType virNodeDeviceRefSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeDeviceRef", + (void**)&virNodeDeviceRefSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeDeviceRefSymbol(dev); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeDeviceResetFuncType)(virNodeDevicePtr dev); + +int +virNodeDeviceResetWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + int ret = -1; + static virNodeDeviceResetFuncType virNodeDeviceResetSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeDeviceReset", + (void**)&virNodeDeviceResetSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeDeviceResetSymbol(dev); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeDeviceSetAutostartFuncType)(virNodeDevicePtr dev, + int autostart); + +int +virNodeDeviceSetAutostartWrapper(virNodeDevicePtr dev, + int autostart, + virErrorPtr err) +{ + int ret = -1; + static virNodeDeviceSetAutostartFuncType virNodeDeviceSetAutostartSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeDeviceSetAutostart", + (void**)&virNodeDeviceSetAutostartSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeDeviceSetAutostartSymbol(dev, + autostart); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeDeviceUndefineFuncType)(virNodeDevicePtr dev, + unsigned int flags); + +int +virNodeDeviceUndefineWrapper(virNodeDevicePtr dev, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virNodeDeviceUndefineFuncType virNodeDeviceUndefineSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeDeviceUndefine", + (void**)&virNodeDeviceUndefineSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeDeviceUndefineSymbol(dev, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeDeviceUpdateFuncType)(virNodeDevicePtr dev, + const char * xmlDesc, + unsigned int flags); + +int +virNodeDeviceUpdateWrapper(virNodeDevicePtr dev, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virNodeDeviceUpdateFuncType virNodeDeviceUpdateSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeDeviceUpdate", + (void**)&virNodeDeviceUpdateSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeDeviceUpdateSymbol(dev, + xmlDesc, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeListDevicesFuncType)(virConnectPtr conn, + const char * cap, + char ** const names, + int maxnames, + unsigned int flags); + +int +virNodeListDevicesWrapper(virConnectPtr conn, + const char * cap, + char ** const names, + int maxnames, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virNodeListDevicesFuncType virNodeListDevicesSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeListDevices", + (void**)&virNodeListDevicesSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeListDevicesSymbol(conn, + cap, + names, + maxnames, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNodeNumOfDevicesFuncType)(virConnectPtr conn, + const char * cap, + unsigned int flags); + +int +virNodeNumOfDevicesWrapper(virConnectPtr conn, + const char * cap, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virNodeNumOfDevicesFuncType virNodeNumOfDevicesSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNodeNumOfDevices", + (void**)&virNodeNumOfDevicesSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNodeNumOfDevicesSymbol(conn, + cap, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_nwfilter.go b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_nwfilter.go new file mode 100644 index 000000000..ff1399909 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_nwfilter.go @@ -0,0 +1,727 @@ +//go:build libvirt_dlopen +// +build libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo LDFLAGS: -ldl +#cgo CFLAGS: -DLIBVIRT_DLOPEN +#include +#include +#include +#include +#include "libvirt_generated_dlopen.h" +#include "error_helper.h" + + +typedef int +(*virConnectListAllNWFilterBindingsFuncType)(virConnectPtr conn, + virNWFilterBindingPtr ** bindings, + unsigned int flags); + +int +virConnectListAllNWFilterBindingsWrapper(virConnectPtr conn, + virNWFilterBindingPtr ** bindings, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virConnectListAllNWFilterBindingsFuncType virConnectListAllNWFilterBindingsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectListAllNWFilterBindings", + (void**)&virConnectListAllNWFilterBindingsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectListAllNWFilterBindingsSymbol(conn, + bindings, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectListAllNWFiltersFuncType)(virConnectPtr conn, + virNWFilterPtr ** filters, + unsigned int flags); + +int +virConnectListAllNWFiltersWrapper(virConnectPtr conn, + virNWFilterPtr ** filters, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virConnectListAllNWFiltersFuncType virConnectListAllNWFiltersSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectListAllNWFilters", + (void**)&virConnectListAllNWFiltersSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectListAllNWFiltersSymbol(conn, + filters, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectListNWFiltersFuncType)(virConnectPtr conn, + char ** const names, + int maxnames); + +int +virConnectListNWFiltersWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = -1; + static virConnectListNWFiltersFuncType virConnectListNWFiltersSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectListNWFilters", + (void**)&virConnectListNWFiltersSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectListNWFiltersSymbol(conn, + names, + maxnames); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectNumOfNWFiltersFuncType)(virConnectPtr conn); + +int +virConnectNumOfNWFiltersWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; + static virConnectNumOfNWFiltersFuncType virConnectNumOfNWFiltersSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectNumOfNWFilters", + (void**)&virConnectNumOfNWFiltersSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectNumOfNWFiltersSymbol(conn); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virNWFilterBindingPtr +(*virNWFilterBindingCreateXMLFuncType)(virConnectPtr conn, + const char * xml, + unsigned int flags); + +virNWFilterBindingPtr +virNWFilterBindingCreateXMLWrapper(virConnectPtr conn, + const char * xml, + unsigned int flags, + virErrorPtr err) +{ + virNWFilterBindingPtr ret = NULL; + static virNWFilterBindingCreateXMLFuncType virNWFilterBindingCreateXMLSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNWFilterBindingCreateXML", + (void**)&virNWFilterBindingCreateXMLSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNWFilterBindingCreateXMLSymbol(conn, + xml, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNWFilterBindingDeleteFuncType)(virNWFilterBindingPtr binding); + +int +virNWFilterBindingDeleteWrapper(virNWFilterBindingPtr binding, + virErrorPtr err) +{ + int ret = -1; + static virNWFilterBindingDeleteFuncType virNWFilterBindingDeleteSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNWFilterBindingDelete", + (void**)&virNWFilterBindingDeleteSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNWFilterBindingDeleteSymbol(binding); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNWFilterBindingFreeFuncType)(virNWFilterBindingPtr binding); + +int +virNWFilterBindingFreeWrapper(virNWFilterBindingPtr binding, + virErrorPtr err) +{ + int ret = -1; + static virNWFilterBindingFreeFuncType virNWFilterBindingFreeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNWFilterBindingFree", + (void**)&virNWFilterBindingFreeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNWFilterBindingFreeSymbol(binding); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef const char * +(*virNWFilterBindingGetFilterNameFuncType)(virNWFilterBindingPtr binding); + +const char * +virNWFilterBindingGetFilterNameWrapper(virNWFilterBindingPtr binding, + virErrorPtr err) +{ + const char * ret = NULL; + static virNWFilterBindingGetFilterNameFuncType virNWFilterBindingGetFilterNameSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNWFilterBindingGetFilterName", + (void**)&virNWFilterBindingGetFilterNameSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNWFilterBindingGetFilterNameSymbol(binding); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef const char * +(*virNWFilterBindingGetPortDevFuncType)(virNWFilterBindingPtr binding); + +const char * +virNWFilterBindingGetPortDevWrapper(virNWFilterBindingPtr binding, + virErrorPtr err) +{ + const char * ret = NULL; + static virNWFilterBindingGetPortDevFuncType virNWFilterBindingGetPortDevSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNWFilterBindingGetPortDev", + (void**)&virNWFilterBindingGetPortDevSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNWFilterBindingGetPortDevSymbol(binding); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virNWFilterBindingGetXMLDescFuncType)(virNWFilterBindingPtr binding, + unsigned int flags); + +char * +virNWFilterBindingGetXMLDescWrapper(virNWFilterBindingPtr binding, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; + static virNWFilterBindingGetXMLDescFuncType virNWFilterBindingGetXMLDescSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNWFilterBindingGetXMLDesc", + (void**)&virNWFilterBindingGetXMLDescSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNWFilterBindingGetXMLDescSymbol(binding, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virNWFilterBindingPtr +(*virNWFilterBindingLookupByPortDevFuncType)(virConnectPtr conn, + const char * portdev); + +virNWFilterBindingPtr +virNWFilterBindingLookupByPortDevWrapper(virConnectPtr conn, + const char * portdev, + virErrorPtr err) +{ + virNWFilterBindingPtr ret = NULL; + static virNWFilterBindingLookupByPortDevFuncType virNWFilterBindingLookupByPortDevSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNWFilterBindingLookupByPortDev", + (void**)&virNWFilterBindingLookupByPortDevSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNWFilterBindingLookupByPortDevSymbol(conn, + portdev); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNWFilterBindingRefFuncType)(virNWFilterBindingPtr binding); + +int +virNWFilterBindingRefWrapper(virNWFilterBindingPtr binding, + virErrorPtr err) +{ + int ret = -1; + static virNWFilterBindingRefFuncType virNWFilterBindingRefSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNWFilterBindingRef", + (void**)&virNWFilterBindingRefSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNWFilterBindingRefSymbol(binding); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virNWFilterPtr +(*virNWFilterDefineXMLFuncType)(virConnectPtr conn, + const char * xmlDesc); + +virNWFilterPtr +virNWFilterDefineXMLWrapper(virConnectPtr conn, + const char * xmlDesc, + virErrorPtr err) +{ + virNWFilterPtr ret = NULL; + static virNWFilterDefineXMLFuncType virNWFilterDefineXMLSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNWFilterDefineXML", + (void**)&virNWFilterDefineXMLSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNWFilterDefineXMLSymbol(conn, + xmlDesc); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virNWFilterPtr +(*virNWFilterDefineXMLFlagsFuncType)(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags); + +virNWFilterPtr +virNWFilterDefineXMLFlagsWrapper(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + virNWFilterPtr ret = NULL; + static virNWFilterDefineXMLFlagsFuncType virNWFilterDefineXMLFlagsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNWFilterDefineXMLFlags", + (void**)&virNWFilterDefineXMLFlagsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNWFilterDefineXMLFlagsSymbol(conn, + xmlDesc, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNWFilterFreeFuncType)(virNWFilterPtr nwfilter); + +int +virNWFilterFreeWrapper(virNWFilterPtr nwfilter, + virErrorPtr err) +{ + int ret = -1; + static virNWFilterFreeFuncType virNWFilterFreeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNWFilterFree", + (void**)&virNWFilterFreeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNWFilterFreeSymbol(nwfilter); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef const char * +(*virNWFilterGetNameFuncType)(virNWFilterPtr nwfilter); + +const char * +virNWFilterGetNameWrapper(virNWFilterPtr nwfilter, + virErrorPtr err) +{ + const char * ret = NULL; + static virNWFilterGetNameFuncType virNWFilterGetNameSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNWFilterGetName", + (void**)&virNWFilterGetNameSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNWFilterGetNameSymbol(nwfilter); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNWFilterGetUUIDFuncType)(virNWFilterPtr nwfilter, + unsigned char * uuid); + +int +virNWFilterGetUUIDWrapper(virNWFilterPtr nwfilter, + unsigned char * uuid, + virErrorPtr err) +{ + int ret = -1; + static virNWFilterGetUUIDFuncType virNWFilterGetUUIDSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNWFilterGetUUID", + (void**)&virNWFilterGetUUIDSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNWFilterGetUUIDSymbol(nwfilter, + uuid); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNWFilterGetUUIDStringFuncType)(virNWFilterPtr nwfilter, + char * buf); + +int +virNWFilterGetUUIDStringWrapper(virNWFilterPtr nwfilter, + char * buf, + virErrorPtr err) +{ + int ret = -1; + static virNWFilterGetUUIDStringFuncType virNWFilterGetUUIDStringSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNWFilterGetUUIDString", + (void**)&virNWFilterGetUUIDStringSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNWFilterGetUUIDStringSymbol(nwfilter, + buf); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virNWFilterGetXMLDescFuncType)(virNWFilterPtr nwfilter, + unsigned int flags); + +char * +virNWFilterGetXMLDescWrapper(virNWFilterPtr nwfilter, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; + static virNWFilterGetXMLDescFuncType virNWFilterGetXMLDescSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNWFilterGetXMLDesc", + (void**)&virNWFilterGetXMLDescSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNWFilterGetXMLDescSymbol(nwfilter, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virNWFilterPtr +(*virNWFilterLookupByNameFuncType)(virConnectPtr conn, + const char * name); + +virNWFilterPtr +virNWFilterLookupByNameWrapper(virConnectPtr conn, + const char * name, + virErrorPtr err) +{ + virNWFilterPtr ret = NULL; + static virNWFilterLookupByNameFuncType virNWFilterLookupByNameSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNWFilterLookupByName", + (void**)&virNWFilterLookupByNameSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNWFilterLookupByNameSymbol(conn, + name); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virNWFilterPtr +(*virNWFilterLookupByUUIDFuncType)(virConnectPtr conn, + const unsigned char * uuid); + +virNWFilterPtr +virNWFilterLookupByUUIDWrapper(virConnectPtr conn, + const unsigned char * uuid, + virErrorPtr err) +{ + virNWFilterPtr ret = NULL; + static virNWFilterLookupByUUIDFuncType virNWFilterLookupByUUIDSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNWFilterLookupByUUID", + (void**)&virNWFilterLookupByUUIDSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNWFilterLookupByUUIDSymbol(conn, + uuid); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virNWFilterPtr +(*virNWFilterLookupByUUIDStringFuncType)(virConnectPtr conn, + const char * uuidstr); + +virNWFilterPtr +virNWFilterLookupByUUIDStringWrapper(virConnectPtr conn, + const char * uuidstr, + virErrorPtr err) +{ + virNWFilterPtr ret = NULL; + static virNWFilterLookupByUUIDStringFuncType virNWFilterLookupByUUIDStringSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNWFilterLookupByUUIDString", + (void**)&virNWFilterLookupByUUIDStringSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNWFilterLookupByUUIDStringSymbol(conn, + uuidstr); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNWFilterRefFuncType)(virNWFilterPtr nwfilter); + +int +virNWFilterRefWrapper(virNWFilterPtr nwfilter, + virErrorPtr err) +{ + int ret = -1; + static virNWFilterRefFuncType virNWFilterRefSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNWFilterRef", + (void**)&virNWFilterRefSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNWFilterRefSymbol(nwfilter); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virNWFilterUndefineFuncType)(virNWFilterPtr nwfilter); + +int +virNWFilterUndefineWrapper(virNWFilterPtr nwfilter, + virErrorPtr err) +{ + int ret = -1; + static virNWFilterUndefineFuncType virNWFilterUndefineSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virNWFilterUndefine", + (void**)&virNWFilterUndefineSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virNWFilterUndefineSymbol(nwfilter); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_secret.go b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_secret.go new file mode 100644 index 000000000..8ed8f3a67 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_secret.go @@ -0,0 +1,638 @@ +//go:build libvirt_dlopen +// +build libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo LDFLAGS: -ldl +#cgo CFLAGS: -DLIBVIRT_DLOPEN +#include +#include +#include +#include +#include "libvirt_generated_dlopen.h" +#include "error_helper.h" + + +typedef int +(*virConnectListAllSecretsFuncType)(virConnectPtr conn, + virSecretPtr ** secrets, + unsigned int flags); + +int +virConnectListAllSecretsWrapper(virConnectPtr conn, + virSecretPtr ** secrets, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virConnectListAllSecretsFuncType virConnectListAllSecretsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectListAllSecrets", + (void**)&virConnectListAllSecretsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectListAllSecretsSymbol(conn, + secrets, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectListSecretsFuncType)(virConnectPtr conn, + char ** uuids, + int maxuuids); + +int +virConnectListSecretsWrapper(virConnectPtr conn, + char ** uuids, + int maxuuids, + virErrorPtr err) +{ + int ret = -1; + static virConnectListSecretsFuncType virConnectListSecretsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectListSecrets", + (void**)&virConnectListSecretsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectListSecretsSymbol(conn, + uuids, + maxuuids); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectNumOfSecretsFuncType)(virConnectPtr conn); + +int +virConnectNumOfSecretsWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; + static virConnectNumOfSecretsFuncType virConnectNumOfSecretsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectNumOfSecrets", + (void**)&virConnectNumOfSecretsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectNumOfSecretsSymbol(conn); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectSecretEventDeregisterAnyFuncType)(virConnectPtr conn, + int callbackID); + +int +virConnectSecretEventDeregisterAnyWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err) +{ + int ret = -1; + static virConnectSecretEventDeregisterAnyFuncType virConnectSecretEventDeregisterAnySymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectSecretEventDeregisterAny", + (void**)&virConnectSecretEventDeregisterAnySymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectSecretEventDeregisterAnySymbol(conn, + callbackID); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectSecretEventRegisterAnyFuncType)(virConnectPtr conn, + virSecretPtr secret, + int eventID, + virConnectSecretEventGenericCallback cb, + void * opaque, + virFreeCallback freecb); + +int +virConnectSecretEventRegisterAnyWrapper(virConnectPtr conn, + virSecretPtr secret, + int eventID, + virConnectSecretEventGenericCallback cb, + void * opaque, + virFreeCallback freecb, + virErrorPtr err) +{ + int ret = -1; + static virConnectSecretEventRegisterAnyFuncType virConnectSecretEventRegisterAnySymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectSecretEventRegisterAny", + (void**)&virConnectSecretEventRegisterAnySymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectSecretEventRegisterAnySymbol(conn, + secret, + eventID, + cb, + opaque, + freecb); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virSecretPtr +(*virSecretDefineXMLFuncType)(virConnectPtr conn, + const char * xml, + unsigned int flags); + +virSecretPtr +virSecretDefineXMLWrapper(virConnectPtr conn, + const char * xml, + unsigned int flags, + virErrorPtr err) +{ + virSecretPtr ret = NULL; + static virSecretDefineXMLFuncType virSecretDefineXMLSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virSecretDefineXML", + (void**)&virSecretDefineXMLSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virSecretDefineXMLSymbol(conn, + xml, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virSecretFreeFuncType)(virSecretPtr secret); + +int +virSecretFreeWrapper(virSecretPtr secret, + virErrorPtr err) +{ + int ret = -1; + static virSecretFreeFuncType virSecretFreeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virSecretFree", + (void**)&virSecretFreeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virSecretFreeSymbol(secret); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virConnectPtr +(*virSecretGetConnectFuncType)(virSecretPtr secret); + +virConnectPtr +virSecretGetConnectWrapper(virSecretPtr secret, + virErrorPtr err) +{ + virConnectPtr ret = NULL; + static virSecretGetConnectFuncType virSecretGetConnectSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virSecretGetConnect", + (void**)&virSecretGetConnectSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virSecretGetConnectSymbol(secret); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virSecretGetUUIDFuncType)(virSecretPtr secret, + unsigned char * uuid); + +int +virSecretGetUUIDWrapper(virSecretPtr secret, + unsigned char * uuid, + virErrorPtr err) +{ + int ret = -1; + static virSecretGetUUIDFuncType virSecretGetUUIDSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virSecretGetUUID", + (void**)&virSecretGetUUIDSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virSecretGetUUIDSymbol(secret, + uuid); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virSecretGetUUIDStringFuncType)(virSecretPtr secret, + char * buf); + +int +virSecretGetUUIDStringWrapper(virSecretPtr secret, + char * buf, + virErrorPtr err) +{ + int ret = -1; + static virSecretGetUUIDStringFuncType virSecretGetUUIDStringSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virSecretGetUUIDString", + (void**)&virSecretGetUUIDStringSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virSecretGetUUIDStringSymbol(secret, + buf); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef const char * +(*virSecretGetUsageIDFuncType)(virSecretPtr secret); + +const char * +virSecretGetUsageIDWrapper(virSecretPtr secret, + virErrorPtr err) +{ + const char * ret = NULL; + static virSecretGetUsageIDFuncType virSecretGetUsageIDSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virSecretGetUsageID", + (void**)&virSecretGetUsageIDSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virSecretGetUsageIDSymbol(secret); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virSecretGetUsageTypeFuncType)(virSecretPtr secret); + +int +virSecretGetUsageTypeWrapper(virSecretPtr secret, + virErrorPtr err) +{ + int ret = -1; + static virSecretGetUsageTypeFuncType virSecretGetUsageTypeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virSecretGetUsageType", + (void**)&virSecretGetUsageTypeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virSecretGetUsageTypeSymbol(secret); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef unsigned char * +(*virSecretGetValueFuncType)(virSecretPtr secret, + size_t * value_size, + unsigned int flags); + +unsigned char * +virSecretGetValueWrapper(virSecretPtr secret, + size_t * value_size, + unsigned int flags, + virErrorPtr err) +{ + unsigned char * ret = NULL; + static virSecretGetValueFuncType virSecretGetValueSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virSecretGetValue", + (void**)&virSecretGetValueSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virSecretGetValueSymbol(secret, + value_size, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virSecretGetXMLDescFuncType)(virSecretPtr secret, + unsigned int flags); + +char * +virSecretGetXMLDescWrapper(virSecretPtr secret, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; + static virSecretGetXMLDescFuncType virSecretGetXMLDescSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virSecretGetXMLDesc", + (void**)&virSecretGetXMLDescSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virSecretGetXMLDescSymbol(secret, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virSecretPtr +(*virSecretLookupByUUIDFuncType)(virConnectPtr conn, + const unsigned char * uuid); + +virSecretPtr +virSecretLookupByUUIDWrapper(virConnectPtr conn, + const unsigned char * uuid, + virErrorPtr err) +{ + virSecretPtr ret = NULL; + static virSecretLookupByUUIDFuncType virSecretLookupByUUIDSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virSecretLookupByUUID", + (void**)&virSecretLookupByUUIDSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virSecretLookupByUUIDSymbol(conn, + uuid); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virSecretPtr +(*virSecretLookupByUUIDStringFuncType)(virConnectPtr conn, + const char * uuidstr); + +virSecretPtr +virSecretLookupByUUIDStringWrapper(virConnectPtr conn, + const char * uuidstr, + virErrorPtr err) +{ + virSecretPtr ret = NULL; + static virSecretLookupByUUIDStringFuncType virSecretLookupByUUIDStringSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virSecretLookupByUUIDString", + (void**)&virSecretLookupByUUIDStringSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virSecretLookupByUUIDStringSymbol(conn, + uuidstr); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virSecretPtr +(*virSecretLookupByUsageFuncType)(virConnectPtr conn, + int usageType, + const char * usageID); + +virSecretPtr +virSecretLookupByUsageWrapper(virConnectPtr conn, + int usageType, + const char * usageID, + virErrorPtr err) +{ + virSecretPtr ret = NULL; + static virSecretLookupByUsageFuncType virSecretLookupByUsageSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virSecretLookupByUsage", + (void**)&virSecretLookupByUsageSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virSecretLookupByUsageSymbol(conn, + usageType, + usageID); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virSecretRefFuncType)(virSecretPtr secret); + +int +virSecretRefWrapper(virSecretPtr secret, + virErrorPtr err) +{ + int ret = -1; + static virSecretRefFuncType virSecretRefSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virSecretRef", + (void**)&virSecretRefSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virSecretRefSymbol(secret); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virSecretSetValueFuncType)(virSecretPtr secret, + const unsigned char * value, + size_t value_size, + unsigned int flags); + +int +virSecretSetValueWrapper(virSecretPtr secret, + const unsigned char * value, + size_t value_size, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virSecretSetValueFuncType virSecretSetValueSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virSecretSetValue", + (void**)&virSecretSetValueSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virSecretSetValueSymbol(secret, + value, + value_size, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virSecretUndefineFuncType)(virSecretPtr secret); + +int +virSecretUndefineWrapper(virSecretPtr secret, + virErrorPtr err) +{ + int ret = -1; + static virSecretUndefineFuncType virSecretUndefineSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virSecretUndefine", + (void**)&virSecretUndefineSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virSecretUndefineSymbol(secret); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_storage.go b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_storage.go new file mode 100644 index 000000000..4f78c3ebc --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_storage.go @@ -0,0 +1,1720 @@ +//go:build libvirt_dlopen +// +build libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo LDFLAGS: -ldl +#cgo CFLAGS: -DLIBVIRT_DLOPEN +#include +#include +#include +#include +#include "libvirt_generated_dlopen.h" +#include "error_helper.h" + + +typedef char * +(*virConnectFindStoragePoolSourcesFuncType)(virConnectPtr conn, + const char * type, + const char * srcSpec, + unsigned int flags); + +char * +virConnectFindStoragePoolSourcesWrapper(virConnectPtr conn, + const char * type, + const char * srcSpec, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; + static virConnectFindStoragePoolSourcesFuncType virConnectFindStoragePoolSourcesSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectFindStoragePoolSources", + (void**)&virConnectFindStoragePoolSourcesSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectFindStoragePoolSourcesSymbol(conn, + type, + srcSpec, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virConnectGetStoragePoolCapabilitiesFuncType)(virConnectPtr conn, + unsigned int flags); + +char * +virConnectGetStoragePoolCapabilitiesWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; + static virConnectGetStoragePoolCapabilitiesFuncType virConnectGetStoragePoolCapabilitiesSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectGetStoragePoolCapabilities", + (void**)&virConnectGetStoragePoolCapabilitiesSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectGetStoragePoolCapabilitiesSymbol(conn, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectListAllStoragePoolsFuncType)(virConnectPtr conn, + virStoragePoolPtr ** pools, + unsigned int flags); + +int +virConnectListAllStoragePoolsWrapper(virConnectPtr conn, + virStoragePoolPtr ** pools, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virConnectListAllStoragePoolsFuncType virConnectListAllStoragePoolsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectListAllStoragePools", + (void**)&virConnectListAllStoragePoolsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectListAllStoragePoolsSymbol(conn, + pools, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectListDefinedStoragePoolsFuncType)(virConnectPtr conn, + char ** const names, + int maxnames); + +int +virConnectListDefinedStoragePoolsWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = -1; + static virConnectListDefinedStoragePoolsFuncType virConnectListDefinedStoragePoolsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectListDefinedStoragePools", + (void**)&virConnectListDefinedStoragePoolsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectListDefinedStoragePoolsSymbol(conn, + names, + maxnames); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectListStoragePoolsFuncType)(virConnectPtr conn, + char ** const names, + int maxnames); + +int +virConnectListStoragePoolsWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = -1; + static virConnectListStoragePoolsFuncType virConnectListStoragePoolsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectListStoragePools", + (void**)&virConnectListStoragePoolsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectListStoragePoolsSymbol(conn, + names, + maxnames); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectNumOfDefinedStoragePoolsFuncType)(virConnectPtr conn); + +int +virConnectNumOfDefinedStoragePoolsWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; + static virConnectNumOfDefinedStoragePoolsFuncType virConnectNumOfDefinedStoragePoolsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectNumOfDefinedStoragePools", + (void**)&virConnectNumOfDefinedStoragePoolsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectNumOfDefinedStoragePoolsSymbol(conn); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectNumOfStoragePoolsFuncType)(virConnectPtr conn); + +int +virConnectNumOfStoragePoolsWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; + static virConnectNumOfStoragePoolsFuncType virConnectNumOfStoragePoolsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectNumOfStoragePools", + (void**)&virConnectNumOfStoragePoolsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectNumOfStoragePoolsSymbol(conn); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectStoragePoolEventDeregisterAnyFuncType)(virConnectPtr conn, + int callbackID); + +int +virConnectStoragePoolEventDeregisterAnyWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err) +{ + int ret = -1; + static virConnectStoragePoolEventDeregisterAnyFuncType virConnectStoragePoolEventDeregisterAnySymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectStoragePoolEventDeregisterAny", + (void**)&virConnectStoragePoolEventDeregisterAnySymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectStoragePoolEventDeregisterAnySymbol(conn, + callbackID); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectStoragePoolEventRegisterAnyFuncType)(virConnectPtr conn, + virStoragePoolPtr pool, + int eventID, + virConnectStoragePoolEventGenericCallback cb, + void * opaque, + virFreeCallback freecb); + +int +virConnectStoragePoolEventRegisterAnyWrapper(virConnectPtr conn, + virStoragePoolPtr pool, + int eventID, + virConnectStoragePoolEventGenericCallback cb, + void * opaque, + virFreeCallback freecb, + virErrorPtr err) +{ + int ret = -1; + static virConnectStoragePoolEventRegisterAnyFuncType virConnectStoragePoolEventRegisterAnySymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnectStoragePoolEventRegisterAny", + (void**)&virConnectStoragePoolEventRegisterAnySymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectStoragePoolEventRegisterAnySymbol(conn, + pool, + eventID, + cb, + opaque, + freecb); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStoragePoolBuildFuncType)(virStoragePoolPtr pool, + unsigned int flags); + +int +virStoragePoolBuildWrapper(virStoragePoolPtr pool, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virStoragePoolBuildFuncType virStoragePoolBuildSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStoragePoolBuild", + (void**)&virStoragePoolBuildSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStoragePoolBuildSymbol(pool, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStoragePoolCreateFuncType)(virStoragePoolPtr pool, + unsigned int flags); + +int +virStoragePoolCreateWrapper(virStoragePoolPtr pool, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virStoragePoolCreateFuncType virStoragePoolCreateSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStoragePoolCreate", + (void**)&virStoragePoolCreateSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStoragePoolCreateSymbol(pool, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virStoragePoolPtr +(*virStoragePoolCreateXMLFuncType)(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags); + +virStoragePoolPtr +virStoragePoolCreateXMLWrapper(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + virStoragePoolPtr ret = NULL; + static virStoragePoolCreateXMLFuncType virStoragePoolCreateXMLSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStoragePoolCreateXML", + (void**)&virStoragePoolCreateXMLSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStoragePoolCreateXMLSymbol(conn, + xmlDesc, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virStoragePoolPtr +(*virStoragePoolDefineXMLFuncType)(virConnectPtr conn, + const char * xml, + unsigned int flags); + +virStoragePoolPtr +virStoragePoolDefineXMLWrapper(virConnectPtr conn, + const char * xml, + unsigned int flags, + virErrorPtr err) +{ + virStoragePoolPtr ret = NULL; + static virStoragePoolDefineXMLFuncType virStoragePoolDefineXMLSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStoragePoolDefineXML", + (void**)&virStoragePoolDefineXMLSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStoragePoolDefineXMLSymbol(conn, + xml, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStoragePoolDeleteFuncType)(virStoragePoolPtr pool, + unsigned int flags); + +int +virStoragePoolDeleteWrapper(virStoragePoolPtr pool, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virStoragePoolDeleteFuncType virStoragePoolDeleteSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStoragePoolDelete", + (void**)&virStoragePoolDeleteSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStoragePoolDeleteSymbol(pool, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStoragePoolDestroyFuncType)(virStoragePoolPtr pool); + +int +virStoragePoolDestroyWrapper(virStoragePoolPtr pool, + virErrorPtr err) +{ + int ret = -1; + static virStoragePoolDestroyFuncType virStoragePoolDestroySymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStoragePoolDestroy", + (void**)&virStoragePoolDestroySymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStoragePoolDestroySymbol(pool); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStoragePoolFreeFuncType)(virStoragePoolPtr pool); + +int +virStoragePoolFreeWrapper(virStoragePoolPtr pool, + virErrorPtr err) +{ + int ret = -1; + static virStoragePoolFreeFuncType virStoragePoolFreeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStoragePoolFree", + (void**)&virStoragePoolFreeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStoragePoolFreeSymbol(pool); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStoragePoolGetAutostartFuncType)(virStoragePoolPtr pool, + int * autostart); + +int +virStoragePoolGetAutostartWrapper(virStoragePoolPtr pool, + int * autostart, + virErrorPtr err) +{ + int ret = -1; + static virStoragePoolGetAutostartFuncType virStoragePoolGetAutostartSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStoragePoolGetAutostart", + (void**)&virStoragePoolGetAutostartSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStoragePoolGetAutostartSymbol(pool, + autostart); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virConnectPtr +(*virStoragePoolGetConnectFuncType)(virStoragePoolPtr pool); + +virConnectPtr +virStoragePoolGetConnectWrapper(virStoragePoolPtr pool, + virErrorPtr err) +{ + virConnectPtr ret = NULL; + static virStoragePoolGetConnectFuncType virStoragePoolGetConnectSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStoragePoolGetConnect", + (void**)&virStoragePoolGetConnectSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStoragePoolGetConnectSymbol(pool); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStoragePoolGetInfoFuncType)(virStoragePoolPtr pool, + virStoragePoolInfoPtr info); + +int +virStoragePoolGetInfoWrapper(virStoragePoolPtr pool, + virStoragePoolInfoPtr info, + virErrorPtr err) +{ + int ret = -1; + static virStoragePoolGetInfoFuncType virStoragePoolGetInfoSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStoragePoolGetInfo", + (void**)&virStoragePoolGetInfoSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStoragePoolGetInfoSymbol(pool, + info); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef const char * +(*virStoragePoolGetNameFuncType)(virStoragePoolPtr pool); + +const char * +virStoragePoolGetNameWrapper(virStoragePoolPtr pool, + virErrorPtr err) +{ + const char * ret = NULL; + static virStoragePoolGetNameFuncType virStoragePoolGetNameSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStoragePoolGetName", + (void**)&virStoragePoolGetNameSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStoragePoolGetNameSymbol(pool); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStoragePoolGetUUIDFuncType)(virStoragePoolPtr pool, + unsigned char * uuid); + +int +virStoragePoolGetUUIDWrapper(virStoragePoolPtr pool, + unsigned char * uuid, + virErrorPtr err) +{ + int ret = -1; + static virStoragePoolGetUUIDFuncType virStoragePoolGetUUIDSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStoragePoolGetUUID", + (void**)&virStoragePoolGetUUIDSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStoragePoolGetUUIDSymbol(pool, + uuid); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStoragePoolGetUUIDStringFuncType)(virStoragePoolPtr pool, + char * buf); + +int +virStoragePoolGetUUIDStringWrapper(virStoragePoolPtr pool, + char * buf, + virErrorPtr err) +{ + int ret = -1; + static virStoragePoolGetUUIDStringFuncType virStoragePoolGetUUIDStringSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStoragePoolGetUUIDString", + (void**)&virStoragePoolGetUUIDStringSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStoragePoolGetUUIDStringSymbol(pool, + buf); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virStoragePoolGetXMLDescFuncType)(virStoragePoolPtr pool, + unsigned int flags); + +char * +virStoragePoolGetXMLDescWrapper(virStoragePoolPtr pool, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; + static virStoragePoolGetXMLDescFuncType virStoragePoolGetXMLDescSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStoragePoolGetXMLDesc", + (void**)&virStoragePoolGetXMLDescSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStoragePoolGetXMLDescSymbol(pool, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStoragePoolIsActiveFuncType)(virStoragePoolPtr pool); + +int +virStoragePoolIsActiveWrapper(virStoragePoolPtr pool, + virErrorPtr err) +{ + int ret = -1; + static virStoragePoolIsActiveFuncType virStoragePoolIsActiveSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStoragePoolIsActive", + (void**)&virStoragePoolIsActiveSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStoragePoolIsActiveSymbol(pool); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStoragePoolIsPersistentFuncType)(virStoragePoolPtr pool); + +int +virStoragePoolIsPersistentWrapper(virStoragePoolPtr pool, + virErrorPtr err) +{ + int ret = -1; + static virStoragePoolIsPersistentFuncType virStoragePoolIsPersistentSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStoragePoolIsPersistent", + (void**)&virStoragePoolIsPersistentSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStoragePoolIsPersistentSymbol(pool); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStoragePoolListAllVolumesFuncType)(virStoragePoolPtr pool, + virStorageVolPtr ** vols, + unsigned int flags); + +int +virStoragePoolListAllVolumesWrapper(virStoragePoolPtr pool, + virStorageVolPtr ** vols, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virStoragePoolListAllVolumesFuncType virStoragePoolListAllVolumesSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStoragePoolListAllVolumes", + (void**)&virStoragePoolListAllVolumesSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStoragePoolListAllVolumesSymbol(pool, + vols, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStoragePoolListVolumesFuncType)(virStoragePoolPtr pool, + char ** const names, + int maxnames); + +int +virStoragePoolListVolumesWrapper(virStoragePoolPtr pool, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = -1; + static virStoragePoolListVolumesFuncType virStoragePoolListVolumesSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStoragePoolListVolumes", + (void**)&virStoragePoolListVolumesSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStoragePoolListVolumesSymbol(pool, + names, + maxnames); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virStoragePoolPtr +(*virStoragePoolLookupByNameFuncType)(virConnectPtr conn, + const char * name); + +virStoragePoolPtr +virStoragePoolLookupByNameWrapper(virConnectPtr conn, + const char * name, + virErrorPtr err) +{ + virStoragePoolPtr ret = NULL; + static virStoragePoolLookupByNameFuncType virStoragePoolLookupByNameSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStoragePoolLookupByName", + (void**)&virStoragePoolLookupByNameSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStoragePoolLookupByNameSymbol(conn, + name); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virStoragePoolPtr +(*virStoragePoolLookupByTargetPathFuncType)(virConnectPtr conn, + const char * path); + +virStoragePoolPtr +virStoragePoolLookupByTargetPathWrapper(virConnectPtr conn, + const char * path, + virErrorPtr err) +{ + virStoragePoolPtr ret = NULL; + static virStoragePoolLookupByTargetPathFuncType virStoragePoolLookupByTargetPathSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStoragePoolLookupByTargetPath", + (void**)&virStoragePoolLookupByTargetPathSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStoragePoolLookupByTargetPathSymbol(conn, + path); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virStoragePoolPtr +(*virStoragePoolLookupByUUIDFuncType)(virConnectPtr conn, + const unsigned char * uuid); + +virStoragePoolPtr +virStoragePoolLookupByUUIDWrapper(virConnectPtr conn, + const unsigned char * uuid, + virErrorPtr err) +{ + virStoragePoolPtr ret = NULL; + static virStoragePoolLookupByUUIDFuncType virStoragePoolLookupByUUIDSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStoragePoolLookupByUUID", + (void**)&virStoragePoolLookupByUUIDSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStoragePoolLookupByUUIDSymbol(conn, + uuid); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virStoragePoolPtr +(*virStoragePoolLookupByUUIDStringFuncType)(virConnectPtr conn, + const char * uuidstr); + +virStoragePoolPtr +virStoragePoolLookupByUUIDStringWrapper(virConnectPtr conn, + const char * uuidstr, + virErrorPtr err) +{ + virStoragePoolPtr ret = NULL; + static virStoragePoolLookupByUUIDStringFuncType virStoragePoolLookupByUUIDStringSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStoragePoolLookupByUUIDString", + (void**)&virStoragePoolLookupByUUIDStringSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStoragePoolLookupByUUIDStringSymbol(conn, + uuidstr); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virStoragePoolPtr +(*virStoragePoolLookupByVolumeFuncType)(virStorageVolPtr vol); + +virStoragePoolPtr +virStoragePoolLookupByVolumeWrapper(virStorageVolPtr vol, + virErrorPtr err) +{ + virStoragePoolPtr ret = NULL; + static virStoragePoolLookupByVolumeFuncType virStoragePoolLookupByVolumeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStoragePoolLookupByVolume", + (void**)&virStoragePoolLookupByVolumeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStoragePoolLookupByVolumeSymbol(vol); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStoragePoolNumOfVolumesFuncType)(virStoragePoolPtr pool); + +int +virStoragePoolNumOfVolumesWrapper(virStoragePoolPtr pool, + virErrorPtr err) +{ + int ret = -1; + static virStoragePoolNumOfVolumesFuncType virStoragePoolNumOfVolumesSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStoragePoolNumOfVolumes", + (void**)&virStoragePoolNumOfVolumesSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStoragePoolNumOfVolumesSymbol(pool); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStoragePoolRefFuncType)(virStoragePoolPtr pool); + +int +virStoragePoolRefWrapper(virStoragePoolPtr pool, + virErrorPtr err) +{ + int ret = -1; + static virStoragePoolRefFuncType virStoragePoolRefSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStoragePoolRef", + (void**)&virStoragePoolRefSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStoragePoolRefSymbol(pool); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStoragePoolRefreshFuncType)(virStoragePoolPtr pool, + unsigned int flags); + +int +virStoragePoolRefreshWrapper(virStoragePoolPtr pool, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virStoragePoolRefreshFuncType virStoragePoolRefreshSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStoragePoolRefresh", + (void**)&virStoragePoolRefreshSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStoragePoolRefreshSymbol(pool, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStoragePoolSetAutostartFuncType)(virStoragePoolPtr pool, + int autostart); + +int +virStoragePoolSetAutostartWrapper(virStoragePoolPtr pool, + int autostart, + virErrorPtr err) +{ + int ret = -1; + static virStoragePoolSetAutostartFuncType virStoragePoolSetAutostartSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStoragePoolSetAutostart", + (void**)&virStoragePoolSetAutostartSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStoragePoolSetAutostartSymbol(pool, + autostart); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStoragePoolUndefineFuncType)(virStoragePoolPtr pool); + +int +virStoragePoolUndefineWrapper(virStoragePoolPtr pool, + virErrorPtr err) +{ + int ret = -1; + static virStoragePoolUndefineFuncType virStoragePoolUndefineSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStoragePoolUndefine", + (void**)&virStoragePoolUndefineSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStoragePoolUndefineSymbol(pool); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virStorageVolPtr +(*virStorageVolCreateXMLFuncType)(virStoragePoolPtr pool, + const char * xmlDesc, + unsigned int flags); + +virStorageVolPtr +virStorageVolCreateXMLWrapper(virStoragePoolPtr pool, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + virStorageVolPtr ret = NULL; + static virStorageVolCreateXMLFuncType virStorageVolCreateXMLSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStorageVolCreateXML", + (void**)&virStorageVolCreateXMLSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStorageVolCreateXMLSymbol(pool, + xmlDesc, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virStorageVolPtr +(*virStorageVolCreateXMLFromFuncType)(virStoragePoolPtr pool, + const char * xmlDesc, + virStorageVolPtr clonevol, + unsigned int flags); + +virStorageVolPtr +virStorageVolCreateXMLFromWrapper(virStoragePoolPtr pool, + const char * xmlDesc, + virStorageVolPtr clonevol, + unsigned int flags, + virErrorPtr err) +{ + virStorageVolPtr ret = NULL; + static virStorageVolCreateXMLFromFuncType virStorageVolCreateXMLFromSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStorageVolCreateXMLFrom", + (void**)&virStorageVolCreateXMLFromSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStorageVolCreateXMLFromSymbol(pool, + xmlDesc, + clonevol, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStorageVolDeleteFuncType)(virStorageVolPtr vol, + unsigned int flags); + +int +virStorageVolDeleteWrapper(virStorageVolPtr vol, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virStorageVolDeleteFuncType virStorageVolDeleteSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStorageVolDelete", + (void**)&virStorageVolDeleteSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStorageVolDeleteSymbol(vol, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStorageVolDownloadFuncType)(virStorageVolPtr vol, + virStreamPtr stream, + unsigned long long offset, + unsigned long long length, + unsigned int flags); + +int +virStorageVolDownloadWrapper(virStorageVolPtr vol, + virStreamPtr stream, + unsigned long long offset, + unsigned long long length, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virStorageVolDownloadFuncType virStorageVolDownloadSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStorageVolDownload", + (void**)&virStorageVolDownloadSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStorageVolDownloadSymbol(vol, + stream, + offset, + length, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStorageVolFreeFuncType)(virStorageVolPtr vol); + +int +virStorageVolFreeWrapper(virStorageVolPtr vol, + virErrorPtr err) +{ + int ret = -1; + static virStorageVolFreeFuncType virStorageVolFreeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStorageVolFree", + (void**)&virStorageVolFreeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStorageVolFreeSymbol(vol); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virConnectPtr +(*virStorageVolGetConnectFuncType)(virStorageVolPtr vol); + +virConnectPtr +virStorageVolGetConnectWrapper(virStorageVolPtr vol, + virErrorPtr err) +{ + virConnectPtr ret = NULL; + static virStorageVolGetConnectFuncType virStorageVolGetConnectSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStorageVolGetConnect", + (void**)&virStorageVolGetConnectSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStorageVolGetConnectSymbol(vol); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStorageVolGetInfoFuncType)(virStorageVolPtr vol, + virStorageVolInfoPtr info); + +int +virStorageVolGetInfoWrapper(virStorageVolPtr vol, + virStorageVolInfoPtr info, + virErrorPtr err) +{ + int ret = -1; + static virStorageVolGetInfoFuncType virStorageVolGetInfoSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStorageVolGetInfo", + (void**)&virStorageVolGetInfoSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStorageVolGetInfoSymbol(vol, + info); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStorageVolGetInfoFlagsFuncType)(virStorageVolPtr vol, + virStorageVolInfoPtr info, + unsigned int flags); + +int +virStorageVolGetInfoFlagsWrapper(virStorageVolPtr vol, + virStorageVolInfoPtr info, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virStorageVolGetInfoFlagsFuncType virStorageVolGetInfoFlagsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStorageVolGetInfoFlags", + (void**)&virStorageVolGetInfoFlagsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStorageVolGetInfoFlagsSymbol(vol, + info, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef const char * +(*virStorageVolGetKeyFuncType)(virStorageVolPtr vol); + +const char * +virStorageVolGetKeyWrapper(virStorageVolPtr vol, + virErrorPtr err) +{ + const char * ret = NULL; + static virStorageVolGetKeyFuncType virStorageVolGetKeySymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStorageVolGetKey", + (void**)&virStorageVolGetKeySymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStorageVolGetKeySymbol(vol); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef const char * +(*virStorageVolGetNameFuncType)(virStorageVolPtr vol); + +const char * +virStorageVolGetNameWrapper(virStorageVolPtr vol, + virErrorPtr err) +{ + const char * ret = NULL; + static virStorageVolGetNameFuncType virStorageVolGetNameSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStorageVolGetName", + (void**)&virStorageVolGetNameSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStorageVolGetNameSymbol(vol); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virStorageVolGetPathFuncType)(virStorageVolPtr vol); + +char * +virStorageVolGetPathWrapper(virStorageVolPtr vol, + virErrorPtr err) +{ + char * ret = NULL; + static virStorageVolGetPathFuncType virStorageVolGetPathSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStorageVolGetPath", + (void**)&virStorageVolGetPathSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStorageVolGetPathSymbol(vol); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virStorageVolGetXMLDescFuncType)(virStorageVolPtr vol, + unsigned int flags); + +char * +virStorageVolGetXMLDescWrapper(virStorageVolPtr vol, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; + static virStorageVolGetXMLDescFuncType virStorageVolGetXMLDescSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStorageVolGetXMLDesc", + (void**)&virStorageVolGetXMLDescSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStorageVolGetXMLDescSymbol(vol, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virStorageVolPtr +(*virStorageVolLookupByKeyFuncType)(virConnectPtr conn, + const char * key); + +virStorageVolPtr +virStorageVolLookupByKeyWrapper(virConnectPtr conn, + const char * key, + virErrorPtr err) +{ + virStorageVolPtr ret = NULL; + static virStorageVolLookupByKeyFuncType virStorageVolLookupByKeySymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStorageVolLookupByKey", + (void**)&virStorageVolLookupByKeySymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStorageVolLookupByKeySymbol(conn, + key); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virStorageVolPtr +(*virStorageVolLookupByNameFuncType)(virStoragePoolPtr pool, + const char * name); + +virStorageVolPtr +virStorageVolLookupByNameWrapper(virStoragePoolPtr pool, + const char * name, + virErrorPtr err) +{ + virStorageVolPtr ret = NULL; + static virStorageVolLookupByNameFuncType virStorageVolLookupByNameSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStorageVolLookupByName", + (void**)&virStorageVolLookupByNameSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStorageVolLookupByNameSymbol(pool, + name); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virStorageVolPtr +(*virStorageVolLookupByPathFuncType)(virConnectPtr conn, + const char * path); + +virStorageVolPtr +virStorageVolLookupByPathWrapper(virConnectPtr conn, + const char * path, + virErrorPtr err) +{ + virStorageVolPtr ret = NULL; + static virStorageVolLookupByPathFuncType virStorageVolLookupByPathSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStorageVolLookupByPath", + (void**)&virStorageVolLookupByPathSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStorageVolLookupByPathSymbol(conn, + path); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStorageVolRefFuncType)(virStorageVolPtr vol); + +int +virStorageVolRefWrapper(virStorageVolPtr vol, + virErrorPtr err) +{ + int ret = -1; + static virStorageVolRefFuncType virStorageVolRefSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStorageVolRef", + (void**)&virStorageVolRefSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStorageVolRefSymbol(vol); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStorageVolResizeFuncType)(virStorageVolPtr vol, + unsigned long long capacity, + unsigned int flags); + +int +virStorageVolResizeWrapper(virStorageVolPtr vol, + unsigned long long capacity, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virStorageVolResizeFuncType virStorageVolResizeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStorageVolResize", + (void**)&virStorageVolResizeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStorageVolResizeSymbol(vol, + capacity, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStorageVolUploadFuncType)(virStorageVolPtr vol, + virStreamPtr stream, + unsigned long long offset, + unsigned long long length, + unsigned int flags); + +int +virStorageVolUploadWrapper(virStorageVolPtr vol, + virStreamPtr stream, + unsigned long long offset, + unsigned long long length, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virStorageVolUploadFuncType virStorageVolUploadSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStorageVolUpload", + (void**)&virStorageVolUploadSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStorageVolUploadSymbol(vol, + stream, + offset, + length, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStorageVolWipeFuncType)(virStorageVolPtr vol, + unsigned int flags); + +int +virStorageVolWipeWrapper(virStorageVolPtr vol, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virStorageVolWipeFuncType virStorageVolWipeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStorageVolWipe", + (void**)&virStorageVolWipeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStorageVolWipeSymbol(vol, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStorageVolWipePatternFuncType)(virStorageVolPtr vol, + unsigned int algorithm, + unsigned int flags); + +int +virStorageVolWipePatternWrapper(virStorageVolPtr vol, + unsigned int algorithm, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virStorageVolWipePatternFuncType virStorageVolWipePatternSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStorageVolWipePattern", + (void**)&virStorageVolWipePatternSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStorageVolWipePatternSymbol(vol, + algorithm, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_stream.go b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_stream.go new file mode 100644 index 000000000..a2cc654ae --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_stream.go @@ -0,0 +1,572 @@ +//go:build libvirt_dlopen +// +build libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo LDFLAGS: -ldl +#cgo CFLAGS: -DLIBVIRT_DLOPEN +#include +#include +#include +#include +#include "libvirt_generated_dlopen.h" +#include "error_helper.h" + + +typedef int +(*virStreamAbortFuncType)(virStreamPtr stream); + +int +virStreamAbortWrapper(virStreamPtr stream, + virErrorPtr err) +{ + int ret = -1; + static virStreamAbortFuncType virStreamAbortSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStreamAbort", + (void**)&virStreamAbortSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStreamAbortSymbol(stream); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStreamEventAddCallbackFuncType)(virStreamPtr stream, + int events, + virStreamEventCallback cb, + void * opaque, + virFreeCallback ff); + +int +virStreamEventAddCallbackWrapper(virStreamPtr stream, + int events, + virStreamEventCallback cb, + void * opaque, + virFreeCallback ff, + virErrorPtr err) +{ + int ret = -1; + static virStreamEventAddCallbackFuncType virStreamEventAddCallbackSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStreamEventAddCallback", + (void**)&virStreamEventAddCallbackSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStreamEventAddCallbackSymbol(stream, + events, + cb, + opaque, + ff); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStreamEventRemoveCallbackFuncType)(virStreamPtr stream); + +int +virStreamEventRemoveCallbackWrapper(virStreamPtr stream, + virErrorPtr err) +{ + int ret = -1; + static virStreamEventRemoveCallbackFuncType virStreamEventRemoveCallbackSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStreamEventRemoveCallback", + (void**)&virStreamEventRemoveCallbackSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStreamEventRemoveCallbackSymbol(stream); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStreamEventUpdateCallbackFuncType)(virStreamPtr stream, + int events); + +int +virStreamEventUpdateCallbackWrapper(virStreamPtr stream, + int events, + virErrorPtr err) +{ + int ret = -1; + static virStreamEventUpdateCallbackFuncType virStreamEventUpdateCallbackSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStreamEventUpdateCallback", + (void**)&virStreamEventUpdateCallbackSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStreamEventUpdateCallbackSymbol(stream, + events); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStreamFinishFuncType)(virStreamPtr stream); + +int +virStreamFinishWrapper(virStreamPtr stream, + virErrorPtr err) +{ + int ret = -1; + static virStreamFinishFuncType virStreamFinishSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStreamFinish", + (void**)&virStreamFinishSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStreamFinishSymbol(stream); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStreamFreeFuncType)(virStreamPtr stream); + +int +virStreamFreeWrapper(virStreamPtr stream, + virErrorPtr err) +{ + int ret = -1; + static virStreamFreeFuncType virStreamFreeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStreamFree", + (void**)&virStreamFreeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStreamFreeSymbol(stream); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virStreamPtr +(*virStreamNewFuncType)(virConnectPtr conn, + unsigned int flags); + +virStreamPtr +virStreamNewWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err) +{ + virStreamPtr ret = NULL; + static virStreamNewFuncType virStreamNewSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStreamNew", + (void**)&virStreamNewSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStreamNewSymbol(conn, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStreamRecvFuncType)(virStreamPtr stream, + char * data, + size_t nbytes); + +int +virStreamRecvWrapper(virStreamPtr stream, + char * data, + size_t nbytes, + virErrorPtr err) +{ + int ret = -1; + static virStreamRecvFuncType virStreamRecvSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStreamRecv", + (void**)&virStreamRecvSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStreamRecvSymbol(stream, + data, + nbytes); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStreamRecvAllFuncType)(virStreamPtr stream, + virStreamSinkFunc handler, + void * opaque); + +int +virStreamRecvAllWrapper(virStreamPtr stream, + virStreamSinkFunc handler, + void * opaque, + virErrorPtr err) +{ + int ret = -1; + static virStreamRecvAllFuncType virStreamRecvAllSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStreamRecvAll", + (void**)&virStreamRecvAllSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStreamRecvAllSymbol(stream, + handler, + opaque); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStreamRecvFlagsFuncType)(virStreamPtr stream, + char * data, + size_t nbytes, + unsigned int flags); + +int +virStreamRecvFlagsWrapper(virStreamPtr stream, + char * data, + size_t nbytes, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virStreamRecvFlagsFuncType virStreamRecvFlagsSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStreamRecvFlags", + (void**)&virStreamRecvFlagsSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStreamRecvFlagsSymbol(stream, + data, + nbytes, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStreamRecvHoleFuncType)(virStreamPtr stream, + long long * length, + unsigned int flags); + +int +virStreamRecvHoleWrapper(virStreamPtr stream, + long long * length, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virStreamRecvHoleFuncType virStreamRecvHoleSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStreamRecvHole", + (void**)&virStreamRecvHoleSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStreamRecvHoleSymbol(stream, + length, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStreamRefFuncType)(virStreamPtr stream); + +int +virStreamRefWrapper(virStreamPtr stream, + virErrorPtr err) +{ + int ret = -1; + static virStreamRefFuncType virStreamRefSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStreamRef", + (void**)&virStreamRefSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStreamRefSymbol(stream); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStreamSendFuncType)(virStreamPtr stream, + const char * data, + size_t nbytes); + +int +virStreamSendWrapper(virStreamPtr stream, + const char * data, + size_t nbytes, + virErrorPtr err) +{ + int ret = -1; + static virStreamSendFuncType virStreamSendSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStreamSend", + (void**)&virStreamSendSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStreamSendSymbol(stream, + data, + nbytes); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStreamSendAllFuncType)(virStreamPtr stream, + virStreamSourceFunc handler, + void * opaque); + +int +virStreamSendAllWrapper(virStreamPtr stream, + virStreamSourceFunc handler, + void * opaque, + virErrorPtr err) +{ + int ret = -1; + static virStreamSendAllFuncType virStreamSendAllSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStreamSendAll", + (void**)&virStreamSendAllSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStreamSendAllSymbol(stream, + handler, + opaque); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStreamSendHoleFuncType)(virStreamPtr stream, + long long length, + unsigned int flags); + +int +virStreamSendHoleWrapper(virStreamPtr stream, + long long length, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virStreamSendHoleFuncType virStreamSendHoleSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStreamSendHole", + (void**)&virStreamSendHoleSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStreamSendHoleSymbol(stream, + length, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStreamSparseRecvAllFuncType)(virStreamPtr stream, + virStreamSinkFunc handler, + virStreamSinkHoleFunc holeHandler, + void * opaque); + +int +virStreamSparseRecvAllWrapper(virStreamPtr stream, + virStreamSinkFunc handler, + virStreamSinkHoleFunc holeHandler, + void * opaque, + virErrorPtr err) +{ + int ret = -1; + static virStreamSparseRecvAllFuncType virStreamSparseRecvAllSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStreamSparseRecvAll", + (void**)&virStreamSparseRecvAllSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStreamSparseRecvAllSymbol(stream, + handler, + holeHandler, + opaque); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virStreamSparseSendAllFuncType)(virStreamPtr stream, + virStreamSourceFunc handler, + virStreamSourceHoleFunc holeHandler, + virStreamSourceSkipFunc skipHandler, + void * opaque); + +int +virStreamSparseSendAllWrapper(virStreamPtr stream, + virStreamSourceFunc handler, + virStreamSourceHoleFunc holeHandler, + virStreamSourceSkipFunc skipHandler, + void * opaque, + virErrorPtr err) +{ + int ret = -1; + static virStreamSparseSendAllFuncType virStreamSparseSendAllSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virStreamSparseSendAll", + (void**)&virStreamSparseSendAllSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virStreamSparseSendAllSymbol(stream, + handler, + holeHandler, + skipHandler, + opaque); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_virterror.go b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_virterror.go new file mode 100644 index 000000000..136181fef --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_dlopen_virterror.go @@ -0,0 +1,407 @@ +//go:build libvirt_dlopen +// +build libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo LDFLAGS: -ldl +#cgo CFLAGS: -DLIBVIRT_DLOPEN +#include +#include +#include +#include +#include "libvirt_generated_dlopen.h" +#include "error_helper.h" + + +typedef int +(*virConnCopyLastErrorFuncType)(virConnectPtr conn, + virErrorPtr to); + +int +virConnCopyLastErrorWrapper(virConnectPtr conn, + virErrorPtr to, + virErrorPtr err) +{ + int ret = -1; + static virConnCopyLastErrorFuncType virConnCopyLastErrorSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnCopyLastError", + (void**)&virConnCopyLastErrorSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnCopyLastErrorSymbol(conn, + to); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virErrorPtr +(*virConnGetLastErrorFuncType)(virConnectPtr conn); + +virErrorPtr +virConnGetLastErrorWrapper(virConnectPtr conn, + virErrorPtr err) +{ + virErrorPtr ret = NULL; + static virConnGetLastErrorFuncType virConnGetLastErrorSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnGetLastError", + (void**)&virConnGetLastErrorSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnGetLastErrorSymbol(conn); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef void +(*virConnResetLastErrorFuncType)(virConnectPtr conn); + +void +virConnResetLastErrorWrapper(virConnectPtr conn) +{ + + static virConnResetLastErrorFuncType virConnResetLastErrorSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnResetLastError", + (void**)&virConnResetLastErrorSymbol, + &once, + &success, + NULL)) { + return; + } + virConnResetLastErrorSymbol(conn); +} + +typedef void +(*virConnSetErrorFuncFuncType)(virConnectPtr conn, + void * userData, + virErrorFunc handler); + +void +virConnSetErrorFuncWrapper(virConnectPtr conn, + void * userData, + virErrorFunc handler) +{ + + static virConnSetErrorFuncFuncType virConnSetErrorFuncSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virConnSetErrorFunc", + (void**)&virConnSetErrorFuncSymbol, + &once, + &success, + NULL)) { + return; + } + virConnSetErrorFuncSymbol(conn, + userData, + handler); +} + +typedef int +(*virCopyLastErrorFuncType)(virErrorPtr to); + +int +virCopyLastErrorWrapper(virErrorPtr to) +{ + int ret = -1; + static virCopyLastErrorFuncType virCopyLastErrorSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virCopyLastError", + (void**)&virCopyLastErrorSymbol, + &once, + &success, + NULL)) { + return ret; + } + ret = virCopyLastErrorSymbol(to); + if (ret < 0) { + setVirError(to, "Failed to copy last error"); + } + return ret; +} + +typedef void +(*virDefaultErrorFuncFuncType)(virErrorPtr err); + +void +virDefaultErrorFuncWrapper(virErrorPtr err) +{ + + static virDefaultErrorFuncFuncType virDefaultErrorFuncSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virDefaultErrorFunc", + (void**)&virDefaultErrorFuncSymbol, + &once, + &success, + NULL)) { + return; + } + virDefaultErrorFuncSymbol(err); +} + +typedef void +(*virFreeErrorFuncType)(virErrorPtr err); + +void +virFreeErrorWrapper(virErrorPtr err) +{ + + static virFreeErrorFuncType virFreeErrorSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virFreeError", + (void**)&virFreeErrorSymbol, + &once, + &success, + NULL)) { + return; + } + virFreeErrorSymbol(err); +} + +typedef virErrorPtr +(*virGetLastErrorFuncType)(void); + +virErrorPtr +virGetLastErrorWrapper(virErrorPtr err) +{ + virErrorPtr ret = NULL; + static virGetLastErrorFuncType virGetLastErrorSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virGetLastError", + (void**)&virGetLastErrorSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virGetLastErrorSymbol(); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virGetLastErrorCodeFuncType)(void); + +int +virGetLastErrorCodeWrapper(virErrorPtr err) +{ + int ret = -1; + static virGetLastErrorCodeFuncType virGetLastErrorCodeSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virGetLastErrorCode", + (void**)&virGetLastErrorCodeSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virGetLastErrorCodeSymbol(); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virGetLastErrorDomainFuncType)(void); + +int +virGetLastErrorDomainWrapper(virErrorPtr err) +{ + int ret = -1; + static virGetLastErrorDomainFuncType virGetLastErrorDomainSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virGetLastErrorDomain", + (void**)&virGetLastErrorDomainSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virGetLastErrorDomainSymbol(); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef const char * +(*virGetLastErrorMessageFuncType)(void); + +const char * +virGetLastErrorMessageWrapper(virErrorPtr err) +{ + const char * ret = NULL; + static virGetLastErrorMessageFuncType virGetLastErrorMessageSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virGetLastErrorMessage", + (void**)&virGetLastErrorMessageSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virGetLastErrorMessageSymbol(); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef void +(*virResetErrorFuncType)(virErrorPtr err); + +void +virResetErrorWrapper(virErrorPtr err) +{ + + static virResetErrorFuncType virResetErrorSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virResetError", + (void**)&virResetErrorSymbol, + &once, + &success, + NULL)) { + return; + } + virResetErrorSymbol(err); +} + +typedef void +(*virResetLastErrorFuncType)(void); + +void +virResetLastErrorWrapper(void) +{ + + static virResetLastErrorFuncType virResetLastErrorSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virResetLastError", + (void**)&virResetLastErrorSymbol, + &once, + &success, + NULL)) { + return; + } + virResetLastErrorSymbol(); +} + +typedef virErrorPtr +(*virSaveLastErrorFuncType)(void); + +virErrorPtr +virSaveLastErrorWrapper(virErrorPtr err) +{ + virErrorPtr ret = NULL; + static virSaveLastErrorFuncType virSaveLastErrorSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virSaveLastError", + (void**)&virSaveLastErrorSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virSaveLastErrorSymbol(); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef void +(*virSetErrorFuncFuncType)(void * userData, + virErrorFunc handler); + +void +virSetErrorFuncWrapper(void * userData, + virErrorFunc handler) +{ + + static virSetErrorFuncFuncType virSetErrorFuncSymbol; + static bool once; + static bool success; + + if (!libvirtSymbol("virSetErrorFunc", + (void**)&virSetErrorFuncSymbol, + &once, + &success, + NULL)) { + return; + } + virSetErrorFuncSymbol(userData, + handler); +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_common.go b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_common.go new file mode 100644 index 000000000..c0854f407 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_common.go @@ -0,0 +1,465 @@ +//go:build !libvirt_dlopen +// +build !libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include +#include +#include +#include "libvirt_generated.h" +#include "error_helper.h" + + +int +virTypedParamsAddBooleanWrapper(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + int value, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 0, 2) + setVirError(err, "Function virTypedParamsAddBoolean not available prior to libvirt version 1.0.2"); +#else + ret = virTypedParamsAddBoolean(params, + nparams, + maxparams, + name, + value); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virTypedParamsAddDoubleWrapper(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + double value, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 0, 2) + setVirError(err, "Function virTypedParamsAddDouble not available prior to libvirt version 1.0.2"); +#else + ret = virTypedParamsAddDouble(params, + nparams, + maxparams, + name, + value); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virTypedParamsAddFromStringWrapper(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + int type, + const char * value, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 0, 2) + setVirError(err, "Function virTypedParamsAddFromString not available prior to libvirt version 1.0.2"); +#else + ret = virTypedParamsAddFromString(params, + nparams, + maxparams, + name, + type, + value); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virTypedParamsAddIntWrapper(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + int value, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 0, 2) + setVirError(err, "Function virTypedParamsAddInt not available prior to libvirt version 1.0.2"); +#else + ret = virTypedParamsAddInt(params, + nparams, + maxparams, + name, + value); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virTypedParamsAddLLongWrapper(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + long long value, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 0, 2) + setVirError(err, "Function virTypedParamsAddLLong not available prior to libvirt version 1.0.2"); +#else + ret = virTypedParamsAddLLong(params, + nparams, + maxparams, + name, + value); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virTypedParamsAddStringWrapper(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + const char * value, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 0, 2) + setVirError(err, "Function virTypedParamsAddString not available prior to libvirt version 1.0.2"); +#else + ret = virTypedParamsAddString(params, + nparams, + maxparams, + name, + value); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virTypedParamsAddStringListWrapper(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + const char ** values, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 2, 17) + setVirError(err, "Function virTypedParamsAddStringList not available prior to libvirt version 1.2.17"); +#else + ret = virTypedParamsAddStringList(params, + nparams, + maxparams, + name, + values); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virTypedParamsAddUIntWrapper(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + unsigned int value, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 0, 2) + setVirError(err, "Function virTypedParamsAddUInt not available prior to libvirt version 1.0.2"); +#else + ret = virTypedParamsAddUInt(params, + nparams, + maxparams, + name, + value); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virTypedParamsAddULLongWrapper(virTypedParameterPtr * params, + int * nparams, + int * maxparams, + const char * name, + unsigned long long value, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 0, 2) + setVirError(err, "Function virTypedParamsAddULLong not available prior to libvirt version 1.0.2"); +#else + ret = virTypedParamsAddULLong(params, + nparams, + maxparams, + name, + value); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +void +virTypedParamsClearWrapper(virTypedParameterPtr params, + int nparams) +{ + +#if !LIBVIR_CHECK_VERSION(1, 0, 2) + setVirError(NULL, "Function virTypedParamsClear not available prior to libvirt version 1.0.2"); +#else + virTypedParamsClear(params, + nparams); +#endif + return; +} + +void +virTypedParamsFreeWrapper(virTypedParameterPtr params, + int nparams) +{ + +#if !LIBVIR_CHECK_VERSION(1, 0, 2) + setVirError(NULL, "Function virTypedParamsFree not available prior to libvirt version 1.0.2"); +#else + virTypedParamsFree(params, + nparams); +#endif + return; +} + +virTypedParameterPtr +virTypedParamsGetWrapper(virTypedParameterPtr params, + int nparams, + const char * name, + virErrorPtr err) +{ + virTypedParameterPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(1, 0, 2) + setVirError(err, "Function virTypedParamsGet not available prior to libvirt version 1.0.2"); +#else + ret = virTypedParamsGet(params, + nparams, + name); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virTypedParamsGetBooleanWrapper(virTypedParameterPtr params, + int nparams, + const char * name, + int * value, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 0, 2) + setVirError(err, "Function virTypedParamsGetBoolean not available prior to libvirt version 1.0.2"); +#else + ret = virTypedParamsGetBoolean(params, + nparams, + name, + value); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virTypedParamsGetDoubleWrapper(virTypedParameterPtr params, + int nparams, + const char * name, + double * value, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 0, 2) + setVirError(err, "Function virTypedParamsGetDouble not available prior to libvirt version 1.0.2"); +#else + ret = virTypedParamsGetDouble(params, + nparams, + name, + value); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virTypedParamsGetIntWrapper(virTypedParameterPtr params, + int nparams, + const char * name, + int * value, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 0, 2) + setVirError(err, "Function virTypedParamsGetInt not available prior to libvirt version 1.0.2"); +#else + ret = virTypedParamsGetInt(params, + nparams, + name, + value); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virTypedParamsGetLLongWrapper(virTypedParameterPtr params, + int nparams, + const char * name, + long long * value, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 0, 2) + setVirError(err, "Function virTypedParamsGetLLong not available prior to libvirt version 1.0.2"); +#else + ret = virTypedParamsGetLLong(params, + nparams, + name, + value); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virTypedParamsGetStringWrapper(virTypedParameterPtr params, + int nparams, + const char * name, + const char ** value, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 0, 2) + setVirError(err, "Function virTypedParamsGetString not available prior to libvirt version 1.0.2"); +#else + ret = virTypedParamsGetString(params, + nparams, + name, + value); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virTypedParamsGetUIntWrapper(virTypedParameterPtr params, + int nparams, + const char * name, + unsigned int * value, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 0, 2) + setVirError(err, "Function virTypedParamsGetUInt not available prior to libvirt version 1.0.2"); +#else + ret = virTypedParamsGetUInt(params, + nparams, + name, + value); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virTypedParamsGetULLongWrapper(virTypedParameterPtr params, + int nparams, + const char * name, + unsigned long long * value, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 0, 2) + setVirError(err, "Function virTypedParamsGetULLong not available prior to libvirt version 1.0.2"); +#else + ret = virTypedParamsGetULLong(params, + nparams, + name, + value); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_domain.go b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_domain.go new file mode 100644 index 000000000..07c1f2fa2 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_domain.go @@ -0,0 +1,3917 @@ +//go:build !libvirt_dlopen +// +build !libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include +#include +#include +#include "libvirt_generated.h" +#include "error_helper.h" + + +int +virConnectDomainEventDeregisterWrapper(virConnectPtr conn, + virConnectDomainEventCallback cb, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 5, 0) + setVirError(err, "Function virConnectDomainEventDeregister not available prior to libvirt version 0.5.0"); +#else + ret = virConnectDomainEventDeregister(conn, + cb); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectDomainEventDeregisterAnyWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virConnectDomainEventDeregisterAny not available prior to libvirt version 0.8.0"); +#else + ret = virConnectDomainEventDeregisterAny(conn, + callbackID); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectDomainEventRegisterWrapper(virConnectPtr conn, + virConnectDomainEventCallback cb, + void * opaque, + virFreeCallback freecb, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 5, 0) + setVirError(err, "Function virConnectDomainEventRegister not available prior to libvirt version 0.5.0"); +#else + ret = virConnectDomainEventRegister(conn, + cb, + opaque, + freecb); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectDomainEventRegisterAnyWrapper(virConnectPtr conn, + virDomainPtr dom, + int eventID, + virConnectDomainEventGenericCallback cb, + void * opaque, + virFreeCallback freecb, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virConnectDomainEventRegisterAny not available prior to libvirt version 0.8.0"); +#else + ret = virConnectDomainEventRegisterAny(conn, + dom, + eventID, + cb, + opaque, + freecb); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virConnectDomainXMLFromNativeWrapper(virConnectPtr conn, + const char * nativeFormat, + const char * nativeConfig, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 6, 4) + setVirError(err, "Function virConnectDomainXMLFromNative not available prior to libvirt version 0.6.4"); +#else + ret = virConnectDomainXMLFromNative(conn, + nativeFormat, + nativeConfig, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virConnectDomainXMLToNativeWrapper(virConnectPtr conn, + const char * nativeFormat, + const char * domainXml, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 6, 4) + setVirError(err, "Function virConnectDomainXMLToNative not available prior to libvirt version 0.6.4"); +#else + ret = virConnectDomainXMLToNative(conn, + nativeFormat, + domainXml, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectGetAllDomainStatsWrapper(virConnectPtr conn, + unsigned int stats, + virDomainStatsRecordPtr ** retStats, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 2, 8) + setVirError(err, "Function virConnectGetAllDomainStats not available prior to libvirt version 1.2.8"); +#else + ret = virConnectGetAllDomainStats(conn, + stats, + retStats, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virConnectGetDomainCapabilitiesWrapper(virConnectPtr conn, + const char * emulatorbin, + const char * arch, + const char * machine, + const char * virttype, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(1, 2, 7) + setVirError(err, "Function virConnectGetDomainCapabilities not available prior to libvirt version 1.2.7"); +#else + ret = virConnectGetDomainCapabilities(conn, + emulatorbin, + arch, + machine, + virttype, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectListAllDomainsWrapper(virConnectPtr conn, + virDomainPtr ** domains, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 13) + setVirError(err, "Function virConnectListAllDomains not available prior to libvirt version 0.9.13"); +#else + ret = virConnectListAllDomains(conn, + domains, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectListDefinedDomainsWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 1, 1) + setVirError(err, "Function virConnectListDefinedDomains not available prior to libvirt version 0.1.1"); +#else + ret = virConnectListDefinedDomains(conn, + names, + maxnames); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectListDomainsWrapper(virConnectPtr conn, + int * ids, + int maxids, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 0, 3) + setVirError(err, "Function virConnectListDomains not available prior to libvirt version 0.0.3"); +#else + ret = virConnectListDomains(conn, + ids, + maxids); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectNumOfDefinedDomainsWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 1, 5) + setVirError(err, "Function virConnectNumOfDefinedDomains not available prior to libvirt version 0.1.5"); +#else + ret = virConnectNumOfDefinedDomains(conn); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectNumOfDomainsWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 0, 3) + setVirError(err, "Function virConnectNumOfDomains not available prior to libvirt version 0.0.3"); +#else + ret = virConnectNumOfDomains(conn); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainAbortJobWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 7) + setVirError(err, "Function virDomainAbortJob not available prior to libvirt version 0.7.7"); +#else + ret = virDomainAbortJob(domain); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainAbortJobFlagsWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(8, 5, 0) + setVirError(err, "Function virDomainAbortJobFlags not available prior to libvirt version 8.5.0"); +#else + ret = virDomainAbortJobFlags(domain, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainAddIOThreadWrapper(virDomainPtr domain, + unsigned int iothread_id, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 2, 15) + setVirError(err, "Function virDomainAddIOThread not available prior to libvirt version 1.2.15"); +#else + ret = virDomainAddIOThread(domain, + iothread_id, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainAgentSetResponseTimeoutWrapper(virDomainPtr domain, + int timeout, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(5, 10, 0) + setVirError(err, "Function virDomainAgentSetResponseTimeout not available prior to libvirt version 5.10.0"); +#else + ret = virDomainAgentSetResponseTimeout(domain, + timeout, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainAttachDeviceWrapper(virDomainPtr domain, + const char * xml, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 1, 9) + setVirError(err, "Function virDomainAttachDevice not available prior to libvirt version 0.1.9"); +#else + ret = virDomainAttachDevice(domain, + xml); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainAttachDeviceFlagsWrapper(virDomainPtr domain, + const char * xml, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 7) + setVirError(err, "Function virDomainAttachDeviceFlags not available prior to libvirt version 0.7.7"); +#else + ret = virDomainAttachDeviceFlags(domain, + xml, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainAuthorizedSSHKeysGetWrapper(virDomainPtr domain, + const char * user, + char *** keys, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(6, 10, 0) + setVirError(err, "Function virDomainAuthorizedSSHKeysGet not available prior to libvirt version 6.10.0"); +#else + ret = virDomainAuthorizedSSHKeysGet(domain, + user, + keys, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainAuthorizedSSHKeysSetWrapper(virDomainPtr domain, + const char * user, + const char ** keys, + unsigned int nkeys, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(6, 10, 0) + setVirError(err, "Function virDomainAuthorizedSSHKeysSet not available prior to libvirt version 6.10.0"); +#else + ret = virDomainAuthorizedSSHKeysSet(domain, + user, + keys, + nkeys, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainBackupBeginWrapper(virDomainPtr domain, + const char * backupXML, + const char * checkpointXML, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(6, 0, 0) + setVirError(err, "Function virDomainBackupBegin not available prior to libvirt version 6.0.0"); +#else + ret = virDomainBackupBegin(domain, + backupXML, + checkpointXML, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virDomainBackupGetXMLDescWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(6, 0, 0) + setVirError(err, "Function virDomainBackupGetXMLDesc not available prior to libvirt version 6.0.0"); +#else + ret = virDomainBackupGetXMLDesc(domain, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainBlockCommitWrapper(virDomainPtr dom, + const char * disk, + const char * base, + const char * top, + unsigned long bandwidth, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 10, 2) + setVirError(err, "Function virDomainBlockCommit not available prior to libvirt version 0.10.2"); +#else + ret = virDomainBlockCommit(dom, + disk, + base, + top, + bandwidth, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainBlockCopyWrapper(virDomainPtr dom, + const char * disk, + const char * destxml, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 2, 8) + setVirError(err, "Function virDomainBlockCopy not available prior to libvirt version 1.2.8"); +#else + ret = virDomainBlockCopy(dom, + disk, + destxml, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainBlockJobAbortWrapper(virDomainPtr dom, + const char * disk, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 4) + setVirError(err, "Function virDomainBlockJobAbort not available prior to libvirt version 0.9.4"); +#else + ret = virDomainBlockJobAbort(dom, + disk, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainBlockJobSetSpeedWrapper(virDomainPtr dom, + const char * disk, + unsigned long bandwidth, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 4) + setVirError(err, "Function virDomainBlockJobSetSpeed not available prior to libvirt version 0.9.4"); +#else + ret = virDomainBlockJobSetSpeed(dom, + disk, + bandwidth, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainBlockPeekWrapper(virDomainPtr dom, + const char * disk, + unsigned long long offset, + size_t size, + void * buffer, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 4, 2) + setVirError(err, "Function virDomainBlockPeek not available prior to libvirt version 0.4.2"); +#else + ret = virDomainBlockPeek(dom, + disk, + offset, + size, + buffer, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainBlockPullWrapper(virDomainPtr dom, + const char * disk, + unsigned long bandwidth, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 4) + setVirError(err, "Function virDomainBlockPull not available prior to libvirt version 0.9.4"); +#else + ret = virDomainBlockPull(dom, + disk, + bandwidth, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainBlockRebaseWrapper(virDomainPtr dom, + const char * disk, + const char * base, + unsigned long bandwidth, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 10) + setVirError(err, "Function virDomainBlockRebase not available prior to libvirt version 0.9.10"); +#else + ret = virDomainBlockRebase(dom, + disk, + base, + bandwidth, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainBlockResizeWrapper(virDomainPtr dom, + const char * disk, + unsigned long long size, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 8) + setVirError(err, "Function virDomainBlockResize not available prior to libvirt version 0.9.8"); +#else + ret = virDomainBlockResize(dom, + disk, + size, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainBlockStatsWrapper(virDomainPtr dom, + const char * disk, + virDomainBlockStatsPtr stats, + size_t size, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 3, 2) + setVirError(err, "Function virDomainBlockStats not available prior to libvirt version 0.3.2"); +#else + ret = virDomainBlockStats(dom, + disk, + stats, + size); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainBlockStatsFlagsWrapper(virDomainPtr dom, + const char * disk, + virTypedParameterPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 5) + setVirError(err, "Function virDomainBlockStatsFlags not available prior to libvirt version 0.9.5"); +#else + ret = virDomainBlockStatsFlags(dom, + disk, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainCoreDumpWrapper(virDomainPtr domain, + const char * to, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 1, 9) + setVirError(err, "Function virDomainCoreDump not available prior to libvirt version 0.1.9"); +#else + ret = virDomainCoreDump(domain, + to, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainCoreDumpWithFormatWrapper(virDomainPtr domain, + const char * to, + unsigned int dumpformat, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 2, 3) + setVirError(err, "Function virDomainCoreDumpWithFormat not available prior to libvirt version 1.2.3"); +#else + ret = virDomainCoreDumpWithFormat(domain, + to, + dumpformat, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainCreateWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 1, 1) + setVirError(err, "Function virDomainCreate not available prior to libvirt version 0.1.1"); +#else + ret = virDomainCreate(domain); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virDomainPtr +virDomainCreateLinuxWrapper(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + virDomainPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 0, 3) + setVirError(err, "Function virDomainCreateLinux not available prior to libvirt version 0.0.3"); +#else + ret = virDomainCreateLinux(conn, + xmlDesc, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainCreateWithFilesWrapper(virDomainPtr domain, + unsigned int nfiles, + int * files, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 1, 1) + setVirError(err, "Function virDomainCreateWithFiles not available prior to libvirt version 1.1.1"); +#else + ret = virDomainCreateWithFiles(domain, + nfiles, + files, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainCreateWithFlagsWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 2) + setVirError(err, "Function virDomainCreateWithFlags not available prior to libvirt version 0.8.2"); +#else + ret = virDomainCreateWithFlags(domain, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virDomainPtr +virDomainCreateXMLWrapper(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + virDomainPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 5, 0) + setVirError(err, "Function virDomainCreateXML not available prior to libvirt version 0.5.0"); +#else + ret = virDomainCreateXML(conn, + xmlDesc, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virDomainPtr +virDomainCreateXMLWithFilesWrapper(virConnectPtr conn, + const char * xmlDesc, + unsigned int nfiles, + int * files, + unsigned int flags, + virErrorPtr err) +{ + virDomainPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(1, 1, 1) + setVirError(err, "Function virDomainCreateXMLWithFiles not available prior to libvirt version 1.1.1"); +#else + ret = virDomainCreateXMLWithFiles(conn, + xmlDesc, + nfiles, + files, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virDomainPtr +virDomainDefineXMLWrapper(virConnectPtr conn, + const char * xml, + virErrorPtr err) +{ + virDomainPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 1, 1) + setVirError(err, "Function virDomainDefineXML not available prior to libvirt version 0.1.1"); +#else + ret = virDomainDefineXML(conn, + xml); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virDomainPtr +virDomainDefineXMLFlagsWrapper(virConnectPtr conn, + const char * xml, + unsigned int flags, + virErrorPtr err) +{ + virDomainPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(1, 2, 12) + setVirError(err, "Function virDomainDefineXMLFlags not available prior to libvirt version 1.2.12"); +#else + ret = virDomainDefineXMLFlags(conn, + xml, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainDelIOThreadWrapper(virDomainPtr domain, + unsigned int iothread_id, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 2, 15) + setVirError(err, "Function virDomainDelIOThread not available prior to libvirt version 1.2.15"); +#else + ret = virDomainDelIOThread(domain, + iothread_id, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainDestroyWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 0, 3) + setVirError(err, "Function virDomainDestroy not available prior to libvirt version 0.0.3"); +#else + ret = virDomainDestroy(domain); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainDestroyFlagsWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 4) + setVirError(err, "Function virDomainDestroyFlags not available prior to libvirt version 0.9.4"); +#else + ret = virDomainDestroyFlags(domain, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainDetachDeviceWrapper(virDomainPtr domain, + const char * xml, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 1, 9) + setVirError(err, "Function virDomainDetachDevice not available prior to libvirt version 0.1.9"); +#else + ret = virDomainDetachDevice(domain, + xml); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainDetachDeviceAliasWrapper(virDomainPtr domain, + const char * alias, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(4, 4, 0) + setVirError(err, "Function virDomainDetachDeviceAlias not available prior to libvirt version 4.4.0"); +#else + ret = virDomainDetachDeviceAlias(domain, + alias, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainDetachDeviceFlagsWrapper(virDomainPtr domain, + const char * xml, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 7) + setVirError(err, "Function virDomainDetachDeviceFlags not available prior to libvirt version 0.7.7"); +#else + ret = virDomainDetachDeviceFlags(domain, + xml, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainFDAssociateWrapper(virDomainPtr domain, + const char * name, + unsigned int nfds, + int * fds, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(9, 0, 0) + setVirError(err, "Function virDomainFDAssociate not available prior to libvirt version 9.0.0"); +#else + ret = virDomainFDAssociate(domain, + name, + nfds, + fds, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainFSFreezeWrapper(virDomainPtr dom, + const char ** mountpoints, + unsigned int nmountpoints, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 2, 5) + setVirError(err, "Function virDomainFSFreeze not available prior to libvirt version 1.2.5"); +#else + ret = virDomainFSFreeze(dom, + mountpoints, + nmountpoints, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +void +virDomainFSInfoFreeWrapper(virDomainFSInfoPtr info) +{ + +#if !LIBVIR_CHECK_VERSION(1, 2, 11) + setVirError(NULL, "Function virDomainFSInfoFree not available prior to libvirt version 1.2.11"); +#else + virDomainFSInfoFree(info); +#endif + return; +} + +int +virDomainFSThawWrapper(virDomainPtr dom, + const char ** mountpoints, + unsigned int nmountpoints, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 2, 5) + setVirError(err, "Function virDomainFSThaw not available prior to libvirt version 1.2.5"); +#else + ret = virDomainFSThaw(dom, + mountpoints, + nmountpoints, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainFSTrimWrapper(virDomainPtr dom, + const char * mountPoint, + unsigned long long minimum, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 0, 1) + setVirError(err, "Function virDomainFSTrim not available prior to libvirt version 1.0.1"); +#else + ret = virDomainFSTrim(dom, + mountPoint, + minimum, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainFreeWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 0, 3) + setVirError(err, "Function virDomainFree not available prior to libvirt version 0.0.3"); +#else + ret = virDomainFree(domain); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetAutostartWrapper(virDomainPtr domain, + int * autostart, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 2, 1) + setVirError(err, "Function virDomainGetAutostart not available prior to libvirt version 0.2.1"); +#else + ret = virDomainGetAutostart(domain, + autostart); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetBlkioParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 0) + setVirError(err, "Function virDomainGetBlkioParameters not available prior to libvirt version 0.9.0"); +#else + ret = virDomainGetBlkioParameters(domain, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetBlockInfoWrapper(virDomainPtr domain, + const char * disk, + virDomainBlockInfoPtr info, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 1) + setVirError(err, "Function virDomainGetBlockInfo not available prior to libvirt version 0.8.1"); +#else + ret = virDomainGetBlockInfo(domain, + disk, + info, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetBlockIoTuneWrapper(virDomainPtr dom, + const char * disk, + virTypedParameterPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 8) + setVirError(err, "Function virDomainGetBlockIoTune not available prior to libvirt version 0.9.8"); +#else + ret = virDomainGetBlockIoTune(dom, + disk, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetBlockJobInfoWrapper(virDomainPtr dom, + const char * disk, + virDomainBlockJobInfoPtr info, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 4) + setVirError(err, "Function virDomainGetBlockJobInfo not available prior to libvirt version 0.9.4"); +#else + ret = virDomainGetBlockJobInfo(dom, + disk, + info, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetCPUStatsWrapper(virDomainPtr domain, + virTypedParameterPtr params, + unsigned int nparams, + int start_cpu, + unsigned int ncpus, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 10) + setVirError(err, "Function virDomainGetCPUStats not available prior to libvirt version 0.9.10"); +#else + ret = virDomainGetCPUStats(domain, + params, + nparams, + start_cpu, + ncpus, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virConnectPtr +virDomainGetConnectWrapper(virDomainPtr dom, + virErrorPtr err) +{ + virConnectPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 3, 0) + setVirError(err, "Function virDomainGetConnect not available prior to libvirt version 0.3.0"); +#else + ret = virDomainGetConnect(dom); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetControlInfoWrapper(virDomainPtr domain, + virDomainControlInfoPtr info, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 3) + setVirError(err, "Function virDomainGetControlInfo not available prior to libvirt version 0.9.3"); +#else + ret = virDomainGetControlInfo(domain, + info, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetDiskErrorsWrapper(virDomainPtr dom, + virDomainDiskErrorPtr errors, + unsigned int maxerrors, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 10) + setVirError(err, "Function virDomainGetDiskErrors not available prior to libvirt version 0.9.10"); +#else + ret = virDomainGetDiskErrors(dom, + errors, + maxerrors, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetEmulatorPinInfoWrapper(virDomainPtr domain, + unsigned char * cpumap, + int maplen, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 10, 0) + setVirError(err, "Function virDomainGetEmulatorPinInfo not available prior to libvirt version 0.10.0"); +#else + ret = virDomainGetEmulatorPinInfo(domain, + cpumap, + maplen, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetFSInfoWrapper(virDomainPtr dom, + virDomainFSInfoPtr ** info, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 2, 11) + setVirError(err, "Function virDomainGetFSInfo not available prior to libvirt version 1.2.11"); +#else + ret = virDomainGetFSInfo(dom, + info, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetGuestInfoWrapper(virDomainPtr domain, + unsigned int types, + virTypedParameterPtr * params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(5, 7, 0) + setVirError(err, "Function virDomainGetGuestInfo not available prior to libvirt version 5.7.0"); +#else + ret = virDomainGetGuestInfo(domain, + types, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetGuestVcpusWrapper(virDomainPtr domain, + virTypedParameterPtr * params, + unsigned int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(2, 0, 0) + setVirError(err, "Function virDomainGetGuestVcpus not available prior to libvirt version 2.0.0"); +#else + ret = virDomainGetGuestVcpus(domain, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virDomainGetHostnameWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 10, 0) + setVirError(err, "Function virDomainGetHostname not available prior to libvirt version 0.10.0"); +#else + ret = virDomainGetHostname(domain, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +unsigned int +virDomainGetIDWrapper(virDomainPtr domain, + virErrorPtr err) +{ + unsigned int ret = 0; +#if !LIBVIR_CHECK_VERSION(0, 0, 3) + setVirError(err, "Function virDomainGetID not available prior to libvirt version 0.0.3"); +#else + ret = virDomainGetID(domain); + if (ret == 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetIOThreadInfoWrapper(virDomainPtr dom, + virDomainIOThreadInfoPtr ** info, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 2, 14) + setVirError(err, "Function virDomainGetIOThreadInfo not available prior to libvirt version 1.2.14"); +#else + ret = virDomainGetIOThreadInfo(dom, + info, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetInfoWrapper(virDomainPtr domain, + virDomainInfoPtr info, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 0, 3) + setVirError(err, "Function virDomainGetInfo not available prior to libvirt version 0.0.3"); +#else + ret = virDomainGetInfo(domain, + info); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetInterfaceParametersWrapper(virDomainPtr domain, + const char * device, + virTypedParameterPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 9) + setVirError(err, "Function virDomainGetInterfaceParameters not available prior to libvirt version 0.9.9"); +#else + ret = virDomainGetInterfaceParameters(domain, + device, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetJobInfoWrapper(virDomainPtr domain, + virDomainJobInfoPtr info, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 7) + setVirError(err, "Function virDomainGetJobInfo not available prior to libvirt version 0.7.7"); +#else + ret = virDomainGetJobInfo(domain, + info); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetJobStatsWrapper(virDomainPtr domain, + int * type, + virTypedParameterPtr * params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 0, 3) + setVirError(err, "Function virDomainGetJobStats not available prior to libvirt version 1.0.3"); +#else + ret = virDomainGetJobStats(domain, + type, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetLaunchSecurityInfoWrapper(virDomainPtr domain, + virTypedParameterPtr * params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(4, 5, 0) + setVirError(err, "Function virDomainGetLaunchSecurityInfo not available prior to libvirt version 4.5.0"); +#else + ret = virDomainGetLaunchSecurityInfo(domain, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +unsigned long +virDomainGetMaxMemoryWrapper(virDomainPtr domain, + virErrorPtr err) +{ + unsigned long ret = 0; +#if !LIBVIR_CHECK_VERSION(0, 0, 3) + setVirError(err, "Function virDomainGetMaxMemory not available prior to libvirt version 0.0.3"); +#else + ret = virDomainGetMaxMemory(domain); + if (ret == 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetMaxVcpusWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 2, 1) + setVirError(err, "Function virDomainGetMaxVcpus not available prior to libvirt version 0.2.1"); +#else + ret = virDomainGetMaxVcpus(domain); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetMemoryParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 5) + setVirError(err, "Function virDomainGetMemoryParameters not available prior to libvirt version 0.8.5"); +#else + ret = virDomainGetMemoryParameters(domain, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetMessagesWrapper(virDomainPtr domain, + char *** msgs, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(7, 1, 0) + setVirError(err, "Function virDomainGetMessages not available prior to libvirt version 7.1.0"); +#else + ret = virDomainGetMessages(domain, + msgs, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virDomainGetMetadataWrapper(virDomainPtr domain, + int type, + const char * uri, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 9, 10) + setVirError(err, "Function virDomainGetMetadata not available prior to libvirt version 0.9.10"); +#else + ret = virDomainGetMetadata(domain, + type, + uri, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +const char * +virDomainGetNameWrapper(virDomainPtr domain, + virErrorPtr err) +{ + const char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 0, 3) + setVirError(err, "Function virDomainGetName not available prior to libvirt version 0.0.3"); +#else + ret = virDomainGetName(domain); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetNumaParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 9) + setVirError(err, "Function virDomainGetNumaParameters not available prior to libvirt version 0.9.9"); +#else + ret = virDomainGetNumaParameters(domain, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virDomainGetOSTypeWrapper(virDomainPtr domain, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 0, 3) + setVirError(err, "Function virDomainGetOSType not available prior to libvirt version 0.0.3"); +#else + ret = virDomainGetOSType(domain); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetPerfEventsWrapper(virDomainPtr domain, + virTypedParameterPtr * params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 3, 3) + setVirError(err, "Function virDomainGetPerfEvents not available prior to libvirt version 1.3.3"); +#else + ret = virDomainGetPerfEvents(domain, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetSchedulerParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int * nparams, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 2, 3) + setVirError(err, "Function virDomainGetSchedulerParameters not available prior to libvirt version 0.2.3"); +#else + ret = virDomainGetSchedulerParameters(domain, + params, + nparams); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetSchedulerParametersFlagsWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 2) + setVirError(err, "Function virDomainGetSchedulerParametersFlags not available prior to libvirt version 0.9.2"); +#else + ret = virDomainGetSchedulerParametersFlags(domain, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virDomainGetSchedulerTypeWrapper(virDomainPtr domain, + int * nparams, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 2, 3) + setVirError(err, "Function virDomainGetSchedulerType not available prior to libvirt version 0.2.3"); +#else + ret = virDomainGetSchedulerType(domain, + nparams); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetSecurityLabelWrapper(virDomainPtr domain, + virSecurityLabelPtr seclabel, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 6, 1) + setVirError(err, "Function virDomainGetSecurityLabel not available prior to libvirt version 0.6.1"); +#else + ret = virDomainGetSecurityLabel(domain, + seclabel); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetSecurityLabelListWrapper(virDomainPtr domain, + virSecurityLabelPtr * seclabels, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 10, 0) + setVirError(err, "Function virDomainGetSecurityLabelList not available prior to libvirt version 0.10.0"); +#else + ret = virDomainGetSecurityLabelList(domain, + seclabels); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetStateWrapper(virDomainPtr domain, + int * state, + int * reason, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 2) + setVirError(err, "Function virDomainGetState not available prior to libvirt version 0.9.2"); +#else + ret = virDomainGetState(domain, + state, + reason, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetTimeWrapper(virDomainPtr dom, + long long * seconds, + unsigned int * nseconds, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 2, 5) + setVirError(err, "Function virDomainGetTime not available prior to libvirt version 1.2.5"); +#else + ret = virDomainGetTime(dom, + seconds, + nseconds, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetUUIDWrapper(virDomainPtr domain, + unsigned char * uuid, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 0, 5) + setVirError(err, "Function virDomainGetUUID not available prior to libvirt version 0.0.5"); +#else + ret = virDomainGetUUID(domain, + uuid); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetUUIDStringWrapper(virDomainPtr domain, + char * buf, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 1, 1) + setVirError(err, "Function virDomainGetUUIDString not available prior to libvirt version 0.1.1"); +#else + ret = virDomainGetUUIDString(domain, + buf); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetVcpuPinInfoWrapper(virDomainPtr domain, + int ncpumaps, + unsigned char * cpumaps, + int maplen, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 3) + setVirError(err, "Function virDomainGetVcpuPinInfo not available prior to libvirt version 0.9.3"); +#else + ret = virDomainGetVcpuPinInfo(domain, + ncpumaps, + cpumaps, + maplen, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetVcpusWrapper(virDomainPtr domain, + virVcpuInfoPtr info, + int maxinfo, + unsigned char * cpumaps, + int maplen, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 1, 4) + setVirError(err, "Function virDomainGetVcpus not available prior to libvirt version 0.1.4"); +#else + ret = virDomainGetVcpus(domain, + info, + maxinfo, + cpumaps, + maplen); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGetVcpusFlagsWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 5) + setVirError(err, "Function virDomainGetVcpusFlags not available prior to libvirt version 0.8.5"); +#else + ret = virDomainGetVcpusFlags(domain, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virDomainGetXMLDescWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 0, 3) + setVirError(err, "Function virDomainGetXMLDesc not available prior to libvirt version 0.0.3"); +#else + ret = virDomainGetXMLDesc(domain, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainGraphicsReloadWrapper(virDomainPtr domain, + unsigned int type, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(10, 2, 0) + setVirError(err, "Function virDomainGraphicsReload not available prior to libvirt version 10.2.0"); +#else + ret = virDomainGraphicsReload(domain, + type, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainHasManagedSaveImageWrapper(virDomainPtr dom, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virDomainHasManagedSaveImage not available prior to libvirt version 0.8.0"); +#else + ret = virDomainHasManagedSaveImage(dom, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +void +virDomainIOThreadInfoFreeWrapper(virDomainIOThreadInfoPtr info) +{ + +#if !LIBVIR_CHECK_VERSION(1, 2, 14) + setVirError(NULL, "Function virDomainIOThreadInfoFree not available prior to libvirt version 1.2.14"); +#else + virDomainIOThreadInfoFree(info); +#endif + return; +} + +int +virDomainInjectNMIWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 2) + setVirError(err, "Function virDomainInjectNMI not available prior to libvirt version 0.9.2"); +#else + ret = virDomainInjectNMI(domain, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainInterfaceAddressesWrapper(virDomainPtr dom, + virDomainInterfacePtr ** ifaces, + unsigned int source, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 2, 14) + setVirError(err, "Function virDomainInterfaceAddresses not available prior to libvirt version 1.2.14"); +#else + ret = virDomainInterfaceAddresses(dom, + ifaces, + source, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +void +virDomainInterfaceFreeWrapper(virDomainInterfacePtr iface) +{ + +#if !LIBVIR_CHECK_VERSION(1, 2, 14) + setVirError(NULL, "Function virDomainInterfaceFree not available prior to libvirt version 1.2.14"); +#else + virDomainInterfaceFree(iface); +#endif + return; +} + +int +virDomainInterfaceStatsWrapper(virDomainPtr dom, + const char * device, + virDomainInterfaceStatsPtr stats, + size_t size, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 3, 2) + setVirError(err, "Function virDomainInterfaceStats not available prior to libvirt version 0.3.2"); +#else + ret = virDomainInterfaceStats(dom, + device, + stats, + size); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainIsActiveWrapper(virDomainPtr dom, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 3) + setVirError(err, "Function virDomainIsActive not available prior to libvirt version 0.7.3"); +#else + ret = virDomainIsActive(dom); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainIsPersistentWrapper(virDomainPtr dom, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 3) + setVirError(err, "Function virDomainIsPersistent not available prior to libvirt version 0.7.3"); +#else + ret = virDomainIsPersistent(dom); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainIsUpdatedWrapper(virDomainPtr dom, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 6) + setVirError(err, "Function virDomainIsUpdated not available prior to libvirt version 0.8.6"); +#else + ret = virDomainIsUpdated(dom); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainListGetStatsWrapper(virDomainPtr * doms, + unsigned int stats, + virDomainStatsRecordPtr ** retStats, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 2, 8) + setVirError(err, "Function virDomainListGetStats not available prior to libvirt version 1.2.8"); +#else + ret = virDomainListGetStats(doms, + stats, + retStats, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virDomainPtr +virDomainLookupByIDWrapper(virConnectPtr conn, + int id, + virErrorPtr err) +{ + virDomainPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 0, 3) + setVirError(err, "Function virDomainLookupByID not available prior to libvirt version 0.0.3"); +#else + ret = virDomainLookupByID(conn, + id); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virDomainPtr +virDomainLookupByNameWrapper(virConnectPtr conn, + const char * name, + virErrorPtr err) +{ + virDomainPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 0, 3) + setVirError(err, "Function virDomainLookupByName not available prior to libvirt version 0.0.3"); +#else + ret = virDomainLookupByName(conn, + name); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virDomainPtr +virDomainLookupByUUIDWrapper(virConnectPtr conn, + const unsigned char * uuid, + virErrorPtr err) +{ + virDomainPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 0, 5) + setVirError(err, "Function virDomainLookupByUUID not available prior to libvirt version 0.0.5"); +#else + ret = virDomainLookupByUUID(conn, + uuid); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virDomainPtr +virDomainLookupByUUIDStringWrapper(virConnectPtr conn, + const char * uuidstr, + virErrorPtr err) +{ + virDomainPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 1, 1) + setVirError(err, "Function virDomainLookupByUUIDString not available prior to libvirt version 0.1.1"); +#else + ret = virDomainLookupByUUIDString(conn, + uuidstr); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainManagedSaveWrapper(virDomainPtr dom, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virDomainManagedSave not available prior to libvirt version 0.8.0"); +#else + ret = virDomainManagedSave(dom, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainManagedSaveDefineXMLWrapper(virDomainPtr domain, + const char * dxml, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(3, 7, 0) + setVirError(err, "Function virDomainManagedSaveDefineXML not available prior to libvirt version 3.7.0"); +#else + ret = virDomainManagedSaveDefineXML(domain, + dxml, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virDomainManagedSaveGetXMLDescWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(3, 7, 0) + setVirError(err, "Function virDomainManagedSaveGetXMLDesc not available prior to libvirt version 3.7.0"); +#else + ret = virDomainManagedSaveGetXMLDesc(domain, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainManagedSaveRemoveWrapper(virDomainPtr dom, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virDomainManagedSaveRemove not available prior to libvirt version 0.8.0"); +#else + ret = virDomainManagedSaveRemove(dom, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainMemoryPeekWrapper(virDomainPtr dom, + unsigned long long start, + size_t size, + void * buffer, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 4, 2) + setVirError(err, "Function virDomainMemoryPeek not available prior to libvirt version 0.4.2"); +#else + ret = virDomainMemoryPeek(dom, + start, + size, + buffer, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainMemoryStatsWrapper(virDomainPtr dom, + virDomainMemoryStatPtr stats, + unsigned int nr_stats, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 5) + setVirError(err, "Function virDomainMemoryStats not available prior to libvirt version 0.7.5"); +#else + ret = virDomainMemoryStats(dom, + stats, + nr_stats, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virDomainPtr +virDomainMigrateWrapper(virDomainPtr domain, + virConnectPtr dconn, + unsigned long flags, + const char * dname, + const char * uri, + unsigned long bandwidth, + virErrorPtr err) +{ + virDomainPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 3, 2) + setVirError(err, "Function virDomainMigrate not available prior to libvirt version 0.3.2"); +#else + ret = virDomainMigrate(domain, + dconn, + flags, + dname, + uri, + bandwidth); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virDomainPtr +virDomainMigrate2Wrapper(virDomainPtr domain, + virConnectPtr dconn, + const char * dxml, + unsigned long flags, + const char * dname, + const char * uri, + unsigned long bandwidth, + virErrorPtr err) +{ + virDomainPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 9, 2) + setVirError(err, "Function virDomainMigrate2 not available prior to libvirt version 0.9.2"); +#else + ret = virDomainMigrate2(domain, + dconn, + dxml, + flags, + dname, + uri, + bandwidth); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virDomainPtr +virDomainMigrate3Wrapper(virDomainPtr domain, + virConnectPtr dconn, + virTypedParameterPtr params, + unsigned int nparams, + unsigned int flags, + virErrorPtr err) +{ + virDomainPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(1, 1, 0) + setVirError(err, "Function virDomainMigrate3 not available prior to libvirt version 1.1.0"); +#else + ret = virDomainMigrate3(domain, + dconn, + params, + nparams, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainMigrateGetCompressionCacheWrapper(virDomainPtr domain, + unsigned long long * cacheSize, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 0, 3) + setVirError(err, "Function virDomainMigrateGetCompressionCache not available prior to libvirt version 1.0.3"); +#else + ret = virDomainMigrateGetCompressionCache(domain, + cacheSize, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainMigrateGetMaxDowntimeWrapper(virDomainPtr domain, + unsigned long long * downtime, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(3, 7, 0) + setVirError(err, "Function virDomainMigrateGetMaxDowntime not available prior to libvirt version 3.7.0"); +#else + ret = virDomainMigrateGetMaxDowntime(domain, + downtime, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainMigrateGetMaxSpeedWrapper(virDomainPtr domain, + unsigned long * bandwidth, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 5) + setVirError(err, "Function virDomainMigrateGetMaxSpeed not available prior to libvirt version 0.9.5"); +#else + ret = virDomainMigrateGetMaxSpeed(domain, + bandwidth, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainMigrateSetCompressionCacheWrapper(virDomainPtr domain, + unsigned long long cacheSize, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 0, 3) + setVirError(err, "Function virDomainMigrateSetCompressionCache not available prior to libvirt version 1.0.3"); +#else + ret = virDomainMigrateSetCompressionCache(domain, + cacheSize, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainMigrateSetMaxDowntimeWrapper(virDomainPtr domain, + unsigned long long downtime, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virDomainMigrateSetMaxDowntime not available prior to libvirt version 0.8.0"); +#else + ret = virDomainMigrateSetMaxDowntime(domain, + downtime, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainMigrateSetMaxSpeedWrapper(virDomainPtr domain, + unsigned long bandwidth, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 0) + setVirError(err, "Function virDomainMigrateSetMaxSpeed not available prior to libvirt version 0.9.0"); +#else + ret = virDomainMigrateSetMaxSpeed(domain, + bandwidth, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainMigrateStartPostCopyWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 3, 3) + setVirError(err, "Function virDomainMigrateStartPostCopy not available prior to libvirt version 1.3.3"); +#else + ret = virDomainMigrateStartPostCopy(domain, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainMigrateToURIWrapper(virDomainPtr domain, + const char * duri, + unsigned long flags, + const char * dname, + unsigned long bandwidth, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 2) + setVirError(err, "Function virDomainMigrateToURI not available prior to libvirt version 0.7.2"); +#else + ret = virDomainMigrateToURI(domain, + duri, + flags, + dname, + bandwidth); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainMigrateToURI2Wrapper(virDomainPtr domain, + const char * dconnuri, + const char * miguri, + const char * dxml, + unsigned long flags, + const char * dname, + unsigned long bandwidth, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 2) + setVirError(err, "Function virDomainMigrateToURI2 not available prior to libvirt version 0.9.2"); +#else + ret = virDomainMigrateToURI2(domain, + dconnuri, + miguri, + dxml, + flags, + dname, + bandwidth); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainMigrateToURI3Wrapper(virDomainPtr domain, + const char * dconnuri, + virTypedParameterPtr params, + unsigned int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 1, 0) + setVirError(err, "Function virDomainMigrateToURI3 not available prior to libvirt version 1.1.0"); +#else + ret = virDomainMigrateToURI3(domain, + dconnuri, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainOpenChannelWrapper(virDomainPtr dom, + const char * name, + virStreamPtr st, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 0, 2) + setVirError(err, "Function virDomainOpenChannel not available prior to libvirt version 1.0.2"); +#else + ret = virDomainOpenChannel(dom, + name, + st, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainOpenConsoleWrapper(virDomainPtr dom, + const char * dev_name, + virStreamPtr st, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 6) + setVirError(err, "Function virDomainOpenConsole not available prior to libvirt version 0.8.6"); +#else + ret = virDomainOpenConsole(dom, + dev_name, + st, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainOpenGraphicsWrapper(virDomainPtr dom, + unsigned int idx, + int fd, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 7) + setVirError(err, "Function virDomainOpenGraphics not available prior to libvirt version 0.9.7"); +#else + ret = virDomainOpenGraphics(dom, + idx, + fd, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainOpenGraphicsFDWrapper(virDomainPtr dom, + unsigned int idx, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 2, 8) + setVirError(err, "Function virDomainOpenGraphicsFD not available prior to libvirt version 1.2.8"); +#else + ret = virDomainOpenGraphicsFD(dom, + idx, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainPMSuspendForDurationWrapper(virDomainPtr dom, + unsigned int target, + unsigned long long duration, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 10) + setVirError(err, "Function virDomainPMSuspendForDuration not available prior to libvirt version 0.9.10"); +#else + ret = virDomainPMSuspendForDuration(dom, + target, + duration, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainPMWakeupWrapper(virDomainPtr dom, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 11) + setVirError(err, "Function virDomainPMWakeup not available prior to libvirt version 0.9.11"); +#else + ret = virDomainPMWakeup(dom, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainPinEmulatorWrapper(virDomainPtr domain, + unsigned char * cpumap, + int maplen, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 10, 0) + setVirError(err, "Function virDomainPinEmulator not available prior to libvirt version 0.10.0"); +#else + ret = virDomainPinEmulator(domain, + cpumap, + maplen, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainPinIOThreadWrapper(virDomainPtr domain, + unsigned int iothread_id, + unsigned char * cpumap, + int maplen, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 2, 14) + setVirError(err, "Function virDomainPinIOThread not available prior to libvirt version 1.2.14"); +#else + ret = virDomainPinIOThread(domain, + iothread_id, + cpumap, + maplen, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainPinVcpuWrapper(virDomainPtr domain, + unsigned int vcpu, + unsigned char * cpumap, + int maplen, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 1, 4) + setVirError(err, "Function virDomainPinVcpu not available prior to libvirt version 0.1.4"); +#else + ret = virDomainPinVcpu(domain, + vcpu, + cpumap, + maplen); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainPinVcpuFlagsWrapper(virDomainPtr domain, + unsigned int vcpu, + unsigned char * cpumap, + int maplen, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 3) + setVirError(err, "Function virDomainPinVcpuFlags not available prior to libvirt version 0.9.3"); +#else + ret = virDomainPinVcpuFlags(domain, + vcpu, + cpumap, + maplen, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainRebootWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 1, 0) + setVirError(err, "Function virDomainReboot not available prior to libvirt version 0.1.0"); +#else + ret = virDomainReboot(domain, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainRefWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 6, 0) + setVirError(err, "Function virDomainRef not available prior to libvirt version 0.6.0"); +#else + ret = virDomainRef(domain); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainRenameWrapper(virDomainPtr dom, + const char * new_name, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 2, 19) + setVirError(err, "Function virDomainRename not available prior to libvirt version 1.2.19"); +#else + ret = virDomainRename(dom, + new_name, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainResetWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 7) + setVirError(err, "Function virDomainReset not available prior to libvirt version 0.9.7"); +#else + ret = virDomainReset(domain, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainRestoreWrapper(virConnectPtr conn, + const char * from, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 0, 3) + setVirError(err, "Function virDomainRestore not available prior to libvirt version 0.0.3"); +#else + ret = virDomainRestore(conn, + from); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainRestoreFlagsWrapper(virConnectPtr conn, + const char * from, + const char * dxml, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 4) + setVirError(err, "Function virDomainRestoreFlags not available prior to libvirt version 0.9.4"); +#else + ret = virDomainRestoreFlags(conn, + from, + dxml, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainRestoreParamsWrapper(virConnectPtr conn, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(8, 4, 0) + setVirError(err, "Function virDomainRestoreParams not available prior to libvirt version 8.4.0"); +#else + ret = virDomainRestoreParams(conn, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainResumeWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 0, 3) + setVirError(err, "Function virDomainResume not available prior to libvirt version 0.0.3"); +#else + ret = virDomainResume(domain); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSaveWrapper(virDomainPtr domain, + const char * to, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 0, 3) + setVirError(err, "Function virDomainSave not available prior to libvirt version 0.0.3"); +#else + ret = virDomainSave(domain, + to); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSaveFlagsWrapper(virDomainPtr domain, + const char * to, + const char * dxml, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 4) + setVirError(err, "Function virDomainSaveFlags not available prior to libvirt version 0.9.4"); +#else + ret = virDomainSaveFlags(domain, + to, + dxml, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSaveImageDefineXMLWrapper(virConnectPtr conn, + const char * file, + const char * dxml, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 4) + setVirError(err, "Function virDomainSaveImageDefineXML not available prior to libvirt version 0.9.4"); +#else + ret = virDomainSaveImageDefineXML(conn, + file, + dxml, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virDomainSaveImageGetXMLDescWrapper(virConnectPtr conn, + const char * file, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 9, 4) + setVirError(err, "Function virDomainSaveImageGetXMLDesc not available prior to libvirt version 0.9.4"); +#else + ret = virDomainSaveImageGetXMLDesc(conn, + file, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSaveParamsWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(8, 4, 0) + setVirError(err, "Function virDomainSaveParams not available prior to libvirt version 8.4.0"); +#else + ret = virDomainSaveParams(domain, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virDomainScreenshotWrapper(virDomainPtr domain, + virStreamPtr stream, + unsigned int screen, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 9, 2) + setVirError(err, "Function virDomainScreenshot not available prior to libvirt version 0.9.2"); +#else + ret = virDomainScreenshot(domain, + stream, + screen, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSendKeyWrapper(virDomainPtr domain, + unsigned int codeset, + unsigned int holdtime, + unsigned int * keycodes, + int nkeycodes, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 3) + setVirError(err, "Function virDomainSendKey not available prior to libvirt version 0.9.3"); +#else + ret = virDomainSendKey(domain, + codeset, + holdtime, + keycodes, + nkeycodes, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSendProcessSignalWrapper(virDomainPtr domain, + long long pid_value, + unsigned int signum, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 0, 1) + setVirError(err, "Function virDomainSendProcessSignal not available prior to libvirt version 1.0.1"); +#else + ret = virDomainSendProcessSignal(domain, + pid_value, + signum, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSetAutostartWrapper(virDomainPtr domain, + int autostart, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 2, 1) + setVirError(err, "Function virDomainSetAutostart not available prior to libvirt version 0.2.1"); +#else + ret = virDomainSetAutostart(domain, + autostart); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSetBlkioParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 0) + setVirError(err, "Function virDomainSetBlkioParameters not available prior to libvirt version 0.9.0"); +#else + ret = virDomainSetBlkioParameters(domain, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSetBlockIoTuneWrapper(virDomainPtr dom, + const char * disk, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 8) + setVirError(err, "Function virDomainSetBlockIoTune not available prior to libvirt version 0.9.8"); +#else + ret = virDomainSetBlockIoTune(dom, + disk, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSetBlockThresholdWrapper(virDomainPtr domain, + const char * dev, + unsigned long long threshold, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(3, 1, 0) + setVirError(err, "Function virDomainSetBlockThreshold not available prior to libvirt version 3.1.0"); +#else + ret = virDomainSetBlockThreshold(domain, + dev, + threshold, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSetGuestVcpusWrapper(virDomainPtr domain, + const char * cpumap, + int state, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(2, 0, 0) + setVirError(err, "Function virDomainSetGuestVcpus not available prior to libvirt version 2.0.0"); +#else + ret = virDomainSetGuestVcpus(domain, + cpumap, + state, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSetIOThreadParamsWrapper(virDomainPtr domain, + unsigned int iothread_id, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(4, 10, 0) + setVirError(err, "Function virDomainSetIOThreadParams not available prior to libvirt version 4.10.0"); +#else + ret = virDomainSetIOThreadParams(domain, + iothread_id, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSetInterfaceParametersWrapper(virDomainPtr domain, + const char * device, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 9) + setVirError(err, "Function virDomainSetInterfaceParameters not available prior to libvirt version 0.9.9"); +#else + ret = virDomainSetInterfaceParameters(domain, + device, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSetLaunchSecurityStateWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(8, 0, 0) + setVirError(err, "Function virDomainSetLaunchSecurityState not available prior to libvirt version 8.0.0"); +#else + ret = virDomainSetLaunchSecurityState(domain, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSetLifecycleActionWrapper(virDomainPtr domain, + unsigned int type, + unsigned int action, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(3, 9, 0) + setVirError(err, "Function virDomainSetLifecycleAction not available prior to libvirt version 3.9.0"); +#else + ret = virDomainSetLifecycleAction(domain, + type, + action, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSetMaxMemoryWrapper(virDomainPtr domain, + unsigned long memory, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 0, 3) + setVirError(err, "Function virDomainSetMaxMemory not available prior to libvirt version 0.0.3"); +#else + ret = virDomainSetMaxMemory(domain, + memory); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSetMemoryWrapper(virDomainPtr domain, + unsigned long memory, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 1, 1) + setVirError(err, "Function virDomainSetMemory not available prior to libvirt version 0.1.1"); +#else + ret = virDomainSetMemory(domain, + memory); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSetMemoryFlagsWrapper(virDomainPtr domain, + unsigned long memory, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 0) + setVirError(err, "Function virDomainSetMemoryFlags not available prior to libvirt version 0.9.0"); +#else + ret = virDomainSetMemoryFlags(domain, + memory, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSetMemoryParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 5) + setVirError(err, "Function virDomainSetMemoryParameters not available prior to libvirt version 0.8.5"); +#else + ret = virDomainSetMemoryParameters(domain, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSetMemoryStatsPeriodWrapper(virDomainPtr domain, + int period, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 1, 1) + setVirError(err, "Function virDomainSetMemoryStatsPeriod not available prior to libvirt version 1.1.1"); +#else + ret = virDomainSetMemoryStatsPeriod(domain, + period, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSetMetadataWrapper(virDomainPtr domain, + int type, + const char * metadata, + const char * key, + const char * uri, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 10) + setVirError(err, "Function virDomainSetMetadata not available prior to libvirt version 0.9.10"); +#else + ret = virDomainSetMetadata(domain, + type, + metadata, + key, + uri, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSetNumaParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 9) + setVirError(err, "Function virDomainSetNumaParameters not available prior to libvirt version 0.9.9"); +#else + ret = virDomainSetNumaParameters(domain, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSetPerfEventsWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 3, 3) + setVirError(err, "Function virDomainSetPerfEvents not available prior to libvirt version 1.3.3"); +#else + ret = virDomainSetPerfEvents(domain, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSetSchedulerParametersWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 2, 3) + setVirError(err, "Function virDomainSetSchedulerParameters not available prior to libvirt version 0.2.3"); +#else + ret = virDomainSetSchedulerParameters(domain, + params, + nparams); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSetSchedulerParametersFlagsWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 2) + setVirError(err, "Function virDomainSetSchedulerParametersFlags not available prior to libvirt version 0.9.2"); +#else + ret = virDomainSetSchedulerParametersFlags(domain, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSetTimeWrapper(virDomainPtr dom, + long long seconds, + unsigned int nseconds, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 2, 5) + setVirError(err, "Function virDomainSetTime not available prior to libvirt version 1.2.5"); +#else + ret = virDomainSetTime(dom, + seconds, + nseconds, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSetUserPasswordWrapper(virDomainPtr dom, + const char * user, + const char * password, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 2, 16) + setVirError(err, "Function virDomainSetUserPassword not available prior to libvirt version 1.2.16"); +#else + ret = virDomainSetUserPassword(dom, + user, + password, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSetVcpuWrapper(virDomainPtr domain, + const char * vcpumap, + int state, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(3, 1, 0) + setVirError(err, "Function virDomainSetVcpu not available prior to libvirt version 3.1.0"); +#else + ret = virDomainSetVcpu(domain, + vcpumap, + state, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSetVcpusWrapper(virDomainPtr domain, + unsigned int nvcpus, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 1, 4) + setVirError(err, "Function virDomainSetVcpus not available prior to libvirt version 0.1.4"); +#else + ret = virDomainSetVcpus(domain, + nvcpus); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSetVcpusFlagsWrapper(virDomainPtr domain, + unsigned int nvcpus, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 5) + setVirError(err, "Function virDomainSetVcpusFlags not available prior to libvirt version 0.8.5"); +#else + ret = virDomainSetVcpusFlags(domain, + nvcpus, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainShutdownWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 0, 3) + setVirError(err, "Function virDomainShutdown not available prior to libvirt version 0.0.3"); +#else + ret = virDomainShutdown(domain); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainShutdownFlagsWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 10) + setVirError(err, "Function virDomainShutdownFlags not available prior to libvirt version 0.9.10"); +#else + ret = virDomainShutdownFlags(domain, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainStartDirtyRateCalcWrapper(virDomainPtr domain, + int seconds, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(7, 2, 0) + setVirError(err, "Function virDomainStartDirtyRateCalc not available prior to libvirt version 7.2.0"); +#else + ret = virDomainStartDirtyRateCalc(domain, + seconds, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +void +virDomainStatsRecordListFreeWrapper(virDomainStatsRecordPtr * stats) +{ + +#if !LIBVIR_CHECK_VERSION(1, 2, 8) + setVirError(NULL, "Function virDomainStatsRecordListFree not available prior to libvirt version 1.2.8"); +#else + virDomainStatsRecordListFree(stats); +#endif + return; +} + +int +virDomainSuspendWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 0, 3) + setVirError(err, "Function virDomainSuspend not available prior to libvirt version 0.0.3"); +#else + ret = virDomainSuspend(domain); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainUndefineWrapper(virDomainPtr domain, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 1, 1) + setVirError(err, "Function virDomainUndefine not available prior to libvirt version 0.1.1"); +#else + ret = virDomainUndefine(domain); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainUndefineFlagsWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 4) + setVirError(err, "Function virDomainUndefineFlags not available prior to libvirt version 0.9.4"); +#else + ret = virDomainUndefineFlags(domain, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainUpdateDeviceFlagsWrapper(virDomainPtr domain, + const char * xml, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virDomainUpdateDeviceFlags not available prior to libvirt version 0.8.0"); +#else + ret = virDomainUpdateDeviceFlags(domain, + xml, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_domain_checkpoint.go b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_domain_checkpoint.go new file mode 100644 index 000000000..5bf165e94 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_domain_checkpoint.go @@ -0,0 +1,259 @@ +//go:build !libvirt_dlopen +// +build !libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include +#include +#include +#include "libvirt_generated.h" +#include "error_helper.h" + + +virDomainCheckpointPtr +virDomainCheckpointCreateXMLWrapper(virDomainPtr domain, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + virDomainCheckpointPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(5, 6, 0) + setVirError(err, "Function virDomainCheckpointCreateXML not available prior to libvirt version 5.6.0"); +#else + ret = virDomainCheckpointCreateXML(domain, + xmlDesc, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainCheckpointDeleteWrapper(virDomainCheckpointPtr checkpoint, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(5, 6, 0) + setVirError(err, "Function virDomainCheckpointDelete not available prior to libvirt version 5.6.0"); +#else + ret = virDomainCheckpointDelete(checkpoint, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainCheckpointFreeWrapper(virDomainCheckpointPtr checkpoint, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(5, 6, 0) + setVirError(err, "Function virDomainCheckpointFree not available prior to libvirt version 5.6.0"); +#else + ret = virDomainCheckpointFree(checkpoint); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virConnectPtr +virDomainCheckpointGetConnectWrapper(virDomainCheckpointPtr checkpoint, + virErrorPtr err) +{ + virConnectPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(5, 6, 0) + setVirError(err, "Function virDomainCheckpointGetConnect not available prior to libvirt version 5.6.0"); +#else + ret = virDomainCheckpointGetConnect(checkpoint); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virDomainPtr +virDomainCheckpointGetDomainWrapper(virDomainCheckpointPtr checkpoint, + virErrorPtr err) +{ + virDomainPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(5, 6, 0) + setVirError(err, "Function virDomainCheckpointGetDomain not available prior to libvirt version 5.6.0"); +#else + ret = virDomainCheckpointGetDomain(checkpoint); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +const char * +virDomainCheckpointGetNameWrapper(virDomainCheckpointPtr checkpoint, + virErrorPtr err) +{ + const char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(5, 6, 0) + setVirError(err, "Function virDomainCheckpointGetName not available prior to libvirt version 5.6.0"); +#else + ret = virDomainCheckpointGetName(checkpoint); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virDomainCheckpointPtr +virDomainCheckpointGetParentWrapper(virDomainCheckpointPtr checkpoint, + unsigned int flags, + virErrorPtr err) +{ + virDomainCheckpointPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(5, 6, 0) + setVirError(err, "Function virDomainCheckpointGetParent not available prior to libvirt version 5.6.0"); +#else + ret = virDomainCheckpointGetParent(checkpoint, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virDomainCheckpointGetXMLDescWrapper(virDomainCheckpointPtr checkpoint, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(5, 6, 0) + setVirError(err, "Function virDomainCheckpointGetXMLDesc not available prior to libvirt version 5.6.0"); +#else + ret = virDomainCheckpointGetXMLDesc(checkpoint, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainCheckpointListAllChildrenWrapper(virDomainCheckpointPtr checkpoint, + virDomainCheckpointPtr ** children, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(5, 6, 0) + setVirError(err, "Function virDomainCheckpointListAllChildren not available prior to libvirt version 5.6.0"); +#else + ret = virDomainCheckpointListAllChildren(checkpoint, + children, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virDomainCheckpointPtr +virDomainCheckpointLookupByNameWrapper(virDomainPtr domain, + const char * name, + unsigned int flags, + virErrorPtr err) +{ + virDomainCheckpointPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(5, 6, 0) + setVirError(err, "Function virDomainCheckpointLookupByName not available prior to libvirt version 5.6.0"); +#else + ret = virDomainCheckpointLookupByName(domain, + name, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainCheckpointRefWrapper(virDomainCheckpointPtr checkpoint, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(5, 6, 0) + setVirError(err, "Function virDomainCheckpointRef not available prior to libvirt version 5.6.0"); +#else + ret = virDomainCheckpointRef(checkpoint); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainListAllCheckpointsWrapper(virDomainPtr domain, + virDomainCheckpointPtr ** checkpoints, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(5, 6, 0) + setVirError(err, "Function virDomainListAllCheckpoints not available prior to libvirt version 5.6.0"); +#else + ret = virDomainListAllCheckpoints(domain, + checkpoints, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_domain_snapshot.go b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_domain_snapshot.go new file mode 100644 index 000000000..fe7fe051b --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_domain_snapshot.go @@ -0,0 +1,429 @@ +//go:build !libvirt_dlopen +// +build !libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include +#include +#include +#include "libvirt_generated.h" +#include "error_helper.h" + + +int +virDomainHasCurrentSnapshotWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virDomainHasCurrentSnapshot not available prior to libvirt version 0.8.0"); +#else + ret = virDomainHasCurrentSnapshot(domain, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainListAllSnapshotsWrapper(virDomainPtr domain, + virDomainSnapshotPtr ** snaps, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 13) + setVirError(err, "Function virDomainListAllSnapshots not available prior to libvirt version 0.9.13"); +#else + ret = virDomainListAllSnapshots(domain, + snaps, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainRevertToSnapshotWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virDomainRevertToSnapshot not available prior to libvirt version 0.8.0"); +#else + ret = virDomainRevertToSnapshot(snapshot, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virDomainSnapshotPtr +virDomainSnapshotCreateXMLWrapper(virDomainPtr domain, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + virDomainSnapshotPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virDomainSnapshotCreateXML not available prior to libvirt version 0.8.0"); +#else + ret = virDomainSnapshotCreateXML(domain, + xmlDesc, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virDomainSnapshotPtr +virDomainSnapshotCurrentWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + virDomainSnapshotPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virDomainSnapshotCurrent not available prior to libvirt version 0.8.0"); +#else + ret = virDomainSnapshotCurrent(domain, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSnapshotDeleteWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virDomainSnapshotDelete not available prior to libvirt version 0.8.0"); +#else + ret = virDomainSnapshotDelete(snapshot, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSnapshotFreeWrapper(virDomainSnapshotPtr snapshot, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virDomainSnapshotFree not available prior to libvirt version 0.8.0"); +#else + ret = virDomainSnapshotFree(snapshot); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virConnectPtr +virDomainSnapshotGetConnectWrapper(virDomainSnapshotPtr snapshot, + virErrorPtr err) +{ + virConnectPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 9, 5) + setVirError(err, "Function virDomainSnapshotGetConnect not available prior to libvirt version 0.9.5"); +#else + ret = virDomainSnapshotGetConnect(snapshot); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virDomainPtr +virDomainSnapshotGetDomainWrapper(virDomainSnapshotPtr snapshot, + virErrorPtr err) +{ + virDomainPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 9, 5) + setVirError(err, "Function virDomainSnapshotGetDomain not available prior to libvirt version 0.9.5"); +#else + ret = virDomainSnapshotGetDomain(snapshot); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +const char * +virDomainSnapshotGetNameWrapper(virDomainSnapshotPtr snapshot, + virErrorPtr err) +{ + const char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 9, 5) + setVirError(err, "Function virDomainSnapshotGetName not available prior to libvirt version 0.9.5"); +#else + ret = virDomainSnapshotGetName(snapshot); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virDomainSnapshotPtr +virDomainSnapshotGetParentWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err) +{ + virDomainSnapshotPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 9, 7) + setVirError(err, "Function virDomainSnapshotGetParent not available prior to libvirt version 0.9.7"); +#else + ret = virDomainSnapshotGetParent(snapshot, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virDomainSnapshotGetXMLDescWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virDomainSnapshotGetXMLDesc not available prior to libvirt version 0.8.0"); +#else + ret = virDomainSnapshotGetXMLDesc(snapshot, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSnapshotHasMetadataWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 13) + setVirError(err, "Function virDomainSnapshotHasMetadata not available prior to libvirt version 0.9.13"); +#else + ret = virDomainSnapshotHasMetadata(snapshot, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSnapshotIsCurrentWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 13) + setVirError(err, "Function virDomainSnapshotIsCurrent not available prior to libvirt version 0.9.13"); +#else + ret = virDomainSnapshotIsCurrent(snapshot, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSnapshotListAllChildrenWrapper(virDomainSnapshotPtr snapshot, + virDomainSnapshotPtr ** snaps, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 13) + setVirError(err, "Function virDomainSnapshotListAllChildren not available prior to libvirt version 0.9.13"); +#else + ret = virDomainSnapshotListAllChildren(snapshot, + snaps, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSnapshotListChildrenNamesWrapper(virDomainSnapshotPtr snapshot, + char ** names, + int nameslen, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 7) + setVirError(err, "Function virDomainSnapshotListChildrenNames not available prior to libvirt version 0.9.7"); +#else + ret = virDomainSnapshotListChildrenNames(snapshot, + names, + nameslen, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSnapshotListNamesWrapper(virDomainPtr domain, + char ** names, + int nameslen, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virDomainSnapshotListNames not available prior to libvirt version 0.8.0"); +#else + ret = virDomainSnapshotListNames(domain, + names, + nameslen, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virDomainSnapshotPtr +virDomainSnapshotLookupByNameWrapper(virDomainPtr domain, + const char * name, + unsigned int flags, + virErrorPtr err) +{ + virDomainSnapshotPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virDomainSnapshotLookupByName not available prior to libvirt version 0.8.0"); +#else + ret = virDomainSnapshotLookupByName(domain, + name, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSnapshotNumWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virDomainSnapshotNum not available prior to libvirt version 0.8.0"); +#else + ret = virDomainSnapshotNum(domain, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSnapshotNumChildrenWrapper(virDomainSnapshotPtr snapshot, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 7) + setVirError(err, "Function virDomainSnapshotNumChildren not available prior to libvirt version 0.9.7"); +#else + ret = virDomainSnapshotNumChildren(snapshot, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainSnapshotRefWrapper(virDomainSnapshotPtr snapshot, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 13) + setVirError(err, "Function virDomainSnapshotRef not available prior to libvirt version 0.9.13"); +#else + ret = virDomainSnapshotRef(snapshot); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_event.go b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_event.go new file mode 100644 index 000000000..7a1e5f4b0 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_event.go @@ -0,0 +1,203 @@ +//go:build !libvirt_dlopen +// +build !libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include +#include +#include +#include "libvirt_generated.h" +#include "error_helper.h" + + +int +virEventAddHandleWrapper(int fd, + int events, + virEventHandleCallback cb, + void * opaque, + virFreeCallback ff, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 3) + setVirError(err, "Function virEventAddHandle not available prior to libvirt version 0.9.3"); +#else + ret = virEventAddHandle(fd, + events, + cb, + opaque, + ff); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virEventAddTimeoutWrapper(int timeout, + virEventTimeoutCallback cb, + void * opaque, + virFreeCallback ff, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 3) + setVirError(err, "Function virEventAddTimeout not available prior to libvirt version 0.9.3"); +#else + ret = virEventAddTimeout(timeout, + cb, + opaque, + ff); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virEventRegisterDefaultImplWrapper(virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 0) + setVirError(err, "Function virEventRegisterDefaultImpl not available prior to libvirt version 0.9.0"); +#else + ret = virEventRegisterDefaultImpl(); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +void +virEventRegisterImplWrapper(virEventAddHandleFunc addHandle, + virEventUpdateHandleFunc updateHandle, + virEventRemoveHandleFunc removeHandle, + virEventAddTimeoutFunc addTimeout, + virEventUpdateTimeoutFunc updateTimeout, + virEventRemoveTimeoutFunc removeTimeout) +{ + +#if !LIBVIR_CHECK_VERSION(0, 5, 0) + setVirError(NULL, "Function virEventRegisterImpl not available prior to libvirt version 0.5.0"); +#else + virEventRegisterImpl(addHandle, + updateHandle, + removeHandle, + addTimeout, + updateTimeout, + removeTimeout); +#endif + return; +} + +int +virEventRemoveHandleWrapper(int watch, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 3) + setVirError(err, "Function virEventRemoveHandle not available prior to libvirt version 0.9.3"); +#else + ret = virEventRemoveHandle(watch); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virEventRemoveTimeoutWrapper(int timer, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 3) + setVirError(err, "Function virEventRemoveTimeout not available prior to libvirt version 0.9.3"); +#else + ret = virEventRemoveTimeout(timer); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virEventRunDefaultImplWrapper(virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 0) + setVirError(err, "Function virEventRunDefaultImpl not available prior to libvirt version 0.9.0"); +#else + ret = virEventRunDefaultImpl(); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +void +virEventUpdateHandleWrapper(int watch, + int events) +{ + +#if !LIBVIR_CHECK_VERSION(0, 9, 3) + setVirError(NULL, "Function virEventUpdateHandle not available prior to libvirt version 0.9.3"); +#else + virEventUpdateHandle(watch, + events); +#endif + return; +} + +void +virEventUpdateTimeoutWrapper(int timer, + int timeout) +{ + +#if !LIBVIR_CHECK_VERSION(0, 9, 3) + setVirError(NULL, "Function virEventUpdateTimeout not available prior to libvirt version 0.9.3"); +#else + virEventUpdateTimeout(timer, + timeout); +#endif + return; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_host.go b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_host.go new file mode 100644 index 000000000..18db178c6 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_host.go @@ -0,0 +1,840 @@ +//go:build !libvirt_dlopen +// +build !libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include +#include +#include +#include "libvirt_generated.h" +#include "error_helper.h" + + +char * +virConnectBaselineCPUWrapper(virConnectPtr conn, + const char ** xmlCPUs, + unsigned int ncpus, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 7, 7) + setVirError(err, "Function virConnectBaselineCPU not available prior to libvirt version 0.7.7"); +#else + ret = virConnectBaselineCPU(conn, + xmlCPUs, + ncpus, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virConnectBaselineHypervisorCPUWrapper(virConnectPtr conn, + const char * emulator, + const char * arch, + const char * machine, + const char * virttype, + const char ** xmlCPUs, + unsigned int ncpus, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(4, 4, 0) + setVirError(err, "Function virConnectBaselineHypervisorCPU not available prior to libvirt version 4.4.0"); +#else + ret = virConnectBaselineHypervisorCPU(conn, + emulator, + arch, + machine, + virttype, + xmlCPUs, + ncpus, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectCloseWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 0, 3) + setVirError(err, "Function virConnectClose not available prior to libvirt version 0.0.3"); +#else + ret = virConnectClose(conn); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectCompareCPUWrapper(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 5) + setVirError(err, "Function virConnectCompareCPU not available prior to libvirt version 0.7.5"); +#else + ret = virConnectCompareCPU(conn, + xmlDesc, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectCompareHypervisorCPUWrapper(virConnectPtr conn, + const char * emulator, + const char * arch, + const char * machine, + const char * virttype, + const char * xmlCPU, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(4, 4, 0) + setVirError(err, "Function virConnectCompareHypervisorCPU not available prior to libvirt version 4.4.0"); +#else + ret = virConnectCompareHypervisorCPU(conn, + emulator, + arch, + machine, + virttype, + xmlCPU, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectGetCPUModelNamesWrapper(virConnectPtr conn, + const char * arch, + char *** models, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 1, 3) + setVirError(err, "Function virConnectGetCPUModelNames not available prior to libvirt version 1.1.3"); +#else + ret = virConnectGetCPUModelNames(conn, + arch, + models, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virConnectGetCapabilitiesWrapper(virConnectPtr conn, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 2, 1) + setVirError(err, "Function virConnectGetCapabilities not available prior to libvirt version 0.2.1"); +#else + ret = virConnectGetCapabilities(conn); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virConnectGetHostnameWrapper(virConnectPtr conn, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 3, 0) + setVirError(err, "Function virConnectGetHostname not available prior to libvirt version 0.3.0"); +#else + ret = virConnectGetHostname(conn); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectGetLibVersionWrapper(virConnectPtr conn, + unsigned long * libVer, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 3) + setVirError(err, "Function virConnectGetLibVersion not available prior to libvirt version 0.7.3"); +#else + ret = virConnectGetLibVersion(conn, + libVer); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectGetMaxVcpusWrapper(virConnectPtr conn, + const char * type, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 2, 1) + setVirError(err, "Function virConnectGetMaxVcpus not available prior to libvirt version 0.2.1"); +#else + ret = virConnectGetMaxVcpus(conn, + type); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virConnectGetSysinfoWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 8, 8) + setVirError(err, "Function virConnectGetSysinfo not available prior to libvirt version 0.8.8"); +#else + ret = virConnectGetSysinfo(conn, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +const char * +virConnectGetTypeWrapper(virConnectPtr conn, + virErrorPtr err) +{ + const char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 0, 3) + setVirError(err, "Function virConnectGetType not available prior to libvirt version 0.0.3"); +#else + ret = virConnectGetType(conn); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virConnectGetURIWrapper(virConnectPtr conn, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 3, 0) + setVirError(err, "Function virConnectGetURI not available prior to libvirt version 0.3.0"); +#else + ret = virConnectGetURI(conn); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectGetVersionWrapper(virConnectPtr conn, + unsigned long * hvVer, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 0, 3) + setVirError(err, "Function virConnectGetVersion not available prior to libvirt version 0.0.3"); +#else + ret = virConnectGetVersion(conn, + hvVer); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectIsAliveWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 8) + setVirError(err, "Function virConnectIsAlive not available prior to libvirt version 0.9.8"); +#else + ret = virConnectIsAlive(conn); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectIsEncryptedWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 3) + setVirError(err, "Function virConnectIsEncrypted not available prior to libvirt version 0.7.3"); +#else + ret = virConnectIsEncrypted(conn); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectIsSecureWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 3) + setVirError(err, "Function virConnectIsSecure not available prior to libvirt version 0.7.3"); +#else + ret = virConnectIsSecure(conn); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virConnectPtr +virConnectOpenWrapper(const char * name, + virErrorPtr err) +{ + virConnectPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 0, 3) + setVirError(err, "Function virConnectOpen not available prior to libvirt version 0.0.3"); +#else + ret = virConnectOpen(name); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virConnectPtr +virConnectOpenAuthWrapper(const char * name, + virConnectAuthPtr auth, + unsigned int flags, + virErrorPtr err) +{ + virConnectPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 4, 0) + setVirError(err, "Function virConnectOpenAuth not available prior to libvirt version 0.4.0"); +#else + ret = virConnectOpenAuth(name, + auth, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virConnectPtr +virConnectOpenReadOnlyWrapper(const char * name, + virErrorPtr err) +{ + virConnectPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 0, 3) + setVirError(err, "Function virConnectOpenReadOnly not available prior to libvirt version 0.0.3"); +#else + ret = virConnectOpenReadOnly(name); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectRefWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 6, 0) + setVirError(err, "Function virConnectRef not available prior to libvirt version 0.6.0"); +#else + ret = virConnectRef(conn); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectRegisterCloseCallbackWrapper(virConnectPtr conn, + virConnectCloseFunc cb, + void * opaque, + virFreeCallback freecb, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 10, 0) + setVirError(err, "Function virConnectRegisterCloseCallback not available prior to libvirt version 0.10.0"); +#else + ret = virConnectRegisterCloseCallback(conn, + cb, + opaque, + freecb); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectSetIdentityWrapper(virConnectPtr conn, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(5, 8, 0) + setVirError(err, "Function virConnectSetIdentity not available prior to libvirt version 5.8.0"); +#else + ret = virConnectSetIdentity(conn, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectSetKeepAliveWrapper(virConnectPtr conn, + int interval, + unsigned int count, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 8) + setVirError(err, "Function virConnectSetKeepAlive not available prior to libvirt version 0.9.8"); +#else + ret = virConnectSetKeepAlive(conn, + interval, + count); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectUnregisterCloseCallbackWrapper(virConnectPtr conn, + virConnectCloseFunc cb, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 10, 0) + setVirError(err, "Function virConnectUnregisterCloseCallback not available prior to libvirt version 0.10.0"); +#else + ret = virConnectUnregisterCloseCallback(conn, + cb); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virGetVersionWrapper(unsigned long * libVer, + const char * type, + unsigned long * typeVer, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 0, 3) + setVirError(err, "Function virGetVersion not available prior to libvirt version 0.0.3"); +#else + ret = virGetVersion(libVer, + type, + typeVer); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virInitializeWrapper(virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 1, 0) + setVirError(err, "Function virInitialize not available prior to libvirt version 0.1.0"); +#else + ret = virInitialize(); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeAllocPagesWrapper(virConnectPtr conn, + unsigned int npages, + unsigned int * pageSizes, + unsigned long long * pageCounts, + int startCell, + unsigned int cellCount, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 2, 9) + setVirError(err, "Function virNodeAllocPages not available prior to libvirt version 1.2.9"); +#else + ret = virNodeAllocPages(conn, + npages, + pageSizes, + pageCounts, + startCell, + cellCount, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeGetCPUMapWrapper(virConnectPtr conn, + unsigned char ** cpumap, + unsigned int * online, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 0, 0) + setVirError(err, "Function virNodeGetCPUMap not available prior to libvirt version 1.0.0"); +#else + ret = virNodeGetCPUMap(conn, + cpumap, + online, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeGetCPUStatsWrapper(virConnectPtr conn, + int cpuNum, + virNodeCPUStatsPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 3) + setVirError(err, "Function virNodeGetCPUStats not available prior to libvirt version 0.9.3"); +#else + ret = virNodeGetCPUStats(conn, + cpuNum, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeGetCellsFreeMemoryWrapper(virConnectPtr conn, + unsigned long long * freeMems, + int startCell, + int maxCells, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 3, 3) + setVirError(err, "Function virNodeGetCellsFreeMemory not available prior to libvirt version 0.3.3"); +#else + ret = virNodeGetCellsFreeMemory(conn, + freeMems, + startCell, + maxCells); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +unsigned long long +virNodeGetFreeMemoryWrapper(virConnectPtr conn, + virErrorPtr err) +{ + unsigned long long ret = 0; +#if !LIBVIR_CHECK_VERSION(0, 3, 3) + setVirError(err, "Function virNodeGetFreeMemory not available prior to libvirt version 0.3.3"); +#else + ret = virNodeGetFreeMemory(conn); + if (ret == 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeGetFreePagesWrapper(virConnectPtr conn, + unsigned int npages, + unsigned int * pages, + int startCell, + unsigned int cellCount, + unsigned long long * counts, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 2, 6) + setVirError(err, "Function virNodeGetFreePages not available prior to libvirt version 1.2.6"); +#else + ret = virNodeGetFreePages(conn, + npages, + pages, + startCell, + cellCount, + counts, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeGetInfoWrapper(virConnectPtr conn, + virNodeInfoPtr info, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 1, 0) + setVirError(err, "Function virNodeGetInfo not available prior to libvirt version 0.1.0"); +#else + ret = virNodeGetInfo(conn, + info); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeGetMemoryParametersWrapper(virConnectPtr conn, + virTypedParameterPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 10, 2) + setVirError(err, "Function virNodeGetMemoryParameters not available prior to libvirt version 0.10.2"); +#else + ret = virNodeGetMemoryParameters(conn, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeGetMemoryStatsWrapper(virConnectPtr conn, + int cellNum, + virNodeMemoryStatsPtr params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 3) + setVirError(err, "Function virNodeGetMemoryStats not available prior to libvirt version 0.9.3"); +#else + ret = virNodeGetMemoryStats(conn, + cellNum, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeGetSEVInfoWrapper(virConnectPtr conn, + virTypedParameterPtr * params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(4, 5, 0) + setVirError(err, "Function virNodeGetSEVInfo not available prior to libvirt version 4.5.0"); +#else + ret = virNodeGetSEVInfo(conn, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeGetSecurityModelWrapper(virConnectPtr conn, + virSecurityModelPtr secmodel, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 6, 1) + setVirError(err, "Function virNodeGetSecurityModel not available prior to libvirt version 0.6.1"); +#else + ret = virNodeGetSecurityModel(conn, + secmodel); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeSetMemoryParametersWrapper(virConnectPtr conn, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 10, 2) + setVirError(err, "Function virNodeSetMemoryParameters not available prior to libvirt version 0.10.2"); +#else + ret = virNodeSetMemoryParameters(conn, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeSuspendForDurationWrapper(virConnectPtr conn, + unsigned int target, + unsigned long long duration, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 8) + setVirError(err, "Function virNodeSuspendForDuration not available prior to libvirt version 0.9.8"); +#else + ret = virNodeSuspendForDuration(conn, + target, + duration, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_interface.go b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_interface.go new file mode 100644 index 000000000..e7a8aa043 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_interface.go @@ -0,0 +1,413 @@ +//go:build !libvirt_dlopen +// +build !libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include +#include +#include +#include "libvirt_generated.h" +#include "error_helper.h" + + +int +virConnectListAllInterfacesWrapper(virConnectPtr conn, + virInterfacePtr ** ifaces, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 10, 2) + setVirError(err, "Function virConnectListAllInterfaces not available prior to libvirt version 0.10.2"); +#else + ret = virConnectListAllInterfaces(conn, + ifaces, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectListDefinedInterfacesWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 0) + setVirError(err, "Function virConnectListDefinedInterfaces not available prior to libvirt version 0.7.0"); +#else + ret = virConnectListDefinedInterfaces(conn, + names, + maxnames); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectListInterfacesWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 6, 4) + setVirError(err, "Function virConnectListInterfaces not available prior to libvirt version 0.6.4"); +#else + ret = virConnectListInterfaces(conn, + names, + maxnames); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectNumOfDefinedInterfacesWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 0) + setVirError(err, "Function virConnectNumOfDefinedInterfaces not available prior to libvirt version 0.7.0"); +#else + ret = virConnectNumOfDefinedInterfaces(conn); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectNumOfInterfacesWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 6, 4) + setVirError(err, "Function virConnectNumOfInterfaces not available prior to libvirt version 0.6.4"); +#else + ret = virConnectNumOfInterfaces(conn); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virInterfaceChangeBeginWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 2) + setVirError(err, "Function virInterfaceChangeBegin not available prior to libvirt version 0.9.2"); +#else + ret = virInterfaceChangeBegin(conn, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virInterfaceChangeCommitWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 2) + setVirError(err, "Function virInterfaceChangeCommit not available prior to libvirt version 0.9.2"); +#else + ret = virInterfaceChangeCommit(conn, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virInterfaceChangeRollbackWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 2) + setVirError(err, "Function virInterfaceChangeRollback not available prior to libvirt version 0.9.2"); +#else + ret = virInterfaceChangeRollback(conn, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virInterfaceCreateWrapper(virInterfacePtr iface, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 6, 4) + setVirError(err, "Function virInterfaceCreate not available prior to libvirt version 0.6.4"); +#else + ret = virInterfaceCreate(iface, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virInterfacePtr +virInterfaceDefineXMLWrapper(virConnectPtr conn, + const char * xml, + unsigned int flags, + virErrorPtr err) +{ + virInterfacePtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 6, 4) + setVirError(err, "Function virInterfaceDefineXML not available prior to libvirt version 0.6.4"); +#else + ret = virInterfaceDefineXML(conn, + xml, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virInterfaceDestroyWrapper(virInterfacePtr iface, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 6, 4) + setVirError(err, "Function virInterfaceDestroy not available prior to libvirt version 0.6.4"); +#else + ret = virInterfaceDestroy(iface, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virInterfaceFreeWrapper(virInterfacePtr iface, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 6, 4) + setVirError(err, "Function virInterfaceFree not available prior to libvirt version 0.6.4"); +#else + ret = virInterfaceFree(iface); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virConnectPtr +virInterfaceGetConnectWrapper(virInterfacePtr iface, + virErrorPtr err) +{ + virConnectPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 6, 4) + setVirError(err, "Function virInterfaceGetConnect not available prior to libvirt version 0.6.4"); +#else + ret = virInterfaceGetConnect(iface); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +const char * +virInterfaceGetMACStringWrapper(virInterfacePtr iface, + virErrorPtr err) +{ + const char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 6, 4) + setVirError(err, "Function virInterfaceGetMACString not available prior to libvirt version 0.6.4"); +#else + ret = virInterfaceGetMACString(iface); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +const char * +virInterfaceGetNameWrapper(virInterfacePtr iface, + virErrorPtr err) +{ + const char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 6, 4) + setVirError(err, "Function virInterfaceGetName not available prior to libvirt version 0.6.4"); +#else + ret = virInterfaceGetName(iface); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virInterfaceGetXMLDescWrapper(virInterfacePtr iface, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 6, 4) + setVirError(err, "Function virInterfaceGetXMLDesc not available prior to libvirt version 0.6.4"); +#else + ret = virInterfaceGetXMLDesc(iface, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virInterfaceIsActiveWrapper(virInterfacePtr iface, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 3) + setVirError(err, "Function virInterfaceIsActive not available prior to libvirt version 0.7.3"); +#else + ret = virInterfaceIsActive(iface); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virInterfacePtr +virInterfaceLookupByMACStringWrapper(virConnectPtr conn, + const char * macstr, + virErrorPtr err) +{ + virInterfacePtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 6, 4) + setVirError(err, "Function virInterfaceLookupByMACString not available prior to libvirt version 0.6.4"); +#else + ret = virInterfaceLookupByMACString(conn, + macstr); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virInterfacePtr +virInterfaceLookupByNameWrapper(virConnectPtr conn, + const char * name, + virErrorPtr err) +{ + virInterfacePtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 6, 4) + setVirError(err, "Function virInterfaceLookupByName not available prior to libvirt version 0.6.4"); +#else + ret = virInterfaceLookupByName(conn, + name); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virInterfaceRefWrapper(virInterfacePtr iface, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 6, 4) + setVirError(err, "Function virInterfaceRef not available prior to libvirt version 0.6.4"); +#else + ret = virInterfaceRef(iface); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virInterfaceUndefineWrapper(virInterfacePtr iface, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 6, 4) + setVirError(err, "Function virInterfaceUndefine not available prior to libvirt version 0.6.4"); +#else + ret = virInterfaceUndefine(iface); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_network.go b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_network.go new file mode 100644 index 000000000..aff15dfec --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_network.go @@ -0,0 +1,909 @@ +//go:build !libvirt_dlopen +// +build !libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include +#include +#include +#include "libvirt_generated.h" +#include "error_helper.h" + + +int +virConnectListAllNetworksWrapper(virConnectPtr conn, + virNetworkPtr ** nets, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 10, 2) + setVirError(err, "Function virConnectListAllNetworks not available prior to libvirt version 0.10.2"); +#else + ret = virConnectListAllNetworks(conn, + nets, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectListDefinedNetworksWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 2, 0) + setVirError(err, "Function virConnectListDefinedNetworks not available prior to libvirt version 0.2.0"); +#else + ret = virConnectListDefinedNetworks(conn, + names, + maxnames); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectListNetworksWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 2, 0) + setVirError(err, "Function virConnectListNetworks not available prior to libvirt version 0.2.0"); +#else + ret = virConnectListNetworks(conn, + names, + maxnames); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectNetworkEventDeregisterAnyWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 2, 1) + setVirError(err, "Function virConnectNetworkEventDeregisterAny not available prior to libvirt version 1.2.1"); +#else + ret = virConnectNetworkEventDeregisterAny(conn, + callbackID); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectNetworkEventRegisterAnyWrapper(virConnectPtr conn, + virNetworkPtr net, + int eventID, + virConnectNetworkEventGenericCallback cb, + void * opaque, + virFreeCallback freecb, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 2, 1) + setVirError(err, "Function virConnectNetworkEventRegisterAny not available prior to libvirt version 1.2.1"); +#else + ret = virConnectNetworkEventRegisterAny(conn, + net, + eventID, + cb, + opaque, + freecb); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectNumOfDefinedNetworksWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 2, 0) + setVirError(err, "Function virConnectNumOfDefinedNetworks not available prior to libvirt version 0.2.0"); +#else + ret = virConnectNumOfDefinedNetworks(conn); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectNumOfNetworksWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 2, 0) + setVirError(err, "Function virConnectNumOfNetworks not available prior to libvirt version 0.2.0"); +#else + ret = virConnectNumOfNetworks(conn); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNetworkCreateWrapper(virNetworkPtr network, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 2, 0) + setVirError(err, "Function virNetworkCreate not available prior to libvirt version 0.2.0"); +#else + ret = virNetworkCreate(network); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virNetworkPtr +virNetworkCreateXMLWrapper(virConnectPtr conn, + const char * xmlDesc, + virErrorPtr err) +{ + virNetworkPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 2, 0) + setVirError(err, "Function virNetworkCreateXML not available prior to libvirt version 0.2.0"); +#else + ret = virNetworkCreateXML(conn, + xmlDesc); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virNetworkPtr +virNetworkCreateXMLFlagsWrapper(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + virNetworkPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(7, 8, 0) + setVirError(err, "Function virNetworkCreateXMLFlags not available prior to libvirt version 7.8.0"); +#else + ret = virNetworkCreateXMLFlags(conn, + xmlDesc, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +void +virNetworkDHCPLeaseFreeWrapper(virNetworkDHCPLeasePtr lease) +{ + +#if !LIBVIR_CHECK_VERSION(1, 2, 6) + setVirError(NULL, "Function virNetworkDHCPLeaseFree not available prior to libvirt version 1.2.6"); +#else + virNetworkDHCPLeaseFree(lease); +#endif + return; +} + +virNetworkPtr +virNetworkDefineXMLWrapper(virConnectPtr conn, + const char * xml, + virErrorPtr err) +{ + virNetworkPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 2, 0) + setVirError(err, "Function virNetworkDefineXML not available prior to libvirt version 0.2.0"); +#else + ret = virNetworkDefineXML(conn, + xml); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virNetworkPtr +virNetworkDefineXMLFlagsWrapper(virConnectPtr conn, + const char * xml, + unsigned int flags, + virErrorPtr err) +{ + virNetworkPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(7, 7, 0) + setVirError(err, "Function virNetworkDefineXMLFlags not available prior to libvirt version 7.7.0"); +#else + ret = virNetworkDefineXMLFlags(conn, + xml, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNetworkDestroyWrapper(virNetworkPtr network, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 2, 0) + setVirError(err, "Function virNetworkDestroy not available prior to libvirt version 0.2.0"); +#else + ret = virNetworkDestroy(network); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNetworkFreeWrapper(virNetworkPtr network, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 2, 0) + setVirError(err, "Function virNetworkFree not available prior to libvirt version 0.2.0"); +#else + ret = virNetworkFree(network); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNetworkGetAutostartWrapper(virNetworkPtr network, + int * autostart, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 2, 1) + setVirError(err, "Function virNetworkGetAutostart not available prior to libvirt version 0.2.1"); +#else + ret = virNetworkGetAutostart(network, + autostart); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virNetworkGetBridgeNameWrapper(virNetworkPtr network, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 2, 0) + setVirError(err, "Function virNetworkGetBridgeName not available prior to libvirt version 0.2.0"); +#else + ret = virNetworkGetBridgeName(network); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virConnectPtr +virNetworkGetConnectWrapper(virNetworkPtr net, + virErrorPtr err) +{ + virConnectPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 3, 0) + setVirError(err, "Function virNetworkGetConnect not available prior to libvirt version 0.3.0"); +#else + ret = virNetworkGetConnect(net); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNetworkGetDHCPLeasesWrapper(virNetworkPtr network, + const char * mac, + virNetworkDHCPLeasePtr ** leases, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 2, 6) + setVirError(err, "Function virNetworkGetDHCPLeases not available prior to libvirt version 1.2.6"); +#else + ret = virNetworkGetDHCPLeases(network, + mac, + leases, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virNetworkGetMetadataWrapper(virNetworkPtr network, + int type, + const char * uri, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(9, 7, 0) + setVirError(err, "Function virNetworkGetMetadata not available prior to libvirt version 9.7.0"); +#else + ret = virNetworkGetMetadata(network, + type, + uri, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +const char * +virNetworkGetNameWrapper(virNetworkPtr network, + virErrorPtr err) +{ + const char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 2, 0) + setVirError(err, "Function virNetworkGetName not available prior to libvirt version 0.2.0"); +#else + ret = virNetworkGetName(network); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNetworkGetUUIDWrapper(virNetworkPtr network, + unsigned char * uuid, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 2, 0) + setVirError(err, "Function virNetworkGetUUID not available prior to libvirt version 0.2.0"); +#else + ret = virNetworkGetUUID(network, + uuid); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNetworkGetUUIDStringWrapper(virNetworkPtr network, + char * buf, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 2, 0) + setVirError(err, "Function virNetworkGetUUIDString not available prior to libvirt version 0.2.0"); +#else + ret = virNetworkGetUUIDString(network, + buf); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virNetworkGetXMLDescWrapper(virNetworkPtr network, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 2, 0) + setVirError(err, "Function virNetworkGetXMLDesc not available prior to libvirt version 0.2.0"); +#else + ret = virNetworkGetXMLDesc(network, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNetworkIsActiveWrapper(virNetworkPtr net, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 3) + setVirError(err, "Function virNetworkIsActive not available prior to libvirt version 0.7.3"); +#else + ret = virNetworkIsActive(net); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNetworkIsPersistentWrapper(virNetworkPtr net, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 3) + setVirError(err, "Function virNetworkIsPersistent not available prior to libvirt version 0.7.3"); +#else + ret = virNetworkIsPersistent(net); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNetworkListAllPortsWrapper(virNetworkPtr network, + virNetworkPortPtr ** ports, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(5, 5, 0) + setVirError(err, "Function virNetworkListAllPorts not available prior to libvirt version 5.5.0"); +#else + ret = virNetworkListAllPorts(network, + ports, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virNetworkPtr +virNetworkLookupByNameWrapper(virConnectPtr conn, + const char * name, + virErrorPtr err) +{ + virNetworkPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 2, 0) + setVirError(err, "Function virNetworkLookupByName not available prior to libvirt version 0.2.0"); +#else + ret = virNetworkLookupByName(conn, + name); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virNetworkPtr +virNetworkLookupByUUIDWrapper(virConnectPtr conn, + const unsigned char * uuid, + virErrorPtr err) +{ + virNetworkPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 2, 0) + setVirError(err, "Function virNetworkLookupByUUID not available prior to libvirt version 0.2.0"); +#else + ret = virNetworkLookupByUUID(conn, + uuid); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virNetworkPtr +virNetworkLookupByUUIDStringWrapper(virConnectPtr conn, + const char * uuidstr, + virErrorPtr err) +{ + virNetworkPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 2, 0) + setVirError(err, "Function virNetworkLookupByUUIDString not available prior to libvirt version 0.2.0"); +#else + ret = virNetworkLookupByUUIDString(conn, + uuidstr); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virNetworkPortPtr +virNetworkPortCreateXMLWrapper(virNetworkPtr net, + const char * xmldesc, + unsigned int flags, + virErrorPtr err) +{ + virNetworkPortPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(5, 5, 0) + setVirError(err, "Function virNetworkPortCreateXML not available prior to libvirt version 5.5.0"); +#else + ret = virNetworkPortCreateXML(net, + xmldesc, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNetworkPortDeleteWrapper(virNetworkPortPtr port, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(5, 5, 0) + setVirError(err, "Function virNetworkPortDelete not available prior to libvirt version 5.5.0"); +#else + ret = virNetworkPortDelete(port, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNetworkPortFreeWrapper(virNetworkPortPtr port, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(5, 5, 0) + setVirError(err, "Function virNetworkPortFree not available prior to libvirt version 5.5.0"); +#else + ret = virNetworkPortFree(port); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virNetworkPtr +virNetworkPortGetNetworkWrapper(virNetworkPortPtr port, + virErrorPtr err) +{ + virNetworkPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(5, 5, 0) + setVirError(err, "Function virNetworkPortGetNetwork not available prior to libvirt version 5.5.0"); +#else + ret = virNetworkPortGetNetwork(port); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNetworkPortGetParametersWrapper(virNetworkPortPtr port, + virTypedParameterPtr * params, + int * nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(5, 5, 0) + setVirError(err, "Function virNetworkPortGetParameters not available prior to libvirt version 5.5.0"); +#else + ret = virNetworkPortGetParameters(port, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNetworkPortGetUUIDWrapper(virNetworkPortPtr port, + unsigned char * uuid, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(5, 5, 0) + setVirError(err, "Function virNetworkPortGetUUID not available prior to libvirt version 5.5.0"); +#else + ret = virNetworkPortGetUUID(port, + uuid); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNetworkPortGetUUIDStringWrapper(virNetworkPortPtr port, + char * buf, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(5, 5, 0) + setVirError(err, "Function virNetworkPortGetUUIDString not available prior to libvirt version 5.5.0"); +#else + ret = virNetworkPortGetUUIDString(port, + buf); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virNetworkPortGetXMLDescWrapper(virNetworkPortPtr port, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(5, 5, 0) + setVirError(err, "Function virNetworkPortGetXMLDesc not available prior to libvirt version 5.5.0"); +#else + ret = virNetworkPortGetXMLDesc(port, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virNetworkPortPtr +virNetworkPortLookupByUUIDWrapper(virNetworkPtr net, + const unsigned char * uuid, + virErrorPtr err) +{ + virNetworkPortPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(5, 5, 0) + setVirError(err, "Function virNetworkPortLookupByUUID not available prior to libvirt version 5.5.0"); +#else + ret = virNetworkPortLookupByUUID(net, + uuid); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virNetworkPortPtr +virNetworkPortLookupByUUIDStringWrapper(virNetworkPtr net, + const char * uuidstr, + virErrorPtr err) +{ + virNetworkPortPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(5, 5, 0) + setVirError(err, "Function virNetworkPortLookupByUUIDString not available prior to libvirt version 5.5.0"); +#else + ret = virNetworkPortLookupByUUIDString(net, + uuidstr); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNetworkPortRefWrapper(virNetworkPortPtr port, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(5, 5, 0) + setVirError(err, "Function virNetworkPortRef not available prior to libvirt version 5.5.0"); +#else + ret = virNetworkPortRef(port); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNetworkPortSetParametersWrapper(virNetworkPortPtr port, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(5, 5, 0) + setVirError(err, "Function virNetworkPortSetParameters not available prior to libvirt version 5.5.0"); +#else + ret = virNetworkPortSetParameters(port, + params, + nparams, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNetworkRefWrapper(virNetworkPtr network, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 6, 0) + setVirError(err, "Function virNetworkRef not available prior to libvirt version 0.6.0"); +#else + ret = virNetworkRef(network); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNetworkSetAutostartWrapper(virNetworkPtr network, + int autostart, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 2, 1) + setVirError(err, "Function virNetworkSetAutostart not available prior to libvirt version 0.2.1"); +#else + ret = virNetworkSetAutostart(network, + autostart); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNetworkSetMetadataWrapper(virNetworkPtr network, + int type, + const char * metadata, + const char * key, + const char * uri, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(9, 7, 0) + setVirError(err, "Function virNetworkSetMetadata not available prior to libvirt version 9.7.0"); +#else + ret = virNetworkSetMetadata(network, + type, + metadata, + key, + uri, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNetworkUndefineWrapper(virNetworkPtr network, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 2, 0) + setVirError(err, "Function virNetworkUndefine not available prior to libvirt version 0.2.0"); +#else + ret = virNetworkUndefine(network); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNetworkUpdateWrapper(virNetworkPtr network, + unsigned int command, + unsigned int section, + int parentIndex, + const char * xml, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 10, 2) + setVirError(err, "Function virNetworkUpdate not available prior to libvirt version 0.10.2"); +#else + ret = virNetworkUpdate(network, + command, + section, + parentIndex, + xml, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_nodedev.go b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_nodedev.go new file mode 100644 index 000000000..c7e8592a1 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_nodedev.go @@ -0,0 +1,559 @@ +//go:build !libvirt_dlopen +// +build !libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include +#include +#include +#include "libvirt_generated.h" +#include "error_helper.h" + + +int +virConnectListAllNodeDevicesWrapper(virConnectPtr conn, + virNodeDevicePtr ** devices, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 10, 2) + setVirError(err, "Function virConnectListAllNodeDevices not available prior to libvirt version 0.10.2"); +#else + ret = virConnectListAllNodeDevices(conn, + devices, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectNodeDeviceEventDeregisterAnyWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(2, 2, 0) + setVirError(err, "Function virConnectNodeDeviceEventDeregisterAny not available prior to libvirt version 2.2.0"); +#else + ret = virConnectNodeDeviceEventDeregisterAny(conn, + callbackID); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectNodeDeviceEventRegisterAnyWrapper(virConnectPtr conn, + virNodeDevicePtr dev, + int eventID, + virConnectNodeDeviceEventGenericCallback cb, + void * opaque, + virFreeCallback freecb, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(2, 2, 0) + setVirError(err, "Function virConnectNodeDeviceEventRegisterAny not available prior to libvirt version 2.2.0"); +#else + ret = virConnectNodeDeviceEventRegisterAny(conn, + dev, + eventID, + cb, + opaque, + freecb); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeDeviceCreateWrapper(virNodeDevicePtr dev, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(7, 3, 0) + setVirError(err, "Function virNodeDeviceCreate not available prior to libvirt version 7.3.0"); +#else + ret = virNodeDeviceCreate(dev, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virNodeDevicePtr +virNodeDeviceCreateXMLWrapper(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + virNodeDevicePtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 6, 3) + setVirError(err, "Function virNodeDeviceCreateXML not available prior to libvirt version 0.6.3"); +#else + ret = virNodeDeviceCreateXML(conn, + xmlDesc, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virNodeDevicePtr +virNodeDeviceDefineXMLWrapper(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + virNodeDevicePtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(7, 3, 0) + setVirError(err, "Function virNodeDeviceDefineXML not available prior to libvirt version 7.3.0"); +#else + ret = virNodeDeviceDefineXML(conn, + xmlDesc, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeDeviceDestroyWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 6, 3) + setVirError(err, "Function virNodeDeviceDestroy not available prior to libvirt version 0.6.3"); +#else + ret = virNodeDeviceDestroy(dev); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeDeviceDetachFlagsWrapper(virNodeDevicePtr dev, + const char * driverName, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 0, 5) + setVirError(err, "Function virNodeDeviceDetachFlags not available prior to libvirt version 1.0.5"); +#else + ret = virNodeDeviceDetachFlags(dev, + driverName, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeDeviceDettachWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 6, 1) + setVirError(err, "Function virNodeDeviceDettach not available prior to libvirt version 0.6.1"); +#else + ret = virNodeDeviceDettach(dev); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeDeviceFreeWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 5, 0) + setVirError(err, "Function virNodeDeviceFree not available prior to libvirt version 0.5.0"); +#else + ret = virNodeDeviceFree(dev); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeDeviceGetAutostartWrapper(virNodeDevicePtr dev, + int * autostart, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(7, 8, 0) + setVirError(err, "Function virNodeDeviceGetAutostart not available prior to libvirt version 7.8.0"); +#else + ret = virNodeDeviceGetAutostart(dev, + autostart); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +const char * +virNodeDeviceGetNameWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + const char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 5, 0) + setVirError(err, "Function virNodeDeviceGetName not available prior to libvirt version 0.5.0"); +#else + ret = virNodeDeviceGetName(dev); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +const char * +virNodeDeviceGetParentWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + const char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 5, 0) + setVirError(err, "Function virNodeDeviceGetParent not available prior to libvirt version 0.5.0"); +#else + ret = virNodeDeviceGetParent(dev); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virNodeDeviceGetXMLDescWrapper(virNodeDevicePtr dev, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 5, 0) + setVirError(err, "Function virNodeDeviceGetXMLDesc not available prior to libvirt version 0.5.0"); +#else + ret = virNodeDeviceGetXMLDesc(dev, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeDeviceIsActiveWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(7, 8, 0) + setVirError(err, "Function virNodeDeviceIsActive not available prior to libvirt version 7.8.0"); +#else + ret = virNodeDeviceIsActive(dev); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeDeviceIsPersistentWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(7, 8, 0) + setVirError(err, "Function virNodeDeviceIsPersistent not available prior to libvirt version 7.8.0"); +#else + ret = virNodeDeviceIsPersistent(dev); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeDeviceListCapsWrapper(virNodeDevicePtr dev, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 5, 0) + setVirError(err, "Function virNodeDeviceListCaps not available prior to libvirt version 0.5.0"); +#else + ret = virNodeDeviceListCaps(dev, + names, + maxnames); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virNodeDevicePtr +virNodeDeviceLookupByNameWrapper(virConnectPtr conn, + const char * name, + virErrorPtr err) +{ + virNodeDevicePtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 5, 0) + setVirError(err, "Function virNodeDeviceLookupByName not available prior to libvirt version 0.5.0"); +#else + ret = virNodeDeviceLookupByName(conn, + name); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virNodeDevicePtr +virNodeDeviceLookupSCSIHostByWWNWrapper(virConnectPtr conn, + const char * wwnn, + const char * wwpn, + unsigned int flags, + virErrorPtr err) +{ + virNodeDevicePtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(1, 0, 3) + setVirError(err, "Function virNodeDeviceLookupSCSIHostByWWN not available prior to libvirt version 1.0.3"); +#else + ret = virNodeDeviceLookupSCSIHostByWWN(conn, + wwnn, + wwpn, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeDeviceNumOfCapsWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 5, 0) + setVirError(err, "Function virNodeDeviceNumOfCaps not available prior to libvirt version 0.5.0"); +#else + ret = virNodeDeviceNumOfCaps(dev); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeDeviceReAttachWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 6, 1) + setVirError(err, "Function virNodeDeviceReAttach not available prior to libvirt version 0.6.1"); +#else + ret = virNodeDeviceReAttach(dev); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeDeviceRefWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 6, 0) + setVirError(err, "Function virNodeDeviceRef not available prior to libvirt version 0.6.0"); +#else + ret = virNodeDeviceRef(dev); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeDeviceResetWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 6, 1) + setVirError(err, "Function virNodeDeviceReset not available prior to libvirt version 0.6.1"); +#else + ret = virNodeDeviceReset(dev); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeDeviceSetAutostartWrapper(virNodeDevicePtr dev, + int autostart, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(7, 8, 0) + setVirError(err, "Function virNodeDeviceSetAutostart not available prior to libvirt version 7.8.0"); +#else + ret = virNodeDeviceSetAutostart(dev, + autostart); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeDeviceUndefineWrapper(virNodeDevicePtr dev, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(7, 3, 0) + setVirError(err, "Function virNodeDeviceUndefine not available prior to libvirt version 7.3.0"); +#else + ret = virNodeDeviceUndefine(dev, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeDeviceUpdateWrapper(virNodeDevicePtr dev, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(10, 1, 0) + setVirError(err, "Function virNodeDeviceUpdate not available prior to libvirt version 10.1.0"); +#else + ret = virNodeDeviceUpdate(dev, + xmlDesc, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeListDevicesWrapper(virConnectPtr conn, + const char * cap, + char ** const names, + int maxnames, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 5, 0) + setVirError(err, "Function virNodeListDevices not available prior to libvirt version 0.5.0"); +#else + ret = virNodeListDevices(conn, + cap, + names, + maxnames, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNodeNumOfDevicesWrapper(virConnectPtr conn, + const char * cap, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 5, 0) + setVirError(err, "Function virNodeNumOfDevices not available prior to libvirt version 0.5.0"); +#else + ret = virNodeNumOfDevices(conn, + cap, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_nwfilter.go b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_nwfilter.go new file mode 100644 index 000000000..c0562f972 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_nwfilter.go @@ -0,0 +1,467 @@ +//go:build !libvirt_dlopen +// +build !libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include +#include +#include +#include "libvirt_generated.h" +#include "error_helper.h" + + +int +virConnectListAllNWFilterBindingsWrapper(virConnectPtr conn, + virNWFilterBindingPtr ** bindings, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(4, 5, 0) + setVirError(err, "Function virConnectListAllNWFilterBindings not available prior to libvirt version 4.5.0"); +#else + ret = virConnectListAllNWFilterBindings(conn, + bindings, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectListAllNWFiltersWrapper(virConnectPtr conn, + virNWFilterPtr ** filters, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 10, 2) + setVirError(err, "Function virConnectListAllNWFilters not available prior to libvirt version 0.10.2"); +#else + ret = virConnectListAllNWFilters(conn, + filters, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectListNWFiltersWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virConnectListNWFilters not available prior to libvirt version 0.8.0"); +#else + ret = virConnectListNWFilters(conn, + names, + maxnames); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectNumOfNWFiltersWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virConnectNumOfNWFilters not available prior to libvirt version 0.8.0"); +#else + ret = virConnectNumOfNWFilters(conn); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virNWFilterBindingPtr +virNWFilterBindingCreateXMLWrapper(virConnectPtr conn, + const char * xml, + unsigned int flags, + virErrorPtr err) +{ + virNWFilterBindingPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(4, 5, 0) + setVirError(err, "Function virNWFilterBindingCreateXML not available prior to libvirt version 4.5.0"); +#else + ret = virNWFilterBindingCreateXML(conn, + xml, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNWFilterBindingDeleteWrapper(virNWFilterBindingPtr binding, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(4, 5, 0) + setVirError(err, "Function virNWFilterBindingDelete not available prior to libvirt version 4.5.0"); +#else + ret = virNWFilterBindingDelete(binding); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNWFilterBindingFreeWrapper(virNWFilterBindingPtr binding, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(4, 5, 0) + setVirError(err, "Function virNWFilterBindingFree not available prior to libvirt version 4.5.0"); +#else + ret = virNWFilterBindingFree(binding); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +const char * +virNWFilterBindingGetFilterNameWrapper(virNWFilterBindingPtr binding, + virErrorPtr err) +{ + const char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(4, 5, 0) + setVirError(err, "Function virNWFilterBindingGetFilterName not available prior to libvirt version 4.5.0"); +#else + ret = virNWFilterBindingGetFilterName(binding); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +const char * +virNWFilterBindingGetPortDevWrapper(virNWFilterBindingPtr binding, + virErrorPtr err) +{ + const char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(4, 5, 0) + setVirError(err, "Function virNWFilterBindingGetPortDev not available prior to libvirt version 4.5.0"); +#else + ret = virNWFilterBindingGetPortDev(binding); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virNWFilterBindingGetXMLDescWrapper(virNWFilterBindingPtr binding, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(4, 5, 0) + setVirError(err, "Function virNWFilterBindingGetXMLDesc not available prior to libvirt version 4.5.0"); +#else + ret = virNWFilterBindingGetXMLDesc(binding, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virNWFilterBindingPtr +virNWFilterBindingLookupByPortDevWrapper(virConnectPtr conn, + const char * portdev, + virErrorPtr err) +{ + virNWFilterBindingPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(4, 5, 0) + setVirError(err, "Function virNWFilterBindingLookupByPortDev not available prior to libvirt version 4.5.0"); +#else + ret = virNWFilterBindingLookupByPortDev(conn, + portdev); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNWFilterBindingRefWrapper(virNWFilterBindingPtr binding, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(4, 5, 0) + setVirError(err, "Function virNWFilterBindingRef not available prior to libvirt version 4.5.0"); +#else + ret = virNWFilterBindingRef(binding); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virNWFilterPtr +virNWFilterDefineXMLWrapper(virConnectPtr conn, + const char * xmlDesc, + virErrorPtr err) +{ + virNWFilterPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virNWFilterDefineXML not available prior to libvirt version 0.8.0"); +#else + ret = virNWFilterDefineXML(conn, + xmlDesc); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virNWFilterPtr +virNWFilterDefineXMLFlagsWrapper(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + virNWFilterPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(7, 7, 0) + setVirError(err, "Function virNWFilterDefineXMLFlags not available prior to libvirt version 7.7.0"); +#else + ret = virNWFilterDefineXMLFlags(conn, + xmlDesc, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNWFilterFreeWrapper(virNWFilterPtr nwfilter, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virNWFilterFree not available prior to libvirt version 0.8.0"); +#else + ret = virNWFilterFree(nwfilter); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +const char * +virNWFilterGetNameWrapper(virNWFilterPtr nwfilter, + virErrorPtr err) +{ + const char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virNWFilterGetName not available prior to libvirt version 0.8.0"); +#else + ret = virNWFilterGetName(nwfilter); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNWFilterGetUUIDWrapper(virNWFilterPtr nwfilter, + unsigned char * uuid, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virNWFilterGetUUID not available prior to libvirt version 0.8.0"); +#else + ret = virNWFilterGetUUID(nwfilter, + uuid); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNWFilterGetUUIDStringWrapper(virNWFilterPtr nwfilter, + char * buf, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virNWFilterGetUUIDString not available prior to libvirt version 0.8.0"); +#else + ret = virNWFilterGetUUIDString(nwfilter, + buf); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virNWFilterGetXMLDescWrapper(virNWFilterPtr nwfilter, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virNWFilterGetXMLDesc not available prior to libvirt version 0.8.0"); +#else + ret = virNWFilterGetXMLDesc(nwfilter, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virNWFilterPtr +virNWFilterLookupByNameWrapper(virConnectPtr conn, + const char * name, + virErrorPtr err) +{ + virNWFilterPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virNWFilterLookupByName not available prior to libvirt version 0.8.0"); +#else + ret = virNWFilterLookupByName(conn, + name); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virNWFilterPtr +virNWFilterLookupByUUIDWrapper(virConnectPtr conn, + const unsigned char * uuid, + virErrorPtr err) +{ + virNWFilterPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virNWFilterLookupByUUID not available prior to libvirt version 0.8.0"); +#else + ret = virNWFilterLookupByUUID(conn, + uuid); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virNWFilterPtr +virNWFilterLookupByUUIDStringWrapper(virConnectPtr conn, + const char * uuidstr, + virErrorPtr err) +{ + virNWFilterPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virNWFilterLookupByUUIDString not available prior to libvirt version 0.8.0"); +#else + ret = virNWFilterLookupByUUIDString(conn, + uuidstr); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNWFilterRefWrapper(virNWFilterPtr nwfilter, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virNWFilterRef not available prior to libvirt version 0.8.0"); +#else + ret = virNWFilterRef(nwfilter); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virNWFilterUndefineWrapper(virNWFilterPtr nwfilter, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virNWFilterUndefine not available prior to libvirt version 0.8.0"); +#else + ret = virNWFilterUndefine(nwfilter); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_secret.go b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_secret.go new file mode 100644 index 000000000..c502c288e --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_secret.go @@ -0,0 +1,413 @@ +//go:build !libvirt_dlopen +// +build !libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include +#include +#include +#include "libvirt_generated.h" +#include "error_helper.h" + + +int +virConnectListAllSecretsWrapper(virConnectPtr conn, + virSecretPtr ** secrets, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 10, 2) + setVirError(err, "Function virConnectListAllSecrets not available prior to libvirt version 0.10.2"); +#else + ret = virConnectListAllSecrets(conn, + secrets, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectListSecretsWrapper(virConnectPtr conn, + char ** uuids, + int maxuuids, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 1) + setVirError(err, "Function virConnectListSecrets not available prior to libvirt version 0.7.1"); +#else + ret = virConnectListSecrets(conn, + uuids, + maxuuids); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectNumOfSecretsWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 1) + setVirError(err, "Function virConnectNumOfSecrets not available prior to libvirt version 0.7.1"); +#else + ret = virConnectNumOfSecrets(conn); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectSecretEventDeregisterAnyWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(3, 0, 0) + setVirError(err, "Function virConnectSecretEventDeregisterAny not available prior to libvirt version 3.0.0"); +#else + ret = virConnectSecretEventDeregisterAny(conn, + callbackID); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectSecretEventRegisterAnyWrapper(virConnectPtr conn, + virSecretPtr secret, + int eventID, + virConnectSecretEventGenericCallback cb, + void * opaque, + virFreeCallback freecb, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(3, 0, 0) + setVirError(err, "Function virConnectSecretEventRegisterAny not available prior to libvirt version 3.0.0"); +#else + ret = virConnectSecretEventRegisterAny(conn, + secret, + eventID, + cb, + opaque, + freecb); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virSecretPtr +virSecretDefineXMLWrapper(virConnectPtr conn, + const char * xml, + unsigned int flags, + virErrorPtr err) +{ + virSecretPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 7, 1) + setVirError(err, "Function virSecretDefineXML not available prior to libvirt version 0.7.1"); +#else + ret = virSecretDefineXML(conn, + xml, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virSecretFreeWrapper(virSecretPtr secret, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 1) + setVirError(err, "Function virSecretFree not available prior to libvirt version 0.7.1"); +#else + ret = virSecretFree(secret); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virConnectPtr +virSecretGetConnectWrapper(virSecretPtr secret, + virErrorPtr err) +{ + virConnectPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 7, 1) + setVirError(err, "Function virSecretGetConnect not available prior to libvirt version 0.7.1"); +#else + ret = virSecretGetConnect(secret); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virSecretGetUUIDWrapper(virSecretPtr secret, + unsigned char * uuid, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 1) + setVirError(err, "Function virSecretGetUUID not available prior to libvirt version 0.7.1"); +#else + ret = virSecretGetUUID(secret, + uuid); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virSecretGetUUIDStringWrapper(virSecretPtr secret, + char * buf, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 1) + setVirError(err, "Function virSecretGetUUIDString not available prior to libvirt version 0.7.1"); +#else + ret = virSecretGetUUIDString(secret, + buf); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +const char * +virSecretGetUsageIDWrapper(virSecretPtr secret, + virErrorPtr err) +{ + const char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 7, 1) + setVirError(err, "Function virSecretGetUsageID not available prior to libvirt version 0.7.1"); +#else + ret = virSecretGetUsageID(secret); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virSecretGetUsageTypeWrapper(virSecretPtr secret, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 1) + setVirError(err, "Function virSecretGetUsageType not available prior to libvirt version 0.7.1"); +#else + ret = virSecretGetUsageType(secret); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +unsigned char * +virSecretGetValueWrapper(virSecretPtr secret, + size_t * value_size, + unsigned int flags, + virErrorPtr err) +{ + unsigned char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 7, 1) + setVirError(err, "Function virSecretGetValue not available prior to libvirt version 0.7.1"); +#else + ret = virSecretGetValue(secret, + value_size, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virSecretGetXMLDescWrapper(virSecretPtr secret, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 7, 1) + setVirError(err, "Function virSecretGetXMLDesc not available prior to libvirt version 0.7.1"); +#else + ret = virSecretGetXMLDesc(secret, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virSecretPtr +virSecretLookupByUUIDWrapper(virConnectPtr conn, + const unsigned char * uuid, + virErrorPtr err) +{ + virSecretPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 7, 1) + setVirError(err, "Function virSecretLookupByUUID not available prior to libvirt version 0.7.1"); +#else + ret = virSecretLookupByUUID(conn, + uuid); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virSecretPtr +virSecretLookupByUUIDStringWrapper(virConnectPtr conn, + const char * uuidstr, + virErrorPtr err) +{ + virSecretPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 7, 1) + setVirError(err, "Function virSecretLookupByUUIDString not available prior to libvirt version 0.7.1"); +#else + ret = virSecretLookupByUUIDString(conn, + uuidstr); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virSecretPtr +virSecretLookupByUsageWrapper(virConnectPtr conn, + int usageType, + const char * usageID, + virErrorPtr err) +{ + virSecretPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 7, 1) + setVirError(err, "Function virSecretLookupByUsage not available prior to libvirt version 0.7.1"); +#else + ret = virSecretLookupByUsage(conn, + usageType, + usageID); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virSecretRefWrapper(virSecretPtr secret, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 1) + setVirError(err, "Function virSecretRef not available prior to libvirt version 0.7.1"); +#else + ret = virSecretRef(secret); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virSecretSetValueWrapper(virSecretPtr secret, + const unsigned char * value, + size_t value_size, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 1) + setVirError(err, "Function virSecretSetValue not available prior to libvirt version 0.7.1"); +#else + ret = virSecretSetValue(secret, + value, + value_size, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virSecretUndefineWrapper(virSecretPtr secret, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 1) + setVirError(err, "Function virSecretUndefine not available prior to libvirt version 0.7.1"); +#else + ret = virSecretUndefine(secret); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_storage.go b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_storage.go new file mode 100644 index 000000000..f2199e9a3 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_storage.go @@ -0,0 +1,1085 @@ +//go:build !libvirt_dlopen +// +build !libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include +#include +#include +#include "libvirt_generated.h" +#include "error_helper.h" + + +char * +virConnectFindStoragePoolSourcesWrapper(virConnectPtr conn, + const char * type, + const char * srcSpec, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 4, 5) + setVirError(err, "Function virConnectFindStoragePoolSources not available prior to libvirt version 0.4.5"); +#else + ret = virConnectFindStoragePoolSources(conn, + type, + srcSpec, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virConnectGetStoragePoolCapabilitiesWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(5, 2, 0) + setVirError(err, "Function virConnectGetStoragePoolCapabilities not available prior to libvirt version 5.2.0"); +#else + ret = virConnectGetStoragePoolCapabilities(conn, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectListAllStoragePoolsWrapper(virConnectPtr conn, + virStoragePoolPtr ** pools, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 10, 2) + setVirError(err, "Function virConnectListAllStoragePools not available prior to libvirt version 0.10.2"); +#else + ret = virConnectListAllStoragePools(conn, + pools, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectListDefinedStoragePoolsWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virConnectListDefinedStoragePools not available prior to libvirt version 0.4.1"); +#else + ret = virConnectListDefinedStoragePools(conn, + names, + maxnames); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectListStoragePoolsWrapper(virConnectPtr conn, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virConnectListStoragePools not available prior to libvirt version 0.4.1"); +#else + ret = virConnectListStoragePools(conn, + names, + maxnames); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectNumOfDefinedStoragePoolsWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virConnectNumOfDefinedStoragePools not available prior to libvirt version 0.4.1"); +#else + ret = virConnectNumOfDefinedStoragePools(conn); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectNumOfStoragePoolsWrapper(virConnectPtr conn, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virConnectNumOfStoragePools not available prior to libvirt version 0.4.1"); +#else + ret = virConnectNumOfStoragePools(conn); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectStoragePoolEventDeregisterAnyWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(2, 0, 0) + setVirError(err, "Function virConnectStoragePoolEventDeregisterAny not available prior to libvirt version 2.0.0"); +#else + ret = virConnectStoragePoolEventDeregisterAny(conn, + callbackID); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectStoragePoolEventRegisterAnyWrapper(virConnectPtr conn, + virStoragePoolPtr pool, + int eventID, + virConnectStoragePoolEventGenericCallback cb, + void * opaque, + virFreeCallback freecb, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(2, 0, 0) + setVirError(err, "Function virConnectStoragePoolEventRegisterAny not available prior to libvirt version 2.0.0"); +#else + ret = virConnectStoragePoolEventRegisterAny(conn, + pool, + eventID, + cb, + opaque, + freecb); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStoragePoolBuildWrapper(virStoragePoolPtr pool, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStoragePoolBuild not available prior to libvirt version 0.4.1"); +#else + ret = virStoragePoolBuild(pool, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStoragePoolCreateWrapper(virStoragePoolPtr pool, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStoragePoolCreate not available prior to libvirt version 0.4.1"); +#else + ret = virStoragePoolCreate(pool, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virStoragePoolPtr +virStoragePoolCreateXMLWrapper(virConnectPtr conn, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + virStoragePoolPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStoragePoolCreateXML not available prior to libvirt version 0.4.1"); +#else + ret = virStoragePoolCreateXML(conn, + xmlDesc, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virStoragePoolPtr +virStoragePoolDefineXMLWrapper(virConnectPtr conn, + const char * xml, + unsigned int flags, + virErrorPtr err) +{ + virStoragePoolPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStoragePoolDefineXML not available prior to libvirt version 0.4.1"); +#else + ret = virStoragePoolDefineXML(conn, + xml, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStoragePoolDeleteWrapper(virStoragePoolPtr pool, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStoragePoolDelete not available prior to libvirt version 0.4.1"); +#else + ret = virStoragePoolDelete(pool, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStoragePoolDestroyWrapper(virStoragePoolPtr pool, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStoragePoolDestroy not available prior to libvirt version 0.4.1"); +#else + ret = virStoragePoolDestroy(pool); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStoragePoolFreeWrapper(virStoragePoolPtr pool, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStoragePoolFree not available prior to libvirt version 0.4.1"); +#else + ret = virStoragePoolFree(pool); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStoragePoolGetAutostartWrapper(virStoragePoolPtr pool, + int * autostart, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStoragePoolGetAutostart not available prior to libvirt version 0.4.1"); +#else + ret = virStoragePoolGetAutostart(pool, + autostart); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virConnectPtr +virStoragePoolGetConnectWrapper(virStoragePoolPtr pool, + virErrorPtr err) +{ + virConnectPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStoragePoolGetConnect not available prior to libvirt version 0.4.1"); +#else + ret = virStoragePoolGetConnect(pool); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStoragePoolGetInfoWrapper(virStoragePoolPtr pool, + virStoragePoolInfoPtr info, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStoragePoolGetInfo not available prior to libvirt version 0.4.1"); +#else + ret = virStoragePoolGetInfo(pool, + info); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +const char * +virStoragePoolGetNameWrapper(virStoragePoolPtr pool, + virErrorPtr err) +{ + const char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStoragePoolGetName not available prior to libvirt version 0.4.1"); +#else + ret = virStoragePoolGetName(pool); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStoragePoolGetUUIDWrapper(virStoragePoolPtr pool, + unsigned char * uuid, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStoragePoolGetUUID not available prior to libvirt version 0.4.1"); +#else + ret = virStoragePoolGetUUID(pool, + uuid); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStoragePoolGetUUIDStringWrapper(virStoragePoolPtr pool, + char * buf, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStoragePoolGetUUIDString not available prior to libvirt version 0.4.1"); +#else + ret = virStoragePoolGetUUIDString(pool, + buf); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virStoragePoolGetXMLDescWrapper(virStoragePoolPtr pool, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStoragePoolGetXMLDesc not available prior to libvirt version 0.4.1"); +#else + ret = virStoragePoolGetXMLDesc(pool, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStoragePoolIsActiveWrapper(virStoragePoolPtr pool, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 3) + setVirError(err, "Function virStoragePoolIsActive not available prior to libvirt version 0.7.3"); +#else + ret = virStoragePoolIsActive(pool); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStoragePoolIsPersistentWrapper(virStoragePoolPtr pool, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 3) + setVirError(err, "Function virStoragePoolIsPersistent not available prior to libvirt version 0.7.3"); +#else + ret = virStoragePoolIsPersistent(pool); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStoragePoolListAllVolumesWrapper(virStoragePoolPtr pool, + virStorageVolPtr ** vols, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 10, 2) + setVirError(err, "Function virStoragePoolListAllVolumes not available prior to libvirt version 0.10.2"); +#else + ret = virStoragePoolListAllVolumes(pool, + vols, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStoragePoolListVolumesWrapper(virStoragePoolPtr pool, + char ** const names, + int maxnames, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStoragePoolListVolumes not available prior to libvirt version 0.4.1"); +#else + ret = virStoragePoolListVolumes(pool, + names, + maxnames); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virStoragePoolPtr +virStoragePoolLookupByNameWrapper(virConnectPtr conn, + const char * name, + virErrorPtr err) +{ + virStoragePoolPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStoragePoolLookupByName not available prior to libvirt version 0.4.1"); +#else + ret = virStoragePoolLookupByName(conn, + name); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virStoragePoolPtr +virStoragePoolLookupByTargetPathWrapper(virConnectPtr conn, + const char * path, + virErrorPtr err) +{ + virStoragePoolPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(4, 1, 0) + setVirError(err, "Function virStoragePoolLookupByTargetPath not available prior to libvirt version 4.1.0"); +#else + ret = virStoragePoolLookupByTargetPath(conn, + path); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virStoragePoolPtr +virStoragePoolLookupByUUIDWrapper(virConnectPtr conn, + const unsigned char * uuid, + virErrorPtr err) +{ + virStoragePoolPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStoragePoolLookupByUUID not available prior to libvirt version 0.4.1"); +#else + ret = virStoragePoolLookupByUUID(conn, + uuid); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virStoragePoolPtr +virStoragePoolLookupByUUIDStringWrapper(virConnectPtr conn, + const char * uuidstr, + virErrorPtr err) +{ + virStoragePoolPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStoragePoolLookupByUUIDString not available prior to libvirt version 0.4.1"); +#else + ret = virStoragePoolLookupByUUIDString(conn, + uuidstr); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virStoragePoolPtr +virStoragePoolLookupByVolumeWrapper(virStorageVolPtr vol, + virErrorPtr err) +{ + virStoragePoolPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStoragePoolLookupByVolume not available prior to libvirt version 0.4.1"); +#else + ret = virStoragePoolLookupByVolume(vol); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStoragePoolNumOfVolumesWrapper(virStoragePoolPtr pool, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStoragePoolNumOfVolumes not available prior to libvirt version 0.4.1"); +#else + ret = virStoragePoolNumOfVolumes(pool); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStoragePoolRefWrapper(virStoragePoolPtr pool, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 6, 0) + setVirError(err, "Function virStoragePoolRef not available prior to libvirt version 0.6.0"); +#else + ret = virStoragePoolRef(pool); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStoragePoolRefreshWrapper(virStoragePoolPtr pool, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStoragePoolRefresh not available prior to libvirt version 0.4.1"); +#else + ret = virStoragePoolRefresh(pool, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStoragePoolSetAutostartWrapper(virStoragePoolPtr pool, + int autostart, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStoragePoolSetAutostart not available prior to libvirt version 0.4.1"); +#else + ret = virStoragePoolSetAutostart(pool, + autostart); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStoragePoolUndefineWrapper(virStoragePoolPtr pool, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStoragePoolUndefine not available prior to libvirt version 0.4.1"); +#else + ret = virStoragePoolUndefine(pool); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virStorageVolPtr +virStorageVolCreateXMLWrapper(virStoragePoolPtr pool, + const char * xmlDesc, + unsigned int flags, + virErrorPtr err) +{ + virStorageVolPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStorageVolCreateXML not available prior to libvirt version 0.4.1"); +#else + ret = virStorageVolCreateXML(pool, + xmlDesc, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virStorageVolPtr +virStorageVolCreateXMLFromWrapper(virStoragePoolPtr pool, + const char * xmlDesc, + virStorageVolPtr clonevol, + unsigned int flags, + virErrorPtr err) +{ + virStorageVolPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 6, 4) + setVirError(err, "Function virStorageVolCreateXMLFrom not available prior to libvirt version 0.6.4"); +#else + ret = virStorageVolCreateXMLFrom(pool, + xmlDesc, + clonevol, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStorageVolDeleteWrapper(virStorageVolPtr vol, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStorageVolDelete not available prior to libvirt version 0.4.1"); +#else + ret = virStorageVolDelete(vol, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStorageVolDownloadWrapper(virStorageVolPtr vol, + virStreamPtr stream, + unsigned long long offset, + unsigned long long length, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 0) + setVirError(err, "Function virStorageVolDownload not available prior to libvirt version 0.9.0"); +#else + ret = virStorageVolDownload(vol, + stream, + offset, + length, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStorageVolFreeWrapper(virStorageVolPtr vol, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStorageVolFree not available prior to libvirt version 0.4.1"); +#else + ret = virStorageVolFree(vol); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virConnectPtr +virStorageVolGetConnectWrapper(virStorageVolPtr vol, + virErrorPtr err) +{ + virConnectPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStorageVolGetConnect not available prior to libvirt version 0.4.1"); +#else + ret = virStorageVolGetConnect(vol); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStorageVolGetInfoWrapper(virStorageVolPtr vol, + virStorageVolInfoPtr info, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStorageVolGetInfo not available prior to libvirt version 0.4.1"); +#else + ret = virStorageVolGetInfo(vol, + info); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStorageVolGetInfoFlagsWrapper(virStorageVolPtr vol, + virStorageVolInfoPtr info, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(3, 0, 0) + setVirError(err, "Function virStorageVolGetInfoFlags not available prior to libvirt version 3.0.0"); +#else + ret = virStorageVolGetInfoFlags(vol, + info, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +const char * +virStorageVolGetKeyWrapper(virStorageVolPtr vol, + virErrorPtr err) +{ + const char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStorageVolGetKey not available prior to libvirt version 0.4.1"); +#else + ret = virStorageVolGetKey(vol); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +const char * +virStorageVolGetNameWrapper(virStorageVolPtr vol, + virErrorPtr err) +{ + const char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStorageVolGetName not available prior to libvirt version 0.4.1"); +#else + ret = virStorageVolGetName(vol); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virStorageVolGetPathWrapper(virStorageVolPtr vol, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStorageVolGetPath not available prior to libvirt version 0.4.1"); +#else + ret = virStorageVolGetPath(vol); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virStorageVolGetXMLDescWrapper(virStorageVolPtr vol, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStorageVolGetXMLDesc not available prior to libvirt version 0.4.1"); +#else + ret = virStorageVolGetXMLDesc(vol, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virStorageVolPtr +virStorageVolLookupByKeyWrapper(virConnectPtr conn, + const char * key, + virErrorPtr err) +{ + virStorageVolPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStorageVolLookupByKey not available prior to libvirt version 0.4.1"); +#else + ret = virStorageVolLookupByKey(conn, + key); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virStorageVolPtr +virStorageVolLookupByNameWrapper(virStoragePoolPtr pool, + const char * name, + virErrorPtr err) +{ + virStorageVolPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStorageVolLookupByName not available prior to libvirt version 0.4.1"); +#else + ret = virStorageVolLookupByName(pool, + name); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virStorageVolPtr +virStorageVolLookupByPathWrapper(virConnectPtr conn, + const char * path, + virErrorPtr err) +{ + virStorageVolPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 4, 1) + setVirError(err, "Function virStorageVolLookupByPath not available prior to libvirt version 0.4.1"); +#else + ret = virStorageVolLookupByPath(conn, + path); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStorageVolRefWrapper(virStorageVolPtr vol, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 6, 0) + setVirError(err, "Function virStorageVolRef not available prior to libvirt version 0.6.0"); +#else + ret = virStorageVolRef(vol); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStorageVolResizeWrapper(virStorageVolPtr vol, + unsigned long long capacity, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 10) + setVirError(err, "Function virStorageVolResize not available prior to libvirt version 0.9.10"); +#else + ret = virStorageVolResize(vol, + capacity, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStorageVolUploadWrapper(virStorageVolPtr vol, + virStreamPtr stream, + unsigned long long offset, + unsigned long long length, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 0) + setVirError(err, "Function virStorageVolUpload not available prior to libvirt version 0.9.0"); +#else + ret = virStorageVolUpload(vol, + stream, + offset, + length, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStorageVolWipeWrapper(virStorageVolPtr vol, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 0) + setVirError(err, "Function virStorageVolWipe not available prior to libvirt version 0.8.0"); +#else + ret = virStorageVolWipe(vol, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStorageVolWipePatternWrapper(virStorageVolPtr vol, + unsigned int algorithm, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 9, 10) + setVirError(err, "Function virStorageVolWipePattern not available prior to libvirt version 0.9.10"); +#else + ret = virStorageVolWipePattern(vol, + algorithm, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_stream.go b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_stream.go new file mode 100644 index 000000000..a38a2b8c5 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_stream.go @@ -0,0 +1,373 @@ +//go:build !libvirt_dlopen +// +build !libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include +#include +#include +#include "libvirt_generated.h" +#include "error_helper.h" + + +int +virStreamAbortWrapper(virStreamPtr stream, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 2) + setVirError(err, "Function virStreamAbort not available prior to libvirt version 0.7.2"); +#else + ret = virStreamAbort(stream); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStreamEventAddCallbackWrapper(virStreamPtr stream, + int events, + virStreamEventCallback cb, + void * opaque, + virFreeCallback ff, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 2) + setVirError(err, "Function virStreamEventAddCallback not available prior to libvirt version 0.7.2"); +#else + ret = virStreamEventAddCallback(stream, + events, + cb, + opaque, + ff); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStreamEventRemoveCallbackWrapper(virStreamPtr stream, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 2) + setVirError(err, "Function virStreamEventRemoveCallback not available prior to libvirt version 0.7.2"); +#else + ret = virStreamEventRemoveCallback(stream); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStreamEventUpdateCallbackWrapper(virStreamPtr stream, + int events, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 2) + setVirError(err, "Function virStreamEventUpdateCallback not available prior to libvirt version 0.7.2"); +#else + ret = virStreamEventUpdateCallback(stream, + events); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStreamFinishWrapper(virStreamPtr stream, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 2) + setVirError(err, "Function virStreamFinish not available prior to libvirt version 0.7.2"); +#else + ret = virStreamFinish(stream); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStreamFreeWrapper(virStreamPtr stream, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 2) + setVirError(err, "Function virStreamFree not available prior to libvirt version 0.7.2"); +#else + ret = virStreamFree(stream); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virStreamPtr +virStreamNewWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err) +{ + virStreamPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 7, 2) + setVirError(err, "Function virStreamNew not available prior to libvirt version 0.7.2"); +#else + ret = virStreamNew(conn, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStreamRecvWrapper(virStreamPtr stream, + char * data, + size_t nbytes, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 2) + setVirError(err, "Function virStreamRecv not available prior to libvirt version 0.7.2"); +#else + ret = virStreamRecv(stream, + data, + nbytes); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStreamRecvAllWrapper(virStreamPtr stream, + virStreamSinkFunc handler, + void * opaque, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 2) + setVirError(err, "Function virStreamRecvAll not available prior to libvirt version 0.7.2"); +#else + ret = virStreamRecvAll(stream, + handler, + opaque); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStreamRecvFlagsWrapper(virStreamPtr stream, + char * data, + size_t nbytes, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(3, 4, 0) + setVirError(err, "Function virStreamRecvFlags not available prior to libvirt version 3.4.0"); +#else + ret = virStreamRecvFlags(stream, + data, + nbytes, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStreamRecvHoleWrapper(virStreamPtr stream, + long long * length, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(3, 4, 0) + setVirError(err, "Function virStreamRecvHole not available prior to libvirt version 3.4.0"); +#else + ret = virStreamRecvHole(stream, + length, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStreamRefWrapper(virStreamPtr stream, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 2) + setVirError(err, "Function virStreamRef not available prior to libvirt version 0.7.2"); +#else + ret = virStreamRef(stream); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStreamSendWrapper(virStreamPtr stream, + const char * data, + size_t nbytes, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 2) + setVirError(err, "Function virStreamSend not available prior to libvirt version 0.7.2"); +#else + ret = virStreamSend(stream, + data, + nbytes); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStreamSendAllWrapper(virStreamPtr stream, + virStreamSourceFunc handler, + void * opaque, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 7, 2) + setVirError(err, "Function virStreamSendAll not available prior to libvirt version 0.7.2"); +#else + ret = virStreamSendAll(stream, + handler, + opaque); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStreamSendHoleWrapper(virStreamPtr stream, + long long length, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(3, 4, 0) + setVirError(err, "Function virStreamSendHole not available prior to libvirt version 3.4.0"); +#else + ret = virStreamSendHole(stream, + length, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStreamSparseRecvAllWrapper(virStreamPtr stream, + virStreamSinkFunc handler, + virStreamSinkHoleFunc holeHandler, + void * opaque, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(3, 4, 0) + setVirError(err, "Function virStreamSparseRecvAll not available prior to libvirt version 3.4.0"); +#else + ret = virStreamSparseRecvAll(stream, + handler, + holeHandler, + opaque); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virStreamSparseSendAllWrapper(virStreamPtr stream, + virStreamSourceFunc handler, + virStreamSourceHoleFunc holeHandler, + virStreamSourceSkipFunc skipHandler, + void * opaque, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(3, 4, 0) + setVirError(err, "Function virStreamSparseSendAll not available prior to libvirt version 3.4.0"); +#else + ret = virStreamSparseSendAll(stream, + handler, + holeHandler, + skipHandler, + opaque); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_virterror.go b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_virterror.go new file mode 100644 index 000000000..212eab8f5 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_functions_static_virterror.go @@ -0,0 +1,244 @@ +//go:build !libvirt_dlopen +// +build !libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo pkg-config: libvirt +#include +#include +#include +#include +#include "libvirt_generated.h" +#include "error_helper.h" + + +int +virConnCopyLastErrorWrapper(virConnectPtr conn, + virErrorPtr to, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 1, 0) + setVirError(err, "Function virConnCopyLastError not available prior to libvirt version 0.1.0"); +#else + ret = virConnCopyLastError(conn, + to); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +virErrorPtr +virConnGetLastErrorWrapper(virConnectPtr conn, + virErrorPtr err) +{ + virErrorPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 1, 0) + setVirError(err, "Function virConnGetLastError not available prior to libvirt version 0.1.0"); +#else + ret = virConnGetLastError(conn); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +void +virConnResetLastErrorWrapper(virConnectPtr conn) +{ + +#if !LIBVIR_CHECK_VERSION(0, 1, 0) + setVirError(NULL, "Function virConnResetLastError not available prior to libvirt version 0.1.0"); +#else + virConnResetLastError(conn); +#endif + return; +} + +void +virConnSetErrorFuncWrapper(virConnectPtr conn, + void * userData, + virErrorFunc handler) +{ + +#if !LIBVIR_CHECK_VERSION(0, 1, 0) + setVirError(NULL, "Function virConnSetErrorFunc not available prior to libvirt version 0.1.0"); +#else + virConnSetErrorFunc(conn, + userData, + handler); +#endif + return; +} + +void +virDefaultErrorFuncWrapper(virErrorPtr err) +{ + +#if !LIBVIR_CHECK_VERSION(0, 1, 0) + setVirError(NULL, "Function virDefaultErrorFunc not available prior to libvirt version 0.1.0"); +#else + virDefaultErrorFunc(err); +#endif + return; +} + +void +virFreeErrorWrapper(virErrorPtr err) +{ + +#if !LIBVIR_CHECK_VERSION(0, 6, 1) + setVirError(NULL, "Function virFreeError not available prior to libvirt version 0.6.1"); +#else + virFreeError(err); +#endif + return; +} + +virErrorPtr +virGetLastErrorWrapper(virErrorPtr err) +{ + virErrorPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 1, 0) + setVirError(err, "Function virGetLastError not available prior to libvirt version 0.1.0"); +#else + ret = virGetLastError(); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virGetLastErrorCodeWrapper(virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(4, 5, 0) + setVirError(err, "Function virGetLastErrorCode not available prior to libvirt version 4.5.0"); +#else + ret = virGetLastErrorCode(); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virGetLastErrorDomainWrapper(virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(4, 5, 0) + setVirError(err, "Function virGetLastErrorDomain not available prior to libvirt version 4.5.0"); +#else + ret = virGetLastErrorDomain(); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +const char * +virGetLastErrorMessageWrapper(virErrorPtr err) +{ + const char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(1, 0, 6) + setVirError(err, "Function virGetLastErrorMessage not available prior to libvirt version 1.0.6"); +#else + ret = virGetLastErrorMessage(); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +void +virResetErrorWrapper(virErrorPtr err) +{ + +#if !LIBVIR_CHECK_VERSION(0, 1, 0) + setVirError(NULL, "Function virResetError not available prior to libvirt version 0.1.0"); +#else + virResetError(err); +#endif + return; +} + +void +virResetLastErrorWrapper(void) +{ + +#if !LIBVIR_CHECK_VERSION(0, 1, 0) + setVirError(NULL, "Function virResetLastError not available prior to libvirt version 0.1.0"); +#else + virResetLastError(); +#endif + return; +} + +virErrorPtr +virSaveLastErrorWrapper(virErrorPtr err) +{ + virErrorPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 6, 1) + setVirError(err, "Function virSaveLastError not available prior to libvirt version 0.6.1"); +#else + ret = virSaveLastError(); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +void +virSetErrorFuncWrapper(void * userData, + virErrorFunc handler) +{ + +#if !LIBVIR_CHECK_VERSION(0, 1, 0) + setVirError(NULL, "Function virSetErrorFunc not available prior to libvirt version 0.1.0"); +#else + virSetErrorFunc(userData, + handler); +#endif + return; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_macros.h b/vendor/libvirt.org/go/libvirt/libvirt_generated_macros.h new file mode 100644 index 000000000..531a46879 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_macros.h @@ -0,0 +1,1065 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +#pragma once + +#if !LIBVIR_CHECK_VERSION(0, 0, 1) +# define LIBVIR_VERSION_NUMBER 10009000 +#endif + +#if !LIBVIR_CHECK_VERSION(5, 8, 0) +# define VIR_CONNECT_IDENTITY_GROUP_NAME "group-name" +#endif + +#if !LIBVIR_CHECK_VERSION(5, 8, 0) +# define VIR_CONNECT_IDENTITY_PROCESS_ID "process-id" +#endif + +#if !LIBVIR_CHECK_VERSION(5, 8, 0) +# define VIR_CONNECT_IDENTITY_PROCESS_TIME "process-time" +#endif + +#if !LIBVIR_CHECK_VERSION(5, 8, 0) +# define VIR_CONNECT_IDENTITY_SASL_USER_NAME "sasl-user-name" +#endif + +#if !LIBVIR_CHECK_VERSION(5, 8, 0) +# define VIR_CONNECT_IDENTITY_SELINUX_CONTEXT "selinux-context" +#endif + +#if !LIBVIR_CHECK_VERSION(5, 8, 0) +# define VIR_CONNECT_IDENTITY_UNIX_GROUP_ID "unix-group-id" +#endif + +#if !LIBVIR_CHECK_VERSION(5, 8, 0) +# define VIR_CONNECT_IDENTITY_UNIX_USER_ID "unix-user-id" +#endif + +#if !LIBVIR_CHECK_VERSION(5, 8, 0) +# define VIR_CONNECT_IDENTITY_USER_NAME "user-name" +#endif + +#if !LIBVIR_CHECK_VERSION(5, 8, 0) +# define VIR_CONNECT_IDENTITY_X509_DISTINGUISHED_NAME "x509-distinguished-name" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 9) +# define VIR_DOMAIN_BANDWIDTH_IN_AVERAGE "inbound.average" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 9) +# define VIR_DOMAIN_BANDWIDTH_IN_BURST "inbound.burst" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 19) +# define VIR_DOMAIN_BANDWIDTH_IN_FLOOR "inbound.floor" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 9) +# define VIR_DOMAIN_BANDWIDTH_IN_PEAK "inbound.peak" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 9) +# define VIR_DOMAIN_BANDWIDTH_OUT_AVERAGE "outbound.average" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 9) +# define VIR_DOMAIN_BANDWIDTH_OUT_BURST "outbound.burst" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 9) +# define VIR_DOMAIN_BANDWIDTH_OUT_PEAK "outbound.peak" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 2) +# define VIR_DOMAIN_BLKIO_DEVICE_READ_BPS "device_read_bytes_sec" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 2) +# define VIR_DOMAIN_BLKIO_DEVICE_READ_IOPS "device_read_iops_sec" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 8) +# define VIR_DOMAIN_BLKIO_DEVICE_WEIGHT "device_weight" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 2) +# define VIR_DOMAIN_BLKIO_DEVICE_WRITE_BPS "device_write_bytes_sec" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 2) +# define VIR_DOMAIN_BLKIO_DEVICE_WRITE_IOPS "device_write_iops_sec" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 0) +# define VIR_DOMAIN_BLKIO_FIELD_LENGTH VIR_TYPED_PARAM_FIELD_LENGTH +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 0) +# define VIR_DOMAIN_BLKIO_WEIGHT "weight" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 8) +# define VIR_DOMAIN_BLOCK_COPY_BANDWIDTH "bandwidth" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 8) +# define VIR_DOMAIN_BLOCK_COPY_BUF_SIZE "buf-size" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 8) +# define VIR_DOMAIN_BLOCK_COPY_GRANULARITY "granularity" +#endif + +#if !LIBVIR_CHECK_VERSION(3, 0, 0) +# define VIR_DOMAIN_BLOCK_IOTUNE_GROUP_NAME "group_name" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 8) +# define VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC "read_bytes_sec" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 11) +# define VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC_MAX "read_bytes_sec_max" +#endif + +#if !LIBVIR_CHECK_VERSION(2, 4, 0) +# define VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC_MAX_LENGTH "read_bytes_sec_max_length" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 8) +# define VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC "read_iops_sec" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 11) +# define VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC_MAX "read_iops_sec_max" +#endif + +#if !LIBVIR_CHECK_VERSION(2, 4, 0) +# define VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC_MAX_LENGTH "read_iops_sec_max_length" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 11) +# define VIR_DOMAIN_BLOCK_IOTUNE_SIZE_IOPS_SEC "size_iops_sec" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 8) +# define VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC "total_bytes_sec" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 11) +# define VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC_MAX "total_bytes_sec_max" +#endif + +#if !LIBVIR_CHECK_VERSION(2, 4, 0) +# define VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC_MAX_LENGTH "total_bytes_sec_max_length" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 8) +# define VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC "total_iops_sec" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 11) +# define VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC_MAX "total_iops_sec_max" +#endif + +#if !LIBVIR_CHECK_VERSION(2, 4, 0) +# define VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC_MAX_LENGTH "total_iops_sec_max_length" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 8) +# define VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC "write_bytes_sec" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 11) +# define VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC_MAX "write_bytes_sec_max" +#endif + +#if !LIBVIR_CHECK_VERSION(2, 4, 0) +# define VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC_MAX_LENGTH "write_bytes_sec_max_length" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 8) +# define VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC "write_iops_sec" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 11) +# define VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC_MAX "write_iops_sec_max" +#endif + +#if !LIBVIR_CHECK_VERSION(2, 4, 0) +# define VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC_MAX_LENGTH "write_iops_sec_max_length" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_BLOCK_STATS_ERRS "errs" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_BLOCK_STATS_FIELD_LENGTH VIR_TYPED_PARAM_FIELD_LENGTH +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_BLOCK_STATS_FLUSH_REQ "flush_operations" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_BLOCK_STATS_FLUSH_TOTAL_TIMES "flush_total_times" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_BLOCK_STATS_READ_BYTES "rd_bytes" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_BLOCK_STATS_READ_REQ "rd_operations" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_BLOCK_STATS_READ_TOTAL_TIMES "rd_total_times" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_BLOCK_STATS_WRITE_BYTES "wr_bytes" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_BLOCK_STATS_WRITE_REQ "wr_operations" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_DOMAIN_BLOCK_STATS_WRITE_TOTAL_TIMES "wr_total_times" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 10) +# define VIR_DOMAIN_CPU_STATS_CPUTIME "cpu_time" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 11) +# define VIR_DOMAIN_CPU_STATS_SYSTEMTIME "system_time" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 11) +# define VIR_DOMAIN_CPU_STATS_USERTIME "user_time" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 13) +# define VIR_DOMAIN_CPU_STATS_VCPUTIME "vcpu_time" +#endif + +#if !LIBVIR_CHECK_VERSION(4, 10, 0) +# define VIR_DOMAIN_IOTHREAD_POLL_GROW "poll_grow" +#endif + +#if !LIBVIR_CHECK_VERSION(4, 10, 0) +# define VIR_DOMAIN_IOTHREAD_POLL_MAX_NS "poll_max_ns" +#endif + +#if !LIBVIR_CHECK_VERSION(4, 10, 0) +# define VIR_DOMAIN_IOTHREAD_POLL_SHRINK "poll_shrink" +#endif + +#if !LIBVIR_CHECK_VERSION(8, 5, 0) +# define VIR_DOMAIN_IOTHREAD_THREAD_POOL_MAX "thread_pool_max" +#endif + +#if !LIBVIR_CHECK_VERSION(8, 5, 0) +# define VIR_DOMAIN_IOTHREAD_THREAD_POOL_MIN "thread_pool_min" +#endif + +#if !LIBVIR_CHECK_VERSION(2, 0, 0) +# define VIR_DOMAIN_JOB_AUTO_CONVERGE_THROTTLE "auto_converge_throttle" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 0, 3) +# define VIR_DOMAIN_JOB_COMPRESSION_BYTES "compression_bytes" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 0, 3) +# define VIR_DOMAIN_JOB_COMPRESSION_CACHE "compression_cache" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 0, 3) +# define VIR_DOMAIN_JOB_COMPRESSION_CACHE_MISSES "compression_cache_misses" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 0, 3) +# define VIR_DOMAIN_JOB_COMPRESSION_OVERFLOW "compression_overflow" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 0, 3) +# define VIR_DOMAIN_JOB_COMPRESSION_PAGES "compression_pages" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 0, 3) +# define VIR_DOMAIN_JOB_DATA_PROCESSED "data_processed" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 0, 3) +# define VIR_DOMAIN_JOB_DATA_REMAINING "data_remaining" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 0, 3) +# define VIR_DOMAIN_JOB_DATA_TOTAL "data_total" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_JOB_DISK_BPS "disk_bps" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 0, 3) +# define VIR_DOMAIN_JOB_DISK_PROCESSED "disk_processed" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 0, 3) +# define VIR_DOMAIN_JOB_DISK_REMAINING "disk_remaining" +#endif + +#if !LIBVIR_CHECK_VERSION(6, 0, 0) +# define VIR_DOMAIN_JOB_DISK_TEMP_TOTAL "disk_temp_total" +#endif + +#if !LIBVIR_CHECK_VERSION(6, 0, 0) +# define VIR_DOMAIN_JOB_DISK_TEMP_USED "disk_temp_used" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 0, 3) +# define VIR_DOMAIN_JOB_DISK_TOTAL "disk_total" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 0, 3) +# define VIR_DOMAIN_JOB_DOWNTIME "downtime" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 15) +# define VIR_DOMAIN_JOB_DOWNTIME_NET "downtime_net" +#endif + +#if !LIBVIR_CHECK_VERSION(6, 3, 0) +# define VIR_DOMAIN_JOB_ERRMSG "errmsg" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_JOB_MEMORY_BPS "memory_bps" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 0, 3) +# define VIR_DOMAIN_JOB_MEMORY_CONSTANT "memory_constant" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 3, 1) +# define VIR_DOMAIN_JOB_MEMORY_DIRTY_RATE "memory_dirty_rate" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 3, 1) +# define VIR_DOMAIN_JOB_MEMORY_ITERATION "memory_iteration" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 0, 3) +# define VIR_DOMAIN_JOB_MEMORY_NORMAL "memory_normal" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 0, 3) +# define VIR_DOMAIN_JOB_MEMORY_NORMAL_BYTES "memory_normal_bytes" +#endif + +#if !LIBVIR_CHECK_VERSION(3, 9, 0) +# define VIR_DOMAIN_JOB_MEMORY_PAGE_SIZE "memory_page_size" +#endif + +#if !LIBVIR_CHECK_VERSION(5, 0, 0) +# define VIR_DOMAIN_JOB_MEMORY_POSTCOPY_REQS "memory_postcopy_requests" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 0, 3) +# define VIR_DOMAIN_JOB_MEMORY_PROCESSED "memory_processed" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 0, 3) +# define VIR_DOMAIN_JOB_MEMORY_REMAINING "memory_remaining" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 0, 3) +# define VIR_DOMAIN_JOB_MEMORY_TOTAL "memory_total" +#endif + +#if !LIBVIR_CHECK_VERSION(3, 3, 0) +# define VIR_DOMAIN_JOB_OPERATION "operation" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_JOB_SETUP_TIME "setup_time" +#endif + +#if !LIBVIR_CHECK_VERSION(6, 0, 0) +# define VIR_DOMAIN_JOB_SUCCESS "success" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 0, 3) +# define VIR_DOMAIN_JOB_TIME_ELAPSED "time_elapsed" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 15) +# define VIR_DOMAIN_JOB_TIME_ELAPSED_NET "time_elapsed_net" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 0, 3) +# define VIR_DOMAIN_JOB_TIME_REMAINING "time_remaining" +#endif + +#if !LIBVIR_CHECK_VERSION(10, 6, 0) +# define VIR_DOMAIN_JOB_VFIO_DATA_TRANSFERRED "vfio_data_transferred" +#endif + +#if !LIBVIR_CHECK_VERSION(8, 0, 0) +# define VIR_DOMAIN_LAUNCH_SECURITY_SEV_API_MAJOR "sev-api-major" +#endif + +#if !LIBVIR_CHECK_VERSION(8, 0, 0) +# define VIR_DOMAIN_LAUNCH_SECURITY_SEV_API_MINOR "sev-api-minor" +#endif + +#if !LIBVIR_CHECK_VERSION(8, 0, 0) +# define VIR_DOMAIN_LAUNCH_SECURITY_SEV_BUILD_ID "sev-build-id" +#endif + +#if !LIBVIR_CHECK_VERSION(4, 5, 0) +# define VIR_DOMAIN_LAUNCH_SECURITY_SEV_MEASUREMENT "sev-measurement" +#endif + +#if !LIBVIR_CHECK_VERSION(8, 0, 0) +# define VIR_DOMAIN_LAUNCH_SECURITY_SEV_POLICY "sev-policy" +#endif + +#if !LIBVIR_CHECK_VERSION(8, 0, 0) +# define VIR_DOMAIN_LAUNCH_SECURITY_SEV_SECRET "sev-secret" +#endif + +#if !LIBVIR_CHECK_VERSION(8, 0, 0) +# define VIR_DOMAIN_LAUNCH_SECURITY_SEV_SECRET_HEADER "sev-secret-header" +#endif + +#if !LIBVIR_CHECK_VERSION(8, 0, 0) +# define VIR_DOMAIN_LAUNCH_SECURITY_SEV_SECRET_SET_ADDRESS "sev-secret-set-address" +#endif + +#if !LIBVIR_CHECK_VERSION(10, 5, 0) +# define VIR_DOMAIN_LAUNCH_SECURITY_SEV_SNP_POLICY "sev-snp-policy" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 5) +# define VIR_DOMAIN_MEMORY_FIELD_LENGTH VIR_TYPED_PARAM_FIELD_LENGTH +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 5) +# define VIR_DOMAIN_MEMORY_HARD_LIMIT "hard_limit" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 5) +# define VIR_DOMAIN_MEMORY_MIN_GUARANTEE "min_guarantee" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 8) +# define VIR_DOMAIN_MEMORY_PARAM_UNLIMITED 9007199254740991LL /* = INT64_MAX >> 10 */ +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 5) +# define VIR_DOMAIN_MEMORY_SOFT_LIMIT "soft_limit" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 5) +# define VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT "swap_hard_limit" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 9) +# define VIR_DOMAIN_NUMA_MODE "numa_mode" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 9) +# define VIR_DOMAIN_NUMA_NODESET "numa_nodeset" +#endif + +#if !LIBVIR_CHECK_VERSION(8, 4, 0) +# define VIR_DOMAIN_SAVE_PARAM_DXML "dxml" +#endif + +#if !LIBVIR_CHECK_VERSION(8, 4, 0) +# define VIR_DOMAIN_SAVE_PARAM_FILE "file" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 7) +# define VIR_DOMAIN_SCHEDULER_CAP "cap" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 7) +# define VIR_DOMAIN_SCHEDULER_CPU_SHARES "cpu_shares" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 10, 0) +# define VIR_DOMAIN_SCHEDULER_EMULATOR_PERIOD "emulator_period" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 10, 0) +# define VIR_DOMAIN_SCHEDULER_EMULATOR_QUOTA "emulator_quota" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 3, 3) +# define VIR_DOMAIN_SCHEDULER_GLOBAL_PERIOD "global_period" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 3, 3) +# define VIR_DOMAIN_SCHEDULER_GLOBAL_QUOTA "global_quota" +#endif + +#if !LIBVIR_CHECK_VERSION(2, 2, 0) +# define VIR_DOMAIN_SCHEDULER_IOTHREAD_PERIOD "iothread_period" +#endif + +#if !LIBVIR_CHECK_VERSION(2, 2, 0) +# define VIR_DOMAIN_SCHEDULER_IOTHREAD_QUOTA "iothread_quota" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 7) +# define VIR_DOMAIN_SCHEDULER_LIMIT "limit" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 7) +# define VIR_DOMAIN_SCHEDULER_RESERVATION "reservation" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 7) +# define VIR_DOMAIN_SCHEDULER_SHARES "shares" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 7) +# define VIR_DOMAIN_SCHEDULER_VCPU_PERIOD "vcpu_period" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 7) +# define VIR_DOMAIN_SCHEDULER_VCPU_QUOTA "vcpu_quota" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 7) +# define VIR_DOMAIN_SCHEDULER_WEIGHT "weight" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 2, 3) +# define VIR_DOMAIN_SCHED_FIELD_LENGTH VIR_TYPED_PARAM_FIELD_LENGTH +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 3) +# define VIR_DOMAIN_SEND_KEY_MAX_KEYS 16 +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_TUNABLE_BLKDEV_DISK "blkdeviotune.disk" +#endif + +#if !LIBVIR_CHECK_VERSION(3, 0, 0) +# define VIR_DOMAIN_TUNABLE_BLKDEV_GROUP_NAME "blkdeviotune.group_name" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC "blkdeviotune.read_bytes_sec" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 11) +# define VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC_MAX "blkdeviotune.read_bytes_sec_max" +#endif + +#if !LIBVIR_CHECK_VERSION(2, 4, 0) +# define VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC_MAX_LENGTH "blkdeviotune.read_bytes_sec_max_length" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC "blkdeviotune.read_iops_sec" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 11) +# define VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC_MAX "blkdeviotune.read_iops_sec_max" +#endif + +#if !LIBVIR_CHECK_VERSION(2, 4, 0) +# define VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC_MAX_LENGTH "blkdeviotune.read_iops_sec_max_length" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 11) +# define VIR_DOMAIN_TUNABLE_BLKDEV_SIZE_IOPS_SEC "blkdeviotune.size_iops_sec" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC "blkdeviotune.total_bytes_sec" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 11) +# define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC_MAX "blkdeviotune.total_bytes_sec_max" +#endif + +#if !LIBVIR_CHECK_VERSION(2, 4, 0) +# define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC_MAX_LENGTH "blkdeviotune.total_bytes_sec_max_length" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC "blkdeviotune.total_iops_sec" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 11) +# define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC_MAX "blkdeviotune.total_iops_sec_max" +#endif + +#if !LIBVIR_CHECK_VERSION(2, 4, 0) +# define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC_MAX_LENGTH "blkdeviotune.total_iops_sec_max_length" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC "blkdeviotune.write_bytes_sec" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 11) +# define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC_MAX "blkdeviotune.write_bytes_sec_max" +#endif + +#if !LIBVIR_CHECK_VERSION(2, 4, 0) +# define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC_MAX_LENGTH "blkdeviotune.write_bytes_sec_max_length" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC "blkdeviotune.write_iops_sec" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 11) +# define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC_MAX "blkdeviotune.write_iops_sec_max" +#endif + +#if !LIBVIR_CHECK_VERSION(2, 4, 0) +# define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC_MAX_LENGTH "blkdeviotune.write_iops_sec_max_length" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_TUNABLE_CPU_CPU_SHARES "cputune.cpu_shares" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_TUNABLE_CPU_EMULATORPIN "cputune.emulatorpin" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_TUNABLE_CPU_EMULATOR_PERIOD "cputune.emulator_period" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_TUNABLE_CPU_EMULATOR_QUOTA "cputune.emulator_quota" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 3, 3) +# define VIR_DOMAIN_TUNABLE_CPU_GLOBAL_PERIOD "cputune.global_period" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 3, 3) +# define VIR_DOMAIN_TUNABLE_CPU_GLOBAL_QUOTA "cputune.global_quota" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 14) +# define VIR_DOMAIN_TUNABLE_CPU_IOTHREADSPIN "cputune.iothreadpin%u" +#endif + +#if !LIBVIR_CHECK_VERSION(2, 2, 0) +# define VIR_DOMAIN_TUNABLE_CPU_IOTHREAD_PERIOD "cputune.iothread_period" +#endif + +#if !LIBVIR_CHECK_VERSION(2, 2, 0) +# define VIR_DOMAIN_TUNABLE_CPU_IOTHREAD_QUOTA "cputune.iothread_quota" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_TUNABLE_CPU_VCPUPIN "cputune.vcpupin%u" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_TUNABLE_CPU_VCPU_PERIOD "cputune.vcpu_period" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 9) +# define VIR_DOMAIN_TUNABLE_CPU_VCPU_QUOTA "cputune.vcpu_quota" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 5) +# define VIR_KEYCODE_SET_RFB VIR_KEYCODE_SET_QNUM +#endif + +#if !LIBVIR_CHECK_VERSION(2, 0, 0) +# define VIR_MIGRATE_PARAM_AUTO_CONVERGE_INCREMENT "auto_converge.increment" +#endif + +#if !LIBVIR_CHECK_VERSION(2, 0, 0) +# define VIR_MIGRATE_PARAM_AUTO_CONVERGE_INITIAL "auto_converge.initial" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 1, 0) +# define VIR_MIGRATE_PARAM_BANDWIDTH "bandwidth" +#endif + +#if !LIBVIR_CHECK_VERSION(5, 1, 0) +# define VIR_MIGRATE_PARAM_BANDWIDTH_POSTCOPY "bandwidth.postcopy" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 3, 4) +# define VIR_MIGRATE_PARAM_COMPRESSION "compression" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 3, 4) +# define VIR_MIGRATE_PARAM_COMPRESSION_MT_DTHREADS "compression.mt.dthreads" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 3, 4) +# define VIR_MIGRATE_PARAM_COMPRESSION_MT_LEVEL "compression.mt.level" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 3, 4) +# define VIR_MIGRATE_PARAM_COMPRESSION_MT_THREADS "compression.mt.threads" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 3, 4) +# define VIR_MIGRATE_PARAM_COMPRESSION_XBZRLE_CACHE "compression.xbzrle.cache" +#endif + +#if !LIBVIR_CHECK_VERSION(9, 4, 0) +# define VIR_MIGRATE_PARAM_COMPRESSION_ZLIB_LEVEL "compression.zlib.level" +#endif + +#if !LIBVIR_CHECK_VERSION(9, 4, 0) +# define VIR_MIGRATE_PARAM_COMPRESSION_ZSTD_LEVEL "compression.zstd.level" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 1, 0) +# define VIR_MIGRATE_PARAM_DEST_NAME "destination_name" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 1, 0) +# define VIR_MIGRATE_PARAM_DEST_XML "destination_xml" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 3, 3) +# define VIR_MIGRATE_PARAM_DISKS_PORT "disks_port" +#endif + +#if !LIBVIR_CHECK_VERSION(6, 8, 0) +# define VIR_MIGRATE_PARAM_DISKS_URI "disks_uri" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 1, 0) +# define VIR_MIGRATE_PARAM_GRAPHICS_URI "graphics_uri" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 1, 4) +# define VIR_MIGRATE_PARAM_LISTEN_ADDRESS "listen_address" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 17) +# define VIR_MIGRATE_PARAM_MIGRATE_DISKS "migrate_disks" +#endif + +#if !LIBVIR_CHECK_VERSION(10, 9, 0) +# define VIR_MIGRATE_PARAM_MIGRATE_DISKS_DETECT_ZEROES "migrate_disks_detect_zeroes" +#endif + +#if !LIBVIR_CHECK_VERSION(5, 2, 0) +# define VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS "parallel.connections" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 3, 4) +# define VIR_MIGRATE_PARAM_PERSIST_XML "persistent_xml" +#endif + +#if !LIBVIR_CHECK_VERSION(6, 0, 0) +# define VIR_MIGRATE_PARAM_TLS_DESTINATION "tls.destination" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 1, 0) +# define VIR_MIGRATE_PARAM_URI "migrate_uri" +#endif + +#if !LIBVIR_CHECK_VERSION(5, 5, 0) +# define VIR_NETWORK_PORT_BANDWIDTH_IN_AVERAGE "inbound.average" +#endif + +#if !LIBVIR_CHECK_VERSION(5, 5, 0) +# define VIR_NETWORK_PORT_BANDWIDTH_IN_BURST "inbound.burst" +#endif + +#if !LIBVIR_CHECK_VERSION(5, 5, 0) +# define VIR_NETWORK_PORT_BANDWIDTH_IN_FLOOR "inbound.floor" +#endif + +#if !LIBVIR_CHECK_VERSION(5, 5, 0) +# define VIR_NETWORK_PORT_BANDWIDTH_IN_PEAK "inbound.peak" +#endif + +#if !LIBVIR_CHECK_VERSION(5, 5, 0) +# define VIR_NETWORK_PORT_BANDWIDTH_OUT_AVERAGE "outbound.average" +#endif + +#if !LIBVIR_CHECK_VERSION(5, 5, 0) +# define VIR_NETWORK_PORT_BANDWIDTH_OUT_BURST "outbound.burst" +#endif + +#if !LIBVIR_CHECK_VERSION(5, 5, 0) +# define VIR_NETWORK_PORT_BANDWIDTH_OUT_PEAK "outbound.peak" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 3) +# define VIR_NODE_CPU_STATS_FIELD_LENGTH 80 +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 3) +# define VIR_NODE_CPU_STATS_IDLE "idle" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 2) +# define VIR_NODE_CPU_STATS_INTR "intr" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 3) +# define VIR_NODE_CPU_STATS_IOWAIT "iowait" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 3) +# define VIR_NODE_CPU_STATS_KERNEL "kernel" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 3) +# define VIR_NODE_CPU_STATS_USER "user" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 3) +# define VIR_NODE_CPU_STATS_UTILIZATION "utilization" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NODE_MEMORY_SHARED_FULL_SCANS "shm_full_scans" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 0, 0) +# define VIR_NODE_MEMORY_SHARED_MERGE_ACROSS_NODES "shm_merge_across_nodes" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NODE_MEMORY_SHARED_PAGES_SHARED "shm_pages_shared" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NODE_MEMORY_SHARED_PAGES_SHARING "shm_pages_sharing" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NODE_MEMORY_SHARED_PAGES_TO_SCAN "shm_pages_to_scan" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NODE_MEMORY_SHARED_PAGES_UNSHARED "shm_pages_unshared" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NODE_MEMORY_SHARED_PAGES_VOLATILE "shm_pages_volatile" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 10, 2) +# define VIR_NODE_MEMORY_SHARED_SLEEP_MILLISECS "shm_sleep_millisecs" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 3) +# define VIR_NODE_MEMORY_STATS_BUFFERS "buffers" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 3) +# define VIR_NODE_MEMORY_STATS_CACHED "cached" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 3) +# define VIR_NODE_MEMORY_STATS_FIELD_LENGTH 80 +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 3) +# define VIR_NODE_MEMORY_STATS_FREE "free" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 3) +# define VIR_NODE_MEMORY_STATS_TOTAL "total" +#endif + +#if !LIBVIR_CHECK_VERSION(4, 5, 0) +# define VIR_NODE_SEV_CBITPOS "cbitpos" +#endif + +#if !LIBVIR_CHECK_VERSION(4, 5, 0) +# define VIR_NODE_SEV_CERT_CHAIN "cert-chain" +#endif + +#if !LIBVIR_CHECK_VERSION(8, 4, 0) +# define VIR_NODE_SEV_CPU0_ID "cpu0-id" +#endif + +#if !LIBVIR_CHECK_VERSION(8, 0, 0) +# define VIR_NODE_SEV_MAX_ES_GUESTS "max-es-guests" +#endif + +#if !LIBVIR_CHECK_VERSION(8, 0, 0) +# define VIR_NODE_SEV_MAX_GUESTS "max-guests" +#endif + +#if !LIBVIR_CHECK_VERSION(4, 5, 0) +# define VIR_NODE_SEV_PDH "pdh" +#endif + +#if !LIBVIR_CHECK_VERSION(4, 5, 0) +# define VIR_NODE_SEV_REDUCED_PHYS_BITS "reduced-phys-bits" +#endif + +#if !LIBVIR_CHECK_VERSION(3, 2, 0) +# define VIR_PERF_PARAM_ALIGNMENT_FAULTS "alignment_faults" +#endif + +#if !LIBVIR_CHECK_VERSION(3, 0, 0) +# define VIR_PERF_PARAM_BRANCH_INSTRUCTIONS "branch_instructions" +#endif + +#if !LIBVIR_CHECK_VERSION(3, 0, 0) +# define VIR_PERF_PARAM_BRANCH_MISSES "branch_misses" +#endif + +#if !LIBVIR_CHECK_VERSION(3, 0, 0) +# define VIR_PERF_PARAM_BUS_CYCLES "bus_cycles" +#endif + +#if !LIBVIR_CHECK_VERSION(2, 3, 0) +# define VIR_PERF_PARAM_CACHE_MISSES "cache_misses" +#endif + +#if !LIBVIR_CHECK_VERSION(2, 3, 0) +# define VIR_PERF_PARAM_CACHE_REFERENCES "cache_references" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 3, 3) +# define VIR_PERF_PARAM_CMT "cmt" +#endif + +#if !LIBVIR_CHECK_VERSION(3, 2, 0) +# define VIR_PERF_PARAM_CONTEXT_SWITCHES "context_switches" +#endif + +#if !LIBVIR_CHECK_VERSION(3, 2, 0) +# define VIR_PERF_PARAM_CPU_CLOCK "cpu_clock" +#endif + +#if !LIBVIR_CHECK_VERSION(2, 3, 0) +# define VIR_PERF_PARAM_CPU_CYCLES "cpu_cycles" +#endif + +#if !LIBVIR_CHECK_VERSION(3, 2, 0) +# define VIR_PERF_PARAM_CPU_MIGRATIONS "cpu_migrations" +#endif + +#if !LIBVIR_CHECK_VERSION(3, 2, 0) +# define VIR_PERF_PARAM_EMULATION_FAULTS "emulation_faults" +#endif + +#if !LIBVIR_CHECK_VERSION(2, 3, 0) +# define VIR_PERF_PARAM_INSTRUCTIONS "instructions" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 3, 5) +# define VIR_PERF_PARAM_MBML "mbml" +#endif + +#if !LIBVIR_CHECK_VERSION(1, 3, 5) +# define VIR_PERF_PARAM_MBMT "mbmt" +#endif + +#if !LIBVIR_CHECK_VERSION(3, 2, 0) +# define VIR_PERF_PARAM_PAGE_FAULTS "page_faults" +#endif + +#if !LIBVIR_CHECK_VERSION(3, 2, 0) +# define VIR_PERF_PARAM_PAGE_FAULTS_MAJ "page_faults_maj" +#endif + +#if !LIBVIR_CHECK_VERSION(3, 2, 0) +# define VIR_PERF_PARAM_PAGE_FAULTS_MIN "page_faults_min" +#endif + +#if !LIBVIR_CHECK_VERSION(3, 0, 0) +# define VIR_PERF_PARAM_REF_CPU_CYCLES "ref_cpu_cycles" +#endif + +#if !LIBVIR_CHECK_VERSION(3, 0, 0) +# define VIR_PERF_PARAM_STALLED_CYCLES_BACKEND "stalled_cycles_backend" +#endif + +#if !LIBVIR_CHECK_VERSION(3, 0, 0) +# define VIR_PERF_PARAM_STALLED_CYCLES_FRONTEND "stalled_cycles_frontend" +#endif + +#if !LIBVIR_CHECK_VERSION(3, 2, 0) +# define VIR_PERF_PARAM_TASK_CLOCK "task_clock" +#endif + +#if !LIBVIR_CHECK_VERSION(0, 6, 1) +# define VIR_SECURITY_DOI_BUFLEN (256 + 1) +#endif + +#if !LIBVIR_CHECK_VERSION(0, 6, 1) +# define VIR_SECURITY_LABEL_BUFLEN (4096 + 1) +#endif + +#if !LIBVIR_CHECK_VERSION(0, 6, 1) +# define VIR_SECURITY_MODEL_BUFLEN (256 + 1) +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 2) +# define VIR_TYPED_PARAM_FIELD_LENGTH 80 +#endif + +#if !LIBVIR_CHECK_VERSION(0, 2, 0) +# define VIR_UUID_BUFLEN (16) +#endif + +#if !LIBVIR_CHECK_VERSION(0, 2, 0) +# define VIR_UUID_STRING_BUFLEN (36+1) +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 0) +# define _virBlkioParameter _virTypedParameter +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 5) +# define _virMemoryParameter _virTypedParameter +#endif + +#if !LIBVIR_CHECK_VERSION(0, 2, 3) +# define _virSchedParameter _virTypedParameter +#endif diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_structs.h b/vendor/libvirt.org/go/libvirt/libvirt_generated_structs.h new file mode 100644 index 000000000..35541aefb --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_structs.h @@ -0,0 +1,347 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +#pragma once + +#if !LIBVIR_CHECK_VERSION(0, 4, 1) +struct _virConnectAuth { + int * credtype; + unsigned int ncredtype; + virConnectAuthCallbackPtr cb; + void * cbdata; +}; +#endif + + +#if !LIBVIR_CHECK_VERSION(0, 4, 1) +struct _virConnectCredential { + int type; + const char * prompt; + const char * challenge; + const char * defresult; + char * result; + unsigned int resultlen; +}; +#endif + + +#if !LIBVIR_CHECK_VERSION(0, 8, 1) +struct _virDomainBlockInfo { + unsigned long long capacity; + unsigned long long allocation; + unsigned long long physical; +}; +#endif + + +#if !LIBVIR_CHECK_VERSION(0, 9, 4) +struct _virDomainBlockJobInfo { + int type; + unsigned long bandwidth; + virDomainBlockJobCursor cur; + virDomainBlockJobCursor end; +}; +#endif + + +#if !LIBVIR_CHECK_VERSION(0, 3, 3) +struct _virDomainBlockStats { + long long rd_req; + long long rd_bytes; + long long wr_req; + long long wr_bytes; + long long errs; +}; +#endif + + +#if !LIBVIR_CHECK_VERSION(0, 9, 3) +struct _virDomainControlInfo { + unsigned int state; + unsigned int details; + unsigned long long stateTime; +}; +#endif + + +#if !LIBVIR_CHECK_VERSION(0, 9, 10) +struct _virDomainDiskError { + char * disk; + int error; +}; +#endif + + +#if !LIBVIR_CHECK_VERSION(0, 8, 0) +struct _virDomainEventGraphicsAddress { + int family; + char * node; + char * service; +}; +#endif + + +#if !LIBVIR_CHECK_VERSION(0, 8, 0) +struct _virDomainEventGraphicsSubject { + int nidentity; + virDomainEventGraphicsSubjectIdentityPtr identities; +}; +#endif + + +#if !LIBVIR_CHECK_VERSION(0, 8, 0) +struct _virDomainEventGraphicsSubjectIdentity { + char * type; + char * name; +}; +#endif + + +#if !LIBVIR_CHECK_VERSION(1, 2, 11) +struct _virDomainFSInfo { + char * mountpoint; + char * name; + char * fstype; + size_t ndevAlias; + char ** devAlias; +}; +#endif + + +#if !LIBVIR_CHECK_VERSION(1, 2, 14) +struct _virDomainIOThreadInfo { + unsigned int iothread_id; + unsigned char * cpumap; + int cpumaplen; +}; +#endif + + +#if !LIBVIR_CHECK_VERSION(0, 0, 1) +struct _virDomainInfo { + unsigned char state; + unsigned long maxMem; + unsigned long memory; + unsigned short nrVirtCpu; + unsigned long long cpuTime; +}; +#endif + + +#if !LIBVIR_CHECK_VERSION(1, 2, 14) +struct _virDomainInterface { + char * name; + char * hwaddr; + unsigned int naddrs; + virDomainIPAddressPtr addrs; +}; +#endif + + +#if !LIBVIR_CHECK_VERSION(1, 2, 14) +struct _virDomainInterfaceIPAddress { + int type; + char * addr; + unsigned int prefix; +}; +#endif + + +#if !LIBVIR_CHECK_VERSION(0, 3, 3) +struct _virDomainInterfaceStats { + long long rx_bytes; + long long rx_packets; + long long rx_errs; + long long rx_drop; + long long tx_bytes; + long long tx_packets; + long long tx_errs; + long long tx_drop; +}; +#endif + + +#if !LIBVIR_CHECK_VERSION(0, 7, 7) +struct _virDomainJobInfo { + int type; + unsigned long long timeElapsed; + unsigned long long timeRemaining; + unsigned long long dataTotal; + unsigned long long dataProcessed; + unsigned long long dataRemaining; + unsigned long long memTotal; + unsigned long long memProcessed; + unsigned long long memRemaining; + unsigned long long fileTotal; + unsigned long long fileProcessed; + unsigned long long fileRemaining; +}; +#endif + + +#if !LIBVIR_CHECK_VERSION(0, 7, 5) +struct _virDomainMemoryStat { + int tag; + unsigned long long val; +}; +#endif + + +#if !LIBVIR_CHECK_VERSION(1, 2, 8) +struct _virDomainStatsRecord { + virDomainPtr dom; + virTypedParameterPtr params; + int nparams; +}; +#endif + + +#if !LIBVIR_CHECK_VERSION(0, 1, 0) +struct _virError { + int code; + int domain; + char * message; + virErrorLevel level; + virConnectPtr conn; + virDomainPtr dom; + char * str1; + char * str2; + char * str3; + int int1; + int int2; + virNetworkPtr net; +}; +#endif + + +#if !LIBVIR_CHECK_VERSION(1, 2, 6) +struct _virNetworkDHCPLease { + char * iface; + long long expirytime; + int type; + char * mac; + char * iaid; + char * ipaddr; + unsigned int prefix; + char * hostname; + char * clientid; +}; +#endif + + +#if !LIBVIR_CHECK_VERSION(0, 9, 3) +struct _virNodeCPUStats { + char field[VIR_NODE_CPU_STATS_FIELD_LENGTH]; + unsigned long long value; +}; +#endif + + +#if !LIBVIR_CHECK_VERSION(0, 1, 0) +struct _virNodeInfo { + char model[32]; + unsigned long memory; + unsigned int cpus; + unsigned int mhz; + unsigned int nodes; + unsigned int sockets; + unsigned int cores; + unsigned int threads; +}; +#endif + + +#if !LIBVIR_CHECK_VERSION(0, 9, 3) +struct _virNodeMemoryStats { + char field[VIR_NODE_MEMORY_STATS_FIELD_LENGTH]; + unsigned long long value; +}; +#endif + + +#if !LIBVIR_CHECK_VERSION(0, 6, 1) +struct _virSecurityLabel { + char label[VIR_SECURITY_LABEL_BUFLEN]; + int enforcing; +}; +#endif + + +#if !LIBVIR_CHECK_VERSION(0, 6, 1) +struct _virSecurityModel { + char model[VIR_SECURITY_MODEL_BUFLEN]; + char doi[VIR_SECURITY_DOI_BUFLEN]; +}; +#endif + + +#if !LIBVIR_CHECK_VERSION(0, 4, 1) +struct _virStoragePoolInfo { + int state; + unsigned long long capacity; + unsigned long long allocation; + unsigned long long available; +}; +#endif + + +#if !LIBVIR_CHECK_VERSION(0, 4, 1) +struct _virStorageVolInfo { + int type; + unsigned long long capacity; + unsigned long long allocation; +}; +#endif + + +#if !LIBVIR_CHECK_VERSION(0, 9, 0) +struct _virTypedParameter { + char field[VIR_TYPED_PARAM_FIELD_LENGTH]; + int type; + union { + int i; + unsigned int ui; + long long int l; + unsigned long long int ul; + double d; + char b; + char * s; + } value; +}; +#endif + + +#if !LIBVIR_CHECK_VERSION(0, 1, 4) +struct _virVcpuInfo { + unsigned int number; + int state; + unsigned long long cpuTime; + int cpu; +}; +#endif + diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_typedefs.h b/vendor/libvirt.org/go/libvirt/libvirt_generated_typedefs.h new file mode 100644 index 000000000..172449f0d --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_typedefs.h @@ -0,0 +1,1097 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +#pragma once + +#if !LIBVIR_CHECK_VERSION(0, 0, 1) +typedef struct _virConnect virConnect; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 4, 1) +typedef struct _virConnectAuth virConnectAuth; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 4, 1) +typedef struct _virConnectCredential virConnectCredential; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 0, 1) +typedef struct _virDomain virDomain; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 1) +typedef struct _virDomainBlockInfo virDomainBlockInfo; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 4) +typedef struct _virDomainBlockJobInfo virDomainBlockJobInfo; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 3, 3) +typedef struct _virDomainBlockStats virDomainBlockStatsStruct; +#endif + +#if !LIBVIR_CHECK_VERSION(5, 2, 0) +typedef struct _virDomainCheckpoint virDomainCheckpoint; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 3) +typedef struct _virDomainControlInfo virDomainControlInfo; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 10) +typedef struct _virDomainDiskError virDomainDiskError; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 0) +typedef struct _virDomainEventGraphicsAddress virDomainEventGraphicsAddress; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 0) +typedef struct _virDomainEventGraphicsSubject virDomainEventGraphicsSubject; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 0) +typedef struct _virDomainEventGraphicsSubjectIdentity virDomainEventGraphicsSubjectIdentity; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 11) +typedef struct _virDomainFSInfo virDomainFSInfo; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 14) +typedef struct _virDomainIOThreadInfo virDomainIOThreadInfo; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 0, 1) +typedef struct _virDomainInfo virDomainInfo; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 14) +typedef struct _virDomainInterface virDomainInterface; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 14) +typedef struct _virDomainInterfaceIPAddress virDomainIPAddress; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 3, 3) +typedef struct _virDomainInterfaceStats virDomainInterfaceStatsStruct; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 7, 7) +typedef struct _virDomainJobInfo virDomainJobInfo; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 7, 5) +typedef struct _virDomainMemoryStat virDomainMemoryStatStruct; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 0) +typedef struct _virDomainSnapshot virDomainSnapshot; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 8) +typedef struct _virDomainStatsRecord virDomainStatsRecord; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 1, 0) +typedef struct _virError virError; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 6, 4) +typedef struct _virInterface virInterface; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 0) +typedef struct _virNWFilter virNWFilter; +#endif + +#if !LIBVIR_CHECK_VERSION(4, 5, 0) +typedef struct _virNWFilterBinding virNWFilterBinding; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 2, 0) +typedef struct _virNetwork virNetwork; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 6) +typedef struct _virNetworkDHCPLease virNetworkDHCPLease; +#endif + +#if !LIBVIR_CHECK_VERSION(5, 5, 0) +typedef struct _virNetworkPort virNetworkPort; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 3) +typedef struct _virNodeCPUStats virNodeCPUStats; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 5, 0) +typedef struct _virNodeDevice virNodeDevice; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 1, 0) +typedef struct _virNodeInfo virNodeInfo; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 3) +typedef struct _virNodeMemoryStats virNodeMemoryStats; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 7, 1) +typedef struct _virSecret virSecret; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 6, 1) +typedef struct _virSecurityLabel virSecurityLabel; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 6, 1) +typedef struct _virSecurityModel virSecurityModel; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 4, 1) +typedef struct _virStoragePool virStoragePool; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 4, 1) +typedef struct _virStoragePoolInfo virStoragePoolInfo; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 4, 1) +typedef struct _virStorageVol virStorageVol; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 4, 1) +typedef struct _virStorageVolInfo virStorageVolInfo; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 7, 2) +typedef struct _virStream virStream; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 0) +typedef struct _virTypedParameter virBlkioParameter; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 5) +typedef struct _virTypedParameter virMemoryParameter; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 2, 3) +typedef struct _virTypedParameter virSchedParameter; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 2) +typedef struct _virTypedParameter virTypedParameter; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 1, 4) +typedef struct _virVcpuInfo virVcpuInfo; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 0) +typedef virBlkioParameter * virBlkioParameterPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 0) +typedef int virBlkioParameterType; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 7, 5) +typedef int virCPUCompareResult; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 4, 1) +typedef virConnectAuth * virConnectAuthPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 1, 2) +typedef int virConnectBaselineCPUFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 10, 0) +typedef int virConnectCloseReason; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 6) +typedef int virConnectCompareCPUFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 4, 1) +typedef virConnectCredential * virConnectCredentialPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 4, 1) +typedef int virConnectCredentialType; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 11) +typedef int virConnectDomainEventAgentLifecycleReason; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 11) +typedef int virConnectDomainEventAgentLifecycleState; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 4) +typedef int virConnectDomainEventBlockJobStatus; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 7) +typedef int virConnectDomainEventDiskChangeReason; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 4, 1) +typedef int virConnectFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 8) +typedef int virConnectGetAllDomainStatsFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 13) +typedef int virConnectListAllDomainsFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 10, 2) +typedef int virConnectListAllInterfacesFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 10, 2) +typedef int virConnectListAllNetworksFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 10, 2) +typedef int virConnectListAllNodeDeviceFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 10, 2) +typedef int virConnectListAllSecretsFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 10, 2) +typedef int virConnectListAllStoragePoolsFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 0, 1) +typedef virConnect * virConnectPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(8, 5, 0) +typedef int virDomainAbortJobFlagsValues; +#endif + +#if !LIBVIR_CHECK_VERSION(5, 10, 0) +typedef int virDomainAgentResponseTimeoutValues; +#endif + +#if !LIBVIR_CHECK_VERSION(6, 10, 0) +typedef int virDomainAuthorizedSSHKeysSetFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(6, 0, 0) +typedef int virDomainBackupBeginFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 10, 2) +typedef int virDomainBlockCommitFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 8) +typedef int virDomainBlockCopyFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 1) +typedef virDomainBlockInfo * virDomainBlockInfoPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 12) +typedef int virDomainBlockJobAbortFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 4) +typedef unsigned long long virDomainBlockJobCursor; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 9) +typedef int virDomainBlockJobInfoFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 4) +typedef virDomainBlockJobInfo * virDomainBlockJobInfoPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 9) +typedef int virDomainBlockJobSetSpeedFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 4) +typedef int virDomainBlockJobType; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 9) +typedef int virDomainBlockPullFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 12) +typedef int virDomainBlockRebaseFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 11) +typedef int virDomainBlockResizeFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 3, 2) +typedef virDomainBlockStatsStruct * virDomainBlockStatsPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 2) +typedef int virDomainBlockedReason; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 0, 2) +typedef int virDomainChannelFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(5, 6, 0) +typedef int virDomainCheckpointCreateFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(5, 6, 0) +typedef int virDomainCheckpointDeleteFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(5, 6, 0) +typedef int virDomainCheckpointListFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(5, 2, 0) +typedef virDomainCheckpoint * virDomainCheckpointPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(5, 6, 0) +typedef int virDomainCheckpointXMLFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 11) +typedef int virDomainConsoleFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 14) +typedef int virDomainControlErrorReason; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 3) +typedef virDomainControlInfo * virDomainControlInfoPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 3) +typedef int virDomainControlState; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 7, 5) +typedef int virDomainCoreDumpFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 3) +typedef int virDomainCoreDumpFormat; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 2) +typedef int virDomainCrashedReason; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 0, 1) +typedef int virDomainCreateFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 12) +typedef int virDomainDefineFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 4) +typedef int virDomainDestroyFlagsValues; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 7, 7) +typedef int virDomainDeviceModifyFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(8, 1, 0) +typedef int virDomainDirtyRateCalcFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(7, 2, 0) +typedef int virDomainDirtyRateStatus; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 10) +typedef int virDomainDiskErrorCode; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 10) +typedef virDomainDiskError * virDomainDiskErrorPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 1, 1) +typedef int virDomainEventCrashedDetailType; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 5, 0) +typedef int virDomainEventDefinedDetailType; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 0) +typedef virDomainEventGraphicsAddress * virDomainEventGraphicsAddressPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 0) +typedef int virDomainEventGraphicsAddressType; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 0) +typedef int virDomainEventGraphicsPhase; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 0) +typedef virDomainEventGraphicsSubjectIdentity * virDomainEventGraphicsSubjectIdentityPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 0) +typedef virDomainEventGraphicsSubject * virDomainEventGraphicsSubjectPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 0) +typedef int virDomainEventID; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 0) +typedef int virDomainEventIOErrorAction; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 10, 2) +typedef int virDomainEventPMSuspendedDetailType; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 5, 0) +typedef int virDomainEventResumedDetailType; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 8) +typedef int virDomainEventShutdownDetailType; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 5, 0) +typedef int virDomainEventStartedDetailType; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 5, 0) +typedef int virDomainEventStoppedDetailType; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 5, 0) +typedef int virDomainEventSuspendedDetailType; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 11) +typedef int virDomainEventTrayChangeReason; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 5, 0) +typedef int virDomainEventType; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 5, 0) +typedef int virDomainEventUndefinedDetailType; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 0) +typedef int virDomainEventWatchdogAction; +#endif + +#if !LIBVIR_CHECK_VERSION(9, 0, 0) +typedef int virDomainFDAssociateFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 11) +typedef virDomainFSInfo * virDomainFSInfoPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(6, 1, 0) +typedef int virDomainGetHostnameFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 9) +typedef int virDomainGetJobStatsFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(10, 2, 0) +typedef int virDomainGraphicsReloadType; +#endif + +#if !LIBVIR_CHECK_VERSION(5, 7, 0) +typedef int virDomainGuestInfoTypes; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 14) +typedef virDomainIOThreadInfo * virDomainIOThreadInfoPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 14) +typedef virDomainIPAddress * virDomainIPAddressPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 0, 1) +typedef virDomainInfo * virDomainInfoPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 14) +typedef int virDomainInterfaceAddressesSource; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 14) +typedef virDomainInterface * virDomainInterfacePtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 3, 2) +typedef virDomainInterfaceStatsStruct * virDomainInterfaceStatsPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 7, 7) +typedef virDomainJobInfo * virDomainJobInfoPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(3, 3, 0) +typedef int virDomainJobOperation; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 7, 7) +typedef int virDomainJobType; +#endif + +#if !LIBVIR_CHECK_VERSION(3, 9, 0) +typedef int virDomainLifecycle; +#endif + +#if !LIBVIR_CHECK_VERSION(3, 9, 0) +typedef int virDomainLifecycleAction; +#endif + +#if !LIBVIR_CHECK_VERSION(6, 9, 0) +typedef int virDomainMemoryFailureActionType; +#endif + +#if !LIBVIR_CHECK_VERSION(6, 9, 0) +typedef int virDomainMemoryFailureFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(6, 9, 0) +typedef int virDomainMemoryFailureRecipientType; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 4, 4) +typedef int virDomainMemoryFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 0) +typedef int virDomainMemoryModFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 7, 5) +typedef virDomainMemoryStatStruct * virDomainMemoryStatPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 7, 5) +typedef int virDomainMemoryStatTags; +#endif + +#if !LIBVIR_CHECK_VERSION(7, 1, 0) +typedef int virDomainMessageType; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 10) +typedef int virDomainMetadataType; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 3, 2) +typedef int virDomainMigrateFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(5, 1, 0) +typedef int virDomainMigrateMaxSpeedFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 2) +typedef int virDomainModificationImpact; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 2) +typedef int virDomainNostateReason; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 9) +typedef int virDomainNumatuneMemMode; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 7) +typedef int virDomainOpenGraphicsFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 0, 0) +typedef int virDomainPMSuspendedDiskReason; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 11) +typedef int virDomainPMSuspendedReason; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 2) +typedef int virDomainPausedReason; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 0, 1) +typedef int virDomainProcessSignal; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 0, 1) +typedef virDomain * virDomainPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 10) +typedef int virDomainRebootFlagValues; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 2) +typedef int virDomainRunningReason; +#endif + +#if !LIBVIR_CHECK_VERSION(5, 1, 0) +typedef int virDomainSaveImageXMLFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 4) +typedef int virDomainSaveRestoreFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 5) +typedef int virDomainSetTimeFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 16) +typedef int virDomainSetUserPasswordFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 10) +typedef int virDomainShutdownFlagValues; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 2) +typedef int virDomainShutdownReason; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 2) +typedef int virDomainShutoffReason; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 5) +typedef int virDomainSnapshotCreateFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 0) +typedef int virDomainSnapshotDeleteFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 5) +typedef int virDomainSnapshotListFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 0) +typedef virDomainSnapshot * virDomainSnapshotPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 5) +typedef int virDomainSnapshotRevertFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(5, 1, 0) +typedef int virDomainSnapshotXMLFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 0, 1) +typedef int virDomainState; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 8) +typedef virDomainStatsRecord * virDomainStatsRecordPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 8) +typedef int virDomainStatsTypes; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 4) +typedef int virDomainUndefineFlagsValues; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 5) +typedef int virDomainVcpuFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 3, 3) +typedef int virDomainXMLFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 1, 0) +typedef int virErrorDomain; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 1, 0) +typedef int virErrorLevel; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 1, 0) +typedef int virErrorNumber; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 1, 0) +typedef virError * virErrorPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 5, 0) +typedef int virEventHandleType; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 6) +typedef int virIPAddrType; +#endif + +#if !LIBVIR_CHECK_VERSION(7, 7, 0) +typedef int virInterfaceDefineFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 6, 4) +typedef virInterface * virInterfacePtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 7, 3) +typedef int virInterfaceXMLFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 3) +typedef int virKeycodeSet; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 5) +typedef virMemoryParameter * virMemoryParameterPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 5) +typedef int virMemoryParameterType; +#endif + +#if !LIBVIR_CHECK_VERSION(7, 8, 0) +typedef int virNWFilterBindingCreateFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(4, 5, 0) +typedef virNWFilterBinding * virNWFilterBindingPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(7, 7, 0) +typedef int virNWFilterDefineFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 0) +typedef virNWFilter * virNWFilterPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(7, 8, 0) +typedef int virNetworkCreateFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 6) +typedef virNetworkDHCPLease * virNetworkDHCPLeasePtr; +#endif + +#if !LIBVIR_CHECK_VERSION(7, 7, 0) +typedef int virNetworkDefineFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 1) +typedef int virNetworkEventID; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 1) +typedef int virNetworkEventLifecycleType; +#endif + +#if !LIBVIR_CHECK_VERSION(9, 7, 0) +typedef int virNetworkMetadataType; +#endif + +#if !LIBVIR_CHECK_VERSION(5, 5, 0) +typedef int virNetworkPortCreateFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(5, 5, 0) +typedef virNetworkPort * virNetworkPortPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 2, 0) +typedef virNetwork * virNetworkPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 10, 2) +typedef int virNetworkUpdateCommand; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 10, 2) +typedef int virNetworkUpdateFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 10, 2) +typedef int virNetworkUpdateSection; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 10) +typedef int virNetworkXMLFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 2, 9) +typedef int virNodeAllocPagesFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 3) +typedef virNodeCPUStats * virNodeCPUStatsPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(8, 10, 0) +typedef int virNodeDeviceCreateXMLFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(8, 10, 0) +typedef int virNodeDeviceDefineXMLFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(2, 2, 0) +typedef int virNodeDeviceEventID; +#endif + +#if !LIBVIR_CHECK_VERSION(2, 2, 0) +typedef int virNodeDeviceEventLifecycleType; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 5, 0) +typedef virNodeDevice * virNodeDevicePtr; +#endif + +#if !LIBVIR_CHECK_VERSION(10, 1, 0) +typedef int virNodeDeviceUpdateFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(10, 1, 0) +typedef int virNodeDeviceXMLFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 8) +typedef int virNodeGetCPUStatsAllCPUs; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 8) +typedef int virNodeGetMemoryStatsAllCells; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 1, 0) +typedef virNodeInfo * virNodeInfoPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 3) +typedef virNodeMemoryStats * virNodeMemoryStatsPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 8) +typedef int virNodeSuspendTarget; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 2, 3) +typedef virSchedParameter * virSchedParameterPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 2, 3) +typedef int virSchedParameterType; +#endif + +#if !LIBVIR_CHECK_VERSION(7, 7, 0) +typedef int virSecretDefineFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(3, 0, 0) +typedef int virSecretEventID; +#endif + +#if !LIBVIR_CHECK_VERSION(3, 0, 0) +typedef int virSecretEventLifecycleType; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 7, 1) +typedef virSecret * virSecretPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 7, 1) +typedef int virSecretUsageType; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 6, 1) +typedef virSecurityLabel * virSecurityLabelPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 6, 1) +typedef virSecurityModel * virSecurityModelPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 4, 1) +typedef int virStoragePoolBuildFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 3, 1) +typedef int virStoragePoolCreateFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(7, 7, 0) +typedef int virStoragePoolDefineFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 4, 1) +typedef int virStoragePoolDeleteFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(2, 0, 0) +typedef int virStoragePoolEventID; +#endif + +#if !LIBVIR_CHECK_VERSION(2, 0, 0) +typedef int virStoragePoolEventLifecycleType; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 4, 1) +typedef virStoragePoolInfo * virStoragePoolInfoPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 4, 1) +typedef virStoragePool * virStoragePoolPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 4, 1) +typedef int virStoragePoolState; +#endif + +#if !LIBVIR_CHECK_VERSION(1, 0, 1) +typedef int virStorageVolCreateFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 4, 1) +typedef int virStorageVolDeleteFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(3, 4, 0) +typedef int virStorageVolDownloadFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(3, 0, 0) +typedef int virStorageVolInfoFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 4, 1) +typedef virStorageVolInfo * virStorageVolInfoPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 4, 1) +typedef virStorageVol * virStorageVolPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 10) +typedef int virStorageVolResizeFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 4, 1) +typedef int virStorageVolType; +#endif + +#if !LIBVIR_CHECK_VERSION(3, 4, 0) +typedef int virStorageVolUploadFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 10) +typedef int virStorageVolWipeAlgorithm; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 13) +typedef int virStorageXMLFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 7, 2) +typedef int virStreamEventType; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 7, 2) +typedef int virStreamFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 7, 2) +typedef virStream * virStreamPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(3, 4, 0) +typedef int virStreamRecvFlagsValues; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 8) +typedef int virTypedParameterFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 2) +typedef virTypedParameter * virTypedParameterPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 9, 2) +typedef int virTypedParameterType; +#endif + +#if !LIBVIR_CHECK_VERSION(6, 10, 0) +typedef int virVcpuHostCpuState; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 1, 4) +typedef virVcpuInfo * virVcpuInfoPtr; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 1, 4) +typedef int virVcpuState; +#endif diff --git a/vendor/libvirt.org/go/libvirt/libvirt_generated_variables.h b/vendor/libvirt.org/go/libvirt/libvirt_generated_variables.h new file mode 100644 index 000000000..aef8c2ab0 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_generated_variables.h @@ -0,0 +1,35 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +#pragma once +#if LIBVIRT_DLOPEN +extern virConnectAuthPtr *virConnectAuthPtrDefaultVar; +#else +extern virConnectAuthPtr virConnectAuthPtrDefault; +#define virConnectAuthPtrDefaultVar (&virConnectAuthPtrDefault) +#endif diff --git a/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated.h b/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated.h new file mode 100644 index 000000000..a922b03ad --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated.h @@ -0,0 +1,47 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +#pragma once + +#ifdef LIBVIRT_DLOPEN +#define LIBVIR_CHECK_VERSION(a,b,c) 0 +#include +#else +#include +#include +#endif + +#include "libvirt_generated.h" + +#include "libvirt_lxc_generated_macros.h" +#include "libvirt_lxc_generated_enums.h" +#include "libvirt_lxc_generated_typedefs.h" +#include "libvirt_lxc_generated_callbacks.h" +#include "libvirt_lxc_generated_structs.h" +#include "libvirt_lxc_generated_variables.h" +#include "libvirt_lxc_generated_functions.h" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_callbacks.h b/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_callbacks.h new file mode 100644 index 000000000..5e8ccb350 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_callbacks.h @@ -0,0 +1,29 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +#pragma once diff --git a/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_dlopen.go b/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_dlopen.go new file mode 100644 index 000000000..c5f3a4959 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_dlopen.go @@ -0,0 +1,105 @@ +//go:build !libvirt_without_lxc && libvirt_dlopen +// +build !libvirt_without_lxc,libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include +#include +#include +#include "libvirt_lxc_generated_dlopen.h" +#include "error_helper.h" + +static void *handle; +static bool once; + +static void * +libvirtLxcLoad(virErrorPtr err) +{ + char *errMsg; + + if (once) { + if (handle == NULL) { + setVirError(err, "Failed to open libvirt-lxc.so.0"); + } + return handle; + } + handle = dlopen("libvirt-lxc.so.0", RTLD_NOW|RTLD_LOCAL); + once = true; + if (handle == NULL) { + setVirError(err, dlerror()); + return handle; + } + return handle; +} + + +bool +libvirtLxcSymbol(const char *name, + void **symbol, + bool *once, + bool *success, + virErrorPtr err) +{ + char *errMsg; + + if (!libvirtLxcLoad(err)) { + return *success; + } + + if (*once) { + if (!*success) { + // Set error for successive calls + char msg[100]; + snprintf(msg, 100, "Failed to load %s", name); + setVirError(err, msg); + } + return *success; + } + + // Documentation of dlsym says we should use dlerror() to check for failure + // in dlsym() as a NULL might be the right address for a given symbol. + // This is also the reason to have the @success argument. + *symbol = dlsym(handle, name); + if ((errMsg = dlerror()) != NULL) { + setVirError(err, errMsg); + *once = true; + return *success; + } + *once = true; + *success = true; + return *success; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_dlopen.h b/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_dlopen.h new file mode 100644 index 000000000..2e9b8a6b1 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_dlopen.h @@ -0,0 +1,41 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +#pragma once + +#include "libvirt_lxc_generated.h" + +bool +libvirtLxcSymbol(const char *name, + void **symbol, + bool *once, + bool *success, + virErrorPtr err); + +extern int +virCopyLastErrorWrapper(virErrorPtr err); diff --git a/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_enums.h b/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_enums.h new file mode 100644 index 000000000..5e8ccb350 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_enums.h @@ -0,0 +1,29 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +#pragma once diff --git a/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_functions.h b/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_functions.h new file mode 100644 index 000000000..388897e77 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_functions.h @@ -0,0 +1,56 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +#pragma once + +int +virDomainLxcEnterCGroupWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err); + +int +virDomainLxcEnterNamespaceWrapper(virDomainPtr domain, + unsigned int nfdlist, + int * fdlist, + unsigned int * noldfdlist, + int ** oldfdlist, + unsigned int flags, + virErrorPtr err); + +int +virDomainLxcEnterSecurityLabelWrapper(virSecurityModelPtr model, + virSecurityLabelPtr label, + virSecurityLabelPtr oldlabel, + unsigned int flags, + virErrorPtr err); + +int +virDomainLxcOpenNamespaceWrapper(virDomainPtr domain, + int ** fdlist, + unsigned int flags, + virErrorPtr err); diff --git a/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_functions_dlopen.go b/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_functions_dlopen.go new file mode 100644 index 000000000..ece9d7173 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_functions_dlopen.go @@ -0,0 +1,183 @@ +//go:build !libvirt_without_lxc && libvirt_dlopen +// +build !libvirt_without_lxc,libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo LDFLAGS: -ldl +#cgo CFLAGS: -DLIBVIRT_DLOPEN +#include +#include +#include +#include +#include "libvirt_lxc_generated_dlopen.h" +#include "error_helper.h" + + +typedef int +(*virDomainLxcEnterCGroupFuncType)(virDomainPtr domain, + unsigned int flags); + +int +virDomainLxcEnterCGroupWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainLxcEnterCGroupFuncType virDomainLxcEnterCGroupSymbol; + static bool once; + static bool success; + + if (!libvirtLxcSymbol("virDomainLxcEnterCGroup", + (void**)&virDomainLxcEnterCGroupSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainLxcEnterCGroupSymbol(domain, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainLxcEnterNamespaceFuncType)(virDomainPtr domain, + unsigned int nfdlist, + int * fdlist, + unsigned int * noldfdlist, + int ** oldfdlist, + unsigned int flags); + +int +virDomainLxcEnterNamespaceWrapper(virDomainPtr domain, + unsigned int nfdlist, + int * fdlist, + unsigned int * noldfdlist, + int ** oldfdlist, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainLxcEnterNamespaceFuncType virDomainLxcEnterNamespaceSymbol; + static bool once; + static bool success; + + if (!libvirtLxcSymbol("virDomainLxcEnterNamespace", + (void**)&virDomainLxcEnterNamespaceSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainLxcEnterNamespaceSymbol(domain, + nfdlist, + fdlist, + noldfdlist, + oldfdlist, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainLxcEnterSecurityLabelFuncType)(virSecurityModelPtr model, + virSecurityLabelPtr label, + virSecurityLabelPtr oldlabel, + unsigned int flags); + +int +virDomainLxcEnterSecurityLabelWrapper(virSecurityModelPtr model, + virSecurityLabelPtr label, + virSecurityLabelPtr oldlabel, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainLxcEnterSecurityLabelFuncType virDomainLxcEnterSecurityLabelSymbol; + static bool once; + static bool success; + + if (!libvirtLxcSymbol("virDomainLxcEnterSecurityLabel", + (void**)&virDomainLxcEnterSecurityLabelSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainLxcEnterSecurityLabelSymbol(model, + label, + oldlabel, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainLxcOpenNamespaceFuncType)(virDomainPtr domain, + int ** fdlist, + unsigned int flags); + +int +virDomainLxcOpenNamespaceWrapper(virDomainPtr domain, + int ** fdlist, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainLxcOpenNamespaceFuncType virDomainLxcOpenNamespaceSymbol; + static bool once; + static bool success; + + if (!libvirtLxcSymbol("virDomainLxcOpenNamespace", + (void**)&virDomainLxcOpenNamespaceSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainLxcOpenNamespaceSymbol(domain, + fdlist, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_functions_static.go b/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_functions_static.go new file mode 100644 index 000000000..6a60cb7ec --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_functions_static.go @@ -0,0 +1,131 @@ +//go:build !libvirt_without_lxc && !libvirt_dlopen +// +build !libvirt_without_lxc,!libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo pkg-config: libvirt-lxc +#include +#include +#include +#include +#include "libvirt_lxc_generated.h" +#include "error_helper.h" + + +int +virDomainLxcEnterCGroupWrapper(virDomainPtr domain, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(2, 0, 0) + setVirError(err, "Function virDomainLxcEnterCGroup not available prior to libvirt version 2.0.0"); +#else + ret = virDomainLxcEnterCGroup(domain, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainLxcEnterNamespaceWrapper(virDomainPtr domain, + unsigned int nfdlist, + int * fdlist, + unsigned int * noldfdlist, + int ** oldfdlist, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 0, 2) + setVirError(err, "Function virDomainLxcEnterNamespace not available prior to libvirt version 1.0.2"); +#else + ret = virDomainLxcEnterNamespace(domain, + nfdlist, + fdlist, + noldfdlist, + oldfdlist, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainLxcEnterSecurityLabelWrapper(virSecurityModelPtr model, + virSecurityLabelPtr label, + virSecurityLabelPtr oldlabel, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 0, 4) + setVirError(err, "Function virDomainLxcEnterSecurityLabel not available prior to libvirt version 1.0.4"); +#else + ret = virDomainLxcEnterSecurityLabel(model, + label, + oldlabel, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainLxcOpenNamespaceWrapper(virDomainPtr domain, + int ** fdlist, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 0, 2) + setVirError(err, "Function virDomainLxcOpenNamespace not available prior to libvirt version 1.0.2"); +#else + ret = virDomainLxcOpenNamespace(domain, + fdlist, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_macros.h b/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_macros.h new file mode 100644 index 000000000..5e8ccb350 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_macros.h @@ -0,0 +1,29 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +#pragma once diff --git a/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_structs.h b/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_structs.h new file mode 100644 index 000000000..5e8ccb350 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_structs.h @@ -0,0 +1,29 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +#pragma once diff --git a/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_typedefs.h b/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_typedefs.h new file mode 100644 index 000000000..5e8ccb350 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_typedefs.h @@ -0,0 +1,29 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +#pragma once diff --git a/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_variables.h b/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_variables.h new file mode 100644 index 000000000..5e8ccb350 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_lxc_generated_variables.h @@ -0,0 +1,29 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +#pragma once diff --git a/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated.h b/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated.h new file mode 100644 index 000000000..64b3b8af8 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated.h @@ -0,0 +1,47 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +#pragma once + +#ifdef LIBVIRT_DLOPEN +#define LIBVIR_CHECK_VERSION(a,b,c) 0 +#include +#else +#include +#include +#endif + +#include "libvirt_generated.h" + +#include "libvirt_qemu_generated_macros.h" +#include "libvirt_qemu_generated_enums.h" +#include "libvirt_qemu_generated_typedefs.h" +#include "libvirt_qemu_generated_callbacks.h" +#include "libvirt_qemu_generated_structs.h" +#include "libvirt_qemu_generated_variables.h" +#include "libvirt_qemu_generated_functions.h" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_callbacks.h b/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_callbacks.h new file mode 100644 index 000000000..87fe4e4a1 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_callbacks.h @@ -0,0 +1,39 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +#pragma once + +#if !LIBVIR_CHECK_VERSION(1, 2, 3) +typedef void (*virConnectDomainQemuMonitorEventCallback)(virConnectPtr conn, + virDomainPtr dom, + const char * event, + long long seconds, + unsigned int micros, + const char * details, + void * opaque); +#endif diff --git a/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_dlopen.go b/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_dlopen.go new file mode 100644 index 000000000..fec70444f --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_dlopen.go @@ -0,0 +1,105 @@ +//go:build !libvirt_without_qemu && libvirt_dlopen +// +build !libvirt_without_qemu,libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include +#include +#include +#include "libvirt_qemu_generated_dlopen.h" +#include "error_helper.h" + +static void *handle; +static bool once; + +static void * +libvirtQemuLoad(virErrorPtr err) +{ + char *errMsg; + + if (once) { + if (handle == NULL) { + setVirError(err, "Failed to open libvirt-qemu.so.0"); + } + return handle; + } + handle = dlopen("libvirt-qemu.so.0", RTLD_NOW|RTLD_LOCAL); + once = true; + if (handle == NULL) { + setVirError(err, dlerror()); + return handle; + } + return handle; +} + + +bool +libvirtQemuSymbol(const char *name, + void **symbol, + bool *once, + bool *success, + virErrorPtr err) +{ + char *errMsg; + + if (!libvirtQemuLoad(err)) { + return *success; + } + + if (*once) { + if (!*success) { + // Set error for successive calls + char msg[100]; + snprintf(msg, 100, "Failed to load %s", name); + setVirError(err, msg); + } + return *success; + } + + // Documentation of dlsym says we should use dlerror() to check for failure + // in dlsym() as a NULL might be the right address for a given symbol. + // This is also the reason to have the @success argument. + *symbol = dlsym(handle, name); + if ((errMsg = dlerror()) != NULL) { + setVirError(err, errMsg); + *once = true; + return *success; + } + *once = true; + *success = true; + return *success; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_dlopen.h b/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_dlopen.h new file mode 100644 index 000000000..e8dbf989c --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_dlopen.h @@ -0,0 +1,41 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +#pragma once + +#include "libvirt_qemu_generated.h" + +bool +libvirtQemuSymbol(const char *name, + void **symbol, + bool *once, + bool *success, + virErrorPtr err); + +extern int +virCopyLastErrorWrapper(virErrorPtr err); diff --git a/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_enums.h b/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_enums.h new file mode 100644 index 000000000..b7a9d7b7e --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_enums.h @@ -0,0 +1,63 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +#pragma once + +/* enum virConnectDomainQemuMonitorEventRegisterFlags */ +# if !LIBVIR_CHECK_VERSION(1, 2, 3) +# define VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_REGEX (1 << 0) +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 3) +# define VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_NOCASE (1 << 1) +# endif + +/* enum virDomainQemuAgentCommandTimeoutValues */ +# if !LIBVIR_CHECK_VERSION(0, 10, 0) +# define VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_BLOCK +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 0) +# define VIR_DOMAIN_QEMU_AGENT_COMMAND_MIN VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_BLOCK +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 0) +# define VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_DEFAULT +# endif +# if !LIBVIR_CHECK_VERSION(0, 10, 0) +# define VIR_DOMAIN_QEMU_AGENT_COMMAND_NOWAIT VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_NOWAIT +# endif +# if !LIBVIR_CHECK_VERSION(1, 2, 15) +# define VIR_DOMAIN_QEMU_AGENT_COMMAND_SHUTDOWN 60 +# endif + +/* enum virDomainQemuMonitorCommandFlags */ +# if !LIBVIR_CHECK_VERSION(0, 8, 8) +# define VIR_DOMAIN_QEMU_MONITOR_COMMAND_DEFAULT 0 +# endif +# if !LIBVIR_CHECK_VERSION(0, 8, 8) +# define VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP (1 << 0) +# endif + diff --git a/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_functions.h b/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_functions.h new file mode 100644 index 000000000..a139920e4 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_functions.h @@ -0,0 +1,75 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +#pragma once + +int +virConnectDomainQemuMonitorEventDeregisterWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err); + +int +virConnectDomainQemuMonitorEventRegisterWrapper(virConnectPtr conn, + virDomainPtr dom, + const char * event, + virConnectDomainQemuMonitorEventCallback cb, + void * opaque, + virFreeCallback freecb, + unsigned int flags, + virErrorPtr err); + +char * +virDomainQemuAgentCommandWrapper(virDomainPtr domain, + const char * cmd, + int timeout, + unsigned int flags, + virErrorPtr err); + +virDomainPtr +virDomainQemuAttachWrapper(virConnectPtr conn, + unsigned int pid_value, + unsigned int flags, + virErrorPtr err); + +int +virDomainQemuMonitorCommandWrapper(virDomainPtr domain, + const char * cmd, + char ** result, + unsigned int flags, + virErrorPtr err); + +int +virDomainQemuMonitorCommandWithFilesWrapper(virDomainPtr domain, + const char * cmd, + unsigned int ninfiles, + int * infiles, + unsigned int * noutfiles, + int ** outfiles, + char ** result, + unsigned int flags, + virErrorPtr err); diff --git a/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_functions_dlopen.go b/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_functions_dlopen.go new file mode 100644 index 000000000..4e11f2261 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_functions_dlopen.go @@ -0,0 +1,268 @@ +//go:build !libvirt_without_qemu && libvirt_dlopen +// +build !libvirt_without_qemu,libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo LDFLAGS: -ldl +#cgo CFLAGS: -DLIBVIRT_DLOPEN +#include +#include +#include +#include +#include "libvirt_qemu_generated_dlopen.h" +#include "error_helper.h" + + +typedef int +(*virConnectDomainQemuMonitorEventDeregisterFuncType)(virConnectPtr conn, + int callbackID); + +int +virConnectDomainQemuMonitorEventDeregisterWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err) +{ + int ret = -1; + static virConnectDomainQemuMonitorEventDeregisterFuncType virConnectDomainQemuMonitorEventDeregisterSymbol; + static bool once; + static bool success; + + if (!libvirtQemuSymbol("virConnectDomainQemuMonitorEventDeregister", + (void**)&virConnectDomainQemuMonitorEventDeregisterSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectDomainQemuMonitorEventDeregisterSymbol(conn, + callbackID); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virConnectDomainQemuMonitorEventRegisterFuncType)(virConnectPtr conn, + virDomainPtr dom, + const char * event, + virConnectDomainQemuMonitorEventCallback cb, + void * opaque, + virFreeCallback freecb, + unsigned int flags); + +int +virConnectDomainQemuMonitorEventRegisterWrapper(virConnectPtr conn, + virDomainPtr dom, + const char * event, + virConnectDomainQemuMonitorEventCallback cb, + void * opaque, + virFreeCallback freecb, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virConnectDomainQemuMonitorEventRegisterFuncType virConnectDomainQemuMonitorEventRegisterSymbol; + static bool once; + static bool success; + + if (!libvirtQemuSymbol("virConnectDomainQemuMonitorEventRegister", + (void**)&virConnectDomainQemuMonitorEventRegisterSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virConnectDomainQemuMonitorEventRegisterSymbol(conn, + dom, + event, + cb, + opaque, + freecb, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef char * +(*virDomainQemuAgentCommandFuncType)(virDomainPtr domain, + const char * cmd, + int timeout, + unsigned int flags); + +char * +virDomainQemuAgentCommandWrapper(virDomainPtr domain, + const char * cmd, + int timeout, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; + static virDomainQemuAgentCommandFuncType virDomainQemuAgentCommandSymbol; + static bool once; + static bool success; + + if (!libvirtQemuSymbol("virDomainQemuAgentCommand", + (void**)&virDomainQemuAgentCommandSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainQemuAgentCommandSymbol(domain, + cmd, + timeout, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef virDomainPtr +(*virDomainQemuAttachFuncType)(virConnectPtr conn, + unsigned int pid_value, + unsigned int flags); + +virDomainPtr +virDomainQemuAttachWrapper(virConnectPtr conn, + unsigned int pid_value, + unsigned int flags, + virErrorPtr err) +{ + virDomainPtr ret = NULL; + static virDomainQemuAttachFuncType virDomainQemuAttachSymbol; + static bool once; + static bool success; + + if (!libvirtQemuSymbol("virDomainQemuAttach", + (void**)&virDomainQemuAttachSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainQemuAttachSymbol(conn, + pid_value, + flags); + if (!ret) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainQemuMonitorCommandFuncType)(virDomainPtr domain, + const char * cmd, + char ** result, + unsigned int flags); + +int +virDomainQemuMonitorCommandWrapper(virDomainPtr domain, + const char * cmd, + char ** result, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainQemuMonitorCommandFuncType virDomainQemuMonitorCommandSymbol; + static bool once; + static bool success; + + if (!libvirtQemuSymbol("virDomainQemuMonitorCommand", + (void**)&virDomainQemuMonitorCommandSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainQemuMonitorCommandSymbol(domain, + cmd, + result, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +typedef int +(*virDomainQemuMonitorCommandWithFilesFuncType)(virDomainPtr domain, + const char * cmd, + unsigned int ninfiles, + int * infiles, + unsigned int * noutfiles, + int ** outfiles, + char ** result, + unsigned int flags); + +int +virDomainQemuMonitorCommandWithFilesWrapper(virDomainPtr domain, + const char * cmd, + unsigned int ninfiles, + int * infiles, + unsigned int * noutfiles, + int ** outfiles, + char ** result, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; + static virDomainQemuMonitorCommandWithFilesFuncType virDomainQemuMonitorCommandWithFilesSymbol; + static bool once; + static bool success; + + if (!libvirtQemuSymbol("virDomainQemuMonitorCommandWithFiles", + (void**)&virDomainQemuMonitorCommandWithFilesSymbol, + &once, + &success, + err)) { + return ret; + } + ret = virDomainQemuMonitorCommandWithFilesSymbol(domain, + cmd, + ninfiles, + infiles, + noutfiles, + outfiles, + result, + flags); + if (ret < 0) { + virCopyLastErrorWrapper(err); + } + return ret; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_functions_static.go b/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_functions_static.go new file mode 100644 index 000000000..75975dd95 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_functions_static.go @@ -0,0 +1,185 @@ +//go:build !libvirt_without_qemu && !libvirt_dlopen +// +build !libvirt_without_qemu,!libvirt_dlopen + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +package libvirt + +/* +#cgo pkg-config: libvirt-qemu +#include +#include +#include +#include +#include "libvirt_qemu_generated.h" +#include "error_helper.h" + + +int +virConnectDomainQemuMonitorEventDeregisterWrapper(virConnectPtr conn, + int callbackID, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 2, 3) + setVirError(err, "Function virConnectDomainQemuMonitorEventDeregister not available prior to libvirt version 1.2.3"); +#else + ret = virConnectDomainQemuMonitorEventDeregister(conn, + callbackID); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virConnectDomainQemuMonitorEventRegisterWrapper(virConnectPtr conn, + virDomainPtr dom, + const char * event, + virConnectDomainQemuMonitorEventCallback cb, + void * opaque, + virFreeCallback freecb, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(1, 2, 3) + setVirError(err, "Function virConnectDomainQemuMonitorEventRegister not available prior to libvirt version 1.2.3"); +#else + ret = virConnectDomainQemuMonitorEventRegister(conn, + dom, + event, + cb, + opaque, + freecb, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +char * +virDomainQemuAgentCommandWrapper(virDomainPtr domain, + const char * cmd, + int timeout, + unsigned int flags, + virErrorPtr err) +{ + char * ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 10, 0) + setVirError(err, "Function virDomainQemuAgentCommand not available prior to libvirt version 0.10.0"); +#else + ret = virDomainQemuAgentCommand(domain, + cmd, + timeout, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +virDomainPtr +virDomainQemuAttachWrapper(virConnectPtr conn, + unsigned int pid_value, + unsigned int flags, + virErrorPtr err) +{ + virDomainPtr ret = NULL; +#if !LIBVIR_CHECK_VERSION(0, 9, 4) + setVirError(err, "Function virDomainQemuAttach not available prior to libvirt version 0.9.4"); +#else + ret = virDomainQemuAttach(conn, + pid_value, + flags); + if (!ret) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainQemuMonitorCommandWrapper(virDomainPtr domain, + const char * cmd, + char ** result, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(0, 8, 3) + setVirError(err, "Function virDomainQemuMonitorCommand not available prior to libvirt version 0.8.3"); +#else + ret = virDomainQemuMonitorCommand(domain, + cmd, + result, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +int +virDomainQemuMonitorCommandWithFilesWrapper(virDomainPtr domain, + const char * cmd, + unsigned int ninfiles, + int * infiles, + unsigned int * noutfiles, + int ** outfiles, + char ** result, + unsigned int flags, + virErrorPtr err) +{ + int ret = -1; +#if !LIBVIR_CHECK_VERSION(8, 2, 0) + setVirError(err, "Function virDomainQemuMonitorCommandWithFiles not available prior to libvirt version 8.2.0"); +#else + ret = virDomainQemuMonitorCommandWithFiles(domain, + cmd, + ninfiles, + infiles, + noutfiles, + outfiles, + result, + flags); + if (ret < 0) { + virCopyLastError(err); + } +#endif + return ret; +} + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_macros.h b/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_macros.h new file mode 100644 index 000000000..5e8ccb350 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_macros.h @@ -0,0 +1,29 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +#pragma once diff --git a/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_structs.h b/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_structs.h new file mode 100644 index 000000000..5e8ccb350 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_structs.h @@ -0,0 +1,29 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +#pragma once diff --git a/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_typedefs.h b/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_typedefs.h new file mode 100644 index 000000000..9847a0fcd --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_typedefs.h @@ -0,0 +1,41 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +#pragma once + +#if !LIBVIR_CHECK_VERSION(1, 2, 3) +typedef int virConnectDomainQemuMonitorEventRegisterFlags; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 10, 0) +typedef int virDomainQemuAgentCommandTimeoutValues; +#endif + +#if !LIBVIR_CHECK_VERSION(0, 8, 8) +typedef int virDomainQemuMonitorCommandFlags; +#endif diff --git a/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_variables.h b/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_variables.h new file mode 100644 index 000000000..5e8ccb350 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirt_qemu_generated_variables.h @@ -0,0 +1,29 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2022 Red Hat, Inc. + * + */ +/**************************************************************************** + * THIS CODE HAS BEEN GENERATED. DO NOT CHANGE IT DIRECTLY * + ****************************************************************************/ + +#pragma once diff --git a/vendor/libvirt.org/go/libvirt/libvirtd.conf b/vendor/libvirt.org/go/libvirt/libvirtd.conf new file mode 100644 index 000000000..1c31a2414 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirtd.conf @@ -0,0 +1,6 @@ +listen_tls = 0 +listen_tcp = 1 +tcp_port = "16509" +listen_addr = "127.0.0.1" +auth_unix_rw = "none" +auth_tcp = "sasl" diff --git a/vendor/libvirt.org/go/libvirt/libvirtd.sasl b/vendor/libvirt.org/go/libvirt/libvirtd.sasl new file mode 100644 index 000000000..9275a70dc --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/libvirtd.sasl @@ -0,0 +1,2 @@ +mech_list: digest-md5 +sasldb_path: /etc/libvirt/passwd.db diff --git a/vendor/libvirt.org/go/libvirt/lxc.go b/vendor/libvirt.org/go/libvirt/lxc.go new file mode 100644 index 000000000..d3af3f5dc --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/lxc.go @@ -0,0 +1,159 @@ +//go:build !libvirt_without_lxc +// +build !libvirt_without_lxc + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +// Can't rely on pkg-config for libvirt-lxc since it was not +// installed until 2.6.0 onwards +#cgo !libvirt_dlopen LDFLAGS: -lvirt-lxc +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include +#include +#include "libvirt_lxc_generated.h" +*/ +import "C" + +import ( + "os" + "unsafe" +) + +func (d *Domain) LxcOpenNamespace(flags uint32) ([]os.File, error) { + var cfdlist *C.int + + var err C.virError + ret := C.virDomainLxcOpenNamespaceWrapper(d.ptr, &cfdlist, C.uint(flags), &err) + if ret == -1 { + return []os.File{}, makeError(&err) + } + fdlist := make([]os.File, ret) + for i := 0; i < int(ret); i++ { + var cfd C.int + cfd = *(*C.int)(unsafe.Pointer(uintptr(unsafe.Pointer(cfdlist)) + (unsafe.Sizeof(cfd) * uintptr(i)))) + fdlist[i] = *os.NewFile(uintptr(cfd), "namespace") + } + defer C.free(unsafe.Pointer(cfdlist)) + return fdlist, nil +} + +func (d *Domain) LxcEnterNamespace(fdlist []os.File, flags uint32) ([]os.File, error) { + var coldfdlist *C.int + var ncoldfdlist C.uint + nfdlist := len(fdlist) + cfdlist := make([]C.int, nfdlist) + for i := 0; i < nfdlist; i++ { + cfdlist[i] = C.int(fdlist[i].Fd()) + } + + var err C.virError + var cfdlistPtr *C.int = nil + if nfdlist > 0 { + cfdlistPtr = &cfdlist[0] + } + ret := C.virDomainLxcEnterNamespaceWrapper(d.ptr, C.uint(nfdlist), cfdlistPtr, &ncoldfdlist, &coldfdlist, C.uint(flags), &err) + if ret == -1 { + return []os.File{}, makeError(&err) + } + oldfdlist := make([]os.File, ncoldfdlist) + for i := 0; i < int(ncoldfdlist); i++ { + var cfd C.int + cfd = *(*C.int)(unsafe.Pointer(uintptr(unsafe.Pointer(coldfdlist)) + (unsafe.Sizeof(cfd) * uintptr(i)))) + oldfdlist[i] = *os.NewFile(uintptr(cfd), "namespace") + } + defer C.free(unsafe.Pointer(coldfdlist)) + return oldfdlist, nil +} + +func DomainLxcEnterSecurityLabel(model *NodeSecurityModel, label *SecurityLabel, flags uint32) (*SecurityLabel, error) { + var cmodel C.virSecurityModel + var clabel C.virSecurityLabel + var coldlabel C.virSecurityLabel + + cmodelstrlen := len(model.Model) + if cmodelstrlen > (C.VIR_SECURITY_MODEL_BUFLEN - 1) { + cmodelstrlen = C.VIR_SECURITY_MODEL_BUFLEN - 1 + } + cmodelstr := C.CString(model.Model) + defer C.free(unsafe.Pointer(cmodelstr)) + + cdoistrlen := len(model.Doi) + if cdoistrlen >= (C.VIR_SECURITY_DOI_BUFLEN - 1) { + cdoistrlen = C.VIR_SECURITY_DOI_BUFLEN - 1 + } + cdoistr := C.CString(model.Doi) + defer C.free(unsafe.Pointer(cdoistr)) + + C.memcpy(unsafe.Pointer(&cmodel.model), unsafe.Pointer(cmodelstr), C.size_t(cmodelstrlen)) + C.memcpy(unsafe.Pointer(&cmodel.doi), unsafe.Pointer(cdoistr), C.size_t(cdoistrlen)) + + clabelstrlen := len(label.Label) + if clabelstrlen > (C.VIR_SECURITY_LABEL_BUFLEN - 1) { + clabelstrlen = C.VIR_SECURITY_LABEL_BUFLEN - 1 + } + clabelstr := C.CString(label.Label) + defer C.free(unsafe.Pointer(clabelstr)) + + C.memcpy(unsafe.Pointer(&clabel.label), unsafe.Pointer(clabelstr), C.size_t(clabelstrlen)) + if label.Enforcing { + clabel.enforcing = 1 + } else { + clabel.enforcing = 0 + } + + var err C.virError + ret := C.virDomainLxcEnterSecurityLabelWrapper(&cmodel, &clabel, &coldlabel, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + var oldlabel SecurityLabel + + oldlabel.Label = C.GoString((*C.char)(unsafe.Pointer(&coldlabel.label))) + if coldlabel.enforcing != 0 { + oldlabel.Enforcing = true + } else { + oldlabel.Enforcing = false + } + + return &oldlabel, nil +} + +func (d *Domain) DomainLxcEnterCGroup(flags uint32) error { + var err C.virError + ret := C.virDomainLxcEnterCGroupWrapper(d.ptr, C.uint(flags), &err) + + if ret == -1 { + return makeError(&err) + } + + return nil +} diff --git a/vendor/libvirt.org/go/libvirt/network.go b/vendor/libvirt.org/go/libvirt/network.go new file mode 100644 index 000000000..487d5cd89 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/network.go @@ -0,0 +1,465 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include +#include "libvirt_generated.h" +*/ +import "C" + +import ( + "fmt" + "reflect" + "time" + "unsafe" +) + +type IPAddrType int + +const ( + IP_ADDR_TYPE_IPV4 = IPAddrType(C.VIR_IP_ADDR_TYPE_IPV4) + IP_ADDR_TYPE_IPV6 = IPAddrType(C.VIR_IP_ADDR_TYPE_IPV6) +) + +type NetworkXMLFlags uint + +const ( + NETWORK_XML_INACTIVE = NetworkXMLFlags(C.VIR_NETWORK_XML_INACTIVE) +) + +type NetworkCreateFlags uint + +const ( + NETWORK_CREATE_VALIDATE = NetworkCreateFlags(C.VIR_NETWORK_CREATE_VALIDATE) +) + +type NetworkDefineFlags uint + +const ( + NETWORK_DEFINE_VALIDATE = NetworkDefineFlags(C.VIR_NETWORK_DEFINE_VALIDATE) +) + +type NetworkUpdateCommand int + +const ( + NETWORK_UPDATE_COMMAND_NONE = NetworkUpdateCommand(C.VIR_NETWORK_UPDATE_COMMAND_NONE) + NETWORK_UPDATE_COMMAND_MODIFY = NetworkUpdateCommand(C.VIR_NETWORK_UPDATE_COMMAND_MODIFY) + NETWORK_UPDATE_COMMAND_DELETE = NetworkUpdateCommand(C.VIR_NETWORK_UPDATE_COMMAND_DELETE) + NETWORK_UPDATE_COMMAND_ADD_LAST = NetworkUpdateCommand(C.VIR_NETWORK_UPDATE_COMMAND_ADD_LAST) + NETWORK_UPDATE_COMMAND_ADD_FIRST = NetworkUpdateCommand(C.VIR_NETWORK_UPDATE_COMMAND_ADD_FIRST) +) + +type NetworkUpdateSection int + +const ( + NETWORK_SECTION_NONE = NetworkUpdateSection(C.VIR_NETWORK_SECTION_NONE) + NETWORK_SECTION_BRIDGE = NetworkUpdateSection(C.VIR_NETWORK_SECTION_BRIDGE) + NETWORK_SECTION_DOMAIN = NetworkUpdateSection(C.VIR_NETWORK_SECTION_DOMAIN) + NETWORK_SECTION_IP = NetworkUpdateSection(C.VIR_NETWORK_SECTION_IP) + NETWORK_SECTION_IP_DHCP_HOST = NetworkUpdateSection(C.VIR_NETWORK_SECTION_IP_DHCP_HOST) + NETWORK_SECTION_IP_DHCP_RANGE = NetworkUpdateSection(C.VIR_NETWORK_SECTION_IP_DHCP_RANGE) + NETWORK_SECTION_FORWARD = NetworkUpdateSection(C.VIR_NETWORK_SECTION_FORWARD) + NETWORK_SECTION_FORWARD_INTERFACE = NetworkUpdateSection(C.VIR_NETWORK_SECTION_FORWARD_INTERFACE) + NETWORK_SECTION_FORWARD_PF = NetworkUpdateSection(C.VIR_NETWORK_SECTION_FORWARD_PF) + NETWORK_SECTION_PORTGROUP = NetworkUpdateSection(C.VIR_NETWORK_SECTION_PORTGROUP) + NETWORK_SECTION_DNS_HOST = NetworkUpdateSection(C.VIR_NETWORK_SECTION_DNS_HOST) + NETWORK_SECTION_DNS_TXT = NetworkUpdateSection(C.VIR_NETWORK_SECTION_DNS_TXT) + NETWORK_SECTION_DNS_SRV = NetworkUpdateSection(C.VIR_NETWORK_SECTION_DNS_SRV) +) + +type NetworkUpdateFlags uint + +const ( + NETWORK_UPDATE_AFFECT_CURRENT = NetworkUpdateFlags(C.VIR_NETWORK_UPDATE_AFFECT_CURRENT) + NETWORK_UPDATE_AFFECT_LIVE = NetworkUpdateFlags(C.VIR_NETWORK_UPDATE_AFFECT_LIVE) + NETWORK_UPDATE_AFFECT_CONFIG = NetworkUpdateFlags(C.VIR_NETWORK_UPDATE_AFFECT_CONFIG) +) + +type NetworkEventLifecycleType int + +const ( + NETWORK_EVENT_DEFINED = NetworkEventLifecycleType(C.VIR_NETWORK_EVENT_DEFINED) + NETWORK_EVENT_UNDEFINED = NetworkEventLifecycleType(C.VIR_NETWORK_EVENT_UNDEFINED) + NETWORK_EVENT_STARTED = NetworkEventLifecycleType(C.VIR_NETWORK_EVENT_STARTED) + NETWORK_EVENT_STOPPED = NetworkEventLifecycleType(C.VIR_NETWORK_EVENT_STOPPED) +) + +type NetworkEventID int + +const ( + NETWORK_EVENT_ID_LIFECYCLE = NetworkEventID(C.VIR_NETWORK_EVENT_ID_LIFECYCLE) + NETWORK_EVENT_ID_METADATA_CHANGE = NetworkEventID(C.VIR_NETWORK_EVENT_ID_METADATA_CHANGE) +) + +type NetworkMetadataType int + +const ( + NETWORK_METADATA_DESCRIPTION = NetworkMetadataType(C.VIR_NETWORK_METADATA_DESCRIPTION) + NETWORK_METADATA_TITLE = NetworkMetadataType(C.VIR_NETWORK_METADATA_TITLE) + NETWORK_METADATA_ELEMENT = NetworkMetadataType(C.VIR_NETWORK_METADATA_ELEMENT) +) + +type Network struct { + ptr C.virNetworkPtr +} + +type NetworkDHCPLease struct { + Iface string + ExpiryTime time.Time + Type IPAddrType + Mac string + Iaid string + IPaddr string + Prefix uint + Hostname string + Clientid string +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkFree +func (n *Network) Free() error { + var err C.virError + ret := C.virNetworkFreeWrapper(n.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkRef +func (c *Network) Ref() error { + var err C.virError + ret := C.virNetworkRefWrapper(c.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkCreate +func (n *Network) Create() error { + var err C.virError + result := C.virNetworkCreateWrapper(n.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkDestroy +func (n *Network) Destroy() error { + var err C.virError + result := C.virNetworkDestroyWrapper(n.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkIsActive +func (n *Network) IsActive() (bool, error) { + var err C.virError + result := C.virNetworkIsActiveWrapper(n.ptr, &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkIsPersistent +func (n *Network) IsPersistent() (bool, error) { + var err C.virError + result := C.virNetworkIsPersistentWrapper(n.ptr, &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetAutostart +func (n *Network) GetAutostart() (bool, error) { + var out C.int + var err C.virError + result := C.virNetworkGetAutostartWrapper(n.ptr, (*C.int)(unsafe.Pointer(&out)), &err) + if result == -1 { + return false, makeError(&err) + } + switch out { + case 1: + return true, nil + default: + return false, nil + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkSetAutostart +func (n *Network) SetAutostart(autostart bool) error { + var cAutostart C.int + switch autostart { + case true: + cAutostart = 1 + default: + cAutostart = 0 + } + var err C.virError + result := C.virNetworkSetAutostartWrapper(n.ptr, cAutostart, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetName +func (n *Network) GetName() (string, error) { + var err C.virError + name := C.virNetworkGetNameWrapper(n.ptr, &err) + if name == nil { + return "", makeError(&err) + } + return C.GoString(name), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetUUID +func (n *Network) GetUUID() ([]byte, error) { + var cUuid [C.VIR_UUID_BUFLEN](byte) + cuidPtr := unsafe.Pointer(&cUuid) + var err C.virError + result := C.virNetworkGetUUIDWrapper(n.ptr, (*C.uchar)(cuidPtr), &err) + if result != 0 { + return []byte{}, makeError(&err) + } + return C.GoBytes(cuidPtr, C.VIR_UUID_BUFLEN), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetUUIDString +func (n *Network) GetUUIDString() (string, error) { + var cUuid [C.VIR_UUID_STRING_BUFLEN](C.char) + cuidPtr := unsafe.Pointer(&cUuid) + var err C.virError + result := C.virNetworkGetUUIDStringWrapper(n.ptr, (*C.char)(cuidPtr), &err) + if result != 0 { + return "", makeError(&err) + } + return C.GoString((*C.char)(cuidPtr)), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetBridgeName +func (n *Network) GetBridgeName() (string, error) { + var err C.virError + result := C.virNetworkGetBridgeNameWrapper(n.ptr, &err) + if result == nil { + return "", makeError(&err) + } + bridge := C.GoString(result) + C.free(unsafe.Pointer(result)) + return bridge, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetXMLDesc +func (n *Network) GetXMLDesc(flags NetworkXMLFlags) (string, error) { + var err C.virError + result := C.virNetworkGetXMLDescWrapper(n.ptr, C.uint(flags), &err) + if result == nil { + return "", makeError(&err) + } + xml := C.GoString(result) + C.free(unsafe.Pointer(result)) + return xml, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkUndefine +func (n *Network) Undefine() error { + var err C.virError + result := C.virNetworkUndefineWrapper(n.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkUpdate +func (n *Network) Update(cmd NetworkUpdateCommand, section NetworkUpdateSection, parentIndex int, xml string, flags NetworkUpdateFlags) error { + cxml := C.CString(xml) + defer C.free(unsafe.Pointer(cxml)) + var err C.virError + result := C.virNetworkUpdateWrapper(n.ptr, C.uint(cmd), C.uint(section), C.int(parentIndex), cxml, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetDHCPLeases +func (n *Network) GetDHCPLeases() ([]NetworkDHCPLease, error) { + var cLeases *C.virNetworkDHCPLeasePtr + var err C.virError + numLeases := C.virNetworkGetDHCPLeasesWrapper(n.ptr, nil, (**C.virNetworkDHCPLeasePtr)(&cLeases), C.uint(0), &err) + if numLeases == -1 { + return nil, makeError(&err) + } + hdr := reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(cLeases)), + Len: int(numLeases), + Cap: int(numLeases), + } + var leases []NetworkDHCPLease + slice := *(*[]C.virNetworkDHCPLeasePtr)(unsafe.Pointer(&hdr)) + for _, clease := range slice { + leases = append(leases, NetworkDHCPLease{ + Iface: C.GoString(clease.iface), + ExpiryTime: time.Unix(int64(clease.expirytime), 0), + Type: IPAddrType(clease._type), + Mac: C.GoString(clease.mac), + Iaid: C.GoString(clease.iaid), + IPaddr: C.GoString(clease.ipaddr), + Prefix: uint(clease.prefix), + Hostname: C.GoString(clease.hostname), + Clientid: C.GoString(clease.clientid), + }) + C.virNetworkDHCPLeaseFreeWrapper(clease) + } + C.free(unsafe.Pointer(cLeases)) + return leases, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkPortLookupByUUIDString +func (n *Network) LookupNetworkPortByUUIDString(uuid string) (*NetworkPort, error) { + cUuid := C.CString(uuid) + defer C.free(unsafe.Pointer(cUuid)) + var err C.virError + ptr := C.virNetworkPortLookupByUUIDStringWrapper(n.ptr, cUuid, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &NetworkPort{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkPortLookupByUUID +func (n *Network) LookupNetworkPortByUUID(uuid []byte) (*NetworkPort, error) { + if len(uuid) != C.VIR_UUID_BUFLEN { + return nil, fmt.Errorf("UUID must be exactly %d bytes in size", + int(C.VIR_UUID_BUFLEN)) + } + cUuid := make([]C.uchar, C.VIR_UUID_BUFLEN) + for i := 0; i < C.VIR_UUID_BUFLEN; i++ { + cUuid[i] = C.uchar(uuid[i]) + } + var err C.virError + ptr := C.virNetworkPortLookupByUUIDWrapper(n.ptr, &cUuid[0], &err) + if ptr == nil { + return nil, makeError(&err) + } + return &NetworkPort{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkPortCreateXML +func (n *Network) PortCreateXML(xmlConfig string, flags uint32) (*NetworkPort, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virNetworkPortCreateXMLWrapper(n.ptr, cXml, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &NetworkPort{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkListAllPorts +func (n *Network) ListAllPorts(flags uint32) ([]NetworkPort, error) { + var cList *C.virNetworkPortPtr + var err C.virError + numPorts := C.virNetworkListAllPortsWrapper(n.ptr, (**C.virNetworkPortPtr)(&cList), C.uint(flags), &err) + if numPorts == -1 { + return []NetworkPort{}, makeError(&err) + } + hdr := reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(cList)), + Len: int(numPorts), + Cap: int(numPorts), + } + var ports []NetworkPort + slice := *(*[]C.virNetworkPortPtr)(unsafe.Pointer(&hdr)) + for _, ptr := range slice { + ports = append(ports, NetworkPort{ptr}) + } + C.free(unsafe.Pointer(cList)) + return ports, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetMetadata +func (n *Network) GetMetadata(metadataType NetworkMetadataType, uri string, flags NetworkUpdateFlags) (string, error) { + var cUri *C.char + if uri != "" { + cUri = C.CString(uri) + defer C.free(unsafe.Pointer(cUri)) + } + + var err C.virError + result := C.virNetworkGetMetadataWrapper(n.ptr, C.int(metadataType), cUri, C.uint(flags), &err) + if result == nil { + return "", makeError(&err) + + } + defer C.free(unsafe.Pointer(result)) + return C.GoString(result), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkSetMetadata +func (n *Network) SetMetadata(metadataType NetworkMetadataType, metaDataCont, uriKey, uri string, flags NetworkUpdateFlags) error { + var cMetaDataCont *C.char + var cUriKey *C.char + var cUri *C.char + + if metaDataCont != "" { + cMetaDataCont = C.CString(metaDataCont) + defer C.free(unsafe.Pointer(cMetaDataCont)) + } + + if metadataType == NETWORK_METADATA_ELEMENT { + if uriKey != "" { + cUriKey = C.CString(uriKey) + defer C.free(unsafe.Pointer(cUriKey)) + } + cUri = C.CString(uri) + defer C.free(unsafe.Pointer(cUri)) + } + var err C.virError + result := C.virNetworkSetMetadataWrapper(n.ptr, C.int(metadataType), cMetaDataCont, cUriKey, cUri, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} diff --git a/vendor/libvirt.org/go/libvirt/network_events.go b/vendor/libvirt.org/go/libvirt/network_events.go new file mode 100644 index 000000000..f68dcb1ec --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/network_events.go @@ -0,0 +1,165 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +import ( + "fmt" + "unsafe" +) + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include "network_events_helper.h" +*/ +import "C" + +type NetworkEventLifecycle struct { + Event NetworkEventLifecycleType + // TODO: we can make Detail typesafe somehow ? + Detail int +} + +type NetworkEventLifecycleCallback func(c *Connect, n *Network, event *NetworkEventLifecycle) + +type NetworkEventMetadataChange struct { + Type NetworkMetadataType + NSURI string +} + +type NetworkEventMetadataChangeCallback func(c *Connect, n *Network, event *NetworkEventMetadataChange) + +//export networkEventLifecycleCallback +func networkEventLifecycleCallback(c C.virConnectPtr, n C.virNetworkPtr, + event int, detail int, + goCallbackId int) { + + network := &Network{ptr: n} + connection := &Connect{ptr: c} + + eventDetails := &NetworkEventLifecycle{ + Event: NetworkEventLifecycleType(event), + Detail: detail, + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(NetworkEventLifecycleCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, network, eventDetails) +} + +//export networkEventMetadataChangeCallback +func networkEventMetadataChangeCallback(c C.virConnectPtr, d C.virNetworkPtr, + mtype int, nsuri *C.char, goCallbackId int) { + + network := &Network{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &NetworkEventMetadataChange{ + Type: NetworkMetadataType(mtype), + NSURI: C.GoString(nsuri), + } + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(NetworkEventMetadataChangeCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, network, eventDetails) +} + +func (c *Connect) NetworkEventLifecycleRegister(net *Network, callback NetworkEventLifecycleCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + callbackPtr := unsafe.Pointer(C.networkEventLifecycleCallbackHelper) + var cnet C.virNetworkPtr + if net != nil { + cnet = net.ptr + } + var err C.virError + ret := C.virConnectNetworkEventRegisterAnyHelper(c.ptr, cnet, + C.VIR_NETWORK_EVENT_ID_LIFECYCLE, + C.virConnectNetworkEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) NetworkEventMetadataChangeRegister(net *Network, callback NetworkEventMetadataChangeCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + callbackPtr := unsafe.Pointer(C.networkEventMetadataChangeCallbackHelper) + var cnet C.virNetworkPtr + if net != nil { + cnet = net.ptr + } + var err C.virError + ret := C.virConnectNetworkEventRegisterAnyHelper(c.ptr, cnet, + C.VIR_NETWORK_EVENT_ID_METADATA_CHANGE, + C.virConnectNetworkEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) NetworkEventDeregister(callbackId int) error { + // Deregister the callback + var err C.virError + ret := int(C.virConnectNetworkEventDeregisterAnyWrapper(c.ptr, C.int(callbackId), &err)) + if ret < 0 { + return makeError(&err) + } + return nil +} + +func (e NetworkEventLifecycle) String() string { + var event string + switch e.Event { + case NETWORK_EVENT_DEFINED: + event = "defined" + + case NETWORK_EVENT_UNDEFINED: + event = "undefined" + + case NETWORK_EVENT_STARTED: + event = "started" + + case NETWORK_EVENT_STOPPED: + event = "stopped" + + default: + event = "unknown" + } + + return fmt.Sprintf("Network event=%q", event) +} diff --git a/vendor/libvirt.org/go/libvirt/network_events_helper.go b/vendor/libvirt.org/go/libvirt/network_events_helper.go new file mode 100644 index 000000000..eb096c612 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/network_events_helper.go @@ -0,0 +1,71 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include +#include "network_events_helper.h" +#include "callbacks_helper.h" + +extern void networkEventLifecycleCallback(virConnectPtr, virNetworkPtr, int, int, int); +void networkEventLifecycleCallbackHelper(virConnectPtr conn, virNetworkPtr net, + int event, int detail, void *data) +{ + networkEventLifecycleCallback(conn, net, event, detail, (int)(intptr_t)data); +} + + +extern void networkEventMetadataChangeCallback(virConnectPtr, virNetworkPtr, int, const char *, int); +void networkEventMetadataChangeCallbackHelper(virConnectPtr conn, + virNetworkPtr net, + int type, + const char *nsuri, + void *opaque) +{ + networkEventMetadataChangeCallback(conn, net, type, nsuri, (int)(intptr_t)opaque); +} + + +int +virConnectNetworkEventRegisterAnyHelper(virConnectPtr conn, + virNetworkPtr net, + int eventID, + virConnectNetworkEventGenericCallback cb, + long goCallbackId, + virErrorPtr err) +{ + void *id = (void *)goCallbackId; + return virConnectNetworkEventRegisterAnyWrapper(conn, net, eventID, cb, id, + freeGoCallbackHelper, err); +} + + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/network_events_helper.h b/vendor/libvirt.org/go/libvirt/network_events_helper.h new file mode 100644 index 000000000..f4f42d8a3 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/network_events_helper.h @@ -0,0 +1,55 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_NETWORK_EVENTS_HELPER_H__ +#define LIBVIRT_GO_NETWORK_EVENTS_HELPER_H__ + +#include "libvirt_generated.h" + + +void +networkEventLifecycleCallbackHelper(virConnectPtr conn, + virNetworkPtr net, + int event, + int detail, + void *data); + +void networkEventMetadataChangeCallbackHelper(virConnectPtr conn, + virNetworkPtr net, + int type, + const char *nsuri, + void *opaque); + +int +virConnectNetworkEventRegisterAnyHelper(virConnectPtr conn, + virNetworkPtr net, + int eventID, + virConnectNetworkEventGenericCallback cb, + long goCallbackId, + virErrorPtr err); + + +#endif /* LIBVIRT_GO_NETWORK_EVENTS_HELPER_H__ */ diff --git a/vendor/libvirt.org/go/libvirt/network_port.go b/vendor/libvirt.org/go/libvirt/network_port.go new file mode 100644 index 000000000..bae15e266 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/network_port.go @@ -0,0 +1,228 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2019 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include +#include "libvirt_generated.h" +*/ +import "C" + +import ( + "unsafe" +) + +type NetworkPortCreateFlags uint + +const ( + NETWORK_PORT_CREATE_RECLAIM = NetworkPortCreateFlags(C.VIR_NETWORK_PORT_CREATE_RECLAIM) + NETWORK_PORT_CREATE_VALIDATE = NetworkPortCreateFlags(C.VIR_NETWORK_PORT_CREATE_VALIDATE) +) + +type NetworkPort struct { + ptr C.virNetworkPortPtr +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkPortFree +func (n *NetworkPort) Free() error { + var err C.virError + ret := C.virNetworkPortFreeWrapper(n.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkPortRef +func (c *NetworkPort) Ref() error { + var err C.virError + ret := C.virNetworkPortRefWrapper(c.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkPortGetNetwork +// +// Contrary to the native C API behaviour, the Go API will +// acquire a reference on the returned Network, which must +// be released by calling Free() +func (n *NetworkPort) GetNetwork() (*Network, error) { + var err C.virError + ptr := C.virNetworkPortGetNetworkWrapper(n.ptr, &err) + if ptr == nil { + return nil, makeError(&err) + } + + ret := C.virNetworkRefWrapper(ptr, &err) + if ret == -1 { + return nil, makeError(&err) + } + + return &Network{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkPortGetUUID +func (n *NetworkPort) GetUUID() ([]byte, error) { + var cUuid [C.VIR_UUID_BUFLEN](byte) + cuidPtr := unsafe.Pointer(&cUuid) + var err C.virError + result := C.virNetworkPortGetUUIDWrapper(n.ptr, (*C.uchar)(cuidPtr), &err) + if result != 0 { + return []byte{}, makeError(&err) + } + return C.GoBytes(cuidPtr, C.VIR_UUID_BUFLEN), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkPortGetUUIDString +func (n *NetworkPort) GetUUIDString() (string, error) { + var cUuid [C.VIR_UUID_STRING_BUFLEN](C.char) + cuidPtr := unsafe.Pointer(&cUuid) + var err C.virError + result := C.virNetworkPortGetUUIDStringWrapper(n.ptr, (*C.char)(cuidPtr), &err) + if result != 0 { + return "", makeError(&err) + } + return C.GoString((*C.char)(cuidPtr)), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkPortDelete +func (n *NetworkPort) Delete(flags uint32) error { + var err C.virError + result := C.virNetworkPortDeleteWrapper(n.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkPortGetXMLDesc +func (d *NetworkPort) GetXMLDesc(flags uint32) (string, error) { + var err C.virError + result := C.virNetworkPortGetXMLDescWrapper(d.ptr, C.uint(flags), &err) + if result == nil { + return "", makeError(&err) + } + xml := C.GoString(result) + C.free(unsafe.Pointer(result)) + return xml, nil +} + +type NetworkPortParameters struct { + BandwidthInAverageSet bool + BandwidthInAverage uint + BandwidthInPeakSet bool + BandwidthInPeak uint + BandwidthInBurstSet bool + BandwidthInBurst uint + BandwidthInFloorSet bool + BandwidthInFloor uint + BandwidthOutAverageSet bool + BandwidthOutAverage uint + BandwidthOutPeakSet bool + BandwidthOutPeak uint + BandwidthOutBurstSet bool + BandwidthOutBurst uint +} + +func getNetworkPortParametersFieldInfo(params *NetworkPortParameters) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_NETWORK_PORT_BANDWIDTH_IN_AVERAGE: typedParamsFieldInfo{ + set: ¶ms.BandwidthInAverageSet, + ui: ¶ms.BandwidthInAverage, + }, + C.VIR_NETWORK_PORT_BANDWIDTH_IN_PEAK: typedParamsFieldInfo{ + set: ¶ms.BandwidthInPeakSet, + ui: ¶ms.BandwidthInPeak, + }, + C.VIR_NETWORK_PORT_BANDWIDTH_IN_BURST: typedParamsFieldInfo{ + set: ¶ms.BandwidthInBurstSet, + ui: ¶ms.BandwidthInBurst, + }, + C.VIR_NETWORK_PORT_BANDWIDTH_IN_FLOOR: typedParamsFieldInfo{ + set: ¶ms.BandwidthInFloorSet, + ui: ¶ms.BandwidthInFloor, + }, + C.VIR_NETWORK_PORT_BANDWIDTH_OUT_AVERAGE: typedParamsFieldInfo{ + set: ¶ms.BandwidthOutAverageSet, + ui: ¶ms.BandwidthOutAverage, + }, + C.VIR_NETWORK_PORT_BANDWIDTH_OUT_PEAK: typedParamsFieldInfo{ + set: ¶ms.BandwidthOutPeakSet, + ui: ¶ms.BandwidthOutPeak, + }, + C.VIR_NETWORK_PORT_BANDWIDTH_OUT_BURST: typedParamsFieldInfo{ + set: ¶ms.BandwidthOutBurstSet, + ui: ¶ms.BandwidthOutBurst, + }, + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkPortGetParameters +func (d *NetworkPort) GetParameters(flags uint32) (*NetworkPortParameters, error) { + params := &NetworkPortParameters{} + info := getNetworkPortParametersFieldInfo(params) + + var cparams C.virTypedParameterPtr + var cnparams C.int + var err C.virError + ret := C.virNetworkPortGetParametersWrapper(d.ptr, &cparams, &cnparams, C.uint(flags), &err) + if ret == -1 { + return nil, makeError(&err) + } + + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + + _, gerr := typedParamsUnpack(cparams, cnparams, info) + if gerr != nil { + return nil, gerr + } + + return params, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkPortSetParameters +func (d *NetworkPort) SetParameters(params *NetworkPortParameters, flags uint32) error { + info := getNetworkPortParametersFieldInfo(params) + + cparams, cnparams, gerr := typedParamsPackNew(info) + if gerr != nil { + return gerr + } + defer C.virTypedParamsFreeWrapper(cparams, cnparams) + + var err C.virError + ret := C.virNetworkPortSetParametersWrapper(d.ptr, cparams, cnparams, C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} diff --git a/vendor/libvirt.org/go/libvirt/node_device.go b/vendor/libvirt.org/go/libvirt/node_device.go new file mode 100644 index 000000000..d17d81f29 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/node_device.go @@ -0,0 +1,313 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include +#include "libvirt_generated.h" +*/ +import "C" + +import ( + "unsafe" +) + +type NodeDeviceEventID int + +const ( + NODE_DEVICE_EVENT_ID_LIFECYCLE = NodeDeviceEventID(C.VIR_NODE_DEVICE_EVENT_ID_LIFECYCLE) + NODE_DEVICE_EVENT_ID_UPDATE = NodeDeviceEventID(C.VIR_NODE_DEVICE_EVENT_ID_UPDATE) +) + +type NodeDeviceEventLifecycleType int + +const ( + NODE_DEVICE_EVENT_CREATED = NodeDeviceEventLifecycleType(C.VIR_NODE_DEVICE_EVENT_CREATED) + NODE_DEVICE_EVENT_DELETED = NodeDeviceEventLifecycleType(C.VIR_NODE_DEVICE_EVENT_DELETED) + NODE_DEVICE_EVENT_DEFINED = NodeDeviceEventLifecycleType(C.VIR_NODE_DEVICE_EVENT_DEFINED) + NODE_DEVICE_EVENT_UNDEFINED = NodeDeviceEventLifecycleType(C.VIR_NODE_DEVICE_EVENT_UNDEFINED) +) + +type NodeDeviceCreateXMLFlags int + +const ( + NODE_DEVICE_CREATE_XML_VALIDATE = NodeDeviceCreateXMLFlags(C.VIR_NODE_DEVICE_CREATE_XML_VALIDATE) +) + +type NodeDeviceDefineXMLFlags int + +const ( + NODE_DEVICE_DEFINE_XML_VALIDATE = NodeDeviceDefineXMLFlags(C.VIR_NODE_DEVICE_DEFINE_XML_VALIDATE) +) + +type NodeDeviceXMLFlags int + +const ( + NODE_DEVICE_XML_INACTIVE = NodeDeviceXMLFlags(C.VIR_NODE_DEVICE_XML_INACTIVE) +) + +type NodeDeviceUpdateFlags int + +const ( + NODE_DEVICE_UPDATE_AFFECT_CURRENT = NodeDeviceUpdateFlags(C.VIR_NODE_DEVICE_UPDATE_AFFECT_CURRENT) + NODE_DEVICE_UPDATE_AFFECT_CONFIG = NodeDeviceUpdateFlags(C.VIR_NODE_DEVICE_UPDATE_AFFECT_CONFIG) + NODE_DEVICE_UPDATE_AFFECT_LIVE = NodeDeviceUpdateFlags(C.VIR_NODE_DEVICE_UPDATE_AFFECT_LIVE) +) + +type NodeDevice struct { + ptr C.virNodeDevicePtr +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceFree +func (n *NodeDevice) Free() error { + var err C.virError + ret := C.virNodeDeviceFreeWrapper(n.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceRef +func (c *NodeDevice) Ref() error { + var err C.virError + ret := C.virNodeDeviceRefWrapper(c.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceDestroy +func (n *NodeDevice) Destroy() error { + var err C.virError + result := C.virNodeDeviceDestroyWrapper(n.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceReset +func (n *NodeDevice) Reset() error { + var err C.virError + result := C.virNodeDeviceResetWrapper(n.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceDettach +func (n *NodeDevice) Detach() error { + var err C.virError + result := C.virNodeDeviceDettachWrapper(n.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceDetachFlags +func (n *NodeDevice) DetachFlags(driverName string, flags uint32) error { + cDriverName := C.CString(driverName) + defer C.free(unsafe.Pointer(cDriverName)) + var err C.virError + result := C.virNodeDeviceDetachFlagsWrapper(n.ptr, cDriverName, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceReAttach +func (n *NodeDevice) ReAttach() error { + var err C.virError + result := C.virNodeDeviceReAttachWrapper(n.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceGetName +func (n *NodeDevice) GetName() (string, error) { + var err C.virError + name := C.virNodeDeviceGetNameWrapper(n.ptr, &err) + if name == nil { + return "", makeError(&err) + } + return C.GoString(name), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceGetXMLDesc +func (n *NodeDevice) GetXMLDesc(flags NodeDeviceXMLFlags) (string, error) { + var err C.virError + result := C.virNodeDeviceGetXMLDescWrapper(n.ptr, C.uint(flags), &err) + if result == nil { + return "", makeError(&err) + } + xml := C.GoString(result) + C.free(unsafe.Pointer(result)) + return xml, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceGetParent +func (n *NodeDevice) GetParent() (string, error) { + var err C.virError + result := C.virNodeDeviceGetParentWrapper(n.ptr, &err) + if result == nil { + return "", makeError(&err) + } + defer C.free(unsafe.Pointer(result)) + return C.GoString(result), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceNumOfCaps +func (p *NodeDevice) NumOfCaps() (int, error) { + var err C.virError + result := int(C.virNodeDeviceNumOfCapsWrapper(p.ptr, &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceListCaps +func (p *NodeDevice) ListCaps() ([]string, error) { + const maxCaps = 1024 + var names [maxCaps](*C.char) + namesPtr := unsafe.Pointer(&names) + var err C.virError + numCaps := C.virNodeDeviceListCapsWrapper( + p.ptr, + (**C.char)(namesPtr), + maxCaps, &err) + if numCaps == -1 { + return nil, makeError(&err) + } + goNames := make([]string, numCaps) + for k := 0; k < int(numCaps); k++ { + goNames[k] = C.GoString(names[k]) + C.free(unsafe.Pointer(names[k])) + } + return goNames, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceCreate +func (p *NodeDevice) Create(flags uint32) error { + var err C.virError + result := C.virNodeDeviceCreateWrapper(p.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceUndefine +func (p *NodeDevice) Undefine(flags uint32) error { + var err C.virError + result := C.virNodeDeviceUndefineWrapper(p.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNodeDeviceGetAutostart +func (n *NodeDevice) GetAutostart() (bool, error) { + var out C.int + var err C.virError + result := C.virNodeDeviceGetAutostartWrapper(n.ptr, (*C.int)(unsafe.Pointer(&out)), &err) + if result == -1 { + return false, makeError(&err) + } + switch out { + case 1: + return true, nil + default: + return false, nil + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNodeDeviceSetAutostart +func (n *NodeDevice) SetAutostart(autostart bool) error { + var cAutostart C.int + switch autostart { + case true: + cAutostart = 1 + default: + cAutostart = 0 + } + var err C.virError + result := C.virNodeDeviceSetAutostartWrapper(n.ptr, cAutostart, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNodeDeviceIsActive +func (n *NodeDevice) IsActive() (bool, error) { + var err C.virError + result := C.virNodeDeviceIsActiveWrapper(n.ptr, &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNodeDeviceIsPersistent +func (n *NodeDevice) IsPersistent() (bool, error) { + var err C.virError + result := C.virNodeDeviceIsPersistentWrapper(n.ptr, &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNodeDeviceUpdate +func (n *NodeDevice) Update(xml string, flags NodeDeviceUpdateFlags) error { + cXml := C.CString(xml) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + result := C.virNodeDeviceUpdateWrapper(n.ptr, cXml, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} diff --git a/vendor/libvirt.org/go/libvirt/node_device_events.go b/vendor/libvirt.org/go/libvirt/node_device_events.go new file mode 100644 index 000000000..cdb32851a --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/node_device_events.go @@ -0,0 +1,152 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +import ( + "fmt" + "unsafe" +) + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include "node_device_events_helper.h" +*/ +import "C" + +type NodeDeviceEventGenericCallback func(c *Connect, d *NodeDevice) + +type NodeDeviceEventLifecycle struct { + Event NodeDeviceEventLifecycleType + // TODO: we can make Detail typesafe somehow ? + Detail int +} + +type NodeDeviceEventLifecycleCallback func(c *Connect, n *NodeDevice, event *NodeDeviceEventLifecycle) + +//export nodeDeviceEventLifecycleCallback +func nodeDeviceEventLifecycleCallback(c C.virConnectPtr, s C.virNodeDevicePtr, + event int, detail int, + goCallbackId int) { + + node_device := &NodeDevice{ptr: s} + connection := &Connect{ptr: c} + + eventDetails := &NodeDeviceEventLifecycle{ + Event: NodeDeviceEventLifecycleType(event), + Detail: detail, + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(NodeDeviceEventLifecycleCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, node_device, eventDetails) +} + +//export nodeDeviceEventGenericCallback +func nodeDeviceEventGenericCallback(c C.virConnectPtr, d C.virNodeDevicePtr, + goCallbackId int) { + + node_device := &NodeDevice{ptr: d} + connection := &Connect{ptr: c} + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(NodeDeviceEventGenericCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, node_device) +} + +func (c *Connect) NodeDeviceEventLifecycleRegister(device *NodeDevice, callback NodeDeviceEventLifecycleCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.nodeDeviceEventLifecycleCallbackHelper) + var cdevice C.virNodeDevicePtr + if device != nil { + cdevice = device.ptr + } + var err C.virError + ret := C.virConnectNodeDeviceEventRegisterAnyHelper(c.ptr, cdevice, + C.VIR_NODE_DEVICE_EVENT_ID_LIFECYCLE, + C.virConnectNodeDeviceEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) NodeDeviceEventUpdateRegister(device *NodeDevice, callback NodeDeviceEventGenericCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.nodeDeviceEventGenericCallbackHelper) + var cdevice C.virNodeDevicePtr + if device != nil { + cdevice = device.ptr + } + var err C.virError + ret := C.virConnectNodeDeviceEventRegisterAnyHelper(c.ptr, cdevice, + C.VIR_NODE_DEVICE_EVENT_ID_UPDATE, + C.virConnectNodeDeviceEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) NodeDeviceEventDeregister(callbackId int) error { + // Deregister the callback + var err C.virError + ret := int(C.virConnectNodeDeviceEventDeregisterAnyWrapper(c.ptr, C.int(callbackId), &err)) + if ret < 0 { + return makeError(&err) + } + return nil +} + +func (e NodeDeviceEventLifecycle) String() string { + var event string + switch e.Event { + case NODE_DEVICE_EVENT_CREATED: + event = "created" + + case NODE_DEVICE_EVENT_DELETED: + event = "deleted" + + default: + event = "unknown" + } + + return fmt.Sprintf("NodeDevice event=%q", event) +} diff --git a/vendor/libvirt.org/go/libvirt/node_device_events_helper.go b/vendor/libvirt.org/go/libvirt/node_device_events_helper.go new file mode 100644 index 000000000..8785816b4 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/node_device_events_helper.go @@ -0,0 +1,68 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include +#include "node_device_events_helper.h" +#include "callbacks_helper.h" + + +extern void nodeDeviceEventLifecycleCallback(virConnectPtr, virNodeDevicePtr, int, int, int); +void nodeDeviceEventLifecycleCallbackHelper(virConnectPtr conn, virNodeDevicePtr dev, + int event, int detail, void *data) +{ + nodeDeviceEventLifecycleCallback(conn, dev, event, detail, (int)(intptr_t)data); +} + + +extern void nodeDeviceEventGenericCallback(virConnectPtr, virNodeDevicePtr, int); +void nodeDeviceEventGenericCallbackHelper(virConnectPtr conn, virNodeDevicePtr dev, void *data) +{ + nodeDeviceEventGenericCallback(conn, dev, (int)(intptr_t)data); +} + + +int +virConnectNodeDeviceEventRegisterAnyHelper(virConnectPtr conn, + virNodeDevicePtr dev, + int eventID, + virConnectNodeDeviceEventGenericCallback cb, + long goCallbackId, + virErrorPtr err) +{ + void *id = (void *)goCallbackId; + return virConnectNodeDeviceEventRegisterAnyWrapper(conn, dev, eventID, cb, id, + freeGoCallbackHelper, err); +} + + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/node_device_events_helper.h b/vendor/libvirt.org/go/libvirt/node_device_events_helper.h new file mode 100644 index 000000000..787dcd1d1 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/node_device_events_helper.h @@ -0,0 +1,56 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_NODE_DEVICE_EVENTS_HELPER_H__ +#define LIBVIRT_GO_NODE_DEVICE_EVENTS_HELPER_H__ + +#include "libvirt_generated.h" + + +void +nodeDeviceEventLifecycleCallbackHelper(virConnectPtr conn, + virNodeDevicePtr dev, + int event, + int detail, + void *data); + + +void +nodeDeviceEventGenericCallbackHelper(virConnectPtr conn, + virNodeDevicePtr dev, + void *data); + + +int +virConnectNodeDeviceEventRegisterAnyHelper(virConnectPtr conn, + virNodeDevicePtr dev, + int eventID, + virConnectNodeDeviceEventGenericCallback cb, + long goCallbackId, + virErrorPtr err); + + +#endif /* LIBVIRT_GO_NODE_DEVICE_EVENTS_HELPER_H__ */ diff --git a/vendor/libvirt.org/go/libvirt/nwfilter.go b/vendor/libvirt.org/go/libvirt/nwfilter.go new file mode 100644 index 000000000..2131e34a0 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/nwfilter.go @@ -0,0 +1,126 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include +#include "libvirt_generated.h" +*/ +import "C" + +import ( + "unsafe" +) + +type NWFilterDefineFlags uint + +const ( + NWFILTER_DEFINE_VALIDATE = NWFilterDefineFlags(C.VIR_NWFILTER_DEFINE_VALIDATE) +) + +type NWFilter struct { + ptr C.virNWFilterPtr +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterFree +func (f *NWFilter) Free() error { + var err C.virError + ret := C.virNWFilterFreeWrapper(f.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterRef +func (c *NWFilter) Ref() error { + var err C.virError + ret := C.virNWFilterRefWrapper(c.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterGetName +func (f *NWFilter) GetName() (string, error) { + var err C.virError + name := C.virNWFilterGetNameWrapper(f.ptr, &err) + if name == nil { + return "", makeError(&err) + } + return C.GoString(name), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterUndefine +func (f *NWFilter) Undefine() error { + var err C.virError + result := C.virNWFilterUndefineWrapper(f.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterGetUUID +func (f *NWFilter) GetUUID() ([]byte, error) { + var cUuid [C.VIR_UUID_BUFLEN](byte) + cuidPtr := unsafe.Pointer(&cUuid) + var err C.virError + result := C.virNWFilterGetUUIDWrapper(f.ptr, (*C.uchar)(cuidPtr), &err) + if result != 0 { + return []byte{}, makeError(&err) + } + return C.GoBytes(cuidPtr, C.VIR_UUID_BUFLEN), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterGetUUIDString +func (f *NWFilter) GetUUIDString() (string, error) { + var cUuid [C.VIR_UUID_STRING_BUFLEN](C.char) + cuidPtr := unsafe.Pointer(&cUuid) + var err C.virError + result := C.virNWFilterGetUUIDStringWrapper(f.ptr, (*C.char)(cuidPtr), &err) + if result != 0 { + return "", makeError(&err) + } + return C.GoString((*C.char)(cuidPtr)), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterGetXMLDesc +func (f *NWFilter) GetXMLDesc(flags uint32) (string, error) { + var err C.virError + result := C.virNWFilterGetXMLDescWrapper(f.ptr, C.uint(flags), &err) + if result == nil { + return "", makeError(&err) + } + xml := C.GoString(result) + C.free(unsafe.Pointer(result)) + return xml, nil +} diff --git a/vendor/libvirt.org/go/libvirt/nwfilter_binding.go b/vendor/libvirt.org/go/libvirt/nwfilter_binding.go new file mode 100644 index 000000000..5ff3d49ab --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/nwfilter_binding.go @@ -0,0 +1,115 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (C) 2018 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include +#include "libvirt_generated.h" +*/ +import "C" + +import ( + "unsafe" +) + +type NWFilterBinding struct { + ptr C.virNWFilterBindingPtr +} + +type NWFilterBindingCreateFlags uint + +const ( + NWFILTER_BINDING_CREATE_VALIDATE = NetworkPortCreateFlags(C.VIR_NWFILTER_BINDING_CREATE_VALIDATE) +) + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterBindingFree +func (f *NWFilterBinding) Free() error { + var err C.virError + ret := C.virNWFilterBindingFreeWrapper(f.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterBindingRef +func (c *NWFilterBinding) Ref() error { + var err C.virError + ret := C.virNWFilterBindingRefWrapper(c.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterBindingDelete +func (f *NWFilterBinding) Delete() error { + var err C.virError + result := C.virNWFilterBindingDeleteWrapper(f.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterBindingGetPortDev +func (f *NWFilterBinding) GetPortDev() (string, error) { + var err C.virError + result := C.virNWFilterBindingGetPortDevWrapper(f.ptr, &err) + if result == nil { + return "", makeError(&err) + } + name := C.GoString(result) + C.free(unsafe.Pointer(result)) + return name, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterBindingGetFilterName +func (f *NWFilterBinding) GetFilterName() (string, error) { + var err C.virError + result := C.virNWFilterBindingGetFilterNameWrapper(f.ptr, &err) + if result == nil { + return "", makeError(&err) + } + name := C.GoString(result) + C.free(unsafe.Pointer(result)) + return name, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterBindingGetXMLDesc +func (f *NWFilterBinding) GetXMLDesc(flags uint32) (string, error) { + var err C.virError + result := C.virNWFilterBindingGetXMLDescWrapper(f.ptr, C.uint(flags), &err) + if result == nil { + return "", makeError(&err) + } + xml := C.GoString(result) + C.free(unsafe.Pointer(result)) + return xml, nil +} diff --git a/vendor/libvirt.org/go/libvirt/qemu.go b/vendor/libvirt.org/go/libvirt/qemu.go new file mode 100644 index 000000000..37c5aa04a --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/qemu.go @@ -0,0 +1,229 @@ +//go:build !libvirt_without_qemu +// +build !libvirt_without_qemu + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +// Can't rely on pkg-config for libvirt-qemu since it was not +// installed until 2.6.0 onwards +#cgo !libvirt_dlopen LDFLAGS: -lvirt-qemu +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include +#include "qemu_helper.h" +*/ +import "C" + +import ( + "os" + "unsafe" +) + +/* + * QMP has two different kinds of ways to talk to QEMU. One is legacy (HMP, + * or 'human' monitor protocol. The default is QMP, which is all-JSON. + * + * QMP json commands are of the format: + * {"execute" : "query-cpus"} + * + * whereas the same command in 'HMP' would be: + * 'info cpus' + */ + +type DomainQemuMonitorCommandFlags uint + +const ( + DOMAIN_QEMU_MONITOR_COMMAND_DEFAULT = DomainQemuMonitorCommandFlags(C.VIR_DOMAIN_QEMU_MONITOR_COMMAND_DEFAULT) + DOMAIN_QEMU_MONITOR_COMMAND_HMP = DomainQemuMonitorCommandFlags(C.VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP) +) + +type DomainQemuAgentCommandTimeout int + +const ( + DOMAIN_QEMU_AGENT_COMMAND_MIN = DomainQemuAgentCommandTimeout(C.VIR_DOMAIN_QEMU_AGENT_COMMAND_MIN) + DOMAIN_QEMU_AGENT_COMMAND_BLOCK = DomainQemuAgentCommandTimeout(C.VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK) + DOMAIN_QEMU_AGENT_COMMAND_DEFAULT = DomainQemuAgentCommandTimeout(C.VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT) + DOMAIN_QEMU_AGENT_COMMAND_NOWAIT = DomainQemuAgentCommandTimeout(C.VIR_DOMAIN_QEMU_AGENT_COMMAND_NOWAIT) + DOMAIN_QEMU_AGENT_COMMAND_SHUTDOWN = DomainQemuAgentCommandTimeout(C.VIR_DOMAIN_QEMU_AGENT_COMMAND_SHUTDOWN) +) + +type DomainQemuMonitorEventFlags uint + +const ( + CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_REGEX = DomainQemuMonitorEventFlags(C.VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_REGEX) + CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_NOCASE = DomainQemuMonitorEventFlags(C.VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_NOCASE) +) + +// See also https://libvirt.org/html/libvirt-libvirt-qemu.html#virDomainQemuMonitorCommand +func (d *Domain) QemuMonitorCommand(command string, flags DomainQemuMonitorCommandFlags) (string, error) { + var cResult *C.char + cCommand := C.CString(command) + defer C.free(unsafe.Pointer(cCommand)) + var err C.virError + result := C.virDomainQemuMonitorCommandWrapper(d.ptr, cCommand, &cResult, C.uint(flags), &err) + + if result != 0 { + return "", makeError(&err) + } + + rstring := C.GoString(cResult) + C.free(unsafe.Pointer(cResult)) + return rstring, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-qemu.html#virDomainQemuMonitorCommandWithFiles +func (d *Domain) QemuMonitorCommandWithFiles(command string, infiles []os.File, flags DomainQemuMonitorCommandFlags) (string, []*os.File, error) { + ninfiles := len(infiles) + cinfiles := make([]C.int, ninfiles) + for i := 0; i < ninfiles; i++ { + cinfiles[i] = C.int(infiles[i].Fd()) + } + cCommand := C.CString(command) + defer C.free(unsafe.Pointer(cCommand)) + + var cResult *C.char + var cnoutfiles C.uint + var coutfiles *C.int + var err C.virError + var cinfilesPtr *C.int = nil + if ninfiles > 0 { + cinfilesPtr = &cinfiles[0] + } + result := C.virDomainQemuMonitorCommandWithFilesWrapper(d.ptr, cCommand, + C.uint(ninfiles), cinfilesPtr, &cnoutfiles, &coutfiles, + &cResult, C.uint(flags), &err) + + if result != 0 { + return "", []*os.File{}, makeError(&err) + } + + outfiles := []*os.File{} + for i := 0; i < int(cnoutfiles); i++ { + coutfile := *(*C.int)(unsafe.Pointer(uintptr(unsafe.Pointer(coutfiles)) + (unsafe.Sizeof(*coutfiles) * uintptr(i)))) + + outfiles = append(outfiles, os.NewFile(uintptr(coutfile), "mon-cmd-out")) + } + C.free(unsafe.Pointer(coutfiles)) + + rstring := C.GoString(cResult) + C.free(unsafe.Pointer(cResult)) + return rstring, outfiles, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-qemu.html#virDomainQemuAgentCommand +func (d *Domain) QemuAgentCommand(command string, timeout DomainQemuAgentCommandTimeout, flags uint32) (string, error) { + cCommand := C.CString(command) + defer C.free(unsafe.Pointer(cCommand)) + var err C.virError + result := C.virDomainQemuAgentCommandWrapper(d.ptr, cCommand, C.int(timeout), C.uint(flags), &err) + + if result == nil { + return "", makeError(&err) + } + + rstring := C.GoString(result) + C.free(unsafe.Pointer(result)) + return rstring, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-qemu.html#virDomainQemuAttach +func (c *Connect) DomainQemuAttach(pid uint32, flags uint32) (*Domain, error) { + var err C.virError + ptr := C.virDomainQemuAttachWrapper(c.ptr, C.uint(pid), C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &Domain{ptr: ptr}, nil +} + +type DomainQemuMonitorEvent struct { + Event string + Seconds int64 + Micros uint + Details string +} + +type DomainQemuMonitorEventCallback func(c *Connect, d *Domain, event *DomainQemuMonitorEvent) + +//export domainQemuMonitorEventCallback +func domainQemuMonitorEventCallback(c C.virConnectPtr, d C.virDomainPtr, + event *C.char, seconds C.longlong, micros C.uint, details *C.char, goCallbackId int) { + + domain := &Domain{ptr: d} + connection := &Connect{ptr: c} + + eventDetails := &DomainQemuMonitorEvent{ + Event: C.GoString(event), + Seconds: int64(seconds), + Micros: uint(micros), + Details: C.GoString(details), + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(DomainQemuMonitorEventCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, domain, eventDetails) + +} + +// See also https://libvirt.org/html/libvirt-libvirt-qemu.html#virConnectDomainQemuMonitorEventRegister +func (c *Connect) DomainQemuMonitorEventRegister(dom *Domain, event string, callback DomainQemuMonitorEventCallback, flags DomainQemuMonitorEventFlags) (int, error) { + cEvent := C.CString(event) + defer C.free(unsafe.Pointer(cEvent)) + goCallBackId := registerCallbackId(callback) + + var cdom C.virDomainPtr + if dom != nil { + cdom = dom.ptr + } + var err C.virError + ret := C.virConnectDomainQemuMonitorEventRegisterHelper(c.ptr, cdom, + cEvent, + C.long(goCallBackId), + C.uint(flags), &err) + if ret < 0 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-qemu.html#virConnectDomainQemuMonitorEventDeregister +func (c *Connect) DomainQemuEventDeregister(callbackId int) error { + // Deregister the callback + var err C.virError + ret := int(C.virConnectDomainQemuMonitorEventDeregisterWrapper(c.ptr, C.int(callbackId), &err)) + if ret < 0 { + return makeError(&err) + } + return nil +} diff --git a/vendor/libvirt.org/go/libvirt/qemu_helper.go b/vendor/libvirt.org/go/libvirt/qemu_helper.go new file mode 100644 index 000000000..e8eb63ebc --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/qemu_helper.go @@ -0,0 +1,69 @@ +//go:build !libvirt_without_qemu +// +build !libvirt_without_qemu + +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +// Can't rely on pkg-config for libvirt-qemu since it was not +// installed until 2.6.0 onwards +#cgo !libvirt_dlopen LDFLAGS: -lvirt-qemu +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include +#include "qemu_helper.h" +#include "callbacks_helper.h" + + +extern void domainQemuMonitorEventCallback(virConnectPtr, virDomainPtr, const char *, long long, unsigned int, const char *, int); +void domainQemuMonitorEventCallbackHelper(virConnectPtr conn, virDomainPtr dom, + const char *event, long long secs, + unsigned int micros, const char *details, void *data) +{ + domainQemuMonitorEventCallback(conn, dom, event, secs, micros, details, (int)(intptr_t)data); +} + + +int +virConnectDomainQemuMonitorEventRegisterHelper(virConnectPtr conn, + virDomainPtr dom, + const char *event, + long goCallbackId, + unsigned int flags, + virErrorPtr err) +{ + void *id = (void *)goCallbackId; + return virConnectDomainQemuMonitorEventRegisterWrapper(conn, dom, event, + domainQemuMonitorEventCallbackHelper, + id, freeGoCallbackHelper, flags, err); +} + + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/qemu_helper.h b/vendor/libvirt.org/go/libvirt/qemu_helper.h new file mode 100644 index 000000000..84d00381d --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/qemu_helper.h @@ -0,0 +1,52 @@ + /* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_QEMU_HELPER_H__ +#define LIBVIRT_GO_QEMU_HELPER_H__ + +#include "libvirt_qemu_generated.h" + + +void +domainQemuMonitorEventCallbackHelper(virConnectPtr conn, + virDomainPtr dom, + const char *event, + long long secs, + unsigned int micros, + const char *details, + void *data); + + +int +virConnectDomainQemuMonitorEventRegisterHelper(virConnectPtr conn, + virDomainPtr dom, + const char *event, + long goCallbackId, + unsigned int flags, + virErrorPtr err); + + +#endif /* LIBVIRT_GO_QEMU_HELPER_H__ */ diff --git a/vendor/libvirt.org/go/libvirt/secret.go b/vendor/libvirt.org/go/libvirt/secret.go new file mode 100644 index 000000000..1a006c1c6 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/secret.go @@ -0,0 +1,198 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include +#include "libvirt_generated.h" +*/ +import "C" + +import ( + "unsafe" +) + +type SecretUsageType int + +const ( + SECRET_USAGE_TYPE_NONE = SecretUsageType(C.VIR_SECRET_USAGE_TYPE_NONE) + SECRET_USAGE_TYPE_VOLUME = SecretUsageType(C.VIR_SECRET_USAGE_TYPE_VOLUME) + SECRET_USAGE_TYPE_CEPH = SecretUsageType(C.VIR_SECRET_USAGE_TYPE_CEPH) + SECRET_USAGE_TYPE_ISCSI = SecretUsageType(C.VIR_SECRET_USAGE_TYPE_ISCSI) + SECRET_USAGE_TYPE_TLS = SecretUsageType(C.VIR_SECRET_USAGE_TYPE_TLS) + SECRET_USAGE_TYPE_VTPM = SecretUsageType(C.VIR_SECRET_USAGE_TYPE_VTPM) +) + +type SecretDefineFlags uint + +const ( + SECRET_DEFINE_VALIDATE = SecretDefineFlags(C.VIR_SECRET_DEFINE_VALIDATE) +) + +type SecretEventLifecycleType int + +const ( + SECRET_EVENT_DEFINED = SecretEventLifecycleType(C.VIR_SECRET_EVENT_DEFINED) + SECRET_EVENT_UNDEFINED = SecretEventLifecycleType(C.VIR_SECRET_EVENT_UNDEFINED) +) + +type SecretEventID int + +const ( + SECRET_EVENT_ID_LIFECYCLE = SecretEventID(C.VIR_SECRET_EVENT_ID_LIFECYCLE) + SECRET_EVENT_ID_VALUE_CHANGED = SecretEventID(C.VIR_SECRET_EVENT_ID_VALUE_CHANGED) +) + +type Secret struct { + ptr C.virSecretPtr +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretFree +func (s *Secret) Free() error { + var err C.virError + ret := C.virSecretFreeWrapper(s.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretRef +func (c *Secret) Ref() error { + var err C.virError + ret := C.virSecretRefWrapper(c.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretUndefine +func (s *Secret) Undefine() error { + var err C.virError + result := C.virSecretUndefineWrapper(s.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretGetUUID +func (s *Secret) GetUUID() ([]byte, error) { + var cUuid [C.VIR_UUID_BUFLEN](byte) + cuidPtr := unsafe.Pointer(&cUuid) + var err C.virError + result := C.virSecretGetUUIDWrapper(s.ptr, (*C.uchar)(cuidPtr), &err) + if result != 0 { + return []byte{}, makeError(&err) + } + return C.GoBytes(cuidPtr, C.VIR_UUID_BUFLEN), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretGetUUIDString +func (s *Secret) GetUUIDString() (string, error) { + var cUuid [C.VIR_UUID_STRING_BUFLEN](C.char) + cuidPtr := unsafe.Pointer(&cUuid) + var err C.virError + result := C.virSecretGetUUIDStringWrapper(s.ptr, (*C.char)(cuidPtr), &err) + if result != 0 { + return "", makeError(&err) + } + return C.GoString((*C.char)(cuidPtr)), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretGetUsageID +func (s *Secret) GetUsageID() (string, error) { + var err C.virError + result := C.virSecretGetUsageIDWrapper(s.ptr, &err) + if result == nil { + return "", makeError(&err) + } + return C.GoString(result), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretGetUsageType +func (s *Secret) GetUsageType() (SecretUsageType, error) { + var err C.virError + result := SecretUsageType(C.virSecretGetUsageTypeWrapper(s.ptr, &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretGetXMLDesc +func (s *Secret) GetXMLDesc(flags uint32) (string, error) { + var err C.virError + result := C.virSecretGetXMLDescWrapper(s.ptr, C.uint(flags), &err) + if result == nil { + return "", makeError(&err) + } + xml := C.GoString(result) + C.free(unsafe.Pointer(result)) + return xml, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretGetValue +func (s *Secret) GetValue(flags uint32) ([]byte, error) { + var cvalue_size C.size_t + + var err C.virError + cvalue := C.virSecretGetValueWrapper(s.ptr, &cvalue_size, C.uint(flags), &err) + if cvalue == nil { + return nil, makeError(&err) + } + defer C.free(unsafe.Pointer(cvalue)) + ret := C.GoBytes(unsafe.Pointer(cvalue), C.int(cvalue_size)) + return ret, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretSetValue +func (s *Secret) SetValue(value []byte, flags uint32) error { + nvalue := len(value) + cvalue := make([]C.uchar, nvalue) + + for i := 0; i < nvalue; i++ { + cvalue[i] = C.uchar(value[i]) + } + + var err C.virError + var cvaluePtr *C.uchar = nil + if nvalue > 0 { + cvaluePtr = &cvalue[0] + } + result := C.virSecretSetValueWrapper(s.ptr, cvaluePtr, C.size_t(nvalue), C.uint(flags), &err) + + if result == -1 { + return makeError(&err) + } + + return nil +} diff --git a/vendor/libvirt.org/go/libvirt/secret_events.go b/vendor/libvirt.org/go/libvirt/secret_events.go new file mode 100644 index 000000000..9650822a0 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/secret_events.go @@ -0,0 +1,150 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +import ( + "fmt" + "unsafe" +) + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include "secret_events_helper.h" +*/ +import "C" + +type SecretEventLifecycle struct { + Event SecretEventLifecycleType + // TODO: we can make Detail typesafe somehow ? + Detail int +} + +type SecretEventLifecycleCallback func(c *Connect, n *Secret, event *SecretEventLifecycle) + +type SecretEventGenericCallback func(c *Connect, n *Secret) + +//export secretEventLifecycleCallback +func secretEventLifecycleCallback(c C.virConnectPtr, n C.virSecretPtr, + event int, detail int, + goCallbackId int) { + + secret := &Secret{ptr: n} + connection := &Connect{ptr: c} + + eventDetails := &SecretEventLifecycle{ + Event: SecretEventLifecycleType(event), + Detail: detail, + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(SecretEventLifecycleCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, secret, eventDetails) +} + +//export secretEventGenericCallback +func secretEventGenericCallback(c C.virConnectPtr, n C.virSecretPtr, + goCallbackId int) { + + secret := &Secret{ptr: n} + connection := &Connect{ptr: c} + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(SecretEventGenericCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, secret) +} + +func (c *Connect) SecretEventLifecycleRegister(secret *Secret, callback SecretEventLifecycleCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + callbackPtr := unsafe.Pointer(C.secretEventLifecycleCallbackHelper) + var csecret C.virSecretPtr + if secret != nil { + csecret = secret.ptr + } + var err C.virError + ret := C.virConnectSecretEventRegisterAnyHelper(c.ptr, csecret, + C.VIR_SECRET_EVENT_ID_LIFECYCLE, + C.virConnectSecretEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) SecretEventValueChangedRegister(secret *Secret, callback SecretEventGenericCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + callbackPtr := unsafe.Pointer(C.secretEventGenericCallbackHelper) + var csecret C.virSecretPtr + if secret != nil { + csecret = secret.ptr + } + var err C.virError + ret := C.virConnectSecretEventRegisterAnyHelper(c.ptr, csecret, + C.VIR_SECRET_EVENT_ID_VALUE_CHANGED, + C.virConnectSecretEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) SecretEventDeregister(callbackId int) error { + // Deregister the callback + var err C.virError + ret := int(C.virConnectSecretEventDeregisterAnyWrapper(c.ptr, C.int(callbackId), &err)) + if ret < 0 { + return makeError(&err) + } + return nil +} + +func (e SecretEventLifecycle) String() string { + var event string + switch e.Event { + case SECRET_EVENT_DEFINED: + event = "defined" + + case SECRET_EVENT_UNDEFINED: + event = "undefined" + + default: + event = "unknown" + } + + return fmt.Sprintf("Secret event=%q", event) +} diff --git a/vendor/libvirt.org/go/libvirt/secret_events_helper.go b/vendor/libvirt.org/go/libvirt/secret_events_helper.go new file mode 100644 index 000000000..72bee9a31 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/secret_events_helper.go @@ -0,0 +1,69 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include +#include "secret_events_helper.h" +#include "callbacks_helper.h" + + +extern void secretEventLifecycleCallback(virConnectPtr, virSecretPtr, int, int, int); +void secretEventLifecycleCallbackHelper(virConnectPtr conn, virSecretPtr secret, + int event, int detail, void *data) +{ + secretEventLifecycleCallback(conn, secret, event, detail, (int)(intptr_t)data); +} + + +extern void secretEventGenericCallback(virConnectPtr, virSecretPtr, int); +void secretEventGenericCallbackHelper(virConnectPtr conn, virSecretPtr secret, + void *data) +{ + secretEventGenericCallback(conn, secret, (int)(intptr_t)data); +} + + +int +virConnectSecretEventRegisterAnyHelper(virConnectPtr conn, + virSecretPtr secret, + int eventID, + virConnectSecretEventGenericCallback cb, + long goCallbackId, + virErrorPtr err) +{ + void *id = (void *)goCallbackId; + return virConnectSecretEventRegisterAnyWrapper(conn, secret, eventID, cb, id, + freeGoCallbackHelper, err); +} + + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/secret_events_helper.h b/vendor/libvirt.org/go/libvirt/secret_events_helper.h new file mode 100644 index 000000000..8dc4ea53d --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/secret_events_helper.h @@ -0,0 +1,56 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_SECRET_EVENTS_HELPER_H__ +#define LIBVIRT_GO_SECRET_EVENTS_HELPER_H__ + +#include "libvirt_generated.h" + + +void +secretEventLifecycleCallbackHelper(virConnectPtr conn, + virSecretPtr secret, + int event, + int detail, + void *data); + + +void +secretEventGenericCallbackHelper(virConnectPtr conn, + virSecretPtr secret, + void *data); + + +int +virConnectSecretEventRegisterAnyHelper(virConnectPtr conn, + virSecretPtr secret, + int eventID, + virConnectSecretEventGenericCallback cb, + long goCallbackId, + virErrorPtr err); + + +#endif /* LIBVIRT_GO_SECRET_EVENTS_HELPER_H__ */ diff --git a/vendor/libvirt.org/go/libvirt/storage_pool.go b/vendor/libvirt.org/go/libvirt/storage_pool.go new file mode 100644 index 000000000..9ed6155dd --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/storage_pool.go @@ -0,0 +1,402 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include +#include "libvirt_generated.h" +*/ +import "C" + +import ( + "reflect" + "unsafe" +) + +type StoragePoolState int + +const ( + STORAGE_POOL_INACTIVE = StoragePoolState(C.VIR_STORAGE_POOL_INACTIVE) // Not running + STORAGE_POOL_BUILDING = StoragePoolState(C.VIR_STORAGE_POOL_BUILDING) // Initializing pool,not available + STORAGE_POOL_RUNNING = StoragePoolState(C.VIR_STORAGE_POOL_RUNNING) // Running normally + STORAGE_POOL_DEGRADED = StoragePoolState(C.VIR_STORAGE_POOL_DEGRADED) // Running degraded + STORAGE_POOL_INACCESSIBLE = StoragePoolState(C.VIR_STORAGE_POOL_INACCESSIBLE) // Running,but not accessible +) + +type StoragePoolBuildFlags uint + +const ( + STORAGE_POOL_BUILD_NEW = StoragePoolBuildFlags(C.VIR_STORAGE_POOL_BUILD_NEW) // Regular build from scratch + STORAGE_POOL_BUILD_REPAIR = StoragePoolBuildFlags(C.VIR_STORAGE_POOL_BUILD_REPAIR) // Repair / reinitialize + STORAGE_POOL_BUILD_RESIZE = StoragePoolBuildFlags(C.VIR_STORAGE_POOL_BUILD_RESIZE) // Extend existing pool + STORAGE_POOL_BUILD_NO_OVERWRITE = StoragePoolBuildFlags(C.VIR_STORAGE_POOL_BUILD_NO_OVERWRITE) // Do not overwrite existing pool + STORAGE_POOL_BUILD_OVERWRITE = StoragePoolBuildFlags(C.VIR_STORAGE_POOL_BUILD_OVERWRITE) // Overwrite data +) + +type StoragePoolCreateFlags uint + +const ( + STORAGE_POOL_CREATE_NORMAL = StoragePoolCreateFlags(C.VIR_STORAGE_POOL_CREATE_NORMAL) + STORAGE_POOL_CREATE_WITH_BUILD = StoragePoolCreateFlags(C.VIR_STORAGE_POOL_CREATE_WITH_BUILD) + STORAGE_POOL_CREATE_WITH_BUILD_OVERWRITE = StoragePoolCreateFlags(C.VIR_STORAGE_POOL_CREATE_WITH_BUILD_OVERWRITE) + STORAGE_POOL_CREATE_WITH_BUILD_NO_OVERWRITE = StoragePoolCreateFlags(C.VIR_STORAGE_POOL_CREATE_WITH_BUILD_NO_OVERWRITE) +) + +type StoragePoolDefineFlags uint + +const ( + STORAGE_POOL_DEFINE_VALIDATE = StoragePoolDefineFlags(C.VIR_STORAGE_POOL_DEFINE_VALIDATE) +) + +type StoragePoolDeleteFlags uint + +const ( + STORAGE_POOL_DELETE_NORMAL = StoragePoolDeleteFlags(C.VIR_STORAGE_POOL_DELETE_NORMAL) + STORAGE_POOL_DELETE_ZEROED = StoragePoolDeleteFlags(C.VIR_STORAGE_POOL_DELETE_ZEROED) +) + +type StoragePoolEventID int + +const ( + STORAGE_POOL_EVENT_ID_LIFECYCLE = StoragePoolEventID(C.VIR_STORAGE_POOL_EVENT_ID_LIFECYCLE) + STORAGE_POOL_EVENT_ID_REFRESH = StoragePoolEventID(C.VIR_STORAGE_POOL_EVENT_ID_REFRESH) +) + +type StoragePoolEventLifecycleType int + +const ( + STORAGE_POOL_EVENT_DEFINED = StoragePoolEventLifecycleType(C.VIR_STORAGE_POOL_EVENT_DEFINED) + STORAGE_POOL_EVENT_UNDEFINED = StoragePoolEventLifecycleType(C.VIR_STORAGE_POOL_EVENT_UNDEFINED) + STORAGE_POOL_EVENT_STARTED = StoragePoolEventLifecycleType(C.VIR_STORAGE_POOL_EVENT_STARTED) + STORAGE_POOL_EVENT_STOPPED = StoragePoolEventLifecycleType(C.VIR_STORAGE_POOL_EVENT_STOPPED) + STORAGE_POOL_EVENT_CREATED = StoragePoolEventLifecycleType(C.VIR_STORAGE_POOL_EVENT_CREATED) + STORAGE_POOL_EVENT_DELETED = StoragePoolEventLifecycleType(C.VIR_STORAGE_POOL_EVENT_DELETED) +) + +type StoragePool struct { + ptr C.virStoragePoolPtr +} + +type StoragePoolInfo struct { + State StoragePoolState + Capacity uint64 + Allocation uint64 + Available uint64 +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolBuild +func (p *StoragePool) Build(flags StoragePoolBuildFlags) error { + var err C.virError + result := C.virStoragePoolBuildWrapper(p.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolCreate +func (p *StoragePool) Create(flags StoragePoolCreateFlags) error { + var err C.virError + result := C.virStoragePoolCreateWrapper(p.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolDelete +func (p *StoragePool) Delete(flags StoragePoolDeleteFlags) error { + var err C.virError + result := C.virStoragePoolDeleteWrapper(p.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolDestroy +func (p *StoragePool) Destroy() error { + var err C.virError + result := C.virStoragePoolDestroyWrapper(p.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolFree +func (p *StoragePool) Free() error { + var err C.virError + ret := C.virStoragePoolFreeWrapper(p.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolRef +func (c *StoragePool) Ref() error { + var err C.virError + ret := C.virStoragePoolRefWrapper(c.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolGetAutostart +func (p *StoragePool) GetAutostart() (bool, error) { + var out C.int + var err C.virError + result := C.virStoragePoolGetAutostartWrapper(p.ptr, (*C.int)(unsafe.Pointer(&out)), &err) + if result == -1 { + return false, makeError(&err) + } + switch out { + case 1: + return true, nil + default: + return false, nil + } +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolGetInfo +func (p *StoragePool) GetInfo() (*StoragePoolInfo, error) { + var cinfo C.virStoragePoolInfo + var err C.virError + result := C.virStoragePoolGetInfoWrapper(p.ptr, &cinfo, &err) + if result == -1 { + return nil, makeError(&err) + } + return &StoragePoolInfo{ + State: StoragePoolState(cinfo.state), + Capacity: uint64(cinfo.capacity), + Allocation: uint64(cinfo.allocation), + Available: uint64(cinfo.available), + }, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolGetName +func (p *StoragePool) GetName() (string, error) { + var err C.virError + name := C.virStoragePoolGetNameWrapper(p.ptr, &err) + if name == nil { + return "", makeError(&err) + } + return C.GoString(name), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolGetUUID +func (p *StoragePool) GetUUID() ([]byte, error) { + var cUuid [C.VIR_UUID_BUFLEN](byte) + cuidPtr := unsafe.Pointer(&cUuid) + var err C.virError + result := C.virStoragePoolGetUUIDWrapper(p.ptr, (*C.uchar)(cuidPtr), &err) + if result != 0 { + return []byte{}, makeError(&err) + } + return C.GoBytes(cuidPtr, C.VIR_UUID_BUFLEN), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolGetUUIDString +func (p *StoragePool) GetUUIDString() (string, error) { + var cUuid [C.VIR_UUID_STRING_BUFLEN](C.char) + cuidPtr := unsafe.Pointer(&cUuid) + var err C.virError + result := C.virStoragePoolGetUUIDStringWrapper(p.ptr, (*C.char)(cuidPtr), &err) + if result != 0 { + return "", makeError(&err) + } + return C.GoString((*C.char)(cuidPtr)), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolGetXMLDesc +func (p *StoragePool) GetXMLDesc(flags StorageXMLFlags) (string, error) { + var err C.virError + result := C.virStoragePoolGetXMLDescWrapper(p.ptr, C.uint(flags), &err) + if result == nil { + return "", makeError(&err) + } + xml := C.GoString(result) + C.free(unsafe.Pointer(result)) + return xml, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolIsActive +func (p *StoragePool) IsActive() (bool, error) { + var err C.virError + result := C.virStoragePoolIsActiveWrapper(p.ptr, &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolIsPersistent +func (p *StoragePool) IsPersistent() (bool, error) { + var err C.virError + result := C.virStoragePoolIsPersistentWrapper(p.ptr, &err) + if result == -1 { + return false, makeError(&err) + } + if result == 1 { + return true, nil + } + return false, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolSetAutostart +func (p *StoragePool) SetAutostart(autostart bool) error { + var cAutostart C.int + switch autostart { + case true: + cAutostart = 1 + default: + cAutostart = 0 + } + var err C.virError + result := C.virStoragePoolSetAutostartWrapper(p.ptr, cAutostart, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolRefresh +func (p *StoragePool) Refresh(flags uint32) error { + var err C.virError + result := C.virStoragePoolRefreshWrapper(p.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolUndefine +func (p *StoragePool) Undefine() error { + var err C.virError + result := C.virStoragePoolUndefineWrapper(p.ptr, &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolCreateXML +func (p *StoragePool) StorageVolCreateXML(xmlConfig string, flags StorageVolCreateFlags) (*StorageVol, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virStorageVolCreateXMLWrapper(p.ptr, cXml, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &StorageVol{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolCreateXMLFrom +func (p *StoragePool) StorageVolCreateXMLFrom(xmlConfig string, clonevol *StorageVol, flags StorageVolCreateFlags) (*StorageVol, error) { + cXml := C.CString(string(xmlConfig)) + defer C.free(unsafe.Pointer(cXml)) + var err C.virError + ptr := C.virStorageVolCreateXMLFromWrapper(p.ptr, cXml, clonevol.ptr, C.uint(flags), &err) + if ptr == nil { + return nil, makeError(&err) + } + return &StorageVol{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolLookupByName +func (p *StoragePool) LookupStorageVolByName(name string) (*StorageVol, error) { + cName := C.CString(name) + defer C.free(unsafe.Pointer(cName)) + var err C.virError + ptr := C.virStorageVolLookupByNameWrapper(p.ptr, cName, &err) + if ptr == nil { + return nil, makeError(&err) + } + return &StorageVol{ptr: ptr}, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolNumOfVolumes +func (p *StoragePool) NumOfStorageVolumes() (int, error) { + var err C.virError + result := int(C.virStoragePoolNumOfVolumesWrapper(p.ptr, &err)) + if result == -1 { + return 0, makeError(&err) + } + return result, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolListVolumes +func (p *StoragePool) ListStorageVolumes() ([]string, error) { + const maxVols = 1024 + var names [maxVols](*C.char) + namesPtr := unsafe.Pointer(&names) + var err C.virError + numStorageVols := C.virStoragePoolListVolumesWrapper( + p.ptr, + (**C.char)(namesPtr), + maxVols, &err) + if numStorageVols == -1 { + return nil, makeError(&err) + } + goNames := make([]string, numStorageVols) + for k := 0; k < int(numStorageVols); k++ { + goNames[k] = C.GoString(names[k]) + C.free(unsafe.Pointer(names[k])) + } + return goNames, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolListAllVolumes +func (p *StoragePool) ListAllStorageVolumes(flags uint32) ([]StorageVol, error) { + var cList *C.virStorageVolPtr + var err C.virError + numVols := C.virStoragePoolListAllVolumesWrapper(p.ptr, (**C.virStorageVolPtr)(&cList), C.uint(flags), &err) + if numVols == -1 { + return nil, makeError(&err) + } + hdr := reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(cList)), + Len: int(numVols), + Cap: int(numVols), + } + var pools []StorageVol + slice := *(*[]C.virStorageVolPtr)(unsafe.Pointer(&hdr)) + for _, ptr := range slice { + pools = append(pools, StorageVol{ptr}) + } + C.free(unsafe.Pointer(cList)) + return pools, nil +} diff --git a/vendor/libvirt.org/go/libvirt/storage_pool_events.go b/vendor/libvirt.org/go/libvirt/storage_pool_events.go new file mode 100644 index 000000000..596d795f4 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/storage_pool_events.go @@ -0,0 +1,164 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +import ( + "fmt" + "unsafe" +) + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include "storage_pool_events_helper.h" +*/ +import "C" + +type StoragePoolEventLifecycle struct { + Event StoragePoolEventLifecycleType + // TODO: we can make Detail typesafe somehow ? + Detail int +} + +type StoragePoolEventLifecycleCallback func(c *Connect, n *StoragePool, event *StoragePoolEventLifecycle) + +type StoragePoolEventGenericCallback func(c *Connect, n *StoragePool) + +//export storagePoolEventLifecycleCallback +func storagePoolEventLifecycleCallback(c C.virConnectPtr, s C.virStoragePoolPtr, + event int, detail int, + goCallbackId int) { + + storage_pool := &StoragePool{ptr: s} + connection := &Connect{ptr: c} + + eventDetails := &StoragePoolEventLifecycle{ + Event: StoragePoolEventLifecycleType(event), + Detail: detail, + } + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(StoragePoolEventLifecycleCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, storage_pool, eventDetails) +} + +//export storagePoolEventGenericCallback +func storagePoolEventGenericCallback(c C.virConnectPtr, s C.virStoragePoolPtr, + goCallbackId int) { + + storage_pool := &StoragePool{ptr: s} + connection := &Connect{ptr: c} + + callbackFunc := getCallbackId(goCallbackId) + callback, ok := callbackFunc.(StoragePoolEventGenericCallback) + if !ok { + panic("Inappropriate callback type called") + } + callback(connection, storage_pool) +} + +func (c *Connect) StoragePoolEventLifecycleRegister(pool *StoragePool, callback StoragePoolEventLifecycleCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.storagePoolEventLifecycleCallbackHelper) + var cpool C.virStoragePoolPtr + if pool != nil { + cpool = pool.ptr + } + var err C.virError + ret := C.virConnectStoragePoolEventRegisterAnyHelper(c.ptr, cpool, + C.VIR_STORAGE_POOL_EVENT_ID_LIFECYCLE, + C.virConnectStoragePoolEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) StoragePoolEventRefreshRegister(pool *StoragePool, callback StoragePoolEventGenericCallback) (int, error) { + goCallBackId := registerCallbackId(callback) + + callbackPtr := unsafe.Pointer(C.storagePoolEventGenericCallbackHelper) + var cpool C.virStoragePoolPtr + if pool != nil { + cpool = pool.ptr + } + var err C.virError + ret := C.virConnectStoragePoolEventRegisterAnyHelper(c.ptr, cpool, + C.VIR_STORAGE_POOL_EVENT_ID_REFRESH, + C.virConnectStoragePoolEventGenericCallback(callbackPtr), + C.long(goCallBackId), &err) + if ret == -1 { + freeCallbackId(goCallBackId) + return 0, makeError(&err) + } + return int(ret), nil +} + +func (c *Connect) StoragePoolEventDeregister(callbackId int) error { + // Deregister the callback + var err C.virError + ret := int(C.virConnectStoragePoolEventDeregisterAnyWrapper(c.ptr, C.int(callbackId), &err)) + if ret < 0 { + return makeError(&err) + } + return nil +} + +func (e StoragePoolEventLifecycle) String() string { + var event string + switch e.Event { + case STORAGE_POOL_EVENT_DEFINED: + event = "defined" + + case STORAGE_POOL_EVENT_UNDEFINED: + event = "undefined" + + case STORAGE_POOL_EVENT_STARTED: + event = "started" + + case STORAGE_POOL_EVENT_STOPPED: + event = "stopped" + + case STORAGE_POOL_EVENT_CREATED: + event = "created" + + case STORAGE_POOL_EVENT_DELETED: + event = "deleted" + + default: + event = "unknown" + } + + return fmt.Sprintf("StoragePool event=%q", event) +} diff --git a/vendor/libvirt.org/go/libvirt/storage_pool_events_helper.go b/vendor/libvirt.org/go/libvirt/storage_pool_events_helper.go new file mode 100644 index 000000000..43dcd1d7e --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/storage_pool_events_helper.go @@ -0,0 +1,69 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include +#include "storage_pool_events_helper.h" +#include "callbacks_helper.h" + + +extern void storagePoolEventLifecycleCallback(virConnectPtr, virStoragePoolPtr, int, int, int); +void storagePoolEventLifecycleCallbackHelper(virConnectPtr conn, virStoragePoolPtr pool, + int event, int detail, void *data) +{ + storagePoolEventLifecycleCallback(conn, pool, event, detail, (int)(intptr_t)data); +} + + +extern void storagePoolEventGenericCallback(virConnectPtr, virStoragePoolPtr, int); +void storagePoolEventGenericCallbackHelper(virConnectPtr conn, virStoragePoolPtr pool, + void *data) +{ + storagePoolEventGenericCallback(conn, pool, (int)(intptr_t)data); +} + + +int +virConnectStoragePoolEventRegisterAnyHelper(virConnectPtr conn, + virStoragePoolPtr pool, + int eventID, + virConnectStoragePoolEventGenericCallback cb, + long goCallbackId, + virErrorPtr err) +{ + void *id = (void *)goCallbackId; + return virConnectStoragePoolEventRegisterAnyWrapper(conn, pool, eventID, cb, id, + freeGoCallbackHelper, err); +} + + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/storage_pool_events_helper.h b/vendor/libvirt.org/go/libvirt/storage_pool_events_helper.h new file mode 100644 index 000000000..45e64437b --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/storage_pool_events_helper.h @@ -0,0 +1,52 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_STORAGE_POOL_EVENTS_HELPER_H__ +#define LIBVIRT_GO_STORAGE_POOL_EVENTS_HELPER_H__ + +#include "libvirt_generated.h" + +void +storagePoolEventLifecycleCallbackHelper(virConnectPtr conn, + virStoragePoolPtr pool, + int event, + int detail, + void *data); + +void +storagePoolEventGenericCallbackHelper(virConnectPtr conn, + virStoragePoolPtr pool, + void *data); + +int +virConnectStoragePoolEventRegisterAnyHelper(virConnectPtr conn, + virStoragePoolPtr pool, + int eventID, + virConnectStoragePoolEventGenericCallback cb, + long goCallbackId, + virErrorPtr err); + +#endif /* LIBVIRT_GO_STORAGE_POOL_EVENTS_HELPER_H__ */ diff --git a/vendor/libvirt.org/go/libvirt/storage_volume.go b/vendor/libvirt.org/go/libvirt/storage_volume.go new file mode 100644 index 000000000..fa89a1441 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/storage_volume.go @@ -0,0 +1,289 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include +#include "libvirt_generated.h" +*/ +import "C" + +import ( + "unsafe" +) + +type StorageVolCreateFlags uint + +const ( + STORAGE_VOL_CREATE_PREALLOC_METADATA = StorageVolCreateFlags(C.VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA) + STORAGE_VOL_CREATE_REFLINK = StorageVolCreateFlags(C.VIR_STORAGE_VOL_CREATE_REFLINK) + STORAGE_VOL_CREATE_VALIDATE = StorageVolCreateFlags(C.VIR_STORAGE_VOL_CREATE_VALIDATE) +) + +type StorageVolDeleteFlags uint + +const ( + STORAGE_VOL_DELETE_NORMAL = StorageVolDeleteFlags(C.VIR_STORAGE_VOL_DELETE_NORMAL) // Delete metadata only (fast) + STORAGE_VOL_DELETE_ZEROED = StorageVolDeleteFlags(C.VIR_STORAGE_VOL_DELETE_ZEROED) // Clear all data to zeros (slow) + STORAGE_VOL_DELETE_WITH_SNAPSHOTS = StorageVolDeleteFlags(C.VIR_STORAGE_VOL_DELETE_WITH_SNAPSHOTS) // Force removal of volume, even if in use +) + +type StorageVolResizeFlags uint + +const ( + STORAGE_VOL_RESIZE_ALLOCATE = StorageVolResizeFlags(C.VIR_STORAGE_VOL_RESIZE_ALLOCATE) // force allocation of new size + STORAGE_VOL_RESIZE_DELTA = StorageVolResizeFlags(C.VIR_STORAGE_VOL_RESIZE_DELTA) // size is relative to current + STORAGE_VOL_RESIZE_SHRINK = StorageVolResizeFlags(C.VIR_STORAGE_VOL_RESIZE_SHRINK) // allow decrease in capacity +) + +type StorageVolType int + +const ( + STORAGE_VOL_FILE = StorageVolType(C.VIR_STORAGE_VOL_FILE) // Regular file based volumes + STORAGE_VOL_BLOCK = StorageVolType(C.VIR_STORAGE_VOL_BLOCK) // Block based volumes + STORAGE_VOL_DIR = StorageVolType(C.VIR_STORAGE_VOL_DIR) // Directory-passthrough based volume + STORAGE_VOL_NETWORK = StorageVolType(C.VIR_STORAGE_VOL_NETWORK) //Network volumes like RBD (RADOS Block Device) + STORAGE_VOL_NETDIR = StorageVolType(C.VIR_STORAGE_VOL_NETDIR) // Network accessible directory that can contain other network volumes + STORAGE_VOL_PLOOP = StorageVolType(C.VIR_STORAGE_VOL_PLOOP) // Ploop directory based volumes +) + +type StorageVolWipeAlgorithm int + +const ( + STORAGE_VOL_WIPE_ALG_ZERO = StorageVolWipeAlgorithm(C.VIR_STORAGE_VOL_WIPE_ALG_ZERO) // 1-pass, all zeroes + STORAGE_VOL_WIPE_ALG_NNSA = StorageVolWipeAlgorithm(C.VIR_STORAGE_VOL_WIPE_ALG_NNSA) // 4-pass NNSA Policy Letter NAP-14.1-C (XVI-8) + STORAGE_VOL_WIPE_ALG_DOD = StorageVolWipeAlgorithm(C.VIR_STORAGE_VOL_WIPE_ALG_DOD) // 4-pass DoD 5220.22-M section 8-306 procedure + STORAGE_VOL_WIPE_ALG_BSI = StorageVolWipeAlgorithm(C.VIR_STORAGE_VOL_WIPE_ALG_BSI) // 9-pass method recommended by the German Center of Security in Information Technologies + STORAGE_VOL_WIPE_ALG_GUTMANN = StorageVolWipeAlgorithm(C.VIR_STORAGE_VOL_WIPE_ALG_GUTMANN) // The canonical 35-pass sequence + STORAGE_VOL_WIPE_ALG_SCHNEIER = StorageVolWipeAlgorithm(C.VIR_STORAGE_VOL_WIPE_ALG_SCHNEIER) // 7-pass method described by Bruce Schneier in "Applied Cryptography" (1996) + STORAGE_VOL_WIPE_ALG_PFITZNER7 = StorageVolWipeAlgorithm(C.VIR_STORAGE_VOL_WIPE_ALG_PFITZNER7) // 7-pass random + STORAGE_VOL_WIPE_ALG_PFITZNER33 = StorageVolWipeAlgorithm(C.VIR_STORAGE_VOL_WIPE_ALG_PFITZNER33) // 33-pass random + STORAGE_VOL_WIPE_ALG_RANDOM = StorageVolWipeAlgorithm(C.VIR_STORAGE_VOL_WIPE_ALG_RANDOM) // 1-pass random + STORAGE_VOL_WIPE_ALG_TRIM = StorageVolWipeAlgorithm(C.VIR_STORAGE_VOL_WIPE_ALG_TRIM) // Trim the underlying storage +) + +type StorageXMLFlags uint + +const ( + STORAGE_XML_INACTIVE = StorageXMLFlags(C.VIR_STORAGE_XML_INACTIVE) +) + +type StorageVolInfoFlags uint + +const ( + STORAGE_VOL_USE_ALLOCATION = StorageVolInfoFlags(C.VIR_STORAGE_VOL_USE_ALLOCATION) + STORAGE_VOL_GET_PHYSICAL = StorageVolInfoFlags(C.VIR_STORAGE_VOL_GET_PHYSICAL) +) + +type StorageVolUploadFlags uint + +const ( + STORAGE_VOL_UPLOAD_SPARSE_STREAM = StorageVolUploadFlags(C.VIR_STORAGE_VOL_UPLOAD_SPARSE_STREAM) +) + +type StorageVolDownloadFlags uint + +const ( + STORAGE_VOL_DOWNLOAD_SPARSE_STREAM = StorageVolDownloadFlags(C.VIR_STORAGE_VOL_DOWNLOAD_SPARSE_STREAM) +) + +type StorageVol struct { + ptr C.virStorageVolPtr +} + +type StorageVolInfo struct { + Type StorageVolType + Capacity uint64 + Allocation uint64 +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolDelete +func (v *StorageVol) Delete(flags StorageVolDeleteFlags) error { + var err C.virError + result := C.virStorageVolDeleteWrapper(v.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolFree +func (v *StorageVol) Free() error { + var err C.virError + ret := C.virStorageVolFreeWrapper(v.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolRef +func (c *StorageVol) Ref() error { + var err C.virError + ret := C.virStorageVolRefWrapper(c.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolGetInfo +func (v *StorageVol) GetInfo() (*StorageVolInfo, error) { + var cinfo C.virStorageVolInfo + var err C.virError + result := C.virStorageVolGetInfoWrapper(v.ptr, &cinfo, &err) + if result == -1 { + return nil, makeError(&err) + } + return &StorageVolInfo{ + Type: StorageVolType(cinfo._type), + Capacity: uint64(cinfo.capacity), + Allocation: uint64(cinfo.allocation), + }, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolGetInfoFlags +func (v *StorageVol) GetInfoFlags(flags StorageVolInfoFlags) (*StorageVolInfo, error) { + var cinfo C.virStorageVolInfo + var err C.virError + result := C.virStorageVolGetInfoFlagsWrapper(v.ptr, &cinfo, C.uint(flags), &err) + if result == -1 { + return nil, makeError(&err) + } + return &StorageVolInfo{ + Type: StorageVolType(cinfo._type), + Capacity: uint64(cinfo.capacity), + Allocation: uint64(cinfo.allocation), + }, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolGetKey +func (v *StorageVol) GetKey() (string, error) { + var err C.virError + key := C.virStorageVolGetKeyWrapper(v.ptr, &err) + if key == nil { + return "", makeError(&err) + } + return C.GoString(key), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolGetName +func (v *StorageVol) GetName() (string, error) { + var err C.virError + name := C.virStorageVolGetNameWrapper(v.ptr, &err) + if name == nil { + return "", makeError(&err) + } + return C.GoString(name), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolGetPath +func (v *StorageVol) GetPath() (string, error) { + var err C.virError + result := C.virStorageVolGetPathWrapper(v.ptr, &err) + if result == nil { + return "", makeError(&err) + } + path := C.GoString(result) + C.free(unsafe.Pointer(result)) + return path, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolGetXMLDesc +func (v *StorageVol) GetXMLDesc(flags uint32) (string, error) { + var err C.virError + result := C.virStorageVolGetXMLDescWrapper(v.ptr, C.uint(flags), &err) + if result == nil { + return "", makeError(&err) + } + xml := C.GoString(result) + C.free(unsafe.Pointer(result)) + return xml, nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolResize +func (v *StorageVol) Resize(capacity uint64, flags StorageVolResizeFlags) error { + var err C.virError + result := C.virStorageVolResizeWrapper(v.ptr, C.ulonglong(capacity), C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolWipe +func (v *StorageVol) Wipe(flags uint32) error { + var err C.virError + result := C.virStorageVolWipeWrapper(v.ptr, C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolWipePattern +func (v *StorageVol) WipePattern(algorithm StorageVolWipeAlgorithm, flags uint32) error { + var err C.virError + result := C.virStorageVolWipePatternWrapper(v.ptr, C.uint(algorithm), C.uint(flags), &err) + if result == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolUpload +func (v *StorageVol) Upload(stream *Stream, offset, length uint64, flags StorageVolUploadFlags) error { + var err C.virError + if C.virStorageVolUploadWrapper(v.ptr, stream.ptr, C.ulonglong(offset), + C.ulonglong(length), C.uint(flags), &err) == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolDownload +func (v *StorageVol) Download(stream *Stream, offset, length uint64, flags StorageVolDownloadFlags) error { + var err C.virError + if C.virStorageVolDownloadWrapper(v.ptr, stream.ptr, C.ulonglong(offset), + C.ulonglong(length), C.uint(flags), &err) == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolLookupByVolume +func (v *StorageVol) LookupPoolByVolume() (*StoragePool, error) { + var err C.virError + poolPtr := C.virStoragePoolLookupByVolumeWrapper(v.ptr, &err) + if poolPtr == nil { + return nil, makeError(&err) + } + return &StoragePool{ptr: poolPtr}, nil +} diff --git a/vendor/libvirt.org/go/libvirt/stream.go b/vendor/libvirt.org/go/libvirt/stream.go new file mode 100644 index 000000000..c2e0869f4 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/stream.go @@ -0,0 +1,414 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include "stream_helper.h" +*/ +import "C" +import ( + "io" + "unsafe" +) + +type StreamFlags uint + +const ( + STREAM_NONBLOCK = StreamFlags(C.VIR_STREAM_NONBLOCK) +) + +type StreamEventType int + +const ( + STREAM_EVENT_READABLE = StreamEventType(C.VIR_STREAM_EVENT_READABLE) + STREAM_EVENT_WRITABLE = StreamEventType(C.VIR_STREAM_EVENT_WRITABLE) + STREAM_EVENT_ERROR = StreamEventType(C.VIR_STREAM_EVENT_ERROR) + STREAM_EVENT_HANGUP = StreamEventType(C.VIR_STREAM_EVENT_HANGUP) +) + +type StreamRecvFlagsValues int + +const ( + STREAM_RECV_STOP_AT_HOLE = StreamRecvFlagsValues(C.VIR_STREAM_RECV_STOP_AT_HOLE) +) + +type Stream struct { + ptr C.virStreamPtr +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamAbort +func (v *Stream) Abort() error { + var err C.virError + result := C.virStreamAbortWrapper(v.ptr, &err) + if result == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamFinish +func (v *Stream) Finish() error { + var err C.virError + result := C.virStreamFinishWrapper(v.ptr, &err) + if result == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamFree +func (v *Stream) Free() error { + var err C.virError + ret := C.virStreamFreeWrapper(v.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamRef +func (c *Stream) Ref() error { + var err C.virError + ret := C.virStreamRefWrapper(c.ptr, &err) + if ret == -1 { + return makeError(&err) + } + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamRecv +func (v *Stream) Recv(p []byte) (int, error) { + np := len(p) + var err C.virError + var pPtr *C.char = nil + if np > 0 { + pPtr = (*C.char)(unsafe.Pointer(&p[0])) + } + n := C.virStreamRecvWrapper(v.ptr, pPtr, C.size_t(np), &err) + if n < 0 { + return 0, makeError(&err) + } + if n == 0 { + return 0, io.EOF + } + + return int(n), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamRecvFlags +func (v *Stream) RecvFlags(p []byte, flags StreamRecvFlagsValues) (int, error) { + np := len(p) + var err C.virError + var pPtr *C.char = nil + if np > 0 { + pPtr = (*C.char)(unsafe.Pointer(&p[0])) + } + n := C.virStreamRecvFlagsWrapper(v.ptr, pPtr, C.size_t(np), C.uint(flags), &err) + if n < 0 { + return 0, makeError(&err) + } + if n == 0 { + return 0, io.EOF + } + + return int(n), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamRecvHole +func (v *Stream) RecvHole(flags uint32) (int64, error) { + var len C.longlong + var err C.virError + ret := C.virStreamRecvHoleWrapper(v.ptr, &len, C.uint(flags), &err) + if ret < 0 { + return 0, makeError(&err) + } + + return int64(len), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamSend +func (v *Stream) Send(p []byte) (int, error) { + np := len(p) + var err C.virError + var pPtr *C.char = nil + if np > 0 { + pPtr = (*C.char)(unsafe.Pointer(&p[0])) + } + n := C.virStreamSendWrapper(v.ptr, pPtr, C.size_t(np), &err) + if n < 0 { + return 0, makeError(&err) + } + if n == 0 { + return 0, io.EOF + } + + return int(n), nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamSendHole +func (v *Stream) SendHole(len int64, flags uint32) error { + var err C.virError + ret := C.virStreamSendHoleWrapper(v.ptr, C.longlong(len), C.uint(flags), &err) + if ret < 0 { + return makeError(&err) + } + + return nil +} + +type StreamSinkFunc func(*Stream, []byte) (int, error) +type StreamSinkHoleFunc func(*Stream, int64) error + +//export streamSinkCallback +func streamSinkCallback(stream C.virStreamPtr, cdata *C.char, nbytes C.size_t, callbackID int) int { + callbackFunc := getCallbackId(callbackID) + + callback, ok := callbackFunc.(StreamSinkFunc) + if !ok { + panic("Incorrect stream sink func callback") + } + + data := make([]byte, int(nbytes)) + for i := 0; i < int(nbytes); i++ { + cdatabyte := (*C.char)(unsafe.Pointer(uintptr(unsafe.Pointer(cdata)) + (unsafe.Sizeof(*cdata) * uintptr(i)))) + data[i] = (byte)(*cdatabyte) + } + + retnbytes, err := callback(&Stream{ptr: stream}, data) + if err != nil { + return -1 + } + + return retnbytes +} + +//export streamSinkHoleCallback +func streamSinkHoleCallback(stream C.virStreamPtr, length C.longlong, callbackID int) int { + callbackFunc := getCallbackId(callbackID) + + callback, ok := callbackFunc.(StreamSinkHoleFunc) + if !ok { + panic("Incorrect stream sink hole func callback") + } + + err := callback(&Stream{ptr: stream}, int64(length)) + if err != nil { + return -1 + } + + return 0 +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamRecvAll +func (v *Stream) RecvAll(handler StreamSinkFunc) error { + + callbackID := registerCallbackId(handler) + + var err C.virError + ret := C.virStreamRecvAllHelper(v.ptr, (C.int)(callbackID), &err) + freeCallbackId(callbackID) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamSparseRecvAll +func (v *Stream) SparseRecvAll(handler StreamSinkFunc, holeHandler StreamSinkHoleFunc) error { + callbackID := registerCallbackId(handler) + holeCallbackID := registerCallbackId(holeHandler) + + var err C.virError + ret := C.virStreamSparseRecvAllHelper(v.ptr, (C.int)(callbackID), (C.int)(holeCallbackID), &err) + freeCallbackId(callbackID) + freeCallbackId(holeCallbackID) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +type StreamSourceFunc func(*Stream, int) ([]byte, error) +type StreamSourceHoleFunc func(*Stream) (bool, int64, error) +type StreamSourceSkipFunc func(*Stream, int64) error + +//export streamSourceCallback +func streamSourceCallback(stream C.virStreamPtr, cdata *C.char, nbytes C.size_t, callbackID int) int { + callbackFunc := getCallbackId(callbackID) + + callback, ok := callbackFunc.(StreamSourceFunc) + if !ok { + panic("Incorrect stream sink func callback") + } + + data, err := callback(&Stream{ptr: stream}, (int)(nbytes)) + if err != nil { + return -1 + } + + nretbytes := int(nbytes) + if len(data) < nretbytes { + nretbytes = len(data) + } + + for i := 0; i < nretbytes; i++ { + cdatabyte := (*C.char)(unsafe.Pointer(uintptr(unsafe.Pointer(cdata)) + (unsafe.Sizeof(*cdata) * uintptr(i)))) + *cdatabyte = (C.char)(data[i]) + } + + return nretbytes +} + +//export streamSourceHoleCallback +func streamSourceHoleCallback(stream C.virStreamPtr, cinData *C.int, clength *C.longlong, callbackID int) int { + callbackFunc := getCallbackId(callbackID) + + callback, ok := callbackFunc.(StreamSourceHoleFunc) + if !ok { + panic("Incorrect stream sink hole func callback") + } + + inData, length, err := callback(&Stream{ptr: stream}) + if err != nil { + return -1 + } + + if inData { + *cinData = 1 + } else { + *cinData = 0 + } + *clength = C.longlong(length) + + return 0 +} + +//export streamSourceSkipCallback +func streamSourceSkipCallback(stream C.virStreamPtr, length C.longlong, callbackID int) int { + callbackFunc := getCallbackId(callbackID) + + callback, ok := callbackFunc.(StreamSourceSkipFunc) + if !ok { + panic("Incorrect stream sink skip func callback") + } + + err := callback(&Stream{ptr: stream}, int64(length)) + if err != nil { + return -1 + } + + return 0 +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamSendAll +func (v *Stream) SendAll(handler StreamSourceFunc) error { + + callbackID := registerCallbackId(handler) + + var err C.virError + ret := C.virStreamSendAllHelper(v.ptr, (C.int)(callbackID), &err) + freeCallbackId(callbackID) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamSparseSendAll +func (v *Stream) SparseSendAll(handler StreamSourceFunc, holeHandler StreamSourceHoleFunc, skipHandler StreamSourceSkipFunc) error { + callbackID := registerCallbackId(handler) + holeCallbackID := registerCallbackId(holeHandler) + skipCallbackID := registerCallbackId(skipHandler) + + var err C.virError + ret := C.virStreamSparseSendAllHelper(v.ptr, (C.int)(callbackID), (C.int)(holeCallbackID), (C.int)(skipCallbackID), &err) + freeCallbackId(callbackID) + freeCallbackId(holeCallbackID) + freeCallbackId(skipCallbackID) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +type StreamEventCallback func(*Stream, StreamEventType) + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamEventAddCallback +func (v *Stream) EventAddCallback(events StreamEventType, callback StreamEventCallback) error { + callbackID := registerCallbackId(callback) + + var err C.virError + ret := C.virStreamEventAddCallbackHelper(v.ptr, (C.int)(events), (C.int)(callbackID), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +//export streamEventCallback +func streamEventCallback(st C.virStreamPtr, events int, callbackID int) { + callbackFunc := getCallbackId(callbackID) + + callback, ok := callbackFunc.(StreamEventCallback) + if !ok { + panic("Incorrect stream event func callback") + } + + callback(&Stream{ptr: st}, StreamEventType(events)) +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamEventUpdateCallback +func (v *Stream) EventUpdateCallback(events StreamEventType) error { + var err C.virError + ret := C.virStreamEventUpdateCallbackWrapper(v.ptr, (C.int)(events), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + +// See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamEventRemoveCallback +func (v *Stream) EventRemoveCallback() error { + var err C.virError + ret := C.virStreamEventRemoveCallbackWrapper(v.ptr, &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} diff --git a/vendor/libvirt.org/go/libvirt/stream_helper.go b/vendor/libvirt.org/go/libvirt/stream_helper.go new file mode 100644 index 000000000..cdfc3faf5 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/stream_helper.go @@ -0,0 +1,164 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include +#include "stream_helper.h" + + +int streamSourceCallback(virStreamPtr st, char *cdata, size_t nbytes, int callbackID); +int streamSourceHoleCallback(virStreamPtr st, int *inData, long long *length, int callbackID); +int streamSourceSkipCallback(virStreamPtr st, long long length, int callbackID); + +int streamSinkCallback(virStreamPtr st, const char *cdata, size_t nbytes, int callbackID); +int streamSinkHoleCallback(virStreamPtr st, long long length, int callbackID); + +struct CallbackData { + int callbackID; + int holeCallbackID; + int skipCallbackID; +}; + + +static int streamSourceCallbackHelper(virStreamPtr st, char *data, size_t nbytes, void *opaque) +{ + struct CallbackData *cbdata = opaque; + + return streamSourceCallback(st, data, nbytes, cbdata->callbackID); +} + + +static int streamSourceHoleCallbackHelper(virStreamPtr st, int *inData, long long *length, void *opaque) +{ + struct CallbackData *cbdata = opaque; + + return streamSourceHoleCallback(st, inData, length, cbdata->holeCallbackID); +} + + +static int streamSourceSkipCallbackHelper(virStreamPtr st, long long length, void *opaque) +{ + struct CallbackData *cbdata = opaque; + + return streamSourceSkipCallback(st, length, cbdata->skipCallbackID); +} + + +static int streamSinkCallbackHelper(virStreamPtr st, const char *data, size_t nbytes, void *opaque) +{ + struct CallbackData *cbdata = opaque; + + return streamSinkCallback(st, data, nbytes, cbdata->callbackID); +} + + +static int streamSinkHoleCallbackHelper(virStreamPtr st, long long length, void *opaque) +{ + struct CallbackData *cbdata = opaque; + + return streamSinkHoleCallback(st, length, cbdata->holeCallbackID); +} + + +void +streamEventCallback(virStreamPtr st, int events, int callbackID); + +static void +streamEventCallbackHelper(virStreamPtr st, int events, void *opaque) +{ + streamEventCallback(st, events, (int)(intptr_t)opaque); +} + + +int +virStreamEventAddCallbackHelper(virStreamPtr stream, + int events, + int callbackID, + virErrorPtr err) +{ + return virStreamEventAddCallbackWrapper(stream, events, streamEventCallbackHelper, + (void *)(intptr_t)callbackID, NULL, err); +} + + +int +virStreamRecvAllHelper(virStreamPtr stream, + int callbackID, + virErrorPtr err) +{ + struct CallbackData cbdata = { .callbackID = callbackID }; + return virStreamRecvAllWrapper(stream, streamSinkCallbackHelper, &cbdata, err); +} + + +int +virStreamSendAllHelper(virStreamPtr stream, + int callbackID, + virErrorPtr err) +{ + struct CallbackData cbdata = { .callbackID = callbackID }; + return virStreamSendAllWrapper(stream, streamSourceCallbackHelper, &cbdata, err); +} + + +int +virStreamSparseRecvAllHelper(virStreamPtr stream, + int callbackID, + int holeCallbackID, + virErrorPtr err) +{ + struct CallbackData cbdata = { .callbackID = callbackID, + .holeCallbackID = holeCallbackID }; + return virStreamSparseRecvAllWrapper(stream, streamSinkCallbackHelper, + streamSinkHoleCallbackHelper, + &cbdata, err); +} + + +int +virStreamSparseSendAllHelper(virStreamPtr stream, + int callbackID, + int holeCallbackID, + int skipCallbackID, + virErrorPtr err) +{ + struct CallbackData cbdata = { .callbackID = callbackID, + .holeCallbackID = holeCallbackID, + .skipCallbackID = skipCallbackID }; + return virStreamSparseSendAllWrapper(stream, streamSourceCallbackHelper, + streamSourceHoleCallbackHelper, + streamSourceSkipCallbackHelper, + &cbdata, err); +} + + +*/ +import "C" diff --git a/vendor/libvirt.org/go/libvirt/stream_helper.h b/vendor/libvirt.org/go/libvirt/stream_helper.h new file mode 100644 index 000000000..98459b678 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/stream_helper.h @@ -0,0 +1,61 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_STREAM_HELPER_H__ +#define LIBVIRT_GO_STREAM_HELPER_H__ + +#include "libvirt_generated.h" + +int +virStreamEventAddCallbackHelper(virStreamPtr st, + int events, + int callbackID, + virErrorPtr err); +int +virStreamRecvAllHelper(virStreamPtr st, + int callbackID, + virErrorPtr err); + +int +virStreamSendAllHelper(virStreamPtr st, + int callbackID, + virErrorPtr err); + +int +virStreamSparseRecvAllHelper(virStreamPtr st, + int callbackID, + int holeCallbackID, + virErrorPtr err); + +int +virStreamSparseSendAllHelper(virStreamPtr st, + int callbackID, + int holeCallbackID, + int skipCallbackID, + virErrorPtr err); + + +#endif /* LIBVIRT_GO_STREAM_HELPER_H__ */ diff --git a/vendor/libvirt.org/go/libvirt/typedparams.go b/vendor/libvirt.org/go/libvirt/typedparams.go new file mode 100644 index 000000000..d29ea6803 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/typedparams.go @@ -0,0 +1,292 @@ +/* + * This file is part of the libvirt-go-module project + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Copyright (c) 2013 Alex Zorin + * Copyright (C) 2016 Red Hat, Inc. + * + */ + +package libvirt + +/* +#cgo !libvirt_dlopen pkg-config: libvirt +#cgo libvirt_dlopen LDFLAGS: -ldl +#cgo libvirt_dlopen CFLAGS: -DLIBVIRT_DLOPEN +#include +#include +#include "libvirt_generated.h" +*/ +import "C" + +import ( + "fmt" + "strings" + "unsafe" +) + +type TypedParamValue struct { + Name string + Int *int + UInt *uint + Long *int64 + ULong *uint64 + Bool *bool + Float *float64 + String *string +} + +func (val *TypedParamValue) ValueString() string { + if val.Int != nil { + return fmt.Sprintf("%d", *val.Int) + } else if val.UInt != nil { + return fmt.Sprintf("%d", *val.UInt) + } else if val.Long != nil { + return fmt.Sprintf("%d", *val.Long) + } else if val.ULong != nil { + return fmt.Sprintf("%d", *val.ULong) + } else if val.Bool != nil { + return fmt.Sprintf("%t", *val.Bool) + } else if val.Float != nil { + return fmt.Sprintf("%f", *val.Float) + } else if val.Float != nil { + return *val.String + } else { + return "" + } +} + +type typedParamsFieldInfo struct { + set *bool + i *int + ui *uint + l *int64 + ul *uint64 + b *bool + d *float64 + s *string + sl *[]string +} + +func typedParamsUnpackRaw(prefix string, cparams *C.virTypedParameter, cnparams C.int) ([]TypedParamValue, error) { + ret := []TypedParamValue{} + for n := 0; n < int(cnparams); n++ { + var param TypedParamValue + var cparam *C.virTypedParameter + cparam = (*C.virTypedParameter)(unsafe.Pointer(uintptr(unsafe.Pointer(cparams)) + + (unsafe.Sizeof(*cparam) * uintptr(n)))) + + name := C.GoString(&cparam.field[0]) + + if !strings.HasPrefix(name, prefix) { + continue + } + + param.Name = name[len(prefix):] + + // A union is exposed by CGo as a byte array + value := cparam.value + valueptr := unsafe.Pointer(&value[0]) + + switch cparam._type { + case C.VIR_TYPED_PARAM_INT: + i := int(*(*C.int)(valueptr)) + param.Int = &i + case C.VIR_TYPED_PARAM_UINT: + ui := uint(*(*C.uint)(valueptr)) + param.UInt = &ui + case C.VIR_TYPED_PARAM_LLONG: + l := int64(*(*C.longlong)(valueptr)) + param.Long = &l + case C.VIR_TYPED_PARAM_ULLONG: + ul := uint64(*(*C.ulonglong)(valueptr)) + param.ULong = &ul + case C.VIR_TYPED_PARAM_BOOLEAN: + b := bool(*(*C.char)(valueptr) != 0) + param.Bool = &b + case C.VIR_TYPED_PARAM_DOUBLE: + f := float64(*(*C.double)(valueptr)) + param.Float = &f + case C.VIR_TYPED_PARAM_STRING: + s := C.GoString(*(**C.char)(valueptr)) + param.String = &s + } + + ret = append(ret, param) + } + + return ret, nil +} + +func typedParamsUnpack(cparams *C.virTypedParameter, cnparams C.int, infomap map[string]typedParamsFieldInfo) (uint, error) { + count := uint(0) + for name, value := range infomap { + var err C.virError + var ret C.int + cname := C.CString(name) + defer C.free(unsafe.Pointer(cname)) + if value.sl != nil { + for i := 0; i < int(cnparams); i++ { + var cparam *C.virTypedParameter + cparam = (*C.virTypedParameter)(unsafe.Pointer(uintptr(unsafe.Pointer(cparams)) + + (unsafe.Sizeof(*cparam) * uintptr(i)))) + var cs *C.char + ret = C.virTypedParamsGetStringWrapper(cparam, 1, cname, &cs, &err) + if ret == 1 { + *value.sl = append(*value.sl, C.GoString(cs)) + *value.set = true + count++ + } else if ret < 0 { + break + } + } + } else { + if value.i != nil { + var ci C.int + ret = C.virTypedParamsGetIntWrapper(cparams, cnparams, cname, &ci, &err) + if ret == 1 { + *value.i = int(ci) + } + } else if value.ui != nil { + var cui C.uint + ret = C.virTypedParamsGetUIntWrapper(cparams, cnparams, cname, &cui, &err) + if ret == 1 { + *value.ui = uint(cui) + } + } else if value.l != nil { + var cl C.longlong + ret = C.virTypedParamsGetLLongWrapper(cparams, cnparams, cname, &cl, &err) + if ret == 1 { + *value.l = int64(cl) + } + } else if value.ul != nil { + var cul C.ulonglong + ret = C.virTypedParamsGetULLongWrapper(cparams, cnparams, cname, &cul, &err) + if ret == 1 { + *value.ul = uint64(cul) + } + } else if value.d != nil { + var cd C.double + ret = C.virTypedParamsGetDoubleWrapper(cparams, cnparams, cname, &cd, &err) + if ret == 1 { + *value.d = float64(cd) + } + } else if value.b != nil { + var cb C.int + ret = C.virTypedParamsGetBooleanWrapper(cparams, cnparams, cname, &cb, &err) + if ret == 1 { + if cb == 1 { + *value.b = true + } else { + *value.b = false + } + } + } else if value.s != nil { + var cs *C.char + ret = C.virTypedParamsGetStringWrapper(cparams, cnparams, cname, &cs, &err) + if ret == 1 { + *value.s = C.GoString(cs) + } + } + if ret == 1 { + *value.set = true + count++ + } + } + if ret < 0 { + return count, makeError(&err) + } + } + + return count, nil +} + +func typedParamsNew(nparams C.int) *C.virTypedParameter { + var cparams *C.virTypedParameter + memlen := C.size_t(unsafe.Sizeof(*cparams) * uintptr(nparams)) + cparams = (*C.virTypedParameter)(C.malloc(memlen)) + if cparams == nil { + C.abort() + } + C.memset(unsafe.Pointer(cparams), 0, memlen) + return cparams +} + +func typedParamsPackNew(infomap map[string]typedParamsFieldInfo) (*C.virTypedParameter, C.int, error) { + var cparams C.virTypedParameterPtr + var nparams C.int + var maxparams C.int + + defer C.virTypedParamsFreeWrapper(cparams, nparams) + + for name, value := range infomap { + if !*value.set { + continue + } + + cname := C.CString(name) + defer C.free(unsafe.Pointer(cname)) + if value.sl != nil { + /* We're not actually using virTypedParamsAddStringList, as it is + * easier to avoid creating a 'char **' in Go to hold all the strings. + */ + for i := 0; i < len(*value.sl); i++ { + cvalue := C.CString((*value.sl)[i]) + defer C.free(unsafe.Pointer(cvalue)) + var err C.virError + ret := C.virTypedParamsAddStringWrapper(&cparams, &nparams, &maxparams, cname, cvalue, &err) + if ret < 0 { + return nil, 0, makeError(&err) + } + } + } else { + var err C.virError + var ret C.int + if value.i != nil { + ret = C.virTypedParamsAddIntWrapper(&cparams, &nparams, &maxparams, cname, C.int(*value.i), &err) + } else if value.ui != nil { + ret = C.virTypedParamsAddUIntWrapper(&cparams, &nparams, &maxparams, cname, C.uint(*value.ui), &err) + } else if value.l != nil { + ret = C.virTypedParamsAddLLongWrapper(&cparams, &nparams, &maxparams, cname, C.longlong(*value.l), &err) + } else if value.ul != nil { + ret = C.virTypedParamsAddULLongWrapper(&cparams, &nparams, &maxparams, cname, C.ulonglong(*value.ul), &err) + } else if value.b != nil { + v := 0 + if *value.b { + v = 1 + } + ret = C.virTypedParamsAddBooleanWrapper(&cparams, &nparams, &maxparams, cname, C.int(v), &err) + } else if value.d != nil { + ret = C.virTypedParamsAddDoubleWrapper(&cparams, &nparams, &maxparams, cname, C.double(*value.d), &err) + } else if value.s != nil { + cvalue := C.CString(*value.s) + defer C.free(unsafe.Pointer(cvalue)) + ret = C.virTypedParamsAddStringWrapper(&cparams, &nparams, &maxparams, cname, cvalue, &err) + } else { + return nil, 0, fmt.Errorf("No typed parameter value set for field '%s'", name) + } + if ret < 0 { + return nil, 0, makeError(&err) + } + } + } + + return cparams, nparams, nil +} diff --git a/virt-v2v/.bazerlc b/virt-v2v/.bazerlc deleted file mode 100644 index a3f03bba2..000000000 --- a/virt-v2v/.bazerlc +++ /dev/null @@ -1,7 +0,0 @@ -# Appliance build -# container_run_and_extract() does not work inside Podman and Docker -# sandboxes. Use slightly less secure but working processwrapper sandbox. -# NOTE: Same configuration is in .bazelrc in repository root. -build --strategy_regexp="Action appliance/libguestfs-appliance.tar"=processwrapper-sandbox -build --strategy_regexp="RunAndCommitLayer no-ems-in-fips-layer.tar"=processwrapper-sandbox -build --strategy_regexp="RunAndCommitLayer ca-certificate-from-secret-layer.tar"=processwrapper-sandbox diff --git a/virt-v2v/BUILD.bazel b/virt-v2v/BUILD.bazel deleted file mode 100644 index 9b1961f1c..000000000 --- a/virt-v2v/BUILD.bazel +++ /dev/null @@ -1,451 +0,0 @@ -load( - "@io_bazel_rules_docker//container:container.bzl", - "container_image", - "container_push", -) -load( - "@io_bazel_rules_docker//docker/util:run.bzl", - "container_run_and_commit_layer", - "container_run_and_extract", -) -load("@bazeldnf//:deps.bzl", "rpmtree") -load("@rules_pkg//pkg:tar.bzl", "pkg_tar") - -container_push( - name = "push-forklift-virt-v2v", - format = "Docker", - image = ":forklift-virt-v2v", - registry = "$${REGISTRY:-quay.io}", - repository = "$${REGISTRY_ORG:-}$${REGISTRY_ORG:+/}forklift-virt-v2v", - tag = "$${REGISTRY_TAG:-devel}", -) - -# Appliance build -# NOTE: We deliberately do not use (and cannot use) rpmtree to build a base -# layer with packages. Supermin queries the RPM database to track package files -# and dependencies. Tar constructed by rpmtree is just a bunch of files and it -# does not preserve the RPM database info. Therefore we imitate a Dockerfile -# build here. -container_run_and_extract( - name = "appliance", - commands = [ - "set -x", - "dnf -y update", - # Latest glibc in CentOS Stream 9 causes QEMU in TCG emulation to fail - # to boot and leads to kernel panic. If it is installed revert to older - # version. - "( [ \\\"\\$(rpm -q glibc)\\\" == \\\"glibc-2.34-66.el9.x86_64\\\" ] && dnf -y downgrade glibc-2.34-65.el9.x86_64 || true )", - "dnf -y install libguestfs libguestfs-appliance libguestfs-xfs libguestfs-winsupport qemu-img supermin", - "depmod \\$(ls /lib/modules/ |tail -n1)", - "export LIBGUESTFS_BACKEND=direct", - "export LIBGUESTFS_DEBUG=1 LIBGUESTFS_TRACE=1", - "mkdir -p /usr/lib64/guestfs/appliance", - "cd /usr/lib64/guestfs/appliance", - "libguestfs-make-fixed-appliance .", - "qemu-img convert -c -O qcow2 root root.qcow2", - "mv -vf root.qcow2 root", - "tar -cvf /libguestfs-appliance.tar /usr/lib64/guestfs/appliance", - ], - extract_file = "/libguestfs-appliance.tar", - image = "@centos-stream-9//image", -) - -container_image( - name = "virt-v2v-image", - base = "@ubi9-minimal//image", - directory = "/", - tars = [ - ":virt-v2v", - "appliance/libguestfs-appliance.tar", - ], -) - -container_run_and_commit_layer( - name = "no-ems-in-fips", - commands = [ - "rm /etc/pki/tls/fips_local.cnf", - "echo -e '[fips_sect]\ntls1-prf-ems-check = 0\nactivate = 1' > /etc/pki/tls/fips_local.cnf", - "sed -i '/^\\[ crypto_policy \\]/a Options=RHNoEnforceEMSinFIPS' /etc/pki/tls/openssl.cnf", - ], - image = ":virt-v2v-image.tar", -) - -container_run_and_commit_layer( - name = "ca-certificate-from-secret", - commands = [ - "mv /etc/pki/tls/certs/ca-bundle.crt /etc/pki/tls/certs/ca-bundle.crt.bak", - "ln -sf /opt/ca-bundle.crt /etc/pki/tls/certs/ca-bundle.crt", - ], - image = ":virt-v2v-image.tar", -) - -container_image( - name = "virt-v2v-layer", - base = ":virt-v2v-image", - layers = [ - ":no-ems-in-fips", - ":ca-certificate-from-secret", - ], - visibility = ["//visibility:public"], -) - -container_image( - name = "forklift-virt-v2v", - base = ":virt-v2v-layer", - directory = "/usr/local/bin/", - empty_dirs = ["/disks"], - entrypoint = ["/usr/local/bin/virt-v2v-wrapper"], - env = { - "LIBGUESTFS_BACKEND": "direct", - "LIBGUESTFS_PATH": "/usr/lib64/guestfs/appliance", - }, - files = [ - "//cmd:virt-v2v-wrapper", - "@forklift//cmd/image-converter", - "@forklift//cmd/virt-v2v-monitor", - ], - user = "1001", - visibility = ["//visibility:public"], -) - -rpmtree( - name = "virt-v2v", - rpms = [ - "@acl-0__2.3.1-4.el9.x86_64//rpm", - "@adobe-source-code-pro-fonts-0__2.030.1.050-12.el9.1.x86_64//rpm", - "@alternatives-0__1.24-2.el9.x86_64//rpm", - "@audit-libs-0__3.1.5-1.el9.x86_64//rpm", - "@augeas-libs-0__1.14.1-2.el9.x86_64//rpm", - "@basesystem-0__11-13.el9.x86_64//rpm", - "@bash-0__5.1.8-9.el9.x86_64//rpm", - "@bzip2-0__1.0.8-8.el9.x86_64//rpm", - "@bzip2-libs-0__1.0.8-8.el9.x86_64//rpm", - "@ca-certificates-0__2024.2.69_v8.0.303-91.4.el9.x86_64//rpm", - "@capstone-0__4.0.2-10.el9.x86_64//rpm", - "@centos-gpg-keys-0__9.0-11.el9.x86_64//rpm", - "@centos-stream-release-0__9.0-11.el9.x86_64//rpm", - "@centos-stream-repos-0__9.0-11.el9.x86_64//rpm", - "@cmake-rpm-macros-0__3.26.5-2.el9.x86_64//rpm", - "@coreutils-single-0__8.32-39.el9.x86_64//rpm", - "@cpio-0__2.13-16.el9.x86_64//rpm", - "@cracklib-0__2.9.6-27.el9.x86_64//rpm", - "@cracklib-dicts-0__2.9.6-27.el9.x86_64//rpm", - "@crypto-policies-0__20240828-2.git626aa59.el9.x86_64//rpm", - "@cryptsetup-libs-0__2.7.2-3.el9.x86_64//rpm", - "@curl-minimal-0__7.76.1-31.el9.x86_64//rpm", - "@cyrus-sasl-gssapi-0__2.1.27-21.el9.x86_64//rpm", - "@cyrus-sasl-lib-0__2.1.27-21.el9.x86_64//rpm", - "@daxctl-libs-0__78-2.el9.x86_64//rpm", - "@dbus-1__1.12.20-8.el9.x86_64//rpm", - "@dbus-broker-0__28-7.el9.x86_64//rpm", - "@dbus-common-1__1.12.20-8.el9.x86_64//rpm", - "@device-mapper-9__1.02.202-5.el9.x86_64//rpm", - "@device-mapper-libs-9__1.02.202-5.el9.x86_64//rpm", - "@diffutils-0__3.7-12.el9.x86_64//rpm", - "@dmidecode-1__3.6-1.el9.x86_64//rpm", - "@dracut-0__057-79.git20241127.el9.x86_64//rpm", - "@dwz-0__0.14-3.el9.x86_64//rpm", - "@edk2-ovmf-0__20241117-1.el9.x86_64//rpm", - "@efi-srpm-macros-0__6-2.el9.x86_64//rpm", - "@elfutils-libelf-0__0.192-2.el9.x86_64//rpm", - "@expat-0__2.5.0-4.el9.x86_64//rpm", - "@file-0__5.39-16.el9.x86_64//rpm", - "@file-libs-0__5.39-16.el9.x86_64//rpm", - "@filesystem-0__3.16-5.el9.x86_64//rpm", - "@findutils-1__4.8.0-7.el9.x86_64//rpm", - "@fonts-filesystem-1__2.0.5-7.el9.1.x86_64//rpm", - "@fonts-srpm-macros-1__2.0.5-7.el9.1.x86_64//rpm", - "@fuse-0__2.9.9-17.el9.x86_64//rpm", - "@fuse-common-0__3.10.2-9.el9.x86_64//rpm", - "@fuse-libs-0__2.9.9-17.el9.x86_64//rpm", - "@gawk-0__5.1.0-6.el9.x86_64//rpm", - "@gdbm-libs-1__1.23-1.el9.x86_64//rpm", - "@gettext-0__0.21-8.el9.x86_64//rpm", - "@gettext-libs-0__0.21-8.el9.x86_64//rpm", - "@ghc-srpm-macros-0__1.5.0-6.el9.x86_64//rpm", - "@glib-networking-0__2.68.3-3.el9.x86_64//rpm", - "@glib2-0__2.68.4-16.el9.x86_64//rpm", - "@glibc-0__2.34-148.el9.x86_64//rpm", - "@glibc-common-0__2.34-148.el9.x86_64//rpm", - "@glibc-langpack-en-0__2.34-148.el9.x86_64//rpm", - "@gmp-1__6.2.0-13.el9.x86_64//rpm", - "@gnupg2-0__2.3.3-4.el9.x86_64//rpm", - "@gnutls-0__3.8.3-4.el9.x86_64//rpm", - "@gnutls-dane-0__3.8.3-4.el9.x86_64//rpm", - "@gnutls-utils-0__3.8.3-4.el9.x86_64//rpm", - "@go-srpm-macros-0__3.6.0-7.el9.x86_64//rpm", - "@grep-0__3.6-5.el9.x86_64//rpm", - "@groff-base-0__1.22.4-10.el9.x86_64//rpm", - "@gsettings-desktop-schemas-0__40.0-6.el9.x86_64//rpm", - "@guestfs-tools-0__1.52.2-2.el9.x86_64//rpm", - "@gzip-0__1.12-1.el9.x86_64//rpm", - "@hexedit-0__1.6-1.el9.x86_64//rpm", - "@hivex-libs-0__1.3.24-1.el9.x86_64//rpm", - "@hwdata-0__0.348-9.16.el9.x86_64//rpm", - "@inih-0__49-6.el9.x86_64//rpm", - "@iproute-0__6.2.0-5.el9.x86_64//rpm", - "@iproute-tc-0__6.2.0-5.el9.x86_64//rpm", - "@iptables-libs-0__1.8.10-5.el9.x86_64//rpm", - "@ipxe-roms-qemu-0__20200823-9.git4bd064de.el9.x86_64//rpm", - "@json-c-0__0.14-11.el9.x86_64//rpm", - "@json-glib-0__1.6.6-1.el9.x86_64//rpm", - "@kbd-0__2.4.0-11.el9.x86_64//rpm", - "@kbd-legacy-0__2.4.0-11.el9.x86_64//rpm", - "@kbd-misc-0__2.4.0-11.el9.x86_64//rpm", - "@kernel-core-0__5.14.0-547.el9.x86_64//rpm", - "@kernel-modules-core-0__5.14.0-547.el9.x86_64//rpm", - "@kernel-srpm-macros-0__1.0-13.el9.x86_64//rpm", - "@keyutils-libs-0__1.6.3-3.el9.x86_64//rpm", - "@kmod-0__28-10.el9.x86_64//rpm", - "@kmod-libs-0__28-10.el9.x86_64//rpm", - "@kpartx-0__0.8.7-34.el9.x86_64//rpm", - "@krb5-libs-0__1.21.1-4.el9.x86_64//rpm", - "@less-0__590-5.el9.x86_64//rpm", - "@libacl-0__2.3.1-4.el9.x86_64//rpm", - "@libaio-0__0.3.111-13.el9.x86_64//rpm", - "@libarchive-0__3.5.3-4.el9.x86_64//rpm", - "@libassuan-0__2.5.5-3.el9.x86_64//rpm", - "@libattr-0__2.5.1-3.el9.x86_64//rpm", - "@libblkid-0__2.37.4-20.el9.x86_64//rpm", - "@libbpf-2__1.4.0-1.el9.x86_64//rpm", - "@libbrotli-0__1.0.9-7.el9.x86_64//rpm", - "@libcap-0__2.48-9.el9.x86_64//rpm", - "@libcap-ng-0__0.8.2-7.el9.x86_64//rpm", - "@libcbor-0__0.7.0-5.el9.x86_64//rpm", - "@libcom_err-0__1.46.5-6.el9.x86_64//rpm", - "@libconfig-0__1.7.2-9.el9.x86_64//rpm", - "@libcurl-minimal-0__7.76.1-31.el9.x86_64//rpm", - "@libdb-0__5.3.28-55.el9.x86_64//rpm", - "@libeconf-0__0.4.1-4.el9.x86_64//rpm", - "@libedit-0__3.1-38.20210216cvs.el9.x86_64//rpm", - "@libev-0__4.33-6.el9.x86_64//rpm", - "@libevent-0__2.1.12-8.el9.x86_64//rpm", - "@libfdisk-0__2.37.4-20.el9.x86_64//rpm", - "@libfdt-0__1.6.0-7.el9.x86_64//rpm", - "@libffi-0__3.4.2-8.el9.x86_64//rpm", - "@libfido2-0__1.13.0-2.el9.x86_64//rpm", - "@libgcc-0__11.5.0-2.el9.x86_64//rpm", - "@libgcrypt-0__1.10.0-11.el9.x86_64//rpm", - "@libgomp-0__11.5.0-2.el9.x86_64//rpm", - "@libgpg-error-0__1.42-5.el9.x86_64//rpm", - "@libguestfs-1__1.54.0-3.el9.x86_64//rpm", - "@libguestfs-winsupport-0__9.3-1.el9.x86_64//rpm", - "@libguestfs-xfs-1__1.54.0-3.el9.x86_64//rpm", - "@libibverbs-0__54.0-1.el9.x86_64//rpm", - "@libidn2-0__2.3.0-7.el9.x86_64//rpm", - "@libkcapi-0__1.4.0-2.el9.x86_64//rpm", - "@libkcapi-hmaccalc-0__1.4.0-2.el9.x86_64//rpm", - "@libksba-0__1.5.1-7.el9.x86_64//rpm", - "@libmnl-0__1.0.4-16.el9.x86_64//rpm", - "@libmount-0__2.37.4-20.el9.x86_64//rpm", - "@libnbd-0__1.20.3-1.el9.x86_64//rpm", - "@libnetfilter_conntrack-0__1.0.9-1.el9.x86_64//rpm", - "@libnfnetlink-0__1.0.1-21.el9.x86_64//rpm", - "@libnghttp2-0__1.43.0-6.el9.x86_64//rpm", - "@libnl3-0__3.11.0-1.el9.x86_64//rpm", - "@libosinfo-0__1.10.0-1.el9.x86_64//rpm", - "@libpipeline-0__1.5.3-4.el9.x86_64//rpm", - "@libpkgconf-0__1.7.3-10.el9.x86_64//rpm", - "@libpmem-0__1.12.1-1.el9.x86_64//rpm", - "@libpng-2__1.6.37-12.el9.x86_64//rpm", - "@libproxy-0__0.4.15-35.el9.x86_64//rpm", - "@libpsl-0__0.21.1-5.el9.x86_64//rpm", - "@libpwquality-0__1.4.4-8.el9.x86_64//rpm", - "@librdmacm-0__54.0-1.el9.x86_64//rpm", - "@libseccomp-0__2.5.2-2.el9.x86_64//rpm", - "@libselinux-0__3.6-1.el9.x86_64//rpm", - "@libselinux-utils-0__3.6-1.el9.x86_64//rpm", - "@libsemanage-0__3.6-3.el9.x86_64//rpm", - "@libsepol-0__3.6-2.el9.x86_64//rpm", - "@libsigsegv-0__2.13-4.el9.x86_64//rpm", - "@libslirp-0__4.4.0-8.el9.x86_64//rpm", - "@libsmartcols-0__2.37.4-20.el9.x86_64//rpm", - "@libsoup-0__2.72.0-8.el9.x86_64//rpm", - "@libssh-0__0.10.4-13.el9.x86_64//rpm", - "@libssh-config-0__0.10.4-13.el9.x86_64//rpm", - "@libstdc__plus____plus__-0__11.5.0-2.el9.x86_64//rpm", - "@libtasn1-0__4.16.0-8.el9.x86_64//rpm", - "@libtirpc-0__1.3.3-9.el9.x86_64//rpm", - "@libtool-ltdl-0__2.4.6-46.el9.x86_64//rpm", - "@libtpms-0__0.9.1-4.20211126git1ff6fe1f43.el9.x86_64//rpm", - "@libunistring-0__0.9.10-15.el9.x86_64//rpm", - "@liburing-0__2.5-1.el9.x86_64//rpm", - "@libusbx-0__1.0.26-1.el9.x86_64//rpm", - "@libutempter-0__1.2.1-6.el9.x86_64//rpm", - "@libuuid-0__2.37.4-20.el9.x86_64//rpm", - "@libverto-0__0.3.2-3.el9.x86_64//rpm", - "@libverto-libev-0__0.3.2-3.el9.x86_64//rpm", - "@libvirt-client-0__10.10.0-3.el9.x86_64//rpm", - "@libvirt-daemon-common-0__10.10.0-3.el9.x86_64//rpm", - "@libvirt-daemon-driver-qemu-0__10.10.0-3.el9.x86_64//rpm", - "@libvirt-daemon-driver-secret-0__10.10.0-3.el9.x86_64//rpm", - "@libvirt-daemon-driver-storage-core-0__10.10.0-3.el9.x86_64//rpm", - "@libvirt-daemon-log-0__10.10.0-3.el9.x86_64//rpm", - "@libvirt-libs-0__10.10.0-3.el9.x86_64//rpm", - "@libxcrypt-0__4.4.18-3.el9.x86_64//rpm", - "@libxcrypt-compat-0__4.4.18-3.el9.x86_64//rpm", - "@libxml2-0__2.9.13-6.el9.x86_64//rpm", - "@libxslt-0__1.1.34-9.el9.x86_64//rpm", - "@libzstd-0__1.5.5-1.el9.x86_64//rpm", - "@lua-libs-0__5.4.4-4.el9.x86_64//rpm", - "@lua-srpm-macros-0__1-6.el9.x86_64//rpm", - "@lz4-libs-0__1.9.3-5.el9.x86_64//rpm", - "@lzo-0__2.10-7.el9.x86_64//rpm", - "@lzop-0__1.04-8.el9.x86_64//rpm", - "@man-db-0__2.9.3-7.el9.x86_64//rpm", - "@mingw-binutils-generic-0__2.41-3.el9.x86_64//rpm", - "@mingw-filesystem-base-0__148-3.el9.x86_64//rpm", - "@mingw32-crt-0__11.0.1-3.el9.x86_64//rpm", - "@mingw32-filesystem-0__148-3.el9.x86_64//rpm", - "@mingw32-srvany-0__1.1-3.el9.x86_64//rpm", - "@mpfr-0__4.1.0-7.el9.x86_64//rpm", - "@nbdkit-basic-filters-0__1.38.5-2.el9.x86_64//rpm", - "@nbdkit-basic-plugins-0__1.38.5-2.el9.x86_64//rpm", - "@nbdkit-curl-plugin-0__1.38.5-2.el9.x86_64//rpm", - "@nbdkit-nbd-plugin-0__1.38.5-2.el9.x86_64//rpm", - "@nbdkit-server-0__1.38.5-2.el9.x86_64//rpm", - "@nbdkit-ssh-plugin-0__1.38.5-2.el9.x86_64//rpm", - "@nbdkit-vddk-plugin-0__1.38.5-2.el9.x86_64//rpm", - "@ncurses-0__6.2-10.20210508.el9.x86_64//rpm", - "@ncurses-base-0__6.2-10.20210508.el9.x86_64//rpm", - "@ncurses-libs-0__6.2-10.20210508.el9.x86_64//rpm", - "@ndctl-libs-0__78-2.el9.x86_64//rpm", - "@nettle-0__3.9.1-1.el9.x86_64//rpm", - "@npth-0__1.6-8.el9.x86_64//rpm", - "@numactl-libs-0__2.0.19-1.el9.x86_64//rpm", - "@numad-0__0.5-37.20150602git.el9.x86_64//rpm", - "@ocaml-srpm-macros-0__6-6.el9.x86_64//rpm", - "@openblas-srpm-macros-0__2-11.el9.x86_64//rpm", - "@openldap-0__2.6.8-3.el9.x86_64//rpm", - "@openssh-0__8.7p1-44.el9.x86_64//rpm", - "@openssh-clients-0__8.7p1-44.el9.x86_64//rpm", - "@openssl-1__3.2.2-6.el9.x86_64//rpm", - "@openssl-libs-1__3.2.2-6.el9.x86_64//rpm", - "@osinfo-db-0__20240701-3.el9.x86_64//rpm", - "@osinfo-db-tools-0__1.10.0-1.el9.x86_64//rpm", - "@p11-kit-0__0.25.3-3.el9.x86_64//rpm", - "@p11-kit-trust-0__0.25.3-3.el9.x86_64//rpm", - "@pam-0__1.5.1-23.el9.x86_64//rpm", - "@parted-0__3.5-2.el9.x86_64//rpm", - "@pcre-0__8.44-4.el9.x86_64//rpm", - "@pcre2-0__10.40-6.el9.x86_64//rpm", - "@pcre2-syntax-0__10.40-6.el9.x86_64//rpm", - "@perl-AutoLoader-0__5.74-481.el9.x86_64//rpm", - "@perl-B-0__1.80-481.el9.x86_64//rpm", - "@perl-Carp-0__1.50-460.el9.x86_64//rpm", - "@perl-Class-Struct-0__0.66-481.el9.x86_64//rpm", - "@perl-Data-Dumper-0__2.174-462.el9.x86_64//rpm", - "@perl-Digest-0__1.19-4.el9.x86_64//rpm", - "@perl-Digest-MD5-0__2.58-4.el9.x86_64//rpm", - "@perl-Encode-4__3.08-462.el9.x86_64//rpm", - "@perl-Errno-0__1.30-481.el9.x86_64//rpm", - "@perl-Exporter-0__5.74-461.el9.x86_64//rpm", - "@perl-Fcntl-0__1.13-481.el9.x86_64//rpm", - "@perl-File-Basename-0__2.85-481.el9.x86_64//rpm", - "@perl-File-Path-0__2.18-4.el9.x86_64//rpm", - "@perl-File-Temp-1__0.231.100-4.el9.x86_64//rpm", - "@perl-File-stat-0__1.09-481.el9.x86_64//rpm", - "@perl-FileHandle-0__2.03-481.el9.x86_64//rpm", - "@perl-Getopt-Long-1__2.52-4.el9.x86_64//rpm", - "@perl-Getopt-Std-0__1.12-481.el9.x86_64//rpm", - "@perl-HTTP-Tiny-0__0.076-462.el9.x86_64//rpm", - "@perl-IO-0__1.43-481.el9.x86_64//rpm", - "@perl-IO-Socket-IP-0__0.41-5.el9.x86_64//rpm", - "@perl-IO-Socket-SSL-0__2.073-2.el9.x86_64//rpm", - "@perl-IPC-Open3-0__1.21-481.el9.x86_64//rpm", - "@perl-MIME-Base64-0__3.16-4.el9.x86_64//rpm", - "@perl-Mozilla-CA-0__20200520-6.el9.x86_64//rpm", - "@perl-Net-SSLeay-0__1.94-1.el9.x86_64//rpm", - "@perl-POSIX-0__1.94-481.el9.x86_64//rpm", - "@perl-PathTools-0__3.78-461.el9.x86_64//rpm", - "@perl-Pod-Escapes-1__1.07-460.el9.x86_64//rpm", - "@perl-Pod-Perldoc-0__3.28.01-461.el9.x86_64//rpm", - "@perl-Pod-Simple-1__3.42-4.el9.x86_64//rpm", - "@perl-Pod-Usage-4__2.01-4.el9.x86_64//rpm", - "@perl-Scalar-List-Utils-4__1.56-462.el9.x86_64//rpm", - "@perl-SelectSaver-0__1.02-481.el9.x86_64//rpm", - "@perl-Socket-4__2.031-4.el9.x86_64//rpm", - "@perl-Storable-1__3.21-460.el9.x86_64//rpm", - "@perl-Symbol-0__1.08-481.el9.x86_64//rpm", - "@perl-Term-ANSIColor-0__5.01-461.el9.x86_64//rpm", - "@perl-Term-Cap-0__1.17-460.el9.x86_64//rpm", - "@perl-Text-ParseWords-0__3.30-460.el9.x86_64//rpm", - "@perl-Text-Tabs__plus__Wrap-0__2013.0523-460.el9.x86_64//rpm", - "@perl-Time-Local-2__1.300-7.el9.x86_64//rpm", - "@perl-URI-0__5.09-3.el9.x86_64//rpm", - "@perl-base-0__2.27-481.el9.x86_64//rpm", - "@perl-constant-0__1.33-461.el9.x86_64//rpm", - "@perl-if-0__0.60.800-481.el9.x86_64//rpm", - "@perl-interpreter-4__5.32.1-481.el9.x86_64//rpm", - "@perl-libnet-0__3.13-4.el9.x86_64//rpm", - "@perl-libs-4__5.32.1-481.el9.x86_64//rpm", - "@perl-mro-0__1.23-481.el9.x86_64//rpm", - "@perl-overload-0__1.31-481.el9.x86_64//rpm", - "@perl-overloading-0__0.02-481.el9.x86_64//rpm", - "@perl-parent-1__0.238-460.el9.x86_64//rpm", - "@perl-podlators-1__4.14-460.el9.x86_64//rpm", - "@perl-srpm-macros-0__1-41.el9.x86_64//rpm", - "@perl-subs-0__1.03-481.el9.x86_64//rpm", - "@perl-vars-0__1.05-481.el9.x86_64//rpm", - "@pigz-0__2.5-4.el9.x86_64//rpm", - "@pixman-0__0.40.0-6.el9.x86_64//rpm", - "@pkgconf-0__1.7.3-10.el9.x86_64//rpm", - "@policycoreutils-0__3.6-2.1.el9.x86_64//rpm", - "@polkit-0__0.117-13.el9.x86_64//rpm", - "@polkit-libs-0__0.117-13.el9.x86_64//rpm", - "@popt-0__1.18-8.el9.x86_64//rpm", - "@procps-ng-0__3.3.17-14.el9.x86_64//rpm", - "@protobuf-c-0__1.3.3-13.el9.x86_64//rpm", - "@psmisc-0__23.4-3.el9.x86_64//rpm", - "@publicsuffix-list-dafsa-0__20210518-3.el9.x86_64//rpm", - "@pyproject-srpm-macros-0__1.16.2-1.el9.x86_64//rpm", - "@qemu-img-17__9.1.0-8.el9.x86_64//rpm", - "@qemu-kvm-common-17__9.1.0-8.el9.x86_64//rpm", - "@qemu-kvm-core-17__9.1.0-8.el9.x86_64//rpm", - "@qt5-srpm-macros-0__5.15.9-1.el9.x86_64//rpm", - "@readline-0__8.1-4.el9.x86_64//rpm", - "@redhat-rpm-config-0__208-1.el9.x86_64//rpm", - "@rpm-0__4.16.1.3-36.el9.x86_64//rpm", - "@rpm-libs-0__4.16.1.3-36.el9.x86_64//rpm", - "@rpm-plugin-selinux-0__4.16.1.3-36.el9.x86_64//rpm", - "@rust-srpm-macros-0__17-4.el9.x86_64//rpm", - "@scrub-0__2.6.1-4.el9.x86_64//rpm", - "@seabios-bin-0__1.16.3-4.el9.x86_64//rpm", - "@seavgabios-bin-0__1.16.3-4.el9.x86_64//rpm", - "@sed-0__4.8-9.el9.x86_64//rpm", - "@selinux-policy-0__38.1.50-1.el9.x86_64//rpm", - "@selinux-policy-targeted-0__38.1.50-1.el9.x86_64//rpm", - "@setup-0__2.13.7-10.el9.x86_64//rpm", - "@shadow-utils-2__4.9-12.el9.x86_64//rpm", - "@snappy-0__1.1.8-8.el9.x86_64//rpm", - "@sqlite-libs-0__3.34.1-7.el9.x86_64//rpm", - "@swtpm-0__0.8.0-2.el9.x86_64//rpm", - "@swtpm-libs-0__0.8.0-2.el9.x86_64//rpm", - "@swtpm-tools-0__0.8.0-2.el9.x86_64//rpm", - "@systemd-0__252-49.el9.x86_64//rpm", - "@systemd-container-0__252-49.el9.x86_64//rpm", - "@systemd-libs-0__252-49.el9.x86_64//rpm", - "@systemd-pam-0__252-49.el9.x86_64//rpm", - "@systemd-rpm-macros-0__252-49.el9.x86_64//rpm", - "@systemd-udev-0__252-49.el9.x86_64//rpm", - "@tar-2__1.34-7.el9.x86_64//rpm", - "@tpm2-tss-0__3.2.3-1.el9.x86_64//rpm", - "@tzdata-0__2024b-3.el9.x86_64//rpm", - "@unbound-libs-0__1.16.2-8.el9.x86_64//rpm", - "@unzip-0__6.0-57.el9.x86_64//rpm", - "@userspace-rcu-0__0.12.1-6.el9.x86_64//rpm", - "@util-linux-0__2.37.4-20.el9.x86_64//rpm", - "@util-linux-core-0__2.37.4-20.el9.x86_64//rpm", - "@vim-minimal-2__8.2.2637-21.el9.x86_64//rpm", - "@virt-v2v-1__2.7.1-2.el9.x86_64//rpm", - "@virtio-win-1.9.40-1.el9.noarch//rpm", - "@which-0__2.21-29.el9.x86_64//rpm", - "@xfsprogs-0__6.4.0-5.el9.x86_64//rpm", - "@xz-0__5.2.5-8.el9.x86_64//rpm", - "@xz-libs-0__5.2.5-8.el9.x86_64//rpm", - "@zip-0__3.0-35.el9.x86_64//rpm", - "@zlib-0__1.2.11-40.el9.x86_64//rpm", - "@zstd-0__1.5.5-1.el9.x86_64//rpm", - ], - visibility = ["//visibility:public"], -) diff --git a/virt-v2v/WORKSPACE b/virt-v2v/WORKSPACE deleted file mode 100644 index f627a06ad..000000000 --- a/virt-v2v/WORKSPACE +++ /dev/null @@ -1,2891 +0,0 @@ -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file") - -local_repository( - name = "forklift", - path = ".", -) - -http_archive( - name = "io_bazel_rules_go", - sha256 = "91585017debb61982f7054c9688857a2ad1fd823fc3f9cb05048b0025c47d023", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.42.0/rules_go-v0.42.0.zip", - "https://github.com/bazelbuild/rules_go/releases/download/v0.42.0/rules_go-v0.42.0.zip", - ], -) - -http_archive( - name = "bazel_gazelle", - sha256 = "d3fa66a39028e97d76f9e2db8f1b0c11c099e8e01bf363a923074784e451f809", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.33.0/bazel-gazelle-v0.33.0.tar.gz", - "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.33.0/bazel-gazelle-v0.33.0.tar.gz", - ], -) - -http_archive( - name = "io_bazel_rules_docker", - sha256 = "b1e80761a8a8243d03ebca8845e9cc1ba6c82ce7c5179ce2b295cd36f7e394bf", - urls = [ - "https://github.com/bazelbuild/rules_docker/releases/download/v0.25.0/rules_docker-v0.25.0.tar.gz", - ], -) - -http_archive( - name = "rules_proto", - sha256 = "dc3fb206a2cb3441b485eb1e423165b231235a1ea9b031b4433cf7bc1fa460dd", - strip_prefix = "rules_proto-5.3.0-21.7", - urls = [ - "https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz", - ], -) - -http_file( - name = "cirros", - downloaded_file_path = "cirros.raw", - sha256 = "cc704ab14342c1c8a8d91b66a7fc611d921c8b8f1aaf4695f9d6463d913fa8d1", - urls = [ - "https://github.com/cirros-dev/cirros/releases/download/0.6.1/cirros-0.6.1-x86_64-disk.img", - "https://download.cirros-cloud.net/0.6.1/cirros-0.6.1-x86_64-disk.img", - ], -) - -load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") - -rules_proto_dependencies() - -rules_proto_toolchains() - -load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository") - -go_repository( - name = "com_github_klauspost_compress", - importpath = "github.com/klauspost/compress", - sum = "h1:eLeJ3dr/Y9+XRfJT4l+8ZjmtB5RPJhucH2HeCV5+IZY=", - version = "v1.10.8", -) - -go_repository( - name = "com_github_xi2_xz", - importpath = "github.com/xi2/xz", - sum = "h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo=", - version = "v0.0.0-20171230120015-48954b6210f8", -) - -go_repository( - name = "org_golang_x_crypto", - importpath = "golang.org/x/crypto", - sum = "h1:hb9wdF1z5waM+dSIICn1l0DkLVDT3hqhhQsDNUmHPRE=", - version = "v0.0.0-20201002170205-7f63de1d35b0", -) - -go_repository( - name = "in_gopkg_yaml_v2", - importpath = "gopkg.in/yaml.v2", - sum = "h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=", - version = "v2.3.0", -) - -go_repository( - name = "in_gopkg_yaml_v3", - importpath = "gopkg.in/yaml.v3", - sum = "h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ=", - version = "v3.0.0-20200615113413-eeeca48fe776", -) - -go_repository( - name = "org_golang_x_sys", - importpath = "golang.org/x/sys", - sum = "h1:JWgyZ1qgdTaF3N3oxC+MdTV7qvEEgHo3otj+HB5CM7Q=", - version = "v0.0.0-20210603081109-ebe580a85c40", -) - -go_repository( - name = "com_github_spf13_pflag", - importpath = "github.com/spf13/pflag", - sum = "h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=", - version = "v1.0.5", -) - -go_repository( - name = "com_github_pkg_errors", - importpath = "github.com/pkg/errors", - sum = "h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=", - version = "v0.9.1", -) - -load( - "@io_bazel_rules_docker//toolchains/docker:toolchain.bzl", - docker_toolchain_configure = "toolchain_configure", -) - -docker_toolchain_configure( - name = "docker_config", - docker_flags = [ - "--log-level=info", - ], - docker_path = "${CONTAINER_CMD:-$(command -v podman||command -v docker)}", -) - -load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") -load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository") - -go_rules_dependencies() - -# NOTE: Keep the version in sync with Go toolchain in GitHub action. -go_register_toolchains(version = "1.21.9") - -# override rules_docker issue with this dependency -# rules_docker 0.16 uses 0.1.4, bit since there the checksum changed, which is very weird, going with 0.1.4.1 to -go_repository( - name = "com_github_google_go_containerregistry", - importpath = "github.com/google/go-containerregistry", - sha256 = "bc0136a33f9c1e4578a700f7afcdaa1241cfff997d6bba695c710d24c5ae26bd", - strip_prefix = "google-go-containerregistry-efb2d62", - type = "tar.gz", - urls = ["https://api.github.com/repos/google/go-containerregistry/tarball/efb2d62d93a7705315b841d0544cb5b13565ff2a"], # v0.1.4.1 -) - -# All dependencies defined with go_repository should be above -# gazelle_dependencies. Otherwise dependencies defined by Gazelle would be used -# because the first definitions of external repository wins. -gazelle_dependencies() - -http_archive( - name = "rules_pkg", - sha256 = "8c20f74bca25d2d442b327ae26768c02cf3c99e93fad0381f32be9aab1967675", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.8.1/rules_pkg-0.8.1.tar.gz", - "https://github.com/bazelbuild/rules_pkg/releases/download/0.8.1/rules_pkg-0.8.1.tar.gz", - ], -) - -load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") - -rules_pkg_dependencies() - -load( - "@io_bazel_rules_docker//container:container.bzl", - "container_pull", -) -load( - "@io_bazel_rules_docker//repositories:repositories.bzl", - container_repositories = "repositories", -) - -container_repositories() - -http_archive( - name = "bazeldnf", - sha256 = "de8ac0519db6c02bed2a976885379d97dc52f46d52b0338e03963def5c2b65fb", - urls = [ - "https://github.com/rmohr/bazeldnf/releases/download/v0.5.7-rc1/bazeldnf-v0.5.7-rc1.tar.gz", - ], -) - -load( - "@io_bazel_rules_go//go:deps.bzl", - "go_register_toolchains", - "go_rules_dependencies", -) -load("@bazeldnf//:deps.bzl", "bazeldnf_dependencies", "rpm") - -bazeldnf_dependencies() - -container_pull( - name = "centos-stream-9", - registry = "quay.io", - repository = "centos/centos", - # Here we prefer using tag over a digest. CentOS rebuilds images often and - # does not keep older images. That means we would need to update the digest - # regularly. Also the assumption about reproducible builds is dubious - # because of our use of container_run_and_extract() during build. - tag = "stream9", -) - -container_pull( - name = "ubi9-minimal", - registry = "registry.access.redhat.com", - repository = "ubi9/ubi-minimal", - tag = "latest", -) - -rpm( - name = "acl-0__2.3.1-4.el9.x86_64", - sha256 = "ef31699d8c9ec9775e14e4bb3f9cd780288b2c0de3d3c57b6e33d388afba9876", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/acl-2.3.1-4.el9.x86_64.rpm", - ], -) - -rpm( - name = "adobe-source-code-pro-fonts-0__2.030.1.050-12.el9.1.x86_64", - sha256 = "e171adbef98c07975fda991d0a1b22bdfce7a1e0259d7cc8cf929bca36946e0d", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/adobe-source-code-pro-fonts-2.030.1.050-12.el9.1.noarch.rpm", - ], -) - -rpm( - name = "alternatives-0__1.24-2.el9.x86_64", - sha256 = "520c418f670fdd1735f2f605c6b62d2fb801501b5b5653a39d45a3dfd4411d45", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/alternatives-1.24-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "audit-libs-0__3.1.5-1.el9.x86_64", - sha256 = "c152e73767630f4781480c2866935dfc0991bd3da475e9507d016cc7f26da85c", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/audit-libs-3.1.5-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "augeas-libs-0__1.14.1-2.el9.x86_64", - sha256 = "7fdf9697d6674b44533615883111c1753c2fd2196509fd63cf86effe2dad0cbc", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/augeas-libs-1.14.1-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "basesystem-0__11-13.el9.x86_64", - sha256 = "2ea5b1c117cf96a8f0cdba2cf67776c2934c286e2107f8e6ba0357a63f947a03", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/basesystem-11-13.el9.noarch.rpm", - ], -) - -rpm( - name = "bash-0__5.1.8-9.el9.x86_64", - sha256 = "ef7898e1ad43e638d3cb336bb2fbfc4160203568c30a7e955a0317b9a35406a6", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/bash-5.1.8-9.el9.x86_64.rpm", - ], -) - -rpm( - name = "bzip2-0__1.0.8-8.el9.x86_64", - sha256 = "dc263768247f8407ade7bcd80d1dd486b9aade3ee8f6b8196ab7ffc202307607", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/bzip2-1.0.8-8.el9.x86_64.rpm", - ], -) - -rpm( - name = "bzip2-libs-0__1.0.8-8.el9.x86_64", - sha256 = "339ff9bae82e635de5039bc6ff8be3130514d711f9b8e5a162e8e870fbfdfae2", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/bzip2-libs-1.0.8-8.el9.x86_64.rpm", - ], -) - -rpm( - name = "ca-certificates-0__2024.2.69_v8.0.303-91.4.el9.x86_64", - sha256 = "345cfd71983f45555db1f5c23e155f8f6720d640b68f54538c512cdc7b791432", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/ca-certificates-2024.2.69_v8.0.303-91.4.el9.noarch.rpm", - ], -) - -rpm( - name = "capstone-0__4.0.2-10.el9.x86_64", - sha256 = "6846469181ddbc77d78990ce3012a929d1cb3102dceb26fbd9887367f0b689ab", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/capstone-4.0.2-10.el9.x86_64.rpm", - ], -) - -rpm( - name = "centos-gpg-keys-0__9.0-11.el9.x86_64", - sha256 = "72cba4981776b788dde10451dfd538df1651311ea30281108f6ac290f1d78ea5", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/centos-gpg-keys-9.0-11.el9.noarch.rpm", - ], -) - -rpm( - name = "centos-stream-release-0__9.0-11.el9.x86_64", - sha256 = "997fecdc6da163649356bdff0f33e4f00c114e09609d1d4288fc72d10bc188bf", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/centos-stream-release-9.0-11.el9.noarch.rpm", - ], -) - -rpm( - name = "centos-stream-repos-0__9.0-11.el9.x86_64", - sha256 = "bf73192c94f403df472a26c69ae20a27a5320df2e487ab38c207036cac536205", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/centos-stream-repos-9.0-11.el9.noarch.rpm", - ], -) - -rpm( - name = "cmake-rpm-macros-0__3.26.5-2.el9.x86_64", - sha256 = "3bf2b2c3d4583db306ee452e43e2a3b07ce3f29b928ae0a9fa46afafb1694b8a", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/cmake-rpm-macros-3.26.5-2.el9.noarch.rpm", - ], -) - -rpm( - name = "coreutils-single-0__8.32-39.el9.x86_64", - sha256 = "65e9fd2ee40cc97d87a426df6102082fc4fb27cfc8f9e09b7632ef4a0e75f992", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/coreutils-single-8.32-39.el9.x86_64.rpm", - ], -) - -rpm( - name = "cpio-0__2.13-16.el9.x86_64", - sha256 = "c0f30a12f81ee280b09903958fda32da1dd17d8e77ec9f0143a918cf2dca8a90", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/cpio-2.13-16.el9.x86_64.rpm", - ], -) - -rpm( - name = "cracklib-0__2.9.6-27.el9.x86_64", - sha256 = "4b9da39ce264aae2eca0d46339aa4e2157f17ee5c7caee0612c7ba45352bad4d", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/cracklib-2.9.6-27.el9.x86_64.rpm", - ], -) - -rpm( - name = "cracklib-dicts-0__2.9.6-27.el9.x86_64", - sha256 = "0b150dc52d00f0fb765a658f452584fd553b296f19da30df95520da9e1c8e50f", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/cracklib-dicts-2.9.6-27.el9.x86_64.rpm", - ], -) - -rpm( - name = "crypto-policies-0__20240828-2.git626aa59.el9.x86_64", - sha256 = "56dbf9c5d48f5b46ce4e39b4f2eff1d7e93901dea3b00cb9b62ebf84d905dba7", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/crypto-policies-20240828-2.git626aa59.el9.noarch.rpm", - ], -) - -rpm( - name = "cryptsetup-libs-0__2.7.2-3.el9.x86_64", - sha256 = "389afd35635401244c2fcdbfb5d11ec18cb838c2186bc7ec8e5785bc1a198be4", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/cryptsetup-libs-2.7.2-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "curl-minimal-0__7.76.1-31.el9.x86_64", - sha256 = "3f1fa51412b82574a44a4af083fc5a1e59ada73214fd99c2e7faeddf6245e430", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/curl-minimal-7.76.1-31.el9.x86_64.rpm", - ], -) - -rpm( - name = "cyrus-sasl-gssapi-0__2.1.27-21.el9.x86_64", - sha256 = "1eef1a83cc8294136d327d8a9b6d130b6acb9082233eb63957bdd1ab7386f42d", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/cyrus-sasl-gssapi-2.1.27-21.el9.x86_64.rpm", - ], -) - -rpm( - name = "cyrus-sasl-lib-0__2.1.27-21.el9.x86_64", - sha256 = "54c23bdba8e22e5dec8a9dc63036940c0fd41e31e12d54331e66ef65e2abe1ad", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/cyrus-sasl-lib-2.1.27-21.el9.x86_64.rpm", - ], -) - -rpm( - name = "daxctl-libs-0__78-2.el9.x86_64", - sha256 = "ea73c055c6217c16ddf5fde584c6473344ec1b03b4c89459a58440971da1ca5c", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/daxctl-libs-78-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "dbus-1__1.12.20-8.el9.x86_64", - sha256 = "014d753537635033b96b35ad4962e795ae286d3e0114f0be1ce213cb7e4fd68e", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/dbus-1.12.20-8.el9.x86_64.rpm", - ], -) - -rpm( - name = "dbus-broker-0__28-7.el9.x86_64", - sha256 = "1819b8000a02ea70a2cf8a1710e435b53f9e429b322578e00760860397f0adf5", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/dbus-broker-28-7.el9.x86_64.rpm", - ], -) - -rpm( - name = "dbus-common-1__1.12.20-8.el9.x86_64", - sha256 = "6d398f4d0ac1d15065d9870d612326fac16feb5ab3bf2ebaca4b6f41b1d5a3bc", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/dbus-common-1.12.20-8.el9.noarch.rpm", - ], -) - -rpm( - name = "device-mapper-9__1.02.202-5.el9.x86_64", - sha256 = "3f570c0783b853fe6cfe5b9d4296ec7a7da20c7b21a56d007bc73240cdc1cc3e", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/device-mapper-1.02.202-5.el9.x86_64.rpm", - ], -) - -rpm( - name = "device-mapper-libs-9__1.02.202-5.el9.x86_64", - sha256 = "a3e28f9458a212154524b6a87bdbed347d74baf18bcd23ab6227f699e0ea6462", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/device-mapper-libs-1.02.202-5.el9.x86_64.rpm", - ], -) - -rpm( - name = "diffutils-0__3.7-12.el9.x86_64", - sha256 = "f7c6d4ee24b812db5178f48ca059df692ea1a18ceab013e9eee4dbe251d20783", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/diffutils-3.7-12.el9.x86_64.rpm", - ], -) - -rpm( - name = "dmidecode-1__3.6-1.el9.x86_64", - sha256 = "3fef51d7df65d0fbc09d6519f9c0a4fb0656ac5e4fb095d3ef76f24550b84886", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/dmidecode-3.6-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "dracut-0__057-79.git20241127.el9.x86_64", - sha256 = "6e079ccec010fb7c5285fbb735b79a7c69d7179fc37c56f6b2a6fa9e3900b801", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/dracut-057-79.git20241127.el9.x86_64.rpm", - ], -) - -rpm( - name = "dwz-0__0.14-3.el9.x86_64", - sha256 = "033a94947df8d13295142a546b5f35dc7d44c6a130ee95d1bef551b4711ed976", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/dwz-0.14-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "edk2-ovmf-0__20241117-1.el9.x86_64", - sha256 = "05d708f57bd0e4d6588869aa35aa7861ff31a51244730525d47a3108643d5f2f", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/edk2-ovmf-20241117-1.el9.noarch.rpm", - ], -) - -rpm( - name = "efi-srpm-macros-0__6-2.el9.x86_64", - sha256 = "13d99de6a0b3444a63d31a09dd0c708de2162f7ef3cc87e5e24a06a3274dc7a1", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/efi-srpm-macros-6-2.el9.noarch.rpm", - ], -) - -rpm( - name = "elfutils-libelf-0__0.192-2.el9.x86_64", - sha256 = "027b982d474e68dc637c185afbbe313b4856fac8474ee0eade18f7a567f492b1", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/elfutils-libelf-0.192-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "expat-0__2.5.0-4.el9.x86_64", - sha256 = "8fb6eed4945d4b10173031bb14a20083256259ad358ba0009f8c2dc4cd37536a", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/expat-2.5.0-4.el9.x86_64.rpm", - ], -) - -rpm( - name = "file-0__5.39-16.el9.x86_64", - sha256 = "785aeaa01cc3bc12a9b8a5ce92b20e7e9a95d9af88fb62d07a03ecac3b521edf", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/file-5.39-16.el9.x86_64.rpm", - ], -) - -rpm( - name = "file-libs-0__5.39-16.el9.x86_64", - sha256 = "3e234cc4673d69a5ba3583107d30827e76adcc9aeec0095e0db85633b571d7c9", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/file-libs-5.39-16.el9.x86_64.rpm", - ], -) - -rpm( - name = "filesystem-0__3.16-5.el9.x86_64", - sha256 = "e3389fe64db8e7527873791f3d57b7ba5db47bc0a9661f187667c43e8dbb7b7d", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/filesystem-3.16-5.el9.x86_64.rpm", - ], -) - -rpm( - name = "findutils-1__4.8.0-7.el9.x86_64", - sha256 = "a48399a170d02b1ec9c1699c3c3a630affdcde3c3eb8f3c5f269c63c0a9563ba", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/findutils-4.8.0-7.el9.x86_64.rpm", - ], -) - -rpm( - name = "fonts-filesystem-1__2.0.5-7.el9.1.x86_64", - sha256 = "08604a309edf909c48e69a4d96ef82cdd9c566e0cf4dfe873e935f1c3a87f09b", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/fonts-filesystem-2.0.5-7.el9.1.noarch.rpm", - ], -) - -rpm( - name = "fonts-srpm-macros-1__2.0.5-7.el9.1.x86_64", - sha256 = "72afcecfd924df7c174a2fcaceeeb15cde054b8d1378c87efef59cbbbfe9f393", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/fonts-srpm-macros-2.0.5-7.el9.1.noarch.rpm", - ], -) - -rpm( - name = "fuse-0__2.9.9-17.el9.x86_64", - sha256 = "782a340fda6b85107a2d9dbdfb4811dd7f8b980e58e3a7b9ec66fd88bf7ccf43", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/fuse-2.9.9-17.el9.x86_64.rpm", - ], -) - -rpm( - name = "fuse-common-0__3.10.2-9.el9.x86_64", - sha256 = "b1c9f194a66c2d2ef9654ec2d4089620ad08b7586339bebfbea96a759bbaa337", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/fuse-common-3.10.2-9.el9.x86_64.rpm", - ], -) - -rpm( - name = "fuse-libs-0__2.9.9-17.el9.x86_64", - sha256 = "e93a30842853aded30a0c32bacc1f04a164afd7357d634d34dedead2cb0634b2", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/fuse-libs-2.9.9-17.el9.x86_64.rpm", - ], -) - -rpm( - name = "gawk-0__5.1.0-6.el9.x86_64", - sha256 = "0119e036237ba549b66404b6107c02023896eaae4e08fda4b296dbe9fb59c8f3", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/gawk-5.1.0-6.el9.x86_64.rpm", - ], -) - -rpm( - name = "gdbm-libs-1__1.23-1.el9.x86_64", - sha256 = "adbdf6d81052d0cdc95fbdd5e5d456fe9a268cf1a35edf347ffea1271b11c86f", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/gdbm-libs-1.23-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "gettext-0__0.21-8.el9.x86_64", - sha256 = "56564cd32dabd7257466524977443b0fe7452c73938ad8f04f9cb0cb907e15fa", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/gettext-0.21-8.el9.x86_64.rpm", - ], -) - -rpm( - name = "gettext-libs-0__0.21-8.el9.x86_64", - sha256 = "a04cdd7c813dcea3445af3ea024ee7ca8f958eedcd25097827b4b3389f024ea9", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/gettext-libs-0.21-8.el9.x86_64.rpm", - ], -) - -rpm( - name = "ghc-srpm-macros-0__1.5.0-6.el9.x86_64", - sha256 = "a32551475d3337c4ebc0e1218ef62722ae36ee3bbd88c826725ebe5392b472ec", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/ghc-srpm-macros-1.5.0-6.el9.noarch.rpm", - ], -) - -rpm( - name = "glib-networking-0__2.68.3-3.el9.x86_64", - sha256 = "86f8ccd5dd2e6704e658f39d09744e7a66c2592c6ce5dcf28caa0e9b189d82db", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/glib-networking-2.68.3-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "glib2-0__2.68.4-16.el9.x86_64", - sha256 = "8b7662306f8e4dad2083e2a5c684818aafe498052ca6f0c978d84b91a3dfb523", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/glib2-2.68.4-16.el9.x86_64.rpm", - ], -) - -rpm( - name = "glibc-0__2.34-148.el9.x86_64", - sha256 = "b96a9c1f5b320d5480074dda01a881229e1edde0d7af02267f8b8d3c4c9665c0", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/glibc-2.34-148.el9.x86_64.rpm", - ], -) - -rpm( - name = "glibc-common-0__2.34-148.el9.x86_64", - sha256 = "6ca6ea312e24a25bffc72aa9c958600e305f81b426748947b2d37a2d6a049f34", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/glibc-common-2.34-148.el9.x86_64.rpm", - ], -) - -rpm( - name = "glibc-langpack-en-0__2.34-148.el9.x86_64", - sha256 = "42ab920a735c5c66bb0f6edb81ba68c53d31753a34c38a55b05a664061164a54", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/glibc-langpack-en-2.34-148.el9.x86_64.rpm", - ], -) - -rpm( - name = "gmp-1__6.2.0-13.el9.x86_64", - sha256 = "932d8eb40b6b66bf6f54d95b8aa70c9f749951f719591f0b242753a60aef4b2b", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/gmp-6.2.0-13.el9.x86_64.rpm", - ], -) - -rpm( - name = "gnupg2-0__2.3.3-4.el9.x86_64", - sha256 = "98b65c2540941874489dbd2772c7168d232a1d2456cfc15032437b7f3f3fb1c2", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/gnupg2-2.3.3-4.el9.x86_64.rpm", - ], -) - -rpm( - name = "gnutls-0__3.8.3-4.el9.x86_64", - sha256 = "feaaa4dcb80f6433fedb61c5fc3870134faaf40656e028006731ea421b754328", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/gnutls-3.8.3-4.el9.x86_64.rpm", - ], -) - -rpm( - name = "gnutls-dane-0__3.8.3-4.el9.x86_64", - sha256 = "02d5e0864a7144de006015ac191616e4ecf29f9b08ce6eef39f5fc3a08c8fa20", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/gnutls-dane-3.8.3-4.el9.x86_64.rpm", - ], -) - -rpm( - name = "gnutls-utils-0__3.8.3-4.el9.x86_64", - sha256 = "3571b0a4e5f266966f3dae3d8dc256d4e5fccbdf066458fb5bb7a61ec7aaf71a", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/gnutls-utils-3.8.3-4.el9.x86_64.rpm", - ], -) - -rpm( - name = "go-srpm-macros-0__3.6.0-7.el9.x86_64", - sha256 = "f12b2ca6577793cf84d783c79c0b37375d85264dd246edf2595ac38f28873c26", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/go-srpm-macros-3.6.0-7.el9.noarch.rpm", - ], -) - -rpm( - name = "grep-0__3.6-5.el9.x86_64", - sha256 = "1b77e1fc2072e009f6d2eb6216192e487cdae4d18dcd7063882319dbcc03861e", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/grep-3.6-5.el9.x86_64.rpm", - ], -) - -rpm( - name = "groff-base-0__1.22.4-10.el9.x86_64", - sha256 = "043232fcbdfeceff1c38fd8c3f95d022de1293b152574cc3097495363dd938b7", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/groff-base-1.22.4-10.el9.x86_64.rpm", - ], -) - -rpm( - name = "gsettings-desktop-schemas-0__40.0-6.el9.x86_64", - sha256 = "6c1d4e7b98a088646745f22464f751329f13953db672205ba4310d22b320005a", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/gsettings-desktop-schemas-40.0-6.el9.x86_64.rpm", - ], -) - -rpm( - name = "guestfs-tools-0__1.52.2-2.el9.x86_64", - sha256 = "b328fafecab3a7a56c1057916ab2c0f139e9c9c998f51f4f854c52b922b012b4", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/guestfs-tools-1.52.2-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "gzip-0__1.12-1.el9.x86_64", - sha256 = "d5581fd4a1fb514db61a9563bed473e2bfbf5f74d733e3c547db9ec7fd5d8951", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/gzip-1.12-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "hexedit-0__1.6-1.el9.x86_64", - sha256 = "de1ef4056e83660e3e7ecfb3bfc2be03990b115db7d3240c58577242617adce1", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/hexedit-1.6-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "hivex-libs-0__1.3.24-1.el9.x86_64", - sha256 = "a1a8d40d341c535cbeeabdf327a196835d93f2a40be25eea5c01d41e79760c34", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/hivex-libs-1.3.24-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "hwdata-0__0.348-9.16.el9.x86_64", - sha256 = "a574640aa7eef8caafbb60d74ef05985cacc60aa0dd032888301b23b65911a46", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/hwdata-0.348-9.16.el9.noarch.rpm", - ], -) - -rpm( - name = "inih-0__49-6.el9.x86_64", - sha256 = "c3954ad20cd6551bee1863cbefd6ad949766dc7de00eb3b9fca4cd01b7861b21", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/inih-49-6.el9.x86_64.rpm", - ], -) - -rpm( - name = "iproute-0__6.2.0-5.el9.x86_64", - sha256 = "6e08ab402a6c4ed5debb90cf831af14dd52effe5e04f144dd737ada2ea8d976a", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/iproute-6.2.0-5.el9.x86_64.rpm", - ], -) - -rpm( - name = "iproute-tc-0__6.2.0-5.el9.x86_64", - sha256 = "4c8b9f434ce9a835032523992353eb1379722f137caddea80bbbd9b8e64762c8", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/iproute-tc-6.2.0-5.el9.x86_64.rpm", - ], -) - -rpm( - name = "iptables-libs-0__1.8.10-5.el9.x86_64", - sha256 = "0715cb790ff4725209ce17799ad7a92be62cb3ffeecd61aeb875f5364687aaf8", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/iptables-libs-1.8.10-5.el9.x86_64.rpm", - ], -) - -rpm( - name = "ipxe-roms-qemu-0__20200823-9.git4bd064de.el9.x86_64", - sha256 = "26a1ebd5c064156a4b2db6b7e260611be78e229d953caf6d1ee5929981fc0c2f", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/ipxe-roms-qemu-20200823-9.git4bd064de.el9.noarch.rpm", - ], -) - -rpm( - name = "json-c-0__0.14-11.el9.x86_64", - sha256 = "1a0049dbf91fd27841da0b26187943baec0a5b3ec11cec415b715c03e4c13d72", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/json-c-0.14-11.el9.x86_64.rpm", - ], -) - -rpm( - name = "json-glib-0__1.6.6-1.el9.x86_64", - sha256 = "10733ff36161eac979a3d5f27999da94030e4f30bcef3cc2d56e92cc1747f405", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/json-glib-1.6.6-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "kbd-0__2.4.0-11.el9.x86_64", - sha256 = "6c025f2905ea356024502e45e3b4276682ae828ca209f847d287afa876e11230", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/kbd-2.4.0-11.el9.x86_64.rpm", - ], -) - -rpm( - name = "kbd-legacy-0__2.4.0-11.el9.x86_64", - sha256 = "7b58678dbcdfdf8651c8cdf26f1fb03ae1fd6c5e9a5799ac49204803a5ea68e9", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/kbd-legacy-2.4.0-11.el9.noarch.rpm", - ], -) - -rpm( - name = "kbd-misc-0__2.4.0-11.el9.x86_64", - sha256 = "8a911323cc2d62521d250e646c4b6662b1025c4b8e5300433d7d2700a90c25a1", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/kbd-misc-2.4.0-11.el9.noarch.rpm", - ], -) - -rpm( - name = "kernel-core-0__5.14.0-547.el9.x86_64", - sha256 = "925da9ef5d6d462e9a63aa77be40215ca53d2bd92e21f3d5819cb5958eb2ddcd", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/kernel-core-5.14.0-547.el9.x86_64.rpm", - ], -) - -rpm( - name = "kernel-modules-core-0__5.14.0-547.el9.x86_64", - sha256 = "a2a7c7b45b7813d676ae9ad445cf3a7c8abefbe6c6507b539622c0048a38ea3a", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/kernel-modules-core-5.14.0-547.el9.x86_64.rpm", - ], -) - -rpm( - name = "kernel-srpm-macros-0__1.0-13.el9.x86_64", - sha256 = "1a3565cb716827b756d35640a41978cfe78af8225a47955d7589cc0541260d14", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/kernel-srpm-macros-1.0-13.el9.noarch.rpm", - ], -) - -rpm( - name = "keyutils-libs-0__1.6.3-3.el9.x86_64", - sha256 = "82917d32c6595cb27364003c481425dbba510b22be28a9f532afe8581ae0d615", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/keyutils-libs-1.6.3-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "kmod-0__28-10.el9.x86_64", - sha256 = "8b88204ae7e7493a5da5e9e055e348b57e2809f72bdaceadb9b61b05f6e4c555", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/kmod-28-10.el9.x86_64.rpm", - ], -) - -rpm( - name = "kmod-libs-0__28-10.el9.x86_64", - sha256 = "31f90047fc0266d38b8b08799381bb5f286774a8171e4c9fe73a2a0e7c4570ea", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/kmod-libs-28-10.el9.x86_64.rpm", - ], -) - -rpm( - name = "kpartx-0__0.8.7-34.el9.x86_64", - sha256 = "2a8ed8ded35599a61cc38a3853ae65ddac326712393fbafce8bca804a86ee595", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/kpartx-0.8.7-34.el9.x86_64.rpm", - ], -) - -rpm( - name = "krb5-libs-0__1.21.1-4.el9.x86_64", - sha256 = "5e97e752a5968684bf32eef3ff6f0f6eb9af83c177403a37dc5869a8674b1799", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/krb5-libs-1.21.1-4.el9.x86_64.rpm", - ], -) - -rpm( - name = "less-0__590-5.el9.x86_64", - sha256 = "d6910f7c92871082eab20c89fd7793e107d75a673aa772ccee5efbf38c106cf2", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/less-590-5.el9.x86_64.rpm", - ], -) - -rpm( - name = "libacl-0__2.3.1-4.el9.x86_64", - sha256 = "e00201fc534d05ad3d3243ab400e6c15983aa5c0a3996d344dc016f7ec937abc", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libacl-2.3.1-4.el9.x86_64.rpm", - ], -) - -rpm( - name = "libaio-0__0.3.111-13.el9.x86_64", - sha256 = "96b8c1b764cc383db3661f1a9544bab7e59ee914da400857054f0ad1f6eb1742", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libaio-0.3.111-13.el9.x86_64.rpm", - ], -) - -rpm( - name = "libarchive-0__3.5.3-4.el9.x86_64", - sha256 = "0c8600ac3967482a63cf958cc6be34da40e4c67e70d2ce1d86d9fb3c0e4b8c27", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libarchive-3.5.3-4.el9.x86_64.rpm", - ], -) - -rpm( - name = "libassuan-0__2.5.5-3.el9.x86_64", - sha256 = "77b905bb716d722b9b9fa3574462fb91fd57b508d846c3d96eae19d882274f55", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libassuan-2.5.5-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "libattr-0__2.5.1-3.el9.x86_64", - sha256 = "b51006462a9feccf792430bab9dbc5e5933638bc91af7c0ac35c6529c9ea4a55", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libattr-2.5.1-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "libblkid-0__2.37.4-20.el9.x86_64", - sha256 = "b980b5b7115f03d7fca51a87084911afba3af759e3caa77838a813ea4813ad35", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libblkid-2.37.4-20.el9.x86_64.rpm", - ], -) - -rpm( - name = "libbpf-2__1.4.0-1.el9.x86_64", - sha256 = "29ac989eebb5d598c5912013a831caeac8ce493657f6e9c4b1c21267b487b275", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libbpf-1.4.0-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "libbrotli-0__1.0.9-7.el9.x86_64", - sha256 = "feb64b4ee0b6c70e2df46555629e3399b602f7c6740c3012b6dce86fded2ede9", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libbrotli-1.0.9-7.el9.x86_64.rpm", - ], -) - -rpm( - name = "libcap-0__2.48-9.el9.x86_64", - sha256 = "efb63957e8566a66e2b8b0b9b37e9d6e339b586887c16d878113613d6e3c792b", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libcap-2.48-9.el9.x86_64.rpm", - ], -) - -rpm( - name = "libcap-ng-0__0.8.2-7.el9.x86_64", - sha256 = "84a21c19d507bbbb6049f771b5a11e28522c9522e414e6323cd92c1f6c12cbf5", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libcap-ng-0.8.2-7.el9.x86_64.rpm", - ], -) - -rpm( - name = "libcbor-0__0.7.0-5.el9.x86_64", - sha256 = "5902e284c519f2738e5361cf76dbbc768569b7bb1e3c995b20429c2055c2ceaf", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libcbor-0.7.0-5.el9.x86_64.rpm", - ], -) - -rpm( - name = "libcom_err-0__1.46.5-6.el9.x86_64", - sha256 = "74117bc5982f730c0e02c67af2a02e59fdffbfed4c8b08474ce87438cfaa7f47", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libcom_err-1.46.5-6.el9.x86_64.rpm", - ], -) - -rpm( - name = "libconfig-0__1.7.2-9.el9.x86_64", - sha256 = "ee1501db9863e1b8e33c92f1a536c262fc6a57e06de6cc2718db21d3a13efb52", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libconfig-1.7.2-9.el9.x86_64.rpm", - ], -) - -rpm( - name = "libcurl-minimal-0__7.76.1-31.el9.x86_64", - sha256 = "7982f00ee466fe18348d9d8c133dced4767a2ea1ecc8e609fda017feaebf57f3", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libcurl-minimal-7.76.1-31.el9.x86_64.rpm", - ], -) - -rpm( - name = "libdb-0__5.3.28-55.el9.x86_64", - sha256 = "68145e21aea8c639ddb497cd6e8619b79bba07cccb0d2977ab6b32738c1915c7", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libdb-5.3.28-55.el9.x86_64.rpm", - ], -) - -rpm( - name = "libeconf-0__0.4.1-4.el9.x86_64", - sha256 = "7706760cfd8fc0dcce5fb23d0926733c1e2ff45922ce5fbeffade6ebffcb1aa2", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libeconf-0.4.1-4.el9.x86_64.rpm", - ], -) - -rpm( - name = "libedit-0__3.1-38.20210216cvs.el9.x86_64", - sha256 = "6e25c7737eda81a25ba24b0482370d9f34eb5bb63bf35c69a28ef7c64a65851c", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libedit-3.1-38.20210216cvs.el9.x86_64.rpm", - ], -) - -rpm( - name = "libev-0__4.33-6.el9.x86_64", - sha256 = "6a48c8fb5b945e25fca02245be14d6cad24cc4b657fd4c3b3d84d8873dfd645d", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libev-4.33-6.el9.x86_64.rpm", - ], -) - -rpm( - name = "libevent-0__2.1.12-8.el9.x86_64", - sha256 = "990a9418915ea2ad3e2602e57d16c8cd3018dbd3872ee10f3ac6d8596c2291f0", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libevent-2.1.12-8.el9.x86_64.rpm", - ], -) - -rpm( - name = "libfdisk-0__2.37.4-20.el9.x86_64", - sha256 = "9a7b7ae009118a7923503d58ed16eaaa3dac717cfd7cc709186c8572da1d668e", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libfdisk-2.37.4-20.el9.x86_64.rpm", - ], -) - -rpm( - name = "libfdt-0__1.6.0-7.el9.x86_64", - sha256 = "339cc0d4744f801aa0ea32253c89a24275e497ab534284b6f22e197ba6b40a8e", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/libfdt-1.6.0-7.el9.x86_64.rpm", - ], -) - -rpm( - name = "libffi-0__3.4.2-8.el9.x86_64", - sha256 = "7107f69df5163e58e1c3757f6c7229bb68bafe50ea9a5d0bc3e84506190c4794", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libffi-3.4.2-8.el9.x86_64.rpm", - ], -) - -rpm( - name = "libfido2-0__1.13.0-2.el9.x86_64", - sha256 = "3623bf0174ebbc8b72e4e191fdb769f3ce0ea2075735791d4da8bdaad594e38e", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libfido2-1.13.0-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "libgcc-0__11.5.0-2.el9.x86_64", - sha256 = "72c142d95964627ba7d9119341b3764a71249da644e62fe6070798dc72c6b27e", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libgcc-11.5.0-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "libgcrypt-0__1.10.0-11.el9.x86_64", - sha256 = "0fac0176e4da0181317f6fd7a270ff97d5e9e889bebac60a153c70f0a92a6670", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libgcrypt-1.10.0-11.el9.x86_64.rpm", - ], -) - -rpm( - name = "libgomp-0__11.5.0-2.el9.x86_64", - sha256 = "bb7423f44ec4cd27b9d76105a426146c988caf22b62cfdf2b3f18597e8f6233b", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libgomp-11.5.0-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "libgpg-error-0__1.42-5.el9.x86_64", - sha256 = "f985ddac7819e8d7eae0c12c6acd38f86ba26fe1d9d0427ba9b9cb0a7a4533cd", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libgpg-error-1.42-5.el9.x86_64.rpm", - ], -) - -rpm( - name = "libguestfs-1__1.54.0-3.el9.x86_64", - sha256 = "9102737dcb897b3c1279d4db53a31326ce7e57b2e428d28230c1e7a19bba649d", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/libguestfs-1.54.0-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "libguestfs-winsupport-0__9.3-1.el9.x86_64", - sha256 = "e93b95721535643d56ecbd10d6ca956804c499b48bf5b69c3c3ec9df829b4afe", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/libguestfs-winsupport-9.3-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "libguestfs-xfs-1__1.54.0-3.el9.x86_64", - sha256 = "e78c5274f416fb89337a368560ab3ba0ab252658b40ca2d8db1ebb0c448b0e92", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/libguestfs-xfs-1.54.0-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "libibverbs-0__54.0-1.el9.x86_64", - sha256 = "829041d5a109f1204670f9e9b646c7e49eb4acfa58245e98ed440717f8629e0e", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libibverbs-54.0-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "libidn2-0__2.3.0-7.el9.x86_64", - sha256 = "e2183f1db43a2d9cb6c4b350d7e488da09c823d33177ab9f94464e9685b684d6", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libidn2-2.3.0-7.el9.x86_64.rpm", - ], -) - -rpm( - name = "libkcapi-0__1.4.0-2.el9.x86_64", - sha256 = "666c49f52a17400c81fac54fd96cf4cb8598d481e034e81acca27bb0248e19b2", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libkcapi-1.4.0-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "libkcapi-hmaccalc-0__1.4.0-2.el9.x86_64", - sha256 = "29673f5ab0cf4572c079155f179fb33a7f7175c1ed2accd71892ae996e2e1d24", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libkcapi-hmaccalc-1.4.0-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "libksba-0__1.5.1-7.el9.x86_64", - sha256 = "81c33009f51afa6740f28390e83d5649be27a051e4dfede5df27d219449ac10a", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libksba-1.5.1-7.el9.x86_64.rpm", - ], -) - -rpm( - name = "libmnl-0__1.0.4-16.el9.x86_64", - sha256 = "2d4a27695cdb6bf6d9ec44e985ab91885ac5b69cd5ba2de6718f0c6ef0e6afd4", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libmnl-1.0.4-16.el9.x86_64.rpm", - ], -) - -rpm( - name = "libmount-0__2.37.4-20.el9.x86_64", - sha256 = "562bb6596fc1558cc5d2a8143b9fca71728f0a728f402842981d6a6c4e19846b", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libmount-2.37.4-20.el9.x86_64.rpm", - ], -) - -rpm( - name = "libnbd-0__1.20.3-1.el9.x86_64", - sha256 = "a2b00f8ed5a350de0a02cf2b183d578b9da1e1feb641900865ce720a5aa097c5", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/libnbd-1.20.3-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "libnetfilter_conntrack-0__1.0.9-1.el9.x86_64", - sha256 = "6c7d0e4f650d7a533bc6a4af2f45c2a535880da0d7a890de1de044df557d411b", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libnetfilter_conntrack-1.0.9-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "libnfnetlink-0__1.0.1-21.el9.x86_64", - sha256 = "13dcd2bb1c1c420c7b29b73c1f53edc2877791a8a8571f5fe4fc45d0420b6114", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libnfnetlink-1.0.1-21.el9.x86_64.rpm", - ], -) - -rpm( - name = "libnghttp2-0__1.43.0-6.el9.x86_64", - sha256 = "f081b41a0063262e4f05e63c4dbc317c63abc8c5dc8c568ad13dfb3c3d24f140", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libnghttp2-1.43.0-6.el9.x86_64.rpm", - ], -) - -rpm( - name = "libnl3-0__3.11.0-1.el9.x86_64", - sha256 = "444b3fa3a0ad8e0339acb0b83a45c31b9acaca2632ff9ae2bce403133a88d6a1", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libnl3-3.11.0-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "libosinfo-0__1.10.0-1.el9.x86_64", - sha256 = "afc003904716f15179bef8c75faef4ce848f12b2a8e483085b24cc23325fe46e", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/libosinfo-1.10.0-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "libpipeline-0__1.5.3-4.el9.x86_64", - sha256 = "582a0a9c0269db52ba2fcc24ec16d0e2c9451ce3f8ea3b7b3e362e29fea72834", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libpipeline-1.5.3-4.el9.x86_64.rpm", - ], -) - -rpm( - name = "libpkgconf-0__1.7.3-10.el9.x86_64", - sha256 = "482e1e6f3bb6765c83ff8c813c3cc7fc06ae40d58759f52b2a4b1d41f63011cc", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libpkgconf-1.7.3-10.el9.x86_64.rpm", - ], -) - -rpm( - name = "libpmem-0__1.12.1-1.el9.x86_64", - sha256 = "f2d0bebdd8c36f7017c70245daabc57eee47dab1a13a611b10c34394a9ae0990", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/libpmem-1.12.1-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "libpng-2__1.6.37-12.el9.x86_64", - sha256 = "2dc42535910db8a0d3914d51f96d76142a78a4a423130c315032e932cdc2c304", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libpng-1.6.37-12.el9.x86_64.rpm", - ], -) - -rpm( - name = "libproxy-0__0.4.15-35.el9.x86_64", - sha256 = "e9324a6dbedaa8db420a2d2325e10d3aa8e0e2a3ad5e691bda20d159d9e99307", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libproxy-0.4.15-35.el9.x86_64.rpm", - ], -) - -rpm( - name = "libpsl-0__0.21.1-5.el9.x86_64", - sha256 = "d907915a6f01f78919e385ce4e3f4ddc3a644f48049a35721d864954d5eb9680", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libpsl-0.21.1-5.el9.x86_64.rpm", - ], -) - -rpm( - name = "libpwquality-0__1.4.4-8.el9.x86_64", - sha256 = "12a26634170b3b98666b5ff7ad6740a7c30f9c75fa5dc2c6ed7693e3effce4ea", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libpwquality-1.4.4-8.el9.x86_64.rpm", - ], -) - -rpm( - name = "librdmacm-0__54.0-1.el9.x86_64", - sha256 = "a6eff49af5a9d199718027fcb322986d1a2a1a27b9cfd6273dc8f1e93cc14873", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/librdmacm-54.0-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "libseccomp-0__2.5.2-2.el9.x86_64", - sha256 = "8de7b56aa12dfadb0be9625a0c4c9f151a72b9fa052817d5fb89d1f7b43831ee", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libseccomp-2.5.2-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "libselinux-0__3.6-1.el9.x86_64", - sha256 = "f81fcfdf9c30fcf8dfd54c1906976c0390e6472b6cb37fe95d80d63a1b0ab7e3", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libselinux-3.6-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "libselinux-utils-0__3.6-1.el9.x86_64", - sha256 = "e33d0cca5f3274f2f94e6f37aaeceeaf44bf38276c01010097d5115368890daf", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libselinux-utils-3.6-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "libsemanage-0__3.6-3.el9.x86_64", - sha256 = "802bcae31f9a8c7ced42c6c71d60ffd870e5b0e8d4ccf77583dd8cb3a7f9e960", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libsemanage-3.6-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "libsepol-0__3.6-2.el9.x86_64", - sha256 = "e34f37b9627571e18307776138a208a451f48643ec20279cc09fd94abc7a9ec3", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libsepol-3.6-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "libsigsegv-0__2.13-4.el9.x86_64", - sha256 = "f3ee877e3dd76f61587d2e4687a033bc7b0d7138b2f84cf0f1af62efb748777b", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libsigsegv-2.13-4.el9.x86_64.rpm", - ], -) - -rpm( - name = "libslirp-0__4.4.0-8.el9.x86_64", - sha256 = "bd06542cb46165057d323a507ad80287fc97063f95558381870b5d2d352e8d2e", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/libslirp-4.4.0-8.el9.x86_64.rpm", - ], -) - -rpm( - name = "libsmartcols-0__2.37.4-20.el9.x86_64", - sha256 = "2b264e1753186b54043cbb29d3ae4c9c8b7d685a4090bd550cabae19c159a311", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libsmartcols-2.37.4-20.el9.x86_64.rpm", - ], -) - -rpm( - name = "libsoup-0__2.72.0-8.el9.x86_64", - sha256 = "3364e1802a80faa9f4a6e7db1dbef23d95f55e95bc65483894dbd2ec7a24c658", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/libsoup-2.72.0-8.el9.x86_64.rpm", - ], -) - -rpm( - name = "libssh-0__0.10.4-13.el9.x86_64", - sha256 = "9b6e56105ea9077d005d400dab609b5eb866521d76bb8d1b240c08a50a23e0ce", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libssh-0.10.4-13.el9.x86_64.rpm", - ], -) - -rpm( - name = "libssh-config-0__0.10.4-13.el9.x86_64", - sha256 = "8164abb5201d80698301d48e9c284c8ed01c6599b6f37c59faadb6482f6db76f", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libssh-config-0.10.4-13.el9.noarch.rpm", - ], -) - -rpm( - name = "libstdc__plus____plus__-0__11.5.0-2.el9.x86_64", - sha256 = "65e3a8674b62fade64c6d293caef93d694bace34d9e3e50014a1a11ce813dc00", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libstdc++-11.5.0-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "libtasn1-0__4.16.0-8.el9.x86_64", - sha256 = "926cb611745095f3c1a75acb7b090ab906d4c5e22d2d8e8c34fc15398f177e55", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libtasn1-4.16.0-8.el9.x86_64.rpm", - ], -) - -rpm( - name = "libtirpc-0__1.3.3-9.el9.x86_64", - sha256 = "15785813c8732dfd719ed4a0910370d6438c5e4bd01ca9de9b061afb748dd37a", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libtirpc-1.3.3-9.el9.x86_64.rpm", - ], -) - -rpm( - name = "libtool-ltdl-0__2.4.6-46.el9.x86_64", - sha256 = "c195e9981376059479ecb8864a400e7eb5c9b70446b46d0ba39a473ae476a793", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libtool-ltdl-2.4.6-46.el9.x86_64.rpm", - ], -) - -rpm( - name = "libtpms-0__0.9.1-4.20211126git1ff6fe1f43.el9.x86_64", - sha256 = "3adb2c36be9f5b3bef423e705cc2dc2bc2397c32f95c93b4950eca6e0a6681c6", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/libtpms-0.9.1-4.20211126git1ff6fe1f43.el9.x86_64.rpm", - ], -) - -rpm( - name = "libunistring-0__0.9.10-15.el9.x86_64", - sha256 = "42f4771c9226b8c14f83801deb383f41b3675174026ca66e14b0502d5b4ac949", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libunistring-0.9.10-15.el9.x86_64.rpm", - ], -) - -rpm( - name = "liburing-0__2.5-1.el9.x86_64", - sha256 = "dbeb30f4333754b3d7f16a984a3e663c3e20f2c2fc34717037aa9b875a4f2de6", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/liburing-2.5-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "libusbx-0__1.0.26-1.el9.x86_64", - sha256 = "d0c19d754c3aceae52204cc6fc350f13783cc4b36bc0ceb528e0dd5769eaa507", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libusbx-1.0.26-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "libutempter-0__1.2.1-6.el9.x86_64", - sha256 = "55f9c4ed03fd0cf275ebbcdce4e278bb3453055e43db500f7c171634814daea8", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libutempter-1.2.1-6.el9.x86_64.rpm", - ], -) - -rpm( - name = "libuuid-0__2.37.4-20.el9.x86_64", - sha256 = "880975f7b3ab5244889357ee328e7befd0b9f8231c60f277039346ccc54c99ce", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libuuid-2.37.4-20.el9.x86_64.rpm", - ], -) - -rpm( - name = "libverto-0__0.3.2-3.el9.x86_64", - sha256 = "83d6e258d8d4e021e339ad8b7a03c68e136285f740939446ec2795edbdc5e922", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libverto-0.3.2-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "libverto-libev-0__0.3.2-3.el9.x86_64", - sha256 = "220e4388d221618ca373908c307e811c7bdc885ff89e914b78b3a2130e1d21cd", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libverto-libev-0.3.2-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "libvirt-client-0__10.10.0-3.el9.x86_64", - sha256 = "bca42206173b79084d7ad3ac5601ff62422429b39f60a6e6a27dc5798d218627", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/libvirt-client-10.10.0-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "libvirt-daemon-common-0__10.10.0-3.el9.x86_64", - sha256 = "71c71c26285bbd0fb6923c8601416679ea93d60546b9bacae4c32f7cbd68348d", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/libvirt-daemon-common-10.10.0-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "libvirt-daemon-driver-qemu-0__10.10.0-3.el9.x86_64", - sha256 = "9673396b80ed809f71158f2e530e869140e1bf61bb54ecb0e6592b21a37dc1da", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/libvirt-daemon-driver-qemu-10.10.0-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "libvirt-daemon-driver-secret-0__10.10.0-3.el9.x86_64", - sha256 = "2f59d4affb5e034334303023415d26c42011f398a0a992e9a03fb21c981126f0", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/libvirt-daemon-driver-secret-10.10.0-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "libvirt-daemon-driver-storage-core-0__10.10.0-3.el9.x86_64", - sha256 = "8380e253a94e3d93c5f9d522f92b224d56ff40fe5a2116bdd83cd1ee816d5303", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/libvirt-daemon-driver-storage-core-10.10.0-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "libvirt-daemon-log-0__10.10.0-3.el9.x86_64", - sha256 = "3d72f4d61d5cc221883e52ce796b969b137d3586a6c2650183fbc3779f076846", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/libvirt-daemon-log-10.10.0-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "libvirt-libs-0__10.10.0-3.el9.x86_64", - sha256 = "f114085a52730c4c7a390d2337dbf9a8bd34a35957636c295cbfa67418d1c0b5", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/libvirt-libs-10.10.0-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "libxcrypt-0__4.4.18-3.el9.x86_64", - sha256 = "b07e135ce7cea03dd1ba3205606e0d4d42a51d1249a708b804521cfe3bc3454d", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libxcrypt-4.4.18-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "libxcrypt-compat-0__4.4.18-3.el9.x86_64", - sha256 = "b9469ff8d7425ca38961b540348a67004b0f5be34d49f6a7ff05d7051d96527a", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/libxcrypt-compat-4.4.18-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "libxml2-0__2.9.13-6.el9.x86_64", - sha256 = "f7c7e3a76a247f4106fc1cbbb5d170d993ad6fe7b1d27c7cee30d4048c3cb2d2", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libxml2-2.9.13-6.el9.x86_64.rpm", - ], -) - -rpm( - name = "libxslt-0__1.1.34-9.el9.x86_64", - sha256 = "94b2b8b881b9a4022e003e6a2475b0f4bde46abf0c46f0c730cd7fe38b8fe8d0", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/libxslt-1.1.34-9.el9.x86_64.rpm", - ], -) - -rpm( - name = "libzstd-0__1.5.5-1.el9.x86_64", - sha256 = "e3f52d56336121674b4a6ae7e0b935d73ce88063322576504872a787e81acbdb", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/libzstd-1.5.5-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "lua-libs-0__5.4.4-4.el9.x86_64", - sha256 = "23d806cfc723803803c01385f90af4b2f7a2e681bfc9feeb8b96709aad130e02", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/lua-libs-5.4.4-4.el9.x86_64.rpm", - ], -) - -rpm( - name = "lua-srpm-macros-0__1-6.el9.x86_64", - sha256 = "56bd5dd55c441b2d85a8deb3ce71a8c2e83ef8ffa5e4f28e5fa1c8fb22bbfe22", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/lua-srpm-macros-1-6.el9.noarch.rpm", - ], -) - -rpm( - name = "lz4-libs-0__1.9.3-5.el9.x86_64", - sha256 = "c304c2f74c1fdadebce6097df12bfca58480d36c5630a75052028ab831ce98c1", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/lz4-libs-1.9.3-5.el9.x86_64.rpm", - ], -) - -rpm( - name = "lzo-0__2.10-7.el9.x86_64", - sha256 = "bee32640bd562c5853344481b1def6a00e0c67e06ffacc4198aa4d0c5a1203dc", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/lzo-2.10-7.el9.x86_64.rpm", - ], -) - -rpm( - name = "lzop-0__1.04-8.el9.x86_64", - sha256 = "5639d92d0916c1868d01f40ba8f55ddb1f101f6fe7af7292d21e9b671702f41b", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/lzop-1.04-8.el9.x86_64.rpm", - ], -) - -rpm( - name = "man-db-0__2.9.3-7.el9.x86_64", - sha256 = "7253ba0438f31abda7a4b06fd760c977570c7fab19cb97a046fa14880afbb07b", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/man-db-2.9.3-7.el9.x86_64.rpm", - ], -) - -rpm( - name = "mingw-binutils-generic-0__2.41-3.el9.x86_64", - sha256 = "0a4ed979ec9c714b17d4acb2395872d4a8c17e95539fb01014d55c20330909b5", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/mingw-binutils-generic-2.41-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "mingw-filesystem-base-0__148-3.el9.x86_64", - sha256 = "dc0ef22196bd78d32508cd761a9d4c109f89da22cd90f46fc262e427e64f0503", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/mingw-filesystem-base-148-3.el9.noarch.rpm", - ], -) - -rpm( - name = "mingw32-crt-0__11.0.1-3.el9.x86_64", - sha256 = "64b4147f8b409664ef7ed4fe20c54a0d7a40394396e8f6c7a2f28f1c6ab51c2f", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/mingw32-crt-11.0.1-3.el9.noarch.rpm", - ], -) - -rpm( - name = "mingw32-filesystem-0__148-3.el9.x86_64", - sha256 = "1a4572453ef974999dcb64fd97cf737574a5f9564048991e1d1f90eae2a2166c", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/mingw32-filesystem-148-3.el9.noarch.rpm", - ], -) - -rpm( - name = "mingw32-srvany-0__1.1-3.el9.x86_64", - sha256 = "56cac8689189333f2422562fa01989be86fb468084a59dd4920a39f178eb7764", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/mingw32-srvany-1.1-3.el9.noarch.rpm", - ], -) - -rpm( - name = "mpfr-0__4.1.0-7.el9.x86_64", - sha256 = "ad4526486c80739698dee8604a62c4d3953a6c030c23e30b368f44674a257dfb", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/mpfr-4.1.0-7.el9.x86_64.rpm", - ], -) - -rpm( - name = "nbdkit-basic-filters-0__1.38.5-2.el9.x86_64", - sha256 = "957f4f9595018e52446a7f760126256b4739c175ccd11bd6a53671e12b08640a", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/nbdkit-basic-filters-1.38.5-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "nbdkit-basic-plugins-0__1.38.5-2.el9.x86_64", - sha256 = "e0152cae7b1fbb3bb0732437e0387bfb5d016b65ed10b5593c911bafbe3687ee", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/nbdkit-basic-plugins-1.38.5-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "nbdkit-curl-plugin-0__1.38.5-2.el9.x86_64", - sha256 = "35001e8b83cd917560d70d8a49499b604bbec529eb97c2ca30548b26354738fb", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/nbdkit-curl-plugin-1.38.5-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "nbdkit-nbd-plugin-0__1.38.5-2.el9.x86_64", - sha256 = "6fe179822b775c2cca211ebf328611350bfe62b1163e6f326777f841420d4258", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/nbdkit-nbd-plugin-1.38.5-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "nbdkit-server-0__1.38.5-2.el9.x86_64", - sha256 = "cbd719c9b00070c86bae640566b1a00e64115c7e40f181e9803634cd982ba505", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/nbdkit-server-1.38.5-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "nbdkit-ssh-plugin-0__1.38.5-2.el9.x86_64", - sha256 = "f0dfd732370ef0aeef6778191be71655eaea8637b44dd0e54b3c350421292696", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/nbdkit-ssh-plugin-1.38.5-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "nbdkit-vddk-plugin-0__1.38.5-2.el9.x86_64", - sha256 = "4826222aba06f98724b2897aa2c991d46e74eaafcb0cd7b9cd301e4d383a73b6", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/nbdkit-vddk-plugin-1.38.5-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "ncurses-0__6.2-10.20210508.el9.x86_64", - sha256 = "978f8a55ad4690a88483ec4789a09e5083604a1e28ed9603ceb69ddb89726838", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/ncurses-6.2-10.20210508.el9.x86_64.rpm", - ], -) - -rpm( - name = "ncurses-base-0__6.2-10.20210508.el9.x86_64", - sha256 = "3ccbaa39db3cc8ae78f9da42cab3859d0cdb302dd947cdebdb83a702e89074cf", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/ncurses-base-6.2-10.20210508.el9.noarch.rpm", - ], -) - -rpm( - name = "ncurses-libs-0__6.2-10.20210508.el9.x86_64", - sha256 = "c130660ede7c78b7b759d9752a68c5a1ebab8cc16b361450f8b3ab2003d63320", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/ncurses-libs-6.2-10.20210508.el9.x86_64.rpm", - ], -) - -rpm( - name = "ndctl-libs-0__78-2.el9.x86_64", - sha256 = "9056eb17a2071dca7f4c777ad8d15461c0a349f2281973d17478e9045d4c438a", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/ndctl-libs-78-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "nettle-0__3.9.1-1.el9.x86_64", - sha256 = "ecde91b76480ddcf0e617f99d41865e80ff91d345bb051a92dcd1fe9fb373ba9", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/nettle-3.9.1-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "npth-0__1.6-8.el9.x86_64", - sha256 = "5177ac3fbfa90bcffacf86e88a36705d154a0da1a1bda9eb63db2e6c56f6aac6", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/npth-1.6-8.el9.x86_64.rpm", - ], -) - -rpm( - name = "numactl-libs-0__2.0.19-1.el9.x86_64", - sha256 = "d751f16b33606f36b2b03df28cacffda69c3419fe7579dbffbf23c363c7051db", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/numactl-libs-2.0.19-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "numad-0__0.5-37.20150602git.el9.x86_64", - sha256 = "7d27529f2f44ffe4eecb9af50c52afb22f10478c2b94dde657a4adb4f5974f8f", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/numad-0.5-37.20150602git.el9.x86_64.rpm", - ], -) - -rpm( - name = "ocaml-srpm-macros-0__6-6.el9.x86_64", - sha256 = "b4e11a81b641e8b1e36b695813cae09378dc141257ccad619966d221db967a54", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/ocaml-srpm-macros-6-6.el9.noarch.rpm", - ], -) - -rpm( - name = "openblas-srpm-macros-0__2-11.el9.x86_64", - sha256 = "46efd4f011e01a8d0f72674f0009e03f73b06b8e8b86d3a12653fcfbedcc8807", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/openblas-srpm-macros-2-11.el9.noarch.rpm", - ], -) - -rpm( - name = "openldap-0__2.6.8-3.el9.x86_64", - sha256 = "045f7ccfe4a0eb79e5cdfcea1c303489e29752424fa202d5534dbb6c46e18d84", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/openldap-2.6.8-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "openssh-0__8.7p1-44.el9.x86_64", - sha256 = "000a4aad7fa6f22a4c1904a421f74b003d08c824998d02fab6f93e97b62a03fd", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/openssh-8.7p1-44.el9.x86_64.rpm", - ], -) - -rpm( - name = "openssh-clients-0__8.7p1-44.el9.x86_64", - sha256 = "74cf52941f4c898a200f60433e1a570a30d26c80a6fb1e59bdccfd9ee87a8224", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/openssh-clients-8.7p1-44.el9.x86_64.rpm", - ], -) - -rpm( - name = "openssl-1__3.2.2-6.el9.x86_64", - sha256 = "f9040a23e818b7bf0f3ff46c5e3f85eb92b7da50ae627a64cb2ef2022b5a8296", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/openssl-3.2.2-6.el9.x86_64.rpm", - ], -) - -rpm( - name = "openssl-libs-1__3.2.2-6.el9.x86_64", - sha256 = "41e49b8db457814f4935a92b874b3a379126bad665516335485c9477a41ebf8b", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/openssl-libs-3.2.2-6.el9.x86_64.rpm", - ], -) - -rpm( - name = "osinfo-db-0__20240701-3.el9.x86_64", - sha256 = "8e51f6dd436bb845377bea1ec54ab3b142bfd8de4f12fd7206ad930103908165", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/osinfo-db-20240701-3.el9.noarch.rpm", - ], -) - -rpm( - name = "osinfo-db-tools-0__1.10.0-1.el9.x86_64", - sha256 = "2c4c6ff6290eca757fe2fa5200fac71f6982937a70ed5799a11dd9226202f1df", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/osinfo-db-tools-1.10.0-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "p11-kit-0__0.25.3-3.el9.x86_64", - sha256 = "7d8718bc957160706c8c55c476f8725bfc12718c489623fadf858b6af21acd78", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/p11-kit-0.25.3-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "p11-kit-trust-0__0.25.3-3.el9.x86_64", - sha256 = "048514ec9a196d4e0189e6dc27184e3ee8cc86591da27a9abf443d2b89ffe27d", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/p11-kit-trust-0.25.3-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "pam-0__1.5.1-23.el9.x86_64", - sha256 = "fb84a0303288e73c9378aff935ed975d2a334f260ccd38ba5e1940586db2a2f3", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/pam-1.5.1-23.el9.x86_64.rpm", - ], -) - -rpm( - name = "parted-0__3.5-2.el9.x86_64", - sha256 = "a9ebfab683d86716ae6182f6450ac7f0948ff1e4466a0663159f4af11fac5ed9", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/parted-3.5-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "pcre-0__8.44-4.el9.x86_64", - sha256 = "8de7ca63e65ae5b063c37e5a1de1e7024e5b74024df170362e807b05f505eadc", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/pcre-8.44-4.el9.x86_64.rpm", - ], -) - -rpm( - name = "pcre2-0__10.40-6.el9.x86_64", - sha256 = "89ddfdc4ef6df4e623ae20be1d9d3407ac56ba77aaf590e211d5790ce307fe66", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/pcre2-10.40-6.el9.x86_64.rpm", - ], -) - -rpm( - name = "pcre2-syntax-0__10.40-6.el9.x86_64", - sha256 = "63813c993604e0625dede1c0f6dce0ac49e68a2f0c229c5492dd6cb8e059a9df", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/pcre2-syntax-10.40-6.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-AutoLoader-0__5.74-481.el9.x86_64", - sha256 = "c15952804a8cbd9a396566801a6c26e96c3c04396946a027e1b6e06ab3857580", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-AutoLoader-5.74-481.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-B-0__1.80-481.el9.x86_64", - sha256 = "ce6648f5e26e96ed5151c0c55c21a854dafd49be0c6c19f98e11a89757757dea", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-B-1.80-481.el9.x86_64.rpm", - ], -) - -rpm( - name = "perl-Carp-0__1.50-460.el9.x86_64", - sha256 = "7a30bdac2922f63e7a97f180ad1e7da66ca7db888d32c3a660e33486e827fc09", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-Carp-1.50-460.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-Class-Struct-0__0.66-481.el9.x86_64", - sha256 = "3fb30366998a2dcad139963940567fcc5c62d9acbdb81b537b489b777df09ce5", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-Class-Struct-0.66-481.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-Data-Dumper-0__2.174-462.el9.x86_64", - sha256 = "b3b5f1c5240b24cb74f36c5ba443a68c8d4d37aaee93901d9fc913ce206f8f2b", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-Data-Dumper-2.174-462.el9.x86_64.rpm", - ], -) - -rpm( - name = "perl-Digest-0__1.19-4.el9.x86_64", - sha256 = "f48b6b12a9b15fc59f8d119d1c32b94135eaae9f91323c9819116e8b9f6d0742", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-Digest-1.19-4.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-Digest-MD5-0__2.58-4.el9.x86_64", - sha256 = "1937fe693ee7ae82f185d9721d3699a22e4ef9d9cf638513e2acbd254fb239e7", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-Digest-MD5-2.58-4.el9.x86_64.rpm", - ], -) - -rpm( - name = "perl-Encode-4__3.08-462.el9.x86_64", - sha256 = "3d092743aef883c87e72972369370bafe06b627cf872e610af5b632d726dbd82", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-Encode-3.08-462.el9.x86_64.rpm", - ], -) - -rpm( - name = "perl-Errno-0__1.30-481.el9.x86_64", - sha256 = "4dc6ef0eb638a6a6679697478383864638a33c27daf724bcfcf6bd1f30e7e035", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-Errno-1.30-481.el9.x86_64.rpm", - ], -) - -rpm( - name = "perl-Exporter-0__5.74-461.el9.x86_64", - sha256 = "565d2611d7fd5fb85133572db94961554cdcb0749d14ecbdef0f4df02797a446", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-Exporter-5.74-461.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-Fcntl-0__1.13-481.el9.x86_64", - sha256 = "673847f6118856284131e7ebbdb17cae75ee8b106f0167548f6b9b9134305ebd", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-Fcntl-1.13-481.el9.x86_64.rpm", - ], -) - -rpm( - name = "perl-File-Basename-0__2.85-481.el9.x86_64", - sha256 = "713e1b023869216b587a1f2dca3b2985cad561cf6d6d7d2888e9f1edbd77be56", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-File-Basename-2.85-481.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-File-Path-0__2.18-4.el9.x86_64", - sha256 = "5cda633d97d08e2f4d9c008114f096b047ede47eb934086568210e4ccb782dcc", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-File-Path-2.18-4.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-File-Temp-1__0.231.100-4.el9.x86_64", - sha256 = "14a4a835c90ba89e3660ce674c9883f6e9b999ee6c4a3aece3969f7ff8bf9354", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-File-Temp-0.231.100-4.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-File-stat-0__1.09-481.el9.x86_64", - sha256 = "bee7edb7965591d9f554d348f7097f1dfa1cc083ec22b1301cd88b9d81183c02", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-File-stat-1.09-481.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-FileHandle-0__2.03-481.el9.x86_64", - sha256 = "02a57b65cebbaa894109f390a996c5b11ca1df5c0dbeaca6a59a4604860f4b0b", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-FileHandle-2.03-481.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-Getopt-Long-1__2.52-4.el9.x86_64", - sha256 = "aae4ac9bfbd03f0ad70c0ced737737c67a6299811417ca08fe80443e7465597a", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-Getopt-Long-2.52-4.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-Getopt-Std-0__1.12-481.el9.x86_64", - sha256 = "55cc79f4b2f08ff5950c08dae118123d724a7aeee8737dc21909ab679bc27969", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-Getopt-Std-1.12-481.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-HTTP-Tiny-0__0.076-462.el9.x86_64", - sha256 = "bb9cedb962a0648c4f380f617b79e71ae4cdeec82c7f27e60db9ac5764bd5b42", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-HTTP-Tiny-0.076-462.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-IO-0__1.43-481.el9.x86_64", - sha256 = "09660cc9e121907585ff06da231a1ddacf13c5d0e2d1dca724fc10f24a37dcaa", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-IO-1.43-481.el9.x86_64.rpm", - ], -) - -rpm( - name = "perl-IO-Socket-IP-0__0.41-5.el9.x86_64", - sha256 = "131931924d208dc3bec865659a895f942d0bbf418eb12dae450d5b4fc52bbfec", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-IO-Socket-IP-0.41-5.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-IO-Socket-SSL-0__2.073-2.el9.x86_64", - sha256 = "0be095d0e6ba5ffeaa473fb5894f1f4dc4b010b81f27c724a100ce774ef16d80", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-IO-Socket-SSL-2.073-2.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-IPC-Open3-0__1.21-481.el9.x86_64", - sha256 = "69e2ccc70c7843e4ec5c1a09243ab8de6a1be9e0894d42aceb095d4575c0b23c", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-IPC-Open3-1.21-481.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-MIME-Base64-0__3.16-4.el9.x86_64", - sha256 = "b4978c7c2271de024834c4c85e98e1f292dd7b9db9e7a16a8b2e5dd52f6bf8e1", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-MIME-Base64-3.16-4.el9.x86_64.rpm", - ], -) - -rpm( - name = "perl-Mozilla-CA-0__20200520-6.el9.x86_64", - sha256 = "9177d80f9d0822af203019e68185f6e84a3ecd97c381af6a4c776a551752e2bc", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-Mozilla-CA-20200520-6.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-Net-SSLeay-0__1.94-1.el9.x86_64", - sha256 = "e31f267f303dd178831373dabd4c2176136ab42d672d71a9ad779451b0c5a94c", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-Net-SSLeay-1.94-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "perl-POSIX-0__1.94-481.el9.x86_64", - sha256 = "4a1139b631911e98b4aa3b35e2ac84b327def8bdc446e2f4d74e5ac88253e301", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-POSIX-1.94-481.el9.x86_64.rpm", - ], -) - -rpm( - name = "perl-PathTools-0__3.78-461.el9.x86_64", - sha256 = "843ccc42134c9903d77ca47de88f27113e8097c04417ed6c5fdc4ade3000d192", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-PathTools-3.78-461.el9.x86_64.rpm", - ], -) - -rpm( - name = "perl-Pod-Escapes-1__1.07-460.el9.x86_64", - sha256 = "54818499fbb20724b10d1147ff20e945e8d248d9fa715d53a5b76082c633de53", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-Pod-Escapes-1.07-460.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-Pod-Perldoc-0__3.28.01-461.el9.x86_64", - sha256 = "080eecf541aa046233fd5f344456a16802ef61c33fa0ef1df25cf0e9398c098e", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-Pod-Perldoc-3.28.01-461.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-Pod-Simple-1__3.42-4.el9.x86_64", - sha256 = "9d594cd0978cf88e010c91c1ee8d280cd49c70f90277578e7d0c97953def8f4d", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-Pod-Simple-3.42-4.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-Pod-Usage-4__2.01-4.el9.x86_64", - sha256 = "1fec2d3cf4c92a633a1229b42e00e73b2ebb254c3efbd7a7cf0563a7ac00fac6", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-Pod-Usage-2.01-4.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-Scalar-List-Utils-4__1.56-462.el9.x86_64", - sha256 = "bbba257d5a3de71483d05d1c36c4c981e9f30b0466c5c9f23a6b0acd0feeba18", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-Scalar-List-Utils-1.56-462.el9.x86_64.rpm", - ], -) - -rpm( - name = "perl-SelectSaver-0__1.02-481.el9.x86_64", - sha256 = "dd4bdc41f5fb384428c33d5d491c583c413c5d2a4af27b6d184faaf01ab35c64", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-SelectSaver-1.02-481.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-Socket-4__2.031-4.el9.x86_64", - sha256 = "80c5f940c127ed4e75813fbfdcc72052af33131431f52c8eef06e6b1c08f05cd", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-Socket-2.031-4.el9.x86_64.rpm", - ], -) - -rpm( - name = "perl-Storable-1__3.21-460.el9.x86_64", - sha256 = "20ff6846c7bce2995e9826ae5bcbe135465ea8bb052e6e8c631f0452a7d9e8e8", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-Storable-3.21-460.el9.x86_64.rpm", - ], -) - -rpm( - name = "perl-Symbol-0__1.08-481.el9.x86_64", - sha256 = "f14972835a81f040becd5b4ca691ecfefe18a6dd3d65414e3f73f1df664f26c7", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-Symbol-1.08-481.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-Term-ANSIColor-0__5.01-461.el9.x86_64", - sha256 = "fb030930f957b704eb28241b1af66396b07f2cd3d3e53ab4cdd99bec9d8e9b0c", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-Term-ANSIColor-5.01-461.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-Term-Cap-0__1.17-460.el9.x86_64", - sha256 = "2790fea7b2b38df5720130fab473c61274409b4e5bee61d37db9ba5548c9371c", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-Term-Cap-1.17-460.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-Text-ParseWords-0__3.30-460.el9.x86_64", - sha256 = "769b4c6e0831a45843202dbedcfdf51e2ae744d0bc093242b48e2d3475864f28", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-Text-ParseWords-3.30-460.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-Text-Tabs__plus__Wrap-0__2013.0523-460.el9.x86_64", - sha256 = "ba097a3ff9627bfaf989cd89cfbb40bd5a32ee1a53969510494f950b5d6da47d", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-Text-Tabs+Wrap-2013.0523-460.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-Time-Local-2__1.300-7.el9.x86_64", - sha256 = "3e62b49a7e6df19712fcc7c6103b61dc6912dc8a5efcec08bd2f242e3d56b3a9", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-Time-Local-1.300-7.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-URI-0__5.09-3.el9.x86_64", - sha256 = "d5ed01f374761f0628a7de57fa786a938f55c2105930dc920e9486d234f86072", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-URI-5.09-3.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-base-0__2.27-481.el9.x86_64", - sha256 = "c2681e390980a349a4b6b0ba06e546229a1f9c2f18be703ef2e429c150b82ef8", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-base-2.27-481.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-constant-0__1.33-461.el9.x86_64", - sha256 = "844ce96440fe8f96c55335ce37544f8288064a90bb2a6dcbbfa58755d25bf92e", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-constant-1.33-461.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-if-0__0.60.800-481.el9.x86_64", - sha256 = "20f4b34c203cff62b878528506d6413bfffe5a364aec329aa61b2b7a50db5de0", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-if-0.60.800-481.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-interpreter-4__5.32.1-481.el9.x86_64", - sha256 = "eac1fdfbc31d7596bb9e57a5a86f0855060b19b5d91f8587f400c6c56a6a6fff", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-interpreter-5.32.1-481.el9.x86_64.rpm", - ], -) - -rpm( - name = "perl-libnet-0__3.13-4.el9.x86_64", - sha256 = "a777c4998ec024f0aace7aeaa1ed6d4718f4a652b027f720191412ca2e265a47", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-libnet-3.13-4.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-libs-4__5.32.1-481.el9.x86_64", - sha256 = "2cbed8ef58f65a6518cb5570229031a516f9e44c5d28ceefd89054fcacbe7918", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-libs-5.32.1-481.el9.x86_64.rpm", - ], -) - -rpm( - name = "perl-mro-0__1.23-481.el9.x86_64", - sha256 = "32a0b159bd8cd8cb83030353993765c95fb9cb20c6fd716d91a7a8e730b088a8", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-mro-1.23-481.el9.x86_64.rpm", - ], -) - -rpm( - name = "perl-overload-0__1.31-481.el9.x86_64", - sha256 = "df999aa2373e4ce1a45b4b60a1f8a0a5a7ec2abef3aef899efbe2965e7db518f", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-overload-1.31-481.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-overloading-0__0.02-481.el9.x86_64", - sha256 = "ee3cd4ccc851c0abe390296be096c8463ca2ccd19622e4703e08b3af7cb49d95", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-overloading-0.02-481.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-parent-1__0.238-460.el9.x86_64", - sha256 = "5ba7119b1f165e7dedb7694dce61b3c612a12c58e9f660311df88b2fbc0566ed", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-parent-0.238-460.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-podlators-1__4.14-460.el9.x86_64", - sha256 = "ad6c7336fef16e491b71c9c6444b6df4c3adcb1c8edd31581790bb9bd1779c29", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-podlators-4.14-460.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-srpm-macros-0__1-41.el9.x86_64", - sha256 = "42df5aedef9be295f80739a3ca105be003963b9f775f175f9edfba994e27661f", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/perl-srpm-macros-1-41.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-subs-0__1.03-481.el9.x86_64", - sha256 = "876fbe06a665a880dbe4329a57f787e39101b60fb15fefe720a2c1586514e46e", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-subs-1.03-481.el9.noarch.rpm", - ], -) - -rpm( - name = "perl-vars-0__1.05-481.el9.x86_64", - sha256 = "2e7018ab35ea11a612bed012457e65daa4088e4dfe46aec737078e56edec5440", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/perl-vars-1.05-481.el9.noarch.rpm", - ], -) - -rpm( - name = "pigz-0__2.5-4.el9.x86_64", - sha256 = "f00596a4eae7cf9ae1025b16579f2ca3973dc70d893fb1b7d7ddc1d7a3856613", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/pigz-2.5-4.el9.x86_64.rpm", - ], -) - -rpm( - name = "pixman-0__0.40.0-6.el9.x86_64", - sha256 = "5953f7904cd7aa91288cd453d1919bfa065ec4b3ce0092d04f1e7fbd1ed403d5", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/pixman-0.40.0-6.el9.x86_64.rpm", - ], -) - -rpm( - name = "pkgconf-0__1.7.3-10.el9.x86_64", - sha256 = "14c0ce0c3c7be16732e16ea0122a2f5eed652a9ec915f739d83fd5c76872cb60", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/pkgconf-1.7.3-10.el9.x86_64.rpm", - ], -) - -rpm( - name = "policycoreutils-0__3.6-2.1.el9.x86_64", - sha256 = "41114f38eaffa27204b2979ff45658c91a3c7e106b60f604e0bbd8661aee67eb", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/policycoreutils-3.6-2.1.el9.x86_64.rpm", - ], -) - -rpm( - name = "polkit-0__0.117-13.el9.x86_64", - sha256 = "57e364ae618d39a7f80e1f64f7f1127ab4f9935cd1a3e991a5808e482cd3c17e", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/polkit-0.117-13.el9.x86_64.rpm", - ], -) - -rpm( - name = "polkit-libs-0__0.117-13.el9.x86_64", - sha256 = "be585759ebe81e40652557c5d934c7677850af1b2acb9af30f9a17fd3a844245", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/polkit-libs-0.117-13.el9.x86_64.rpm", - ], -) - -rpm( - name = "popt-0__1.18-8.el9.x86_64", - sha256 = "06aab359adaddefa980ab4adec04fd8153a29ac9137830890b4c82ddb29b732d", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/popt-1.18-8.el9.x86_64.rpm", - ], -) - -rpm( - name = "procps-ng-0__3.3.17-14.el9.x86_64", - sha256 = "b99ae1ee257042686586a7adf678d5ad879e3a0ddcbd840e96f5dd5e5c23a0e1", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/procps-ng-3.3.17-14.el9.x86_64.rpm", - ], -) - -rpm( - name = "protobuf-c-0__1.3.3-13.el9.x86_64", - sha256 = "efe770eb50ad20a586e3185f6868ff390db6b8e9ec0d6047d4f29f5d769e38e5", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/protobuf-c-1.3.3-13.el9.x86_64.rpm", - ], -) - -rpm( - name = "psmisc-0__23.4-3.el9.x86_64", - sha256 = "d8f2fceb5da13a4eacfe79e4f4d8fa06e80bfb3e2ef7ac834093a90265c3d581", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/psmisc-23.4-3.el9.x86_64.rpm", - ], -) - -rpm( - name = "publicsuffix-list-dafsa-0__20210518-3.el9.x86_64", - sha256 = "cf13c91ecf9f734a7d2d3ae757c041ebdb7c4e2c7298733d74d4d87c3fd995a6", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/publicsuffix-list-dafsa-20210518-3.el9.noarch.rpm", - ], -) - -rpm( - name = "pyproject-srpm-macros-0__1.16.2-1.el9.x86_64", - sha256 = "b3a012475e6ffed9f764db9adfff47dfc3b79368f16b840b0dfcdd359782c97e", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/pyproject-srpm-macros-1.16.2-1.el9.noarch.rpm", - ], -) - -rpm( - name = "qemu-img-17__9.1.0-8.el9.x86_64", - sha256 = "221a5b734315e500d054ee4ace26e936dec4dc4bf8ff1cd3595f59773c220056", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/qemu-img-9.1.0-8.el9.x86_64.rpm", - ], -) - -rpm( - name = "qemu-kvm-common-17__9.1.0-8.el9.x86_64", - sha256 = "91aeac9f03cbe7361862b14aef41252bb0d5b6fbc3cdc37a03dca3081aa9b5da", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/qemu-kvm-common-9.1.0-8.el9.x86_64.rpm", - ], -) - -rpm( - name = "qemu-kvm-core-17__9.1.0-8.el9.x86_64", - sha256 = "0614272242f4a551243b0f5ccdab17834fad860733c352131a642632478337a9", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/qemu-kvm-core-9.1.0-8.el9.x86_64.rpm", - ], -) - -rpm( - name = "qt5-srpm-macros-0__5.15.9-1.el9.x86_64", - sha256 = "be399bd2dad15f84b1f45720ebb41c00f0cb5af0aeb27f22a6f30eacd7ee98d3", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/qt5-srpm-macros-5.15.9-1.el9.noarch.rpm", - ], -) - -rpm( - name = "readline-0__8.1-4.el9.x86_64", - sha256 = "7e43f8266c9bd4fe4df2798d23d5c6e529f93030b7ef27c0dfbb35fe1bf55f06", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/readline-8.1-4.el9.x86_64.rpm", - ], -) - -rpm( - name = "redhat-rpm-config-0__208-1.el9.x86_64", - sha256 = "31f6515d4960d4a8bef3348973916515665f6cf0970bbfdbd366ea96f7d04abd", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/redhat-rpm-config-208-1.el9.noarch.rpm", - ], -) - -rpm( - name = "rpm-0__4.16.1.3-36.el9.x86_64", - sha256 = "2b70cb69237e6d7529d419d020f4ed47cd8aacc50867164b9674fce6ca3d1be3", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/rpm-4.16.1.3-36.el9.x86_64.rpm", - ], -) - -rpm( - name = "rpm-libs-0__4.16.1.3-36.el9.x86_64", - sha256 = "e28a709e390b404ef3c72df3a599e8cfb46827f1e4932df96291dd82a1f44675", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/rpm-libs-4.16.1.3-36.el9.x86_64.rpm", - ], -) - -rpm( - name = "rpm-plugin-selinux-0__4.16.1.3-36.el9.x86_64", - sha256 = "d9c8e63ae22dfb7af9ac297f2ef5c8bf1a1c8a81942d78a73c7e08f872cd0c7b", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/rpm-plugin-selinux-4.16.1.3-36.el9.x86_64.rpm", - ], -) - -rpm( - name = "rust-srpm-macros-0__17-4.el9.x86_64", - sha256 = "44b8a1bcadd850836432fed64c00b3511e4271766c02b3848ee9f09d3c811e6f", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/rust-srpm-macros-17-4.el9.noarch.rpm", - ], -) - -rpm( - name = "scrub-0__2.6.1-4.el9.x86_64", - sha256 = "ff026d72a49d77ca8ec748332cdefd4246f8c5b073aed2105164fe27b9a3f804", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/scrub-2.6.1-4.el9.x86_64.rpm", - ], -) - -rpm( - name = "seabios-bin-0__1.16.3-4.el9.x86_64", - sha256 = "2a6c9958283238f6d67aa375c6c3295375d31fc44a561684beef54f2d1f9c03d", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/seabios-bin-1.16.3-4.el9.noarch.rpm", - ], -) - -rpm( - name = "seavgabios-bin-0__1.16.3-4.el9.x86_64", - sha256 = "d3f60d48c8a7680d84fa49cbd54545a51b1678a7867ce4c843b8434cfe820087", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/seavgabios-bin-1.16.3-4.el9.noarch.rpm", - ], -) - -rpm( - name = "sed-0__4.8-9.el9.x86_64", - sha256 = "110db587738ad9dbf8aa5a9dd2f442b12d6e760697e0f94c0b7de57741cbbc0d", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/sed-4.8-9.el9.x86_64.rpm", - ], -) - -rpm( - name = "selinux-policy-0__38.1.50-1.el9.x86_64", - sha256 = "b85ec60f2c688c79356a666f4a5b10af64e0f995b7371cb59122b2673fb2389f", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/selinux-policy-38.1.50-1.el9.noarch.rpm", - ], -) - -rpm( - name = "selinux-policy-targeted-0__38.1.50-1.el9.x86_64", - sha256 = "d5481f2a514c616d809bb5416ef37d2e8239fe73371a59a3b98003c980a08028", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/selinux-policy-targeted-38.1.50-1.el9.noarch.rpm", - ], -) - -rpm( - name = "setup-0__2.13.7-10.el9.x86_64", - sha256 = "1afafe063300e6bbe84c953faf0082ac89c54cf95cf622b4db0b2ef68d013f02", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/setup-2.13.7-10.el9.noarch.rpm", - ], -) - -rpm( - name = "shadow-utils-2__4.9-12.el9.x86_64", - sha256 = "1ea6f8a4cfba1a7030c8f51137022bf71a0bd8585174cf6276bc62bb74abb09e", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/shadow-utils-4.9-12.el9.x86_64.rpm", - ], -) - -rpm( - name = "snappy-0__1.1.8-8.el9.x86_64", - sha256 = "1847e787322e49e7a333e8b1c31825d4bce535236a188b4fbbd1cd336f731cab", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/snappy-1.1.8-8.el9.x86_64.rpm", - ], -) - -rpm( - name = "sqlite-libs-0__3.34.1-7.el9.x86_64", - sha256 = "5d1f3688c827ce01e84c06892a325b31a76de65613d7c0e867e321b7dcc45c68", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/sqlite-libs-3.34.1-7.el9.x86_64.rpm", - ], -) - -rpm( - name = "swtpm-0__0.8.0-2.el9.x86_64", - sha256 = "3fe2d91f584f68b260251075ca2d68ba78f47ab72d063e3def6da144a4e16815", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/swtpm-0.8.0-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "swtpm-libs-0__0.8.0-2.el9.x86_64", - sha256 = "347568162146182d912f8c549a83197fb2039d896a110087eb6e0ca961a61518", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/swtpm-libs-0.8.0-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "swtpm-tools-0__0.8.0-2.el9.x86_64", - sha256 = "e41801059094542221e0551aea2ae1379f7903afae53232c45756f3035cdb9b3", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/swtpm-tools-0.8.0-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "systemd-0__252-49.el9.x86_64", - sha256 = "47116e7b7c9d504f78e150df971454aca869ddc08c4cf2000619da014316672f", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/systemd-252-49.el9.x86_64.rpm", - ], -) - -rpm( - name = "systemd-container-0__252-49.el9.x86_64", - sha256 = "c6e6e3ce6118d4c19a8f8219a26dce00a830cd2130359caeef3b856d40a4ae70", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/systemd-container-252-49.el9.x86_64.rpm", - ], -) - -rpm( - name = "systemd-libs-0__252-49.el9.x86_64", - sha256 = "ca9dc588c4061857a2d76b5809ee66d091f838d4e7f1bfa4a295565782598381", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/systemd-libs-252-49.el9.x86_64.rpm", - ], -) - -rpm( - name = "systemd-pam-0__252-49.el9.x86_64", - sha256 = "ed3b7e3f064dc1754c5cdcb0f93c2d167d012bab5d439e1b46157327d8f297ea", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/systemd-pam-252-49.el9.x86_64.rpm", - ], -) - -rpm( - name = "systemd-rpm-macros-0__252-49.el9.x86_64", - sha256 = "f81dcb92057709fb666b148346ff625c208be973c9d896ac1f8252cd1225885a", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/systemd-rpm-macros-252-49.el9.noarch.rpm", - ], -) - -rpm( - name = "systemd-udev-0__252-49.el9.x86_64", - sha256 = "03e51aa16229f5f59f793e850d0ab9cb677179f11b53150c1195829dab106870", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/systemd-udev-252-49.el9.x86_64.rpm", - ], -) - -rpm( - name = "tar-2__1.34-7.el9.x86_64", - sha256 = "3bad93a512f59beadcbad168fcff07785d669099f6c9d3ff4abf429328c8904e", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/tar-1.34-7.el9.x86_64.rpm", - ], -) - -rpm( - name = "tpm2-tss-0__3.2.3-1.el9.x86_64", - sha256 = "df8b9a0f463ccea67fcfdaef0cb3fec74e3b7e2dc9b1cc5bf55a9492c5711bfd", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/tpm2-tss-3.2.3-1.el9.x86_64.rpm", - ], -) - -rpm( - name = "tzdata-0__2024b-3.el9.x86_64", - sha256 = "a8c85e9a3405997bc9a94e6458ae181b7a592b7f0e5561e90aca8e24c8b7b2f8", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/tzdata-2024b-3.el9.noarch.rpm", - ], -) - -rpm( - name = "unbound-libs-0__1.16.2-8.el9.x86_64", - sha256 = "1472f1c7a60b352a94898b6a615b0c809a08a9683f0614a4cb062afe48ae880e", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/unbound-libs-1.16.2-8.el9.x86_64.rpm", - ], -) - -rpm( - name = "unzip-0__6.0-57.el9.x86_64", - sha256 = "160c17021a9838c6bdcb799afcb7909590ff1b4790a4404a6ef73d021222fbb4", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/unzip-6.0-57.el9.x86_64.rpm", - ], -) - -rpm( - name = "userspace-rcu-0__0.12.1-6.el9.x86_64", - sha256 = "86a0de46b4c2827bb02b004fc320098a4d9d49466fb7a51f67228a25bde3bf19", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/userspace-rcu-0.12.1-6.el9.x86_64.rpm", - ], -) - -rpm( - name = "util-linux-0__2.37.4-20.el9.x86_64", - sha256 = "ad9855647f3380b806ed9cc30a8e503357eb63c533a3a1e3f1bba9a8ab882d81", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/util-linux-2.37.4-20.el9.x86_64.rpm", - ], -) - -rpm( - name = "util-linux-core-0__2.37.4-20.el9.x86_64", - sha256 = "13c3cd8ebecb7ee2b7fe4f37c1bd371746064ab6fb53ed0d83e256257ce18fb6", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/util-linux-core-2.37.4-20.el9.x86_64.rpm", - ], -) - -rpm( - name = "vim-minimal-2__8.2.2637-21.el9.x86_64", - sha256 = "68072efd47d176f5826ed1fd3406483099af097ba35f955c503c10736f9257ef", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/vim-minimal-8.2.2637-21.el9.x86_64.rpm", - ], -) - -rpm( - name = "virt-v2v-1__2.7.1-2.el9.x86_64", - sha256 = "145716ed2e1576bdaf5ec1058da00b8bf2ffe882c59773bfa05729627554d544", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/virt-v2v-2.7.1-2.el9.x86_64.rpm", - ], -) - -rpm( - name = "virtio-win-1.9.40-1.el9.noarch", - sha256 = "ce37961310f5466016ff8c68f15d80c2fbcc5b7c73ec7d789790609c887551c7", - urls = [ - "https://kojihub.stream.centos.org/kojifiles/packages/virtio-win/1.9.40/1.el9/noarch/virtio-win-1.9.40-1.el9.noarch.rpm", - ], -) - -rpm( - name = "which-0__2.21-29.el9.x86_64", - sha256 = "8d62b2587b479928e836270f85de4ff3fae3a4bc21bdff854f21c1b5c895968d", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/which-2.21-29.el9.x86_64.rpm", - ], -) - -rpm( - name = "xfsprogs-0__6.4.0-5.el9.x86_64", - sha256 = "f1260a4ba786ce59d52e81a0427539ebf0af1a9364e32e5e73b514d1e846035a", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/xfsprogs-6.4.0-5.el9.x86_64.rpm", - ], -) - -rpm( - name = "xz-0__5.2.5-8.el9.x86_64", - sha256 = "1fbea132146bdb36e7f282005510feb70f1d80988ccfe5560c39e9377bb05ee0", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/xz-5.2.5-8.el9.x86_64.rpm", - ], -) - -rpm( - name = "xz-libs-0__5.2.5-8.el9.x86_64", - sha256 = "2ad419ac36ffe4ba7ebc55372621db5a3ee497a96801a06ba8f7f020270ae851", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/xz-libs-5.2.5-8.el9.x86_64.rpm", - ], -) - -rpm( - name = "zip-0__3.0-35.el9.x86_64", - sha256 = "f64c3fdaf8e89a7dcfa9d387b037f9d62824c86420cbbe2784135e2eef6bff8b", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/zip-3.0-35.el9.x86_64.rpm", - ], -) - -rpm( - name = "zlib-0__1.2.11-40.el9.x86_64", - sha256 = "4ed20865bc82692e597f350bb0cacfdcc3ebd347df5117ad3afcf8fdc5c43d79", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/zlib-1.2.11-40.el9.x86_64.rpm", - ], -) - -rpm( - name = "zstd-0__1.5.5-1.el9.x86_64", - sha256 = "0e392956ccfe925307641604e70d4bd1196b9a80274d8914dcbdf39c6b31b198", - urls = [ - "https://composes.stream.centos.org/development/latest-CentOS-Stream/compose/BaseOS/x86_64/os/Packages/zstd-1.5.5-1.el9.x86_64.rpm", - ], -) diff --git a/virt-v2v/cmd/BUILD.bazel b/virt-v2v/cmd/BUILD.bazel deleted file mode 100644 index 252fa3491..000000000 --- a/virt-v2v/cmd/BUILD.bazel +++ /dev/null @@ -1,33 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") - -go_library( - name = "cmd_lib", - srcs = ["entrypoint.go"], - importpath = "github.com/konveyor/forklift-controller/virt-v2v/cmd", - visibility = ["//visibility:private"], - deps = [ - "//pkg/customize", - "//pkg/global", - "//pkg/server", - "//pkg/utils", - ], -) - -go_binary( - name = "virt-v2v-wrapper", - embed = [":cmd_lib"], - visibility = ["//visibility:public"], -) - -go_test( - name = "entrypoint_test", - srcs = ["entrypoint_test.go"], - embed = [":cmd_lib"], -) - -go_test( - name = "cmd_test", - srcs = ["entrypoint_test.go"], - embed = [":cmd_lib"], - deps = ["//pkg/global"], -) diff --git a/virt-v2v/pkg/customize/BUILD.bazel b/virt-v2v/pkg/customize/BUILD.bazel deleted file mode 100644 index a894ca43f..000000000 --- a/virt-v2v/pkg/customize/BUILD.bazel +++ /dev/null @@ -1,69 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "customize", - srcs = [ - "image.go", - "rhel.go", - "windows.go", - "utils.go", - ], - embedsrcs = [ - "scripts/rhel/firstboot/README.md", - "scripts/rhel/run/README.md", - "scripts/rhel/run/network_config_util.sh", - "scripts/windows/9999-restore_config.ps1", - "scripts/windows/9999-run-mtv-ps-scripts.bat", - "scripts/windows/firstboot.bat", - "scripts/rhel/run/ifcfg-double-quotes-test.d/expected-udev.rule", - "scripts/rhel/run/ifcfg-double-quotes-test.d/root/etc/sysconfig/network-scripts/ifcfg-eth0", - "scripts/rhel/run/ifcfg-double-quotes-test.d/root/tmp/macToIP", - "scripts/rhel/run/ifcfg-hwaddr-test-failure.d/expected-udev.rule", - "scripts/rhel/run/ifcfg-hwaddr-test-failure.d/root/etc/sysconfig/network-scripts/ifcfg-eth0", - "scripts/rhel/run/ifcfg-hwaddr-test-failure.d/root/tmp/macToIP", - "scripts/rhel/run/ifcfg-no-quotes-test.d/expected-udev.rule", - "scripts/rhel/run/ifcfg-no-quotes-test.d/root/etc/sysconfig/network-scripts/ifcfg-eth0", - "scripts/rhel/run/ifcfg-no-quotes-test.d/root/tmp/macToIP", - "scripts/rhel/run/ifcfg-single-quotes-test.d/expected-udev.rule", - "scripts/rhel/run/ifcfg-single-quotes-test.d/root/etc/sysconfig/network-scripts/ifcfg-eth0", - "scripts/rhel/run/ifcfg-single-quotes-test.d/root/tmp/macToIP", - "scripts/rhel/run/netplan-test.d/expected-udev.rule", - "scripts/rhel/run/netplan-test.d/root/etc/netplan/50-netplan.yaml", - "scripts/rhel/run/netplan-test.d/root/tmp/macToIP", - "scripts/rhel/run/netplan-test.d/root/run/systemd/network/netplan-enp3s0.network", - "scripts/rhel/run/netplan-test.d/root/run/systemd/network/netplan-eth1.network", - "scripts/rhel/run/networkmanager-test.d/expected-udev.rule", - "scripts/rhel/run/networkmanager-test.d/root/etc/NetworkManager/system-connections/eth1 but with spaces.nmconnection", - "scripts/rhel/run/networkmanager-test.d/root/tmp/macToIP", - "scripts/rhel/run/systemd-test.d/expected-udev.rule", - "scripts/rhel/run/systemd-test.d/root/etc/netplan/50-netplan.yaml", - "scripts/rhel/run/systemd-test.d/root/run/systemd/network/netplan-ens160.network", - "scripts/rhel/run/systemd-test.d/root/tmp/macToIP", - "scripts/rhel/run/ifcfg-hwaddr-test.d/expected-udev.rule", - "scripts/rhel/run/ifcfg-hwaddr-test.d/root/etc/sysconfig/network-scripts/ifcfg-ens192", - "scripts/rhel/run/ifcfg-hwaddr-test.d/root/etc/sysconfig/network-scripts/ifcfg-ens224", - "scripts/rhel/run/ifcfg-hwaddr-test.d/root/tmp/macToIP", - "scripts/rhel/run/network-interfaces-multiple-test.d/expected-udev.rule", - "scripts/rhel/run/network-interfaces-multiple-test.d/root/etc/network/interfaces", - "scripts/rhel/run/network-interfaces-multiple-test.d/root/etc/network/interfaces.d/if-ens192", - "scripts/rhel/run/network-interfaces-multiple-test.d/root/etc/network/interfaces.d/if-eth0", - "scripts/rhel/run/network-interfaces-multiple-test.d/root/tmp/macToIP", - "scripts/rhel/run/network-interfaces-single-test.d/expected-udev.rule", - "scripts/rhel/run/network-interfaces-single-test.d/root/etc/network/interfaces", - "scripts/rhel/run/network-interfaces-single-test.d/root/tmp/macToIP", - "scripts/rhel/run/test-network_config_util.sh", - ], - importpath = "github.com/konveyor/forklift-controller/virt-v2v/pkg/customize", - visibility = ["//visibility:public"], - deps = [ - "//pkg/global", - "//pkg/utils", - ], -) - -go_test( - name = "customize_test", - srcs = ["rhel_test.go"], - data = glob(["testdata/**"]), - embed = [":customize"], -) diff --git a/virt-v2v/pkg/global/BUILD.bazel b/virt-v2v/pkg/global/BUILD.bazel deleted file mode 100644 index e88ec24b7..000000000 --- a/virt-v2v/pkg/global/BUILD.bazel +++ /dev/null @@ -1,8 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "global", - srcs = ["variables.go"], - importpath = "github.com/konveyor/forklift-controller/virt-v2v/pkg/global", - visibility = ["//visibility:public"], -) diff --git a/virt-v2v/pkg/server/BUILD.bazel b/virt-v2v/pkg/server/BUILD.bazel deleted file mode 100644 index 1454b22ed..000000000 --- a/virt-v2v/pkg/server/BUILD.bazel +++ /dev/null @@ -1,12 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "server", - srcs = ["server.go"], - importpath = "github.com/konveyor/forklift-controller/virt-v2v/pkg/server", - visibility = ["//visibility:public"], - deps = [ - "//pkg/global", - "//pkg/utils", - ], -) diff --git a/virt-v2v/pkg/utils/BUILD.bazel b/virt-v2v/pkg/utils/BUILD.bazel deleted file mode 100644 index 7694010c2..000000000 --- a/virt-v2v/pkg/utils/BUILD.bazel +++ /dev/null @@ -1,19 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "utils", - srcs = [ - "command.go", - "embed-tool.go", - "xml-reader.go", - ], - importpath = "github.com/konveyor/forklift-controller/virt-v2v/pkg/utils", - visibility = ["//visibility:public"], - deps = ["//pkg/global"], -) - -go_test( - name = "utils_test", - srcs = ["utils_test.go"], - embed = [":utils"], -)