From bd62139916b6b4cd60422cd80bbc95a3c89e1900 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Tue, 12 Dec 2023 14:03:49 +0100 Subject: [PATCH] go.mod: Switch to libvirt.org/go/libvirt@v1.8000.0 The upstream bindings have been moved/renamed from github.com/libvirt/libvirt-go to libvirt.org/go/libvirt This raises the minimum libvirt version needed to 8.0.0 as it's been in RHEL8 for a few releases, which is the older releases crc supports. --- go.mod | 2 +- go.sum | 4 +- pkg/libvirt/domain.go | 2 +- pkg/libvirt/libvirt.go | 4 +- pkg/libvirt/storage.go | 2 +- .../github.com/libvirt/libvirt-go/.gitpublish | 4 - .../github.com/libvirt/libvirt-go/.travis.yml | 44 -- vendor/github.com/libvirt/libvirt-go/FAQ.md | 19 - .../go/libvirt}/.gitignore | 1 - vendor/libvirt.org/go/libvirt/.gitlab-ci.yml | 53 ++ .../libvirt.org/go/libvirt/CONTRIBUTING.rst | 28 + .../go/libvirt}/LICENSE | 0 .../go/libvirt/README.rst} | 123 ++-- vendor/libvirt.org/go/libvirt/VERSIONING.rst | 65 ++ .../go/libvirt}/callbacks.go | 8 +- .../go/libvirt}/callbacks_wrapper.go | 2 +- .../go/libvirt}/callbacks_wrapper.h | 2 +- .../go/libvirt}/connect.go | 325 ++++++++-- .../go/libvirt}/connect_compat.h | 61 +- .../go/libvirt}/connect_wrapper.go | 84 ++- .../go/libvirt}/connect_wrapper.h | 31 +- .../go/libvirt}/doc.go | 8 +- .../go/libvirt}/domain.go | 613 +++++++++++++++--- .../go/libvirt}/domain_checkpoint.go | 15 +- .../go/libvirt}/domain_checkpoint_compat.h | 8 +- .../go/libvirt}/domain_checkpoint_wrapper.go | 2 +- .../go/libvirt}/domain_checkpoint_wrapper.h | 2 +- .../go/libvirt}/domain_compat.h | 183 +++++- .../go/libvirt}/domain_events.go | 108 ++- .../go/libvirt}/domain_events_wrapper.go | 23 +- .../go/libvirt}/domain_events_wrapper.h | 17 +- .../go/libvirt}/domain_snapshot.go | 12 +- .../go/libvirt}/domain_snapshot_compat.h | 2 +- .../go/libvirt}/domain_snapshot_wrapper.go | 2 +- .../go/libvirt}/domain_snapshot_wrapper.h | 2 +- .../go/libvirt}/domain_wrapper.go | 92 ++- .../go/libvirt}/domain_wrapper.h | 34 +- .../go/libvirt}/error.go | 27 +- .../go/libvirt}/error_compat.h | 28 +- .../go/libvirt}/events.go | 2 +- .../go/libvirt}/events_wrapper.go | 2 +- .../go/libvirt}/events_wrapper.h | 2 +- .../go/libvirt}/interface.go | 10 +- .../libvirt.org/go/libvirt/interface_compat.h | 35 + .../go/libvirt}/interface_wrapper.go | 2 +- .../go/libvirt}/interface_wrapper.h | 3 +- .../go/libvirt}/libvirtd.conf | 0 .../go/libvirt}/libvirtd.sasl | 0 .../go/libvirt}/lxc.go | 2 +- .../go/libvirt}/lxc_wrapper.go | 4 +- .../go/libvirt}/lxc_wrapper.h | 2 +- .../go/libvirt}/network.go | 22 +- .../go/libvirt}/network_compat.h | 14 +- .../go/libvirt}/network_events.go | 2 +- .../go/libvirt}/network_events_wrapper.go | 2 +- .../go/libvirt}/network_events_wrapper.h | 2 +- .../go/libvirt}/network_port.go | 15 +- .../go/libvirt}/network_port_compat.h | 9 +- .../go/libvirt}/network_port_wrapper.go | 2 +- .../go/libvirt}/network_port_wrapper.h | 2 +- .../go/libvirt}/network_wrapper.go | 2 +- .../go/libvirt}/network_wrapper.h | 2 +- .../go/libvirt}/node_device.go | 105 ++- .../go/libvirt}/node_device_compat.h | 9 +- .../go/libvirt}/node_device_events.go | 2 +- .../go/libvirt}/node_device_events_wrapper.go | 2 +- .../go/libvirt}/node_device_events_wrapper.h | 2 +- .../go/libvirt}/node_device_wrapper.go | 102 ++- .../go/libvirt}/node_device_wrapper.h | 29 +- .../go/libvirt}/nwfilter.go | 8 +- .../go/libvirt}/nwfilter_binding.go | 8 +- .../go/libvirt}/nwfilter_binding_compat.h | 8 +- .../go/libvirt}/nwfilter_binding_wrapper.go | 2 +- .../go/libvirt}/nwfilter_binding_wrapper.h | 2 +- .../libvirt.org/go/libvirt/nwfilter_compat.h | 35 + .../go/libvirt}/nwfilter_wrapper.go | 2 +- .../go/libvirt}/nwfilter_wrapper.h | 4 +- .../go/libvirt}/qemu.go | 11 +- .../go/libvirt}/qemu_compat.h | 2 +- .../go/libvirt}/qemu_wrapper.go | 4 +- .../go/libvirt}/qemu_wrapper.h | 2 +- .../go/libvirt}/secret.go | 8 +- .../go/libvirt}/secret_compat.h | 8 +- .../go/libvirt}/secret_events.go | 2 +- .../go/libvirt}/secret_events_wrapper.go | 2 +- .../go/libvirt}/secret_events_wrapper.h | 2 +- .../go/libvirt}/secret_wrapper.go | 2 +- .../go/libvirt}/secret_wrapper.h | 2 +- .../go/libvirt}/storage_pool.go | 14 +- .../go/libvirt}/storage_pool_compat.h | 7 +- .../go/libvirt}/storage_pool_events.go | 2 +- .../libvirt}/storage_pool_events_wrapper.go | 2 +- .../go/libvirt}/storage_pool_events_wrapper.h | 2 +- .../go/libvirt}/storage_pool_wrapper.go | 2 +- .../go/libvirt}/storage_pool_wrapper.h | 2 +- .../go/libvirt}/storage_volume.go | 16 +- .../go/libvirt}/storage_volume_compat.h | 2 +- .../go/libvirt}/storage_volume_wrapper.go | 2 +- .../go/libvirt}/storage_volume_wrapper.h | 2 +- .../go/libvirt}/stream.go | 6 +- .../go/libvirt}/stream_compat.h | 2 +- .../go/libvirt}/stream_wrapper.go | 2 +- .../go/libvirt}/stream_wrapper.h | 2 +- .../go/libvirt}/typedparams.go | 2 +- .../go/libvirt}/typedparams_wrapper.go | 2 +- .../go/libvirt}/typedparams_wrapper.h | 2 +- vendor/modules.txt | 6 +- 107 files changed, 2219 insertions(+), 403 deletions(-) delete mode 100644 vendor/github.com/libvirt/libvirt-go/.gitpublish delete mode 100644 vendor/github.com/libvirt/libvirt-go/.travis.yml delete mode 100644 vendor/github.com/libvirt/libvirt-go/FAQ.md rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/.gitignore (77%) create mode 100644 vendor/libvirt.org/go/libvirt/.gitlab-ci.yml create mode 100644 vendor/libvirt.org/go/libvirt/CONTRIBUTING.rst rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/LICENSE (100%) rename vendor/{github.com/libvirt/libvirt-go/README.md => libvirt.org/go/libvirt/README.rst} (50%) create mode 100644 vendor/libvirt.org/go/libvirt/VERSIONING.rst rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/callbacks.go (96%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/callbacks_wrapper.go (96%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/callbacks_wrapper.h (96%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/connect.go (91%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/connect_compat.h (83%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/connect_wrapper.go (95%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/connect_wrapper.h (96%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/doc.go (96%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/domain.go (89%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/domain_checkpoint.go (91%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/domain_checkpoint_compat.h (93%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/domain_checkpoint_wrapper.go (98%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/domain_checkpoint_wrapper.h (97%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/domain_compat.h (86%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/domain_events.go (93%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/domain_events_wrapper.go (91%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/domain_events_wrapper.h (95%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/domain_snapshot.go (97%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/domain_snapshot_compat.h (96%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/domain_snapshot_wrapper.go (98%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/domain_snapshot_wrapper.h (98%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/domain_wrapper.go (96%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/domain_wrapper.h (97%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/error.go (96%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/error_compat.h (90%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/events.go (99%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/events_wrapper.go (98%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/events_wrapper.h (97%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/interface.go (95%) create mode 100644 vendor/libvirt.org/go/libvirt/interface_compat.h rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/interface_wrapper.go (98%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/interface_wrapper.h (96%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/libvirtd.conf (100%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/libvirtd.sasl (100%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/lxc.go (98%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/lxc_wrapper.go (97%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/lxc_wrapper.h (97%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/network.go (96%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/network_compat.h (91%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/network_events.go (98%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/network_events_wrapper.go (98%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/network_events_wrapper.h (97%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/network_port.go (93%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/network_port_compat.h (93%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/network_port_wrapper.go (98%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/network_port_wrapper.h (97%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/network_wrapper.go (99%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/network_wrapper.h (98%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/node_device.go (63%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/node_device_compat.h (89%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/node_device_events.go (98%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/node_device_events_wrapper.go (98%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/node_device_events_wrapper.h (97%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/node_device_wrapper.go (65%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/node_device_wrapper.h (79%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/nwfilter.go (95%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/nwfilter_binding.go (95%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/nwfilter_binding_compat.h (88%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/nwfilter_binding_wrapper.go (98%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/nwfilter_binding_wrapper.h (97%) create mode 100644 vendor/libvirt.org/go/libvirt/nwfilter_compat.h rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/nwfilter_wrapper.go (98%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/nwfilter_wrapper.h (96%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/qemu.go (90%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/qemu_compat.h (97%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/qemu_wrapper.go (98%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/qemu_wrapper.h (98%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/secret.go (97%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/secret_compat.h (92%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/secret_events.go (98%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/secret_events_wrapper.go (98%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/secret_events_wrapper.h (97%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/secret_wrapper.go (98%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/secret_wrapper.h (98%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/storage_pool.go (97%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/storage_pool_compat.h (94%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/storage_pool_events.go (98%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/storage_pool_events_wrapper.go (98%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/storage_pool_events_wrapper.h (97%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/storage_pool_wrapper.go (99%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/storage_pool_wrapper.h (98%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/storage_volume.go (97%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/storage_volume_compat.h (97%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/storage_volume_wrapper.go (99%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/storage_volume_wrapper.h (98%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/stream.go (98%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/stream_compat.h (96%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/stream_wrapper.go (99%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/stream_wrapper.h (98%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/typedparams.go (99%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/typedparams_wrapper.go (99%) rename vendor/{github.com/libvirt/libvirt-go => libvirt.org/go/libvirt}/typedparams_wrapper.h (98%) diff --git a/go.mod b/go.mod index d611b139..9edaae5e 100644 --- a/go.mod +++ b/go.mod @@ -2,9 +2,9 @@ module github.com/crc-org/machine-driver-libvirt require ( github.com/crc-org/machine v0.0.0-20221028075518-f9b43442196b - github.com/libvirt/libvirt-go v6.0.0+incompatible github.com/sirupsen/logrus v1.9.3 github.com/stretchr/testify v1.8.4 + libvirt.org/go/libvirt v1.8000.0 libvirt.org/go/libvirtxml v1.9004.0 ) diff --git a/go.sum b/go.sum index 4ca0414f..cf75b535 100644 --- a/go.sum +++ b/go.sum @@ -10,8 +10,6 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/libvirt/libvirt-go v6.0.0+incompatible h1:zGL0R7xG+9yGvRNlNbJtMugA0wn6WRLqY4coGuRE+GU= -github.com/libvirt/libvirt-go v6.0.0+incompatible/go.mod h1:34zsnB4iGeOv7Byj6qotuW8Ya4v4Tr43ttjz/F0wjLE= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= @@ -29,5 +27,7 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EV gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +libvirt.org/go/libvirt v1.8000.0 h1:1sOyBCZA7t0xHrih3lF3h3CFDAlZFaulIzFtNDVtnW0= +libvirt.org/go/libvirt v1.8000.0/go.mod h1:1WiFE8EjZfq+FCVog+rvr1yatKbKZ9FaFMZgEqxEJqQ= libvirt.org/go/libvirtxml v1.9004.0 h1:h+nhEZCABCnK4go0GLRN2WZhIhRrLAqsz84t553oiM4= libvirt.org/go/libvirtxml v1.9004.0/go.mod h1:7Oq2BLDstLr/XtoQD8Fr3mfDNrzlI3utYKySXF2xkng= diff --git a/pkg/libvirt/domain.go b/pkg/libvirt/domain.go index 6f2ea882..1cd2d56f 100644 --- a/pkg/libvirt/domain.go +++ b/pkg/libvirt/domain.go @@ -3,7 +3,7 @@ package libvirt import ( "fmt" - "github.com/libvirt/libvirt-go" + "libvirt.org/go/libvirt" "libvirt.org/go/libvirtxml" "github.com/crc-org/machine/libmachine/drivers" diff --git a/pkg/libvirt/libvirt.go b/pkg/libvirt/libvirt.go index 1bd04650..26154d16 100644 --- a/pkg/libvirt/libvirt.go +++ b/pkg/libvirt/libvirt.go @@ -12,8 +12,8 @@ import ( libvirtdriver "github.com/crc-org/machine/drivers/libvirt" "github.com/crc-org/machine/libmachine/drivers" "github.com/crc-org/machine/libmachine/state" - "github.com/libvirt/libvirt-go" log "github.com/sirupsen/logrus" + "libvirt.org/go/libvirt" "libvirt.org/go/libvirtxml" ) @@ -525,7 +525,7 @@ func (d *Driver) GetIP() (string, error) { for _, iface := range ifaces { if iface.Hwaddr == macAddress { for _, addr := range iface.Addrs { - if addr.Type == int(libvirt.IP_ADDR_TYPE_IPV4) { // ipv4 + if addr.Type == libvirt.IP_ADDR_TYPE_IPV4 { // ipv4 log.Debugf("IP address: %s", addr.Addr) return addr.Addr, nil } diff --git a/pkg/libvirt/storage.go b/pkg/libvirt/storage.go index 4e4e8a4c..c4dd1fe2 100644 --- a/pkg/libvirt/storage.go +++ b/pkg/libvirt/storage.go @@ -4,8 +4,8 @@ import ( "fmt" "os" - "github.com/libvirt/libvirt-go" log "github.com/sirupsen/logrus" + "libvirt.org/go/libvirt" "libvirt.org/go/libvirtxml" ) diff --git a/vendor/github.com/libvirt/libvirt-go/.gitpublish b/vendor/github.com/libvirt/libvirt-go/.gitpublish deleted file mode 100644 index 567c1398..00000000 --- a/vendor/github.com/libvirt/libvirt-go/.gitpublish +++ /dev/null @@ -1,4 +0,0 @@ -[gitpublishprofile "default"] -base = master -to = libvir-list@redhat.com -prefix = go PATCH diff --git a/vendor/github.com/libvirt/libvirt-go/.travis.yml b/vendor/github.com/libvirt/libvirt-go/.travis.yml deleted file mode 100644 index e4bb9890..00000000 --- a/vendor/github.com/libvirt/libvirt-go/.travis.yml +++ /dev/null @@ -1,44 +0,0 @@ -language: go -os: linux -dist: xenial -sudo: require - -go: - - "1.5" - - "1.6" - - "1.7" - - "1.8" - - "1.9" - - "1.10" - - "1.11" - -env: - - LIBVIRT=1.2.0 EXT=gz TEST_ARGS= - - LIBVIRT=1.2.20 EXT=gz TEST_ARGS="-tags integration" - - LIBVIRT=2.5.0 EXT=xz TEST_ARGS="-tags integration" - - LIBVIRT=3.6.0 EXT=xz TEST_ARGS="-tags integration" - - LIBVIRT=4.10.0 EXT=xz TEST_ARGS="-tags integration" - -install: - - sudo apt-get -qqy build-dep libvirt - - sudo apt-get -qqy install curl qemu-system-x86 sasl2-bin - - sudo mkdir -p /usr/src && sudo chown $(id -u) /usr/src - - curl -O -s https://libvirt.org/sources/libvirt-${LIBVIRT}.tar.${EXT} - - tar -C /usr/src -xf libvirt-${LIBVIRT}.tar.${EXT} - - pushd /usr/src/libvirt-${LIBVIRT} - - | - ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc \ - --without-polkit \ - --without-esx --without-vbox --without-xen --without-libxl \ - --with-qemu --with-lxc - - make - - sudo make install - - popd - - sudo cp libvirtd.sasl /etc/sasl2/libvirt.conf - - sudo libvirtd -d -l -f libvirtd.conf - - sudo virtlogd -d || true - - sudo chmod a+rwx /var/run/libvirt/libvirt-sock* - - echo "pass" | sudo saslpasswd2 -p -a libvirt user - -script: - go test -timeout 1m $TEST_ARGS -v diff --git a/vendor/github.com/libvirt/libvirt-go/FAQ.md b/vendor/github.com/libvirt/libvirt-go/FAQ.md deleted file mode 100644 index 0e731817..00000000 --- a/vendor/github.com/libvirt/libvirt-go/FAQ.md +++ /dev/null @@ -1,19 +0,0 @@ -#libvirt-go - -##FAQ - Frequently asked questions - -If your question is a good one, please ask it as a well-formatted patch to this -repository, and we'll merge it along with the answer. - -###Why does this fail when added to my project in travis? - -This lib requires a newish version of the libvirt-dev library to compile. These -are only available in the newer travis environment. You can add: - -``` -sudo: true -dist: trusty -install: sudo apt-get install -y libvirt-dev -``` - -to your `.travis.yaml` file to avoid these errors. diff --git a/vendor/github.com/libvirt/libvirt-go/.gitignore b/vendor/libvirt.org/go/libvirt/.gitignore similarity index 77% rename from vendor/github.com/libvirt/libvirt-go/.gitignore rename to vendor/libvirt.org/go/libvirt/.gitignore index 3624e1cf..6f0ba44a 100644 --- a/vendor/github.com/libvirt/libvirt-go/.gitignore +++ b/vendor/libvirt.org/go/libvirt/.gitignore @@ -1,7 +1,6 @@ *.sublime-workspace *.sublime-project .vagrant -/libvirt-go.test *~ .#* \#* 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 00000000..0edbcd40 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/.gitlab-ci.yml @@ -0,0 +1,53 @@ + +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 + before_script: + - *git_build_vars + script: + - 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 + +.native_build_job: + extends: .gitlab_native_build_job + script: + - go build + - go test + +include: '/ci/gitlab.yml' + +api-coverage: + image: $CI_REGISTRY_IMAGE/ci-centos-8:latest + stage: sanity_checks + needs: + - job: x86_64-centos-8-git + artifacts: true + before_script: + - *git_build_vars + script: + - go test -tags api + rules: + - if: '$CI_PIPELINE_SOURCE == "push"' + allow_failure: true + - if: '$CI_PIPELINE_SOURCE == "schedule"' diff --git a/vendor/libvirt.org/go/libvirt/CONTRIBUTING.rst b/vendor/libvirt.org/go/libvirt/CONTRIBUTING.rst new file mode 100644 index 00000000..1e5cfa40 --- /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/github.com/libvirt/libvirt-go/LICENSE b/vendor/libvirt.org/go/libvirt/LICENSE similarity index 100% rename from vendor/github.com/libvirt/libvirt-go/LICENSE rename to vendor/libvirt.org/go/libvirt/LICENSE diff --git a/vendor/github.com/libvirt/libvirt-go/README.md b/vendor/libvirt.org/go/libvirt/README.rst similarity index 50% rename from vendor/github.com/libvirt/libvirt-go/README.md rename to vendor/libvirt.org/go/libvirt/README.rst index 326d6a06..9a3fd66e 100644 --- a/vendor/github.com/libvirt/libvirt-go/README.md +++ b/vendor/libvirt.org/go/libvirt/README.rst @@ -1,10 +1,22 @@ -# libvirt-go [![Build Status](https://travis-ci.org/libvirt/libvirt-go.svg?branch=master)](https://travis-ci.org/libvirt/libvirt-go) [![GoDoc](https://godoc.org/github.com/libvirt/libvirt-go?status.svg)](https://godoc.org/github.com/libvirt/libvirt-go) +================= +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) +Make sure to have ``libvirt-dev`` package (or the development files +otherwise somewhere in your include path) + -## Version Support +Version Support +=============== The libvirt go package provides API coverage for libvirt versions from 1.2.0 onwards, through conditional compilation of newer APIs. @@ -14,7 +26,9 @@ and libvirt-lxc.so. Coverage for the latter two libraries can be dropped from the build using build tags 'without_qemu' or 'without_lxc' respectively. -## Development status + +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 @@ -30,47 +44,32 @@ changes may apply to future versions: '0' to any 'flags uint32' parameter, since this will auto-cast to any future typedef that is introduced. -## Documentation - -* [api documentation for the bindings](https://godoc.org/github.com/libvirt/libvirt-go) -* [api documentation for libvirt](http://libvirt.org/html/libvirt-libvirt.html) - -## Contributing - -The libvirt project aims to add support for new APIs to libvirt-go -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 change at the same time. - -Bug fixes and other improvements to the libvirt-go library are -welcome at any time. The preferred submission method is to use -git send-email to submit patches to the libvir-list@redhat.com -mailing list. eg. to send a single patch +Please see the `VERSIONING `_ file for information +about release schedule and versioning scheme. - git send-email --to libvir-list@redhat.com --subject-prefix "PATCH go" \ - --smtp-server=$HOSTNAME -1 -Or to send all patches on the current branch, against master +Documentation +============= - git send-email --to libvir-list@redhat.com --subject-prefix "PATCH go" \ - --smtp-server=$HOSTNAME --no-chain-reply-to --cover-letter --annotate \ - master.. +* `API documentation for the bindings `_ +* `API documentation for libvirt `_ -Note the master GIT repository is at -* http://libvirt.org/git/?p=libvirt-go.git;a=summary +Contributing +============ -The following automatic read-only mirrors are available as a -convenience to allow contributors to "fork" the repository: +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. -* https://gitlab.com/libvirt/libvirt-go -* https://github.com/libvirt/libvirt-go +For more information, see the `CONTRIBUTING `_ +file. -While you can send pull-requests to these mirrors, they will be -re-submitted via emai to the mailing list for review before -being merged, unless they are trivial/obvious bug fixes. -## Testing +Testing +======= The core API unit tests are all written to use the built-in test driver (test:///default), so they have no interaction @@ -90,47 +89,43 @@ 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 < /etc/polkit-1/localauthority/50-local.d/50-libvirt.pkla < 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++ { + diskInfo := getDomainGuestInfoDiskDependencyFieldInfo(i, j, &info.Disks[i].Dependencies[j]) + + _, gerr = typedParamsUnpack(cparams, cnparams, diskInfo) + 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 } @@ -5278,3 +5636,92 @@ func (d *Domain) BackupGetXMLDesc(flags uint32) (string, error) { return xml, nil } + +func (d *Domain) AuthorizedSSHKeysGet(user string, flags DomainAuthorizedSSHKeysFlags) ([]string, error) { + if C.LIBVIR_VERSION_NUMBER < 6010000 { + return []string{}, makeNotImplementedError("virDomainAuthorizedSSHKeysGet") + } + 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 { + if C.LIBVIR_VERSION_NUMBER < 6010000 { + return makeNotImplementedError("virDomainAuthorizedSSHKeysSet") + } + 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 err C.virError + ret := C.virDomainAuthorizedSSHKeysSetWrapper(d.ptr, cuser, (**C.char)(unsafe.Pointer(&ckeys[0])), C.uint(nkeys), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil + +} + +func (d *Domain) GetMessages(flags DomainMessageType) ([]string, error) { + if C.LIBVIR_VERSION_NUMBER < 7001000 { + return []string{}, makeNotImplementedError("virDomainGetMessages") + } + + 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 uint) error { + if C.LIBVIR_VERSION_NUMBER < 7002000 { + return makeNotImplementedError("virDomainStartDirtyRateCalc") + } + + var err C.virError + ret := C.virDomainStartDirtyRateCalcWrapper(d.ptr, C.int(secs), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} diff --git a/vendor/github.com/libvirt/libvirt-go/domain_checkpoint.go b/vendor/libvirt.org/go/libvirt/domain_checkpoint.go similarity index 91% rename from vendor/github.com/libvirt/libvirt-go/domain_checkpoint.go rename to vendor/libvirt.org/go/libvirt/domain_checkpoint.go index da876f9a..3fb6f5c6 100644 --- a/vendor/github.com/libvirt/libvirt-go/domain_checkpoint.go +++ b/vendor/libvirt.org/go/libvirt/domain_checkpoint.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -38,14 +38,15 @@ import ( "unsafe" ) -type DomainCheckpointCreateFlags int +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 = 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 int +type DomainCheckpointListFlags uint const ( DOMAIN_CHECKPOINT_LIST_ROOTS = DomainCheckpointListFlags(C.VIR_DOMAIN_CHECKPOINT_LIST_ROOTS) @@ -55,7 +56,7 @@ const ( DOMAIN_CHECKPOINT_LIST_TOPOLOGICAL = DomainCheckpointListFlags(C.VIR_DOMAIN_CHECKPOINT_LIST_TOPOLOGICAL) ) -type DomainCheckpointDeleteFlags int +type DomainCheckpointDeleteFlags uint const ( DOMAIN_CHECKPOINT_DELETE_CHILDREN = DomainCheckpointDeleteFlags(C.VIR_DOMAIN_CHECKPOINT_DELETE_CHILDREN) @@ -63,7 +64,7 @@ const ( DOMAIN_CHECKPOINT_DELETE_CHILDREN_ONLY = DomainCheckpointDeleteFlags(C.VIR_DOMAIN_CHECKPOINT_DELETE_CHILDREN_ONLY) ) -type DomainCheckpointXMLFlags int +type DomainCheckpointXMLFlags uint const ( DOMAIN_CHECKPOINT_XML_SECURE = DomainCheckpointXMLFlags(C.VIR_DOMAIN_CHECKPOINT_XML_SECURE) diff --git a/vendor/github.com/libvirt/libvirt-go/domain_checkpoint_compat.h b/vendor/libvirt.org/go/libvirt/domain_checkpoint_compat.h similarity index 93% rename from vendor/github.com/libvirt/libvirt-go/domain_checkpoint_compat.h rename to vendor/libvirt.org/go/libvirt/domain_checkpoint_compat.h index 7213da74..9a3bd70a 100644 --- a/vendor/github.com/libvirt/libvirt-go/domain_checkpoint_compat.h +++ b/vendor/libvirt.org/go/libvirt/domain_checkpoint_compat.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -91,5 +91,11 @@ typedef struct _virDomainCheckpoint *virDomainCheckpointPtr; # define VIR_DOMAIN_CHECKPOINT_XML_SIZE (1 << 2) #endif +/* 6.10.0 */ + +#ifndef VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE_VALIDATE +# define VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE_VALIDATE (1 << 2) +#endif + #endif /* LIBVIRT_GO_DOMAIN_CHECKPOINT_COMPAT_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/domain_checkpoint_wrapper.go b/vendor/libvirt.org/go/libvirt/domain_checkpoint_wrapper.go similarity index 98% rename from vendor/github.com/libvirt/libvirt-go/domain_checkpoint_wrapper.go rename to vendor/libvirt.org/go/libvirt/domain_checkpoint_wrapper.go index b51f2dcd..87e04e7f 100644 --- a/vendor/github.com/libvirt/libvirt-go/domain_checkpoint_wrapper.go +++ b/vendor/libvirt.org/go/libvirt/domain_checkpoint_wrapper.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/domain_checkpoint_wrapper.h b/vendor/libvirt.org/go/libvirt/domain_checkpoint_wrapper.h similarity index 97% rename from vendor/github.com/libvirt/libvirt-go/domain_checkpoint_wrapper.h rename to vendor/libvirt.org/go/libvirt/domain_checkpoint_wrapper.h index fe9f99cf..c8a90a5b 100644 --- a/vendor/github.com/libvirt/libvirt-go/domain_checkpoint_wrapper.h +++ b/vendor/libvirt.org/go/libvirt/domain_checkpoint_wrapper.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/domain_compat.h b/vendor/libvirt.org/go/libvirt/domain_compat.h similarity index 86% rename from vendor/github.com/libvirt/libvirt-go/domain_compat.h rename to vendor/libvirt.org/go/libvirt/domain_compat.h index cdc1ec36..680ac242 100644 --- a/vendor/github.com/libvirt/libvirt-go/domain_compat.h +++ b/vendor/libvirt.org/go/libvirt/domain_compat.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -1058,4 +1058,185 @@ struct _virDomainInterface { #define VIR_DOMAIN_STATS_MEMORY (1 << 8) #endif +/* 6.1.0 */ + +#ifndef VIR_DOMAIN_GET_HOSTNAME_LEASE +#define VIR_DOMAIN_GET_HOSTNAME_LEASE (1 << 0) +#endif + +#ifndef VIR_DOMAIN_GET_HOSTNAME_AGENT +#define VIR_DOMAIN_GET_HOSTNAME_AGENT (1 << 1) +#endif + +#ifndef VIR_DOMAIN_EVENT_CRASHED_CRASHLOADED +#define VIR_DOMAIN_EVENT_CRASHED_CRASHLOADED 1 +#endif + +/* 6.3.0 */ + +#ifndef VIR_DOMAIN_JOB_ERRMSG +#define VIR_DOMAIN_JOB_ERRMSG "errmsg" +#endif + + +/* 6.8.0 */ + +#ifndef VIR_MIGRATE_PARAM_DISKS_URI +#define VIR_MIGRATE_PARAM_DISKS_URI "disks_uri" +#endif + + +/* 6.9.0 */ + +#ifndef VIR_DOMAIN_EVENT_MEMORY_FAILURE_RECIPIENT_HYPERVISOR +#define VIR_DOMAIN_EVENT_MEMORY_FAILURE_RECIPIENT_HYPERVISOR 0 +#endif + +#ifndef VIR_DOMAIN_EVENT_MEMORY_FAILURE_RECIPIENT_GUEST +#define VIR_DOMAIN_EVENT_MEMORY_FAILURE_RECIPIENT_GUEST 1 +#endif + + +#ifndef VIR_DOMAIN_EVENT_MEMORY_FAILURE_ACTION_IGNORE +#define VIR_DOMAIN_EVENT_MEMORY_FAILURE_ACTION_IGNORE 0 +#endif + +#ifndef VIR_DOMAIN_EVENT_MEMORY_FAILURE_ACTION_INJECT +#define VIR_DOMAIN_EVENT_MEMORY_FAILURE_ACTION_INJECT 1 +#endif + +#ifndef VIR_DOMAIN_EVENT_MEMORY_FAILURE_ACTION_FATAL +#define VIR_DOMAIN_EVENT_MEMORY_FAILURE_ACTION_FATAL 2 +#endif + +#ifndef VIR_DOMAIN_EVENT_MEMORY_FAILURE_ACTION_RESET +#define VIR_DOMAIN_EVENT_MEMORY_FAILURE_ACTION_RESET 3 +#endif + + +#ifndef VIR_DOMAIN_MEMORY_FAILURE_ACTION_REQUIRED +#define VIR_DOMAIN_MEMORY_FAILURE_ACTION_REQUIRED (1 << 0) +#endif + +#ifndef VIR_DOMAIN_MEMORY_FAILURE_RECURSIVE +#define VIR_DOMAIN_MEMORY_FAILURE_RECURSIVE (1 << 1) +#endif + + +#ifndef VIR_DOMAIN_EVENT_ID_MEMORY_FAILURE +#define VIR_DOMAIN_EVENT_ID_MEMORY_FAILURE 25 +#endif + +#ifndef VIR_VCPU_INFO_CPU_OFFLINE +#define VIR_VCPU_INFO_CPU_OFFLINE -1 +#endif + +#ifndef VIR_VCPU_INFO_CPU_UNAVAILABLE +#define VIR_VCPU_INFO_CPU_UNAVAILABLE -2 +#endif + +#ifndef VIR_DOMAIN_AUTHORIZED_SSH_KEYS_SET_APPEND +#define VIR_DOMAIN_AUTHORIZED_SSH_KEYS_SET_APPEND (1 << 0) +#endif + +#ifndef VIR_DOMAIN_AUTHORIZED_SSH_KEYS_SET_REMOVE +#define VIR_DOMAIN_AUTHORIZED_SSH_KEYS_SET_REMOVE (1 << 1) +#endif + +/* 7.0.0 */ + +#ifndef VIR_DOMAIN_GUEST_INFO_DISKS +#define VIR_DOMAIN_GUEST_INFO_DISKS (1 << 5) +#endif + +/* 7.1.0 */ + +#ifndef VIR_DOMAIN_MESSAGE_DEPRECATION +#define VIR_DOMAIN_MESSAGE_DEPRECATION (1 << 0) +#endif + +#ifndef VIR_DOMAIN_MESSAGE_TAINTING +#define VIR_DOMAIN_MESSAGE_TAINTING (1 << 1) +#endif + +/* 7.2.0 */ + +#ifndef VIR_DOMAIN_DIRTYRATE_UNSTARTED +#define VIR_DOMAIN_DIRTYRATE_UNSTARTED 0 +#endif + +#ifndef VIR_DOMAIN_DIRTYRATE_MEASURING +#define VIR_DOMAIN_DIRTYRATE_MEASURING 1 +#endif + +#ifndef VIR_DOMAIN_DIRTYRATE_MEASURED +#define VIR_DOMAIN_DIRTYRATE_MEASURED 2 +#endif + +#ifndef VIR_DOMAIN_STATS_DIRTYRATE +#define VIR_DOMAIN_STATS_DIRTYRATE (1 << 9) +#endif + + +#ifndef VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE +#define VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE 3 +#endif + +/* 7.4.0 */ + +#ifndef VIR_DOMAIN_CORE_DUMP_FORMAT_WIN_DMP +#define VIR_DOMAIN_CORE_DUMP_FORMAT_WIN_DMP 4 +#endif + +/* 7.9.0 */ + +#ifndef VIR_DOMAIN_EVENT_ID_MEMORY_DEVICE_SIZE_CHANGE +#define VIR_DOMAIN_EVENT_ID_MEMORY_DEVICE_SIZE_CHANGE 26 +#endif + +/* 7.10.0 */ + +#ifndef VIR_DOMAIN_GUEST_INFO_INTERFACES +#define VIR_DOMAIN_GUEST_INFO_INTERFACES (1 << 6) +#endif + +/* 8.0.0 */ + +#ifndef VIR_DOMAIN_BLOCK_COPY_SYNCHRONOUS_WRITES +#define VIR_DOMAIN_BLOCK_COPY_SYNCHRONOUS_WRITES 1 << 3 +#endif + +#ifndef VIR_MIGRATE_NON_SHARED_SYNCHRONOUS_WRITES +#define VIR_MIGRATE_NON_SHARED_SYNCHRONOUS_WRITES 1 << 18 +#endif + +#ifndef VIR_DOMAIN_LAUNCH_SECURITY_SEV_API_MAJOR +#define VIR_DOMAIN_LAUNCH_SECURITY_SEV_API_MAJOR "sev-api-major" +#endif + +#ifndef VIR_DOMAIN_LAUNCH_SECURITY_SEV_API_MINOR +#define VIR_DOMAIN_LAUNCH_SECURITY_SEV_API_MINOR "sev-api-minor" +#endif + +#ifndef VIR_DOMAIN_LAUNCH_SECURITY_SEV_BUILD_ID +#define VIR_DOMAIN_LAUNCH_SECURITY_SEV_BUILD_ID "sev-build-id" +#endif + +#ifndef VIR_DOMAIN_LAUNCH_SECURITY_SEV_POLICY +#define VIR_DOMAIN_LAUNCH_SECURITY_SEV_POLICY "sev-policy" +#endif + +#ifndef VIR_DOMAIN_LAUNCH_SECURITY_SEV_SECRET +#define VIR_DOMAIN_LAUNCH_SECURITY_SEV_SECRET "sev-secret" +#endif + +#ifndef VIR_DOMAIN_LAUNCH_SECURITY_SEV_SECRET_HEADER +#define VIR_DOMAIN_LAUNCH_SECURITY_SEV_SECRET_HEADER "sev-secret-header" +#endif + +#ifndef VIR_DOMAIN_LAUNCH_SECURITY_SEV_SECRET_SET_ADDRESS +#define VIR_DOMAIN_LAUNCH_SECURITY_SEV_SECRET_SET_ADDRESS "sev-secret-set-address" +#endif + + #endif /* LIBVIRT_GO_DOMAIN_COMPAT_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/domain_events.go b/vendor/libvirt.org/go/libvirt/domain_events.go similarity index 93% rename from vendor/github.com/libvirt/libvirt-go/domain_events.go rename to vendor/libvirt.org/go/libvirt/domain_events.go index 2aff8e81..a0c6e79f 100644 --- a/vendor/github.com/libvirt/libvirt-go/domain_events.go +++ b/vendor/libvirt.org/go/libvirt/domain_events.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -202,7 +202,7 @@ type DomainEventDeviceRemovalFailed struct { type DomainEventDeviceRemovalFailedCallback func(c *Connect, d *Domain, event *DomainEventDeviceRemovalFailed) type DomainEventMetadataChange struct { - Type int + Type DomainMetadataType NSURI string } @@ -217,6 +217,22 @@ type DomainEventBlockThreshold struct { 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, @@ -328,13 +344,12 @@ func domainEventGraphicsCallback(c C.virConnectPtr, d C.virDomainPtr, connection := &Connect{ptr: c} subjectGo := make([]DomainEventGraphicsSubjectIdentity, 0) - nidentities := int(subject.nidentity) - identities := (*[1 << 30]C.virDomainEventGraphicsSubjectIdentity)(unsafe.Pointer(&subject.identities))[:nidentities:nidentities] - for _, identity := range identities { + 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(identity._type), - Name: C.GoString(identity.name), + Type: C.GoString(cidentity._type), + Name: C.GoString(cidentity.name), }, ) } @@ -562,7 +577,7 @@ func domainEventMetadataChangeCallback(c C.virConnectPtr, d C.virDomainPtr, connection := &Connect{ptr: c} eventDetails := &DomainEventMetadataChange{ - Type: (int)(mtype), + Type: DomainMetadataType(mtype), NSURI: C.GoString(nsuri), } callbackFunc := getCallbackId(goCallbackId) @@ -958,6 +973,43 @@ func domainEventBlockThresholdCallback(c C.virConnectPtr, d C.virDomainPtr, dev } +//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) @@ -1458,6 +1510,46 @@ func (c *Connect) DomainEventBlockThresholdRegister(dom *Domain, callback Domain 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.virConnectDomainEventRegisterAnyWrapper(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.virConnectDomainEventRegisterAnyWrapper(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 diff --git a/vendor/github.com/libvirt/libvirt-go/domain_events_wrapper.go b/vendor/libvirt.org/go/libvirt/domain_events_wrapper.go similarity index 91% rename from vendor/github.com/libvirt/libvirt-go/domain_events_wrapper.go rename to vendor/libvirt.org/go/libvirt/domain_events_wrapper.go index 5d74feed..4f8adda5 100644 --- a/vendor/github.com/libvirt/libvirt-go/domain_events_wrapper.go +++ b/vendor/libvirt.org/go/libvirt/domain_events_wrapper.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -225,6 +225,27 @@ void domainEventBlockThresholdCallbackHelper(virConnectPtr conn, 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 virConnectDomainEventRegisterAnyWrapper(virConnectPtr c, virDomainPtr d, diff --git a/vendor/github.com/libvirt/libvirt-go/domain_events_wrapper.h b/vendor/libvirt.org/go/libvirt/domain_events_wrapper.h similarity index 95% rename from vendor/github.com/libvirt/libvirt-go/domain_events_wrapper.h rename to vendor/libvirt.org/go/libvirt/domain_events_wrapper.h index 1670acdd..e17eed5f 100644 --- a/vendor/github.com/libvirt/libvirt-go/domain_events_wrapper.h +++ b/vendor/libvirt.org/go/libvirt/domain_events_wrapper.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -191,6 +191,21 @@ domainEventBlockThresholdCallbackHelper(virConnectPtr conn, 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 virConnectDomainEventRegisterAnyWrapper(virConnectPtr c, virDomainPtr d, diff --git a/vendor/github.com/libvirt/libvirt-go/domain_snapshot.go b/vendor/libvirt.org/go/libvirt/domain_snapshot.go similarity index 97% rename from vendor/github.com/libvirt/libvirt-go/domain_snapshot.go rename to vendor/libvirt.org/go/libvirt/domain_snapshot.go index 20ca14c9..72c484be 100644 --- a/vendor/github.com/libvirt/libvirt-go/domain_snapshot.go +++ b/vendor/libvirt.org/go/libvirt/domain_snapshot.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -38,7 +38,7 @@ import ( "unsafe" ) -type DomainSnapshotCreateFlags int +type DomainSnapshotCreateFlags uint const ( DOMAIN_SNAPSHOT_CREATE_REDEFINE = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE) @@ -53,7 +53,7 @@ const ( DOMAIN_SNAPSHOT_CREATE_VALIDATE = DomainSnapshotCreateFlags(C.VIR_DOMAIN_SNAPSHOT_CREATE_VALIDATE) ) -type DomainSnapshotListFlags int +type DomainSnapshotListFlags uint const ( DOMAIN_SNAPSHOT_LIST_ROOTS = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_ROOTS) @@ -70,7 +70,7 @@ const ( DOMAIN_SNAPSHOT_LIST_TOPOLOGICAL = DomainSnapshotListFlags(C.VIR_DOMAIN_SNAPSHOT_LIST_TOPOLOGICAL) ) -type DomainSnapshotRevertFlags int +type DomainSnapshotRevertFlags uint const ( DOMAIN_SNAPSHOT_REVERT_RUNNING = DomainSnapshotRevertFlags(C.VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING) @@ -78,7 +78,7 @@ const ( DOMAIN_SNAPSHOT_REVERT_FORCE = DomainSnapshotRevertFlags(C.VIR_DOMAIN_SNAPSHOT_REVERT_FORCE) ) -type DomainSnapshotDeleteFlags int +type DomainSnapshotDeleteFlags uint const ( DOMAIN_SNAPSHOT_DELETE_CHILDREN = DomainSnapshotDeleteFlags(C.VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN) @@ -86,7 +86,7 @@ const ( DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY = DomainSnapshotDeleteFlags(C.VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY) ) -type DomainSnapshotXMLFlags int +type DomainSnapshotXMLFlags uint const ( DOMAIN_SNAPSHOT_XML_SECURE = DomainSnapshotXMLFlags(C.VIR_DOMAIN_SNAPSHOT_XML_SECURE) diff --git a/vendor/github.com/libvirt/libvirt-go/domain_snapshot_compat.h b/vendor/libvirt.org/go/libvirt/domain_snapshot_compat.h similarity index 96% rename from vendor/github.com/libvirt/libvirt-go/domain_snapshot_compat.h rename to vendor/libvirt.org/go/libvirt/domain_snapshot_compat.h index d9f8271b..44fea688 100644 --- a/vendor/github.com/libvirt/libvirt-go/domain_snapshot_compat.h +++ b/vendor/libvirt.org/go/libvirt/domain_snapshot_compat.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/domain_snapshot_wrapper.go b/vendor/libvirt.org/go/libvirt/domain_snapshot_wrapper.go similarity index 98% rename from vendor/github.com/libvirt/libvirt-go/domain_snapshot_wrapper.go rename to vendor/libvirt.org/go/libvirt/domain_snapshot_wrapper.go index 04547de7..61a88205 100644 --- a/vendor/github.com/libvirt/libvirt-go/domain_snapshot_wrapper.go +++ b/vendor/libvirt.org/go/libvirt/domain_snapshot_wrapper.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/domain_snapshot_wrapper.h b/vendor/libvirt.org/go/libvirt/domain_snapshot_wrapper.h similarity index 98% rename from vendor/github.com/libvirt/libvirt-go/domain_snapshot_wrapper.h rename to vendor/libvirt.org/go/libvirt/domain_snapshot_wrapper.h index 7b07e510..bb7c227a 100644 --- a/vendor/github.com/libvirt/libvirt-go/domain_snapshot_wrapper.h +++ b/vendor/libvirt.org/go/libvirt/domain_snapshot_wrapper.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/domain_wrapper.go b/vendor/libvirt.org/go/libvirt/domain_wrapper.go similarity index 96% rename from vendor/github.com/libvirt/libvirt-go/domain_wrapper.go rename to vendor/libvirt.org/go/libvirt/domain_wrapper.go index e066baf8..88aa5727 100644 --- a/vendor/github.com/libvirt/libvirt-go/domain_wrapper.go +++ b/vendor/libvirt.org/go/libvirt/domain_wrapper.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -790,6 +790,25 @@ virDomainGetLaunchSecurityInfoWrapper(virDomainPtr domain, } +int +virDomainSetLaunchSecurityStateWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 8000000 + assert(0); // Caller should have checked version +#else + int ret = virDomainSetLaunchSecurityState(domain, params, nparams, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + unsigned long virDomainGetMaxMemoryWrapper(virDomainPtr domain, virErrorPtr err) @@ -2471,5 +2490,76 @@ virDomainBackupGetXMLDescWrapper(virDomainPtr domain, } +int +virDomainAuthorizedSSHKeysGetWrapper(virDomainPtr domain, + const char *user, + char ***keys, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 6010000 + assert(0); // Caller should have checked version +#else + int ret = virDomainAuthorizedSSHKeysGet(domain, user, keys, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + +int +virDomainAuthorizedSSHKeysSetWrapper(virDomainPtr domain, + const char *user, + const char **keys, + unsigned int nkeys, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 6010000 + assert(0); // Caller should have checked version +#else + int ret = virDomainAuthorizedSSHKeysSet(domain, user, keys, nkeys, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int virDomainGetMessagesWrapper(virDomainPtr domain, + char ***msgs, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 7001000 + assert(0); // Caller should have checked version +#else + int ret = virDomainGetMessages(domain, msgs, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int virDomainStartDirtyRateCalcWrapper(virDomainPtr domain, + int secs, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 7002000 + assert(0); // Caller should have checked version +#else + int ret = virDomainStartDirtyRateCalc(domain, secs, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + */ import "C" diff --git a/vendor/github.com/libvirt/libvirt-go/domain_wrapper.h b/vendor/libvirt.org/go/libvirt/domain_wrapper.h similarity index 97% rename from vendor/github.com/libvirt/libvirt-go/domain_wrapper.h rename to vendor/libvirt.org/go/libvirt/domain_wrapper.h index 818e808c..f7113c64 100644 --- a/vendor/github.com/libvirt/libvirt-go/domain_wrapper.h +++ b/vendor/libvirt.org/go/libvirt/domain_wrapper.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -347,6 +347,13 @@ virDomainGetLaunchSecurityInfoWrapper(virDomainPtr domain, unsigned int flags, virErrorPtr err); +int +virDomainSetLaunchSecurityStateWrapper(virDomainPtr domain, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err); + unsigned long virDomainGetMaxMemoryWrapper(virDomainPtr domain, virErrorPtr err); @@ -1035,5 +1042,30 @@ virDomainBackupGetXMLDescWrapper(virDomainPtr domain, 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 +virDomainGetMessagesWrapper(virDomainPtr domain, + char ***msgs, + unsigned int flags, + virErrorPtr err); + +int virDomainStartDirtyRateCalcWrapper(virDomainPtr domain, + int seconds, + unsigned int flags, + virErrorPtr err); #endif /* LIBVIRT_GO_DOMAIN_WRAPPER_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/error.go b/vendor/libvirt.org/go/libvirt/error.go similarity index 96% rename from vendor/github.com/libvirt/libvirt-go/error.go rename to vendor/libvirt.org/go/libvirt/error.go index 4b057fba..803ba23d 100644 --- a/vendor/github.com/libvirt/libvirt-go/error.go +++ b/vendor/libvirt.org/go/libvirt/error.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -57,6 +57,10 @@ const ( type ErrorNumber int +func (err ErrorNumber) Error() string { + return fmt.Sprintf("virErrCode(%d)", err) +} + const ( ERR_OK = ErrorNumber(C.VIR_ERR_OK) @@ -380,6 +384,15 @@ const ( // 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) ) type ErrorDomain int @@ -599,6 +612,9 @@ const ( // Error from BPF FROM_BPF = ErrorDomain(C.VIR_FROM_BPF) + + // Error from Cloud Hypervisor + FROM_CH = ErrorDomain(C.VIR_FROM_CH) ) type Error struct { @@ -613,6 +629,15 @@ func (err Error) Error() string { 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), diff --git a/vendor/github.com/libvirt/libvirt-go/error_compat.h b/vendor/libvirt.org/go/libvirt/error_compat.h similarity index 90% rename from vendor/github.com/libvirt/libvirt-go/error_compat.h rename to vendor/libvirt.org/go/libvirt/error_compat.h index 03839253..02a30c7d 100644 --- a/vendor/github.com/libvirt/libvirt-go/error_compat.h +++ b/vendor/libvirt.org/go/libvirt/error_compat.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -213,4 +213,30 @@ #define VIR_FROM_BPF 71 #endif +/* 6.1.0 */ +#ifndef VIR_ERR_NO_HOSTNAME +#define VIR_ERR_NO_HOSTNAME 108 +#endif + + +/* 6.10.0 */ + +#ifndef VIR_ERR_CHECKPOINT_INCONSISTENT +#define VIR_ERR_CHECKPOINT_INCONSISTENT 109 +#endif + + +/* 7.0.0 */ + +#ifndef VIR_ERR_MULTIPLE_DOMAINS +#define VIR_ERR_MULTIPLE_DOMAINS 110 +#endif + +/* 7.5.0 */ + +#ifndef VIR_FROM_CH +#define VIR_FROM_CH 72 +#endif + + #endif /* LIBVIRT_GO_ERROR_COMPAT_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/events.go b/vendor/libvirt.org/go/libvirt/events.go similarity index 99% rename from vendor/github.com/libvirt/libvirt-go/events.go rename to vendor/libvirt.org/go/libvirt/events.go index 23d5bbbd..5a2fe023 100644 --- a/vendor/github.com/libvirt/libvirt-go/events.go +++ b/vendor/libvirt.org/go/libvirt/events.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/events_wrapper.go b/vendor/libvirt.org/go/libvirt/events_wrapper.go similarity index 98% rename from vendor/github.com/libvirt/libvirt-go/events_wrapper.go rename to vendor/libvirt.org/go/libvirt/events_wrapper.go index 68145893..584e5471 100644 --- a/vendor/github.com/libvirt/libvirt-go/events_wrapper.go +++ b/vendor/libvirt.org/go/libvirt/events_wrapper.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/events_wrapper.h b/vendor/libvirt.org/go/libvirt/events_wrapper.h similarity index 97% rename from vendor/github.com/libvirt/libvirt-go/events_wrapper.h rename to vendor/libvirt.org/go/libvirt/events_wrapper.h index 62ea9c8a..05355891 100644 --- a/vendor/github.com/libvirt/libvirt-go/events_wrapper.h +++ b/vendor/libvirt.org/go/libvirt/events_wrapper.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/interface.go b/vendor/libvirt.org/go/libvirt/interface.go similarity index 95% rename from vendor/github.com/libvirt/libvirt-go/interface.go rename to vendor/libvirt.org/go/libvirt/interface.go index 9b6ebb2b..74a8f0a5 100644 --- a/vendor/github.com/libvirt/libvirt-go/interface.go +++ b/vendor/libvirt.org/go/libvirt/interface.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -37,12 +37,18 @@ import ( "unsafe" ) -type InterfaceXMLFlags int +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 } diff --git a/vendor/libvirt.org/go/libvirt/interface_compat.h b/vendor/libvirt.org/go/libvirt/interface_compat.h new file mode 100644 index 00000000..b3d92356 --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/interface_compat.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) 2021 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_INTERFACE_COMPAT_H__ +#define LIBVIRT_GO_INTERFACE_COMPAT_H__ + +/* 7.7.0 */ + +#ifndef VIR_INTERFACE_DEFINE_VALIDATE +#define VIR_INTERFACE_DEFINE_VALIDATE 1 << 0 +#endif + +#endif /* LIBVIRT_GO_INTERFACE_COMPAT_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/interface_wrapper.go b/vendor/libvirt.org/go/libvirt/interface_wrapper.go similarity index 98% rename from vendor/github.com/libvirt/libvirt-go/interface_wrapper.go rename to vendor/libvirt.org/go/libvirt/interface_wrapper.go index 36eb16f1..09e6625e 100644 --- a/vendor/github.com/libvirt/libvirt-go/interface_wrapper.go +++ b/vendor/libvirt.org/go/libvirt/interface_wrapper.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/interface_wrapper.h b/vendor/libvirt.org/go/libvirt/interface_wrapper.h similarity index 96% rename from vendor/github.com/libvirt/libvirt-go/interface_wrapper.h rename to vendor/libvirt.org/go/libvirt/interface_wrapper.h index 8d47a224..f67fd7ff 100644 --- a/vendor/github.com/libvirt/libvirt-go/interface_wrapper.h +++ b/vendor/libvirt.org/go/libvirt/interface_wrapper.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -28,6 +28,7 @@ #include #include +#include "interface_compat.h" int virInterfaceCreateWrapper(virInterfacePtr iface, diff --git a/vendor/github.com/libvirt/libvirt-go/libvirtd.conf b/vendor/libvirt.org/go/libvirt/libvirtd.conf similarity index 100% rename from vendor/github.com/libvirt/libvirt-go/libvirtd.conf rename to vendor/libvirt.org/go/libvirt/libvirtd.conf diff --git a/vendor/github.com/libvirt/libvirt-go/libvirtd.sasl b/vendor/libvirt.org/go/libvirt/libvirtd.sasl similarity index 100% rename from vendor/github.com/libvirt/libvirt-go/libvirtd.sasl rename to vendor/libvirt.org/go/libvirt/libvirtd.sasl diff --git a/vendor/github.com/libvirt/libvirt-go/lxc.go b/vendor/libvirt.org/go/libvirt/lxc.go similarity index 98% rename from vendor/github.com/libvirt/libvirt-go/lxc.go rename to vendor/libvirt.org/go/libvirt/lxc.go index 1578cab9..31364193 100644 --- a/vendor/github.com/libvirt/libvirt-go/lxc.go +++ b/vendor/libvirt.org/go/libvirt/lxc.go @@ -1,7 +1,7 @@ // +build !without_lxc /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/lxc_wrapper.go b/vendor/libvirt.org/go/libvirt/lxc_wrapper.go similarity index 97% rename from vendor/github.com/libvirt/libvirt-go/lxc_wrapper.go rename to vendor/libvirt.org/go/libvirt/lxc_wrapper.go index fa3d9103..03cc669e 100644 --- a/vendor/github.com/libvirt/libvirt-go/lxc_wrapper.go +++ b/vendor/libvirt.org/go/libvirt/lxc_wrapper.go @@ -1,5 +1,7 @@ +// +build !without_lxc + /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/lxc_wrapper.h b/vendor/libvirt.org/go/libvirt/lxc_wrapper.h similarity index 97% rename from vendor/github.com/libvirt/libvirt-go/lxc_wrapper.h rename to vendor/libvirt.org/go/libvirt/lxc_wrapper.h index b3afd6e5..481d59aa 100644 --- a/vendor/github.com/libvirt/libvirt-go/lxc_wrapper.h +++ b/vendor/libvirt.org/go/libvirt/lxc_wrapper.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/network.go b/vendor/libvirt.org/go/libvirt/network.go similarity index 96% rename from vendor/github.com/libvirt/libvirt-go/network.go rename to vendor/libvirt.org/go/libvirt/network.go index a0bc361b..74a1df09 100644 --- a/vendor/github.com/libvirt/libvirt-go/network.go +++ b/vendor/libvirt.org/go/libvirt/network.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -47,12 +47,24 @@ const ( IP_ADDR_TYPE_IPV6 = IPAddrType(C.VIR_IP_ADDR_TYPE_IPV6) ) -type NetworkXMLFlags int +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 ( @@ -81,7 +93,7 @@ const ( NETWORK_SECTION_DNS_SRV = NetworkUpdateSection(C.VIR_NETWORK_SECTION_DNS_SRV) ) -type NetworkUpdateFlags int +type NetworkUpdateFlags uint const ( NETWORK_UPDATE_AFFECT_CURRENT = NetworkUpdateFlags(C.VIR_NETWORK_UPDATE_AFFECT_CURRENT) @@ -374,7 +386,7 @@ func (n *Network) LookupNetworkPortByUUID(uuid []byte) (*NetworkPort, error) { } // See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkPortCreateXML -func (n *Network) PortCreateXML(xmlConfig string, flags uint) (*NetworkPort, error) { +func (n *Network) PortCreateXML(xmlConfig string, flags uint32) (*NetworkPort, error) { if C.LIBVIR_VERSION_NUMBER < 5005000 { return nil, makeNotImplementedError("virNetworkPortCreateXML") } @@ -389,7 +401,7 @@ func (n *Network) PortCreateXML(xmlConfig string, flags uint) (*NetworkPort, err } // See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkListAllPorts -func (n *Network) ListAllPorts(flags uint) ([]NetworkPort, error) { +func (n *Network) ListAllPorts(flags uint32) ([]NetworkPort, error) { if C.LIBVIR_VERSION_NUMBER < 5005000 { return []NetworkPort{}, makeNotImplementedError("virNetworkListAllPorts") } diff --git a/vendor/github.com/libvirt/libvirt-go/network_compat.h b/vendor/libvirt.org/go/libvirt/network_compat.h similarity index 91% rename from vendor/github.com/libvirt/libvirt-go/network_compat.h rename to vendor/libvirt.org/go/libvirt/network_compat.h index 08f0778a..a567ed51 100644 --- a/vendor/github.com/libvirt/libvirt-go/network_compat.h +++ b/vendor/libvirt.org/go/libvirt/network_compat.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -83,4 +83,16 @@ struct _virNetworkDHCPLease { }; #endif +/* 7.7.0 */ + +#ifndef VIR_NETWORK_DEFINE_VALIDATE +#define VIR_NETWORK_DEFINE_VALIDATE 1 << 0 +#endif + +/* 7.8.0 */ + +#ifndef VIR_NETWORK_CREATE_VALIDATE +#define VIR_NETWORK_CREATE_VALIDATE 1 << 0 +#endif + #endif /* LIBVIRT_GO_NETWORK_COMPAT_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/network_events.go b/vendor/libvirt.org/go/libvirt/network_events.go similarity index 98% rename from vendor/github.com/libvirt/libvirt-go/network_events.go rename to vendor/libvirt.org/go/libvirt/network_events.go index 2d9bddc3..9a2ad4f7 100644 --- a/vendor/github.com/libvirt/libvirt-go/network_events.go +++ b/vendor/libvirt.org/go/libvirt/network_events.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/network_events_wrapper.go b/vendor/libvirt.org/go/libvirt/network_events_wrapper.go similarity index 98% rename from vendor/github.com/libvirt/libvirt-go/network_events_wrapper.go rename to vendor/libvirt.org/go/libvirt/network_events_wrapper.go index 4e424baa..6226a528 100644 --- a/vendor/github.com/libvirt/libvirt-go/network_events_wrapper.go +++ b/vendor/libvirt.org/go/libvirt/network_events_wrapper.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/network_events_wrapper.h b/vendor/libvirt.org/go/libvirt/network_events_wrapper.h similarity index 97% rename from vendor/github.com/libvirt/libvirt-go/network_events_wrapper.h rename to vendor/libvirt.org/go/libvirt/network_events_wrapper.h index 789837a1..9d8f3ce0 100644 --- a/vendor/github.com/libvirt/libvirt-go/network_events_wrapper.h +++ b/vendor/libvirt.org/go/libvirt/network_events_wrapper.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/network_port.go b/vendor/libvirt.org/go/libvirt/network_port.go similarity index 93% rename from vendor/github.com/libvirt/libvirt-go/network_port.go rename to vendor/libvirt.org/go/libvirt/network_port.go index 5f9d54f1..47067d14 100644 --- a/vendor/github.com/libvirt/libvirt-go/network_port.go +++ b/vendor/libvirt.org/go/libvirt/network_port.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -37,10 +37,11 @@ import ( "unsafe" ) -type NetworkPortCreateFlags int +type NetworkPortCreateFlags uint const ( - NETWORK_PORT_CREATE_RECLAIM = NetworkPortCreateFlags(C.VIR_NETWORK_PORT_CREATE_RECLAIM) + 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 { @@ -128,7 +129,7 @@ func (n *NetworkPort) GetUUIDString() (string, error) { } // See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkPortDelete -func (n *NetworkPort) Delete(flags uint) error { +func (n *NetworkPort) Delete(flags uint32) error { if C.LIBVIR_VERSION_NUMBER < 5005000 { return makeNotImplementedError("virNetworkPortDelete") } @@ -142,7 +143,7 @@ func (n *NetworkPort) Delete(flags uint) error { } // See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkPortGetXMLDesc -func (d *NetworkPort) GetXMLDesc(flags uint) (string, error) { +func (d *NetworkPort) GetXMLDesc(flags uint32) (string, error) { if C.LIBVIR_VERSION_NUMBER < 5005000 { return "", makeNotImplementedError("virNetworkPortDelete") } @@ -208,7 +209,7 @@ func getNetworkPortParametersFieldInfo(params *NetworkPortParameters) map[string } // See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkPortGetParameters -func (d *NetworkPort) GetParameters(flags uint) (*NetworkPortParameters, error) { +func (d *NetworkPort) GetParameters(flags uint32) (*NetworkPortParameters, error) { if C.LIBVIR_VERSION_NUMBER < 5005000 { return nil, makeNotImplementedError("virNetworkPortGetParameters") } @@ -235,7 +236,7 @@ func (d *NetworkPort) GetParameters(flags uint) (*NetworkPortParameters, error) } // See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkPortSetParameters -func (d *NetworkPort) SetParameters(params *NetworkPortParameters, flags uint) error { +func (d *NetworkPort) SetParameters(params *NetworkPortParameters, flags uint32) error { if C.LIBVIR_VERSION_NUMBER < 5005000 { return makeNotImplementedError("virNetworkPortSetParameters") } diff --git a/vendor/github.com/libvirt/libvirt-go/network_port_compat.h b/vendor/libvirt.org/go/libvirt/network_port_compat.h similarity index 93% rename from vendor/github.com/libvirt/libvirt-go/network_port_compat.h rename to vendor/libvirt.org/go/libvirt/network_port_compat.h index 77f541b3..f70c7bec 100644 --- a/vendor/github.com/libvirt/libvirt-go/network_port_compat.h +++ b/vendor/libvirt.org/go/libvirt/network_port_compat.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -64,4 +64,11 @@ typedef struct _virNetworkPort *virNetworkPortPtr; #define VIR_NETWORK_PORT_BANDWIDTH_OUT_BURST "outbound.burst" #endif +/* 7.8.0 */ + +#ifndef VIR_NETWORK_PORT_CREATE_VALIDATE +#define VIR_NETWORK_PORT_CREATE_VALIDATE (1 << 1) +#endif + + #endif /* LIBVIRT_GO_NETWORK_PORT_COMPAT_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/network_port_wrapper.go b/vendor/libvirt.org/go/libvirt/network_port_wrapper.go similarity index 98% rename from vendor/github.com/libvirt/libvirt-go/network_port_wrapper.go rename to vendor/libvirt.org/go/libvirt/network_port_wrapper.go index 2b691675..ab6aff66 100644 --- a/vendor/github.com/libvirt/libvirt-go/network_port_wrapper.go +++ b/vendor/libvirt.org/go/libvirt/network_port_wrapper.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/network_port_wrapper.h b/vendor/libvirt.org/go/libvirt/network_port_wrapper.h similarity index 97% rename from vendor/github.com/libvirt/libvirt-go/network_port_wrapper.h rename to vendor/libvirt.org/go/libvirt/network_port_wrapper.h index 054d4590..37efabde 100644 --- a/vendor/github.com/libvirt/libvirt-go/network_port_wrapper.h +++ b/vendor/libvirt.org/go/libvirt/network_port_wrapper.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/network_wrapper.go b/vendor/libvirt.org/go/libvirt/network_wrapper.go similarity index 99% rename from vendor/github.com/libvirt/libvirt-go/network_wrapper.go rename to vendor/libvirt.org/go/libvirt/network_wrapper.go index ed1741f2..f36c8bb8 100644 --- a/vendor/github.com/libvirt/libvirt-go/network_wrapper.go +++ b/vendor/libvirt.org/go/libvirt/network_wrapper.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/network_wrapper.h b/vendor/libvirt.org/go/libvirt/network_wrapper.h similarity index 98% rename from vendor/github.com/libvirt/libvirt-go/network_wrapper.h rename to vendor/libvirt.org/go/libvirt/network_wrapper.h index 5d2f529d..5eba7d4d 100644 --- a/vendor/github.com/libvirt/libvirt-go/network_wrapper.h +++ b/vendor/libvirt.org/go/libvirt/network_wrapper.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/node_device.go b/vendor/libvirt.org/go/libvirt/node_device.go similarity index 63% rename from vendor/github.com/libvirt/libvirt-go/node_device.go rename to vendor/libvirt.org/go/libvirt/node_device.go index 474f288c..3fb255c3 100644 --- a/vendor/github.com/libvirt/libvirt-go/node_device.go +++ b/vendor/libvirt.org/go/libvirt/node_device.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -47,8 +47,10 @@ const ( 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_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 NodeDevice struct { @@ -190,3 +192,100 @@ func (p *NodeDevice) ListCaps() ([]string, error) { } return goNames, nil } + +// See also https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceCreate +func (p *NodeDevice) Create(flags uint32) error { + if C.LIBVIR_VERSION_NUMBER < 7003000 { + return makeNotImplementedError("virNodeDeviceCreate") + } + 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 { + if C.LIBVIR_VERSION_NUMBER < 7003000 { + return makeNotImplementedError("virNodeDeviceUndefine") + } + 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) { + if C.LIBVIR_VERSION_NUMBER < 7008000 { + return false, makeNotImplementedError("virNodeDeviceGetAutostart") + } + 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 { + if C.LIBVIR_VERSION_NUMBER < 7008000 { + return makeNotImplementedError("virNodeDeviceSetAutostart") + } + 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) { + if C.LIBVIR_VERSION_NUMBER < 7008000 { + return false, makeNotImplementedError("virNodeDeviceIsActive") + } + 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) { + if C.LIBVIR_VERSION_NUMBER < 7008000 { + return false, makeNotImplementedError("virNodeDeviceIsPersistent") + } + 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 +} diff --git a/vendor/github.com/libvirt/libvirt-go/node_device_compat.h b/vendor/libvirt.org/go/libvirt/node_device_compat.h similarity index 89% rename from vendor/github.com/libvirt/libvirt-go/node_device_compat.h rename to vendor/libvirt.org/go/libvirt/node_device_compat.h index 32020397..c9b4dd59 100644 --- a/vendor/github.com/libvirt/libvirt-go/node_device_compat.h +++ b/vendor/libvirt.org/go/libvirt/node_device_compat.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -51,5 +51,12 @@ typedef void (*virConnectNodeDeviceEventGenericCallback)(virConnectPtr conn, void *opaque); #endif +#ifndef VIR_NODE_DEVICE_EVENT_DEFINED +#define VIR_NODE_DEVICE_EVENT_DEFINED 1 +#endif + +#ifndef VIR_NODE_DEVICE_EVENT_UNDEFINED +#define VIR_NODE_DEVICE_EVENT_UNDEFINED 1 +#endif #endif /* LIBVIRT_GO_NODE_DEVICE_COMPAT_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/node_device_events.go b/vendor/libvirt.org/go/libvirt/node_device_events.go similarity index 98% rename from vendor/github.com/libvirt/libvirt-go/node_device_events.go rename to vendor/libvirt.org/go/libvirt/node_device_events.go index 7920a424..0a28b270 100644 --- a/vendor/github.com/libvirt/libvirt-go/node_device_events.go +++ b/vendor/libvirt.org/go/libvirt/node_device_events.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/node_device_events_wrapper.go b/vendor/libvirt.org/go/libvirt/node_device_events_wrapper.go similarity index 98% rename from vendor/github.com/libvirt/libvirt-go/node_device_events_wrapper.go rename to vendor/libvirt.org/go/libvirt/node_device_events_wrapper.go index 8b2e624e..4e6a03e4 100644 --- a/vendor/github.com/libvirt/libvirt-go/node_device_events_wrapper.go +++ b/vendor/libvirt.org/go/libvirt/node_device_events_wrapper.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/node_device_events_wrapper.h b/vendor/libvirt.org/go/libvirt/node_device_events_wrapper.h similarity index 97% rename from vendor/github.com/libvirt/libvirt-go/node_device_events_wrapper.h rename to vendor/libvirt.org/go/libvirt/node_device_events_wrapper.h index fb691d2c..fd7e603a 100644 --- a/vendor/github.com/libvirt/libvirt-go/node_device_events_wrapper.h +++ b/vendor/libvirt.org/go/libvirt/node_device_events_wrapper.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/node_device_wrapper.go b/vendor/libvirt.org/go/libvirt/node_device_wrapper.go similarity index 65% rename from vendor/github.com/libvirt/libvirt-go/node_device_wrapper.go rename to vendor/libvirt.org/go/libvirt/node_device_wrapper.go index c4e173a3..563968d8 100644 --- a/vendor/github.com/libvirt/libvirt-go/node_device_wrapper.go +++ b/vendor/libvirt.org/go/libvirt/node_device_wrapper.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -180,5 +180,105 @@ virNodeDeviceResetWrapper(virNodeDevicePtr dev, } +int +virNodeDeviceCreateWrapper(virNodeDevicePtr dev, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 7003000 + assert(0); // Caller should have checked version +#else + int ret = virNodeDeviceCreate(dev, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virNodeDeviceUndefineWrapper(virNodeDevicePtr dev, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 7003000 + assert(0); // Caller should have checked version +#else + int ret = virNodeDeviceUndefine(dev, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virNodeDeviceGetAutostartWrapper(virNodeDevicePtr dev, + int *autostart, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 7008000 + assert(0); // Caller should have checked version +#else + int ret = virNodeDeviceGetAutostart(dev, autostart); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virNodeDeviceSetAutostartWrapper(virNodeDevicePtr dev, + int autostart, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 7008000 + assert(0); // Caller should have checked version +#else + int ret = virNodeDeviceSetAutostart(dev, autostart); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virNodeDeviceIsActiveWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 7008000 + assert(0); // Caller should have checked version +#else + int ret = virNodeDeviceIsActive(dev); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int +virNodeDeviceIsPersistentWrapper(virNodeDevicePtr dev, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 7008000 + assert(0); // Caller should have checked version +#else + int ret = virNodeDeviceIsPersistent(dev); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + */ import "C" diff --git a/vendor/github.com/libvirt/libvirt-go/node_device_wrapper.h b/vendor/libvirt.org/go/libvirt/node_device_wrapper.h similarity index 79% rename from vendor/github.com/libvirt/libvirt-go/node_device_wrapper.h rename to vendor/libvirt.org/go/libvirt/node_device_wrapper.h index 7670415c..bf513f3e 100644 --- a/vendor/github.com/libvirt/libvirt-go/node_device_wrapper.h +++ b/vendor/libvirt.org/go/libvirt/node_device_wrapper.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -84,5 +84,32 @@ int virNodeDeviceResetWrapper(virNodeDevicePtr dev, virErrorPtr err); +int +virNodeDeviceCreateWrapper(virNodeDevicePtr dev, + unsigned int flags, + virErrorPtr err); + +int +virNodeDeviceUndefineWrapper(virNodeDevicePtr dev, + unsigned int flags, + virErrorPtr err); + +int +virNodeDeviceGetAutostartWrapper(virNodeDevicePtr dev, + int *autostart, + virErrorPtr err); + +int +virNodeDeviceSetAutostartWrapper(virNodeDevicePtr dev, + int autostart, + virErrorPtr err); + +int +virNodeDeviceIsActiveWrapper(virNodeDevicePtr dev, + virErrorPtr err); + +int +virNodeDeviceIsPersistentWrapper(virNodeDevicePtr dev, + virErrorPtr err); #endif /* LIBVIRT_GO_NODE_DEVICE_WRAPPER_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/nwfilter.go b/vendor/libvirt.org/go/libvirt/nwfilter.go similarity index 95% rename from vendor/github.com/libvirt/libvirt-go/nwfilter.go rename to vendor/libvirt.org/go/libvirt/nwfilter.go index 0b55c412..8448ec9c 100644 --- a/vendor/github.com/libvirt/libvirt-go/nwfilter.go +++ b/vendor/libvirt.org/go/libvirt/nwfilter.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -37,6 +37,12 @@ import ( "unsafe" ) +type NWFilterDefineFlags uint + +const ( + NWFILTER_DEFINE_VALIDATE = NWFilterDefineFlags(C.VIR_NWFILTER_DEFINE_VALIDATE) +) + type NWFilter struct { ptr C.virNWFilterPtr } diff --git a/vendor/github.com/libvirt/libvirt-go/nwfilter_binding.go b/vendor/libvirt.org/go/libvirt/nwfilter_binding.go similarity index 95% rename from vendor/github.com/libvirt/libvirt-go/nwfilter_binding.go rename to vendor/libvirt.org/go/libvirt/nwfilter_binding.go index e36c1de2..342aae26 100644 --- a/vendor/github.com/libvirt/libvirt-go/nwfilter_binding.go +++ b/vendor/libvirt.org/go/libvirt/nwfilter_binding.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -40,6 +40,12 @@ 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 { if C.LIBVIR_VERSION_NUMBER < 4005000 { diff --git a/vendor/github.com/libvirt/libvirt-go/nwfilter_binding_compat.h b/vendor/libvirt.org/go/libvirt/nwfilter_binding_compat.h similarity index 88% rename from vendor/github.com/libvirt/libvirt-go/nwfilter_binding_compat.h rename to vendor/libvirt.org/go/libvirt/nwfilter_binding_compat.h index 1d6fd161..cad09097 100644 --- a/vendor/github.com/libvirt/libvirt-go/nwfilter_binding_compat.h +++ b/vendor/libvirt.org/go/libvirt/nwfilter_binding_compat.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -30,4 +30,10 @@ typedef struct _virNWFilterBinding *virNWFilterBindingPtr; #endif +/* 7.8.0 */ + +#ifndef VIR_NWFILTER_BINDING_CREATE_VALIDATE +#define VIR_NWFILTER_BINDING_CREATE_VALIDATE (1 << 0) +#endif + #endif /* LIBVIRT_GO_NWFILTER_BINDING_COMPAT_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/nwfilter_binding_wrapper.go b/vendor/libvirt.org/go/libvirt/nwfilter_binding_wrapper.go similarity index 98% rename from vendor/github.com/libvirt/libvirt-go/nwfilter_binding_wrapper.go rename to vendor/libvirt.org/go/libvirt/nwfilter_binding_wrapper.go index b0950b5d..554f5ef0 100644 --- a/vendor/github.com/libvirt/libvirt-go/nwfilter_binding_wrapper.go +++ b/vendor/libvirt.org/go/libvirt/nwfilter_binding_wrapper.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/nwfilter_binding_wrapper.h b/vendor/libvirt.org/go/libvirt/nwfilter_binding_wrapper.h similarity index 97% rename from vendor/github.com/libvirt/libvirt-go/nwfilter_binding_wrapper.h rename to vendor/libvirt.org/go/libvirt/nwfilter_binding_wrapper.h index 0bcbfb70..d0aca55d 100644 --- a/vendor/github.com/libvirt/libvirt-go/nwfilter_binding_wrapper.h +++ b/vendor/libvirt.org/go/libvirt/nwfilter_binding_wrapper.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/libvirt.org/go/libvirt/nwfilter_compat.h b/vendor/libvirt.org/go/libvirt/nwfilter_compat.h new file mode 100644 index 00000000..b2a603ae --- /dev/null +++ b/vendor/libvirt.org/go/libvirt/nwfilter_compat.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) 2021 Red Hat, Inc. + * + */ + +#ifndef LIBVIRT_GO_NWFILTER_COMPAT_H__ +#define LIBVIRT_GO_NWFILTER_COMPAT_H__ + +/* 7.7.0 */ + +#ifndef VIR_NWFILTER_DEFINE_VALIDATE +#define VIR_NWFILTER_DEFINE_VALIDATE 1 << 0 +#endif + +#endif /* LIBVIRT_GO_NWFILTER_COMPAT_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/nwfilter_wrapper.go b/vendor/libvirt.org/go/libvirt/nwfilter_wrapper.go similarity index 98% rename from vendor/github.com/libvirt/libvirt-go/nwfilter_wrapper.go rename to vendor/libvirt.org/go/libvirt/nwfilter_wrapper.go index 809e5278..d1645242 100644 --- a/vendor/github.com/libvirt/libvirt-go/nwfilter_wrapper.go +++ b/vendor/libvirt.org/go/libvirt/nwfilter_wrapper.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/nwfilter_wrapper.h b/vendor/libvirt.org/go/libvirt/nwfilter_wrapper.h similarity index 96% rename from vendor/github.com/libvirt/libvirt-go/nwfilter_wrapper.h rename to vendor/libvirt.org/go/libvirt/nwfilter_wrapper.h index 9a0651cc..1483d4f5 100644 --- a/vendor/github.com/libvirt/libvirt-go/nwfilter_wrapper.h +++ b/vendor/libvirt.org/go/libvirt/nwfilter_wrapper.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -28,7 +28,7 @@ #include #include - +#include "nwfilter_compat.h" int virNWFilterFreeWrapper(virNWFilterPtr nwfilter, diff --git a/vendor/github.com/libvirt/libvirt-go/qemu.go b/vendor/libvirt.org/go/libvirt/qemu.go similarity index 90% rename from vendor/github.com/libvirt/libvirt-go/qemu.go rename to vendor/libvirt.org/go/libvirt/qemu.go index a2f8507f..065e053c 100644 --- a/vendor/github.com/libvirt/libvirt-go/qemu.go +++ b/vendor/libvirt.org/go/libvirt/qemu.go @@ -1,7 +1,7 @@ // +build !without_qemu /* - * This file is part of the libvirt-go project + * 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 @@ -53,7 +53,7 @@ import ( * 'info cpus' */ -type DomainQemuMonitorCommandFlags int +type DomainQemuMonitorCommandFlags uint const ( DOMAIN_QEMU_MONITOR_COMMAND_DEFAULT = DomainQemuMonitorCommandFlags(C.VIR_DOMAIN_QEMU_MONITOR_COMMAND_DEFAULT) @@ -70,13 +70,14 @@ const ( DOMAIN_QEMU_AGENT_COMMAND_SHUTDOWN = DomainQemuAgentCommandTimeout(C.VIR_DOMAIN_QEMU_AGENT_COMMAND_SHUTDOWN) ) -type DomainQemuMonitorEventFlags int +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) @@ -93,6 +94,7 @@ func (d *Domain) QemuMonitorCommand(command string, flags DomainQemuMonitorComma return rstring, 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)) @@ -108,6 +110,7 @@ func (d *Domain) QemuAgentCommand(command string, timeout DomainQemuAgentCommand 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) @@ -149,6 +152,7 @@ func domainQemuMonitorEventCallback(c C.virConnectPtr, d C.virDomainPtr, } +// 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) { if C.LIBVIR_VERSION_NUMBER < 1002003 { return 0, makeNotImplementedError("virConnectDomainQemuMonitorEventRegister") @@ -174,6 +178,7 @@ func (c *Connect) DomainQemuMonitorEventRegister(dom *Domain, event string, call return int(ret), nil } +// See also https://libvirt.org/html/libvirt-libvirt-qemu.html#virConnectDomainQemuMonitorEventDeregister func (c *Connect) DomainQemuEventDeregister(callbackId int) error { if C.LIBVIR_VERSION_NUMBER < 1002003 { return makeNotImplementedError("virConnectDomainQemuMonitorEventDeregister") diff --git a/vendor/github.com/libvirt/libvirt-go/qemu_compat.h b/vendor/libvirt.org/go/libvirt/qemu_compat.h similarity index 97% rename from vendor/github.com/libvirt/libvirt-go/qemu_compat.h rename to vendor/libvirt.org/go/libvirt/qemu_compat.h index 7756d7f8..33b3a670 100644 --- a/vendor/github.com/libvirt/libvirt-go/qemu_compat.h +++ b/vendor/libvirt.org/go/libvirt/qemu_compat.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/qemu_wrapper.go b/vendor/libvirt.org/go/libvirt/qemu_wrapper.go similarity index 98% rename from vendor/github.com/libvirt/libvirt-go/qemu_wrapper.go rename to vendor/libvirt.org/go/libvirt/qemu_wrapper.go index 20089d22..2e91a83e 100644 --- a/vendor/github.com/libvirt/libvirt-go/qemu_wrapper.go +++ b/vendor/libvirt.org/go/libvirt/qemu_wrapper.go @@ -1,5 +1,7 @@ +// +build !without_qemu + /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/qemu_wrapper.h b/vendor/libvirt.org/go/libvirt/qemu_wrapper.h similarity index 98% rename from vendor/github.com/libvirt/libvirt-go/qemu_wrapper.h rename to vendor/libvirt.org/go/libvirt/qemu_wrapper.h index df389c4f..bec1fe62 100644 --- a/vendor/github.com/libvirt/libvirt-go/qemu_wrapper.h +++ b/vendor/libvirt.org/go/libvirt/qemu_wrapper.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/secret.go b/vendor/libvirt.org/go/libvirt/secret.go similarity index 97% rename from vendor/github.com/libvirt/libvirt-go/secret.go rename to vendor/libvirt.org/go/libvirt/secret.go index 53d82c7e..d13bc0ec 100644 --- a/vendor/github.com/libvirt/libvirt-go/secret.go +++ b/vendor/libvirt.org/go/libvirt/secret.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -48,6 +48,12 @@ const ( 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 ( diff --git a/vendor/github.com/libvirt/libvirt-go/secret_compat.h b/vendor/libvirt.org/go/libvirt/secret_compat.h similarity index 92% rename from vendor/github.com/libvirt/libvirt-go/secret_compat.h rename to vendor/libvirt.org/go/libvirt/secret_compat.h index 507ab808..bc74bc18 100644 --- a/vendor/github.com/libvirt/libvirt-go/secret_compat.h +++ b/vendor/libvirt.org/go/libvirt/secret_compat.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -64,4 +64,10 @@ typedef void (*virConnectSecretEventGenericCallback)(virConnectPtr conn, #define VIR_SECRET_USAGE_TYPE_VTPM 5 #endif +/* 7.7.0 */ + +#ifndef VIR_SECRET_DEFINE_VALIDATE +#define VIR_SECRET_DEFINE_VALIDATE 1 << 0 +#endif + #endif /* LIBVIRT_GO_SECRET_COMPAT_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/secret_events.go b/vendor/libvirt.org/go/libvirt/secret_events.go similarity index 98% rename from vendor/github.com/libvirt/libvirt-go/secret_events.go rename to vendor/libvirt.org/go/libvirt/secret_events.go index d928e985..339079e8 100644 --- a/vendor/github.com/libvirt/libvirt-go/secret_events.go +++ b/vendor/libvirt.org/go/libvirt/secret_events.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/secret_events_wrapper.go b/vendor/libvirt.org/go/libvirt/secret_events_wrapper.go similarity index 98% rename from vendor/github.com/libvirt/libvirt-go/secret_events_wrapper.go rename to vendor/libvirt.org/go/libvirt/secret_events_wrapper.go index a543e7f5..a69b7eb3 100644 --- a/vendor/github.com/libvirt/libvirt-go/secret_events_wrapper.go +++ b/vendor/libvirt.org/go/libvirt/secret_events_wrapper.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/secret_events_wrapper.h b/vendor/libvirt.org/go/libvirt/secret_events_wrapper.h similarity index 97% rename from vendor/github.com/libvirt/libvirt-go/secret_events_wrapper.h rename to vendor/libvirt.org/go/libvirt/secret_events_wrapper.h index 5101bc0b..10432a03 100644 --- a/vendor/github.com/libvirt/libvirt-go/secret_events_wrapper.h +++ b/vendor/libvirt.org/go/libvirt/secret_events_wrapper.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/secret_wrapper.go b/vendor/libvirt.org/go/libvirt/secret_wrapper.go similarity index 98% rename from vendor/github.com/libvirt/libvirt-go/secret_wrapper.go rename to vendor/libvirt.org/go/libvirt/secret_wrapper.go index d95a168a..2ab8f837 100644 --- a/vendor/github.com/libvirt/libvirt-go/secret_wrapper.go +++ b/vendor/libvirt.org/go/libvirt/secret_wrapper.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/secret_wrapper.h b/vendor/libvirt.org/go/libvirt/secret_wrapper.h similarity index 98% rename from vendor/github.com/libvirt/libvirt-go/secret_wrapper.h rename to vendor/libvirt.org/go/libvirt/secret_wrapper.h index eee2a5ea..88e3d863 100644 --- a/vendor/github.com/libvirt/libvirt-go/secret_wrapper.h +++ b/vendor/libvirt.org/go/libvirt/secret_wrapper.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/storage_pool.go b/vendor/libvirt.org/go/libvirt/storage_pool.go similarity index 97% rename from vendor/github.com/libvirt/libvirt-go/storage_pool.go rename to vendor/libvirt.org/go/libvirt/storage_pool.go index 9bfcc79a..6e3f3829 100644 --- a/vendor/github.com/libvirt/libvirt-go/storage_pool.go +++ b/vendor/libvirt.org/go/libvirt/storage_pool.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -48,7 +48,7 @@ const ( STORAGE_POOL_INACCESSIBLE = StoragePoolState(C.VIR_STORAGE_POOL_INACCESSIBLE) // Running,but not accessible ) -type StoragePoolBuildFlags int +type StoragePoolBuildFlags uint const ( STORAGE_POOL_BUILD_NEW = StoragePoolBuildFlags(C.VIR_STORAGE_POOL_BUILD_NEW) // Regular build from scratch @@ -58,7 +58,7 @@ const ( STORAGE_POOL_BUILD_OVERWRITE = StoragePoolBuildFlags(C.VIR_STORAGE_POOL_BUILD_OVERWRITE) // Overwrite data ) -type StoragePoolCreateFlags int +type StoragePoolCreateFlags uint const ( STORAGE_POOL_CREATE_NORMAL = StoragePoolCreateFlags(C.VIR_STORAGE_POOL_CREATE_NORMAL) @@ -67,7 +67,13 @@ const ( STORAGE_POOL_CREATE_WITH_BUILD_NO_OVERWRITE = StoragePoolCreateFlags(C.VIR_STORAGE_POOL_CREATE_WITH_BUILD_NO_OVERWRITE) ) -type StoragePoolDeleteFlags int +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) diff --git a/vendor/github.com/libvirt/libvirt-go/storage_pool_compat.h b/vendor/libvirt.org/go/libvirt/storage_pool_compat.h similarity index 94% rename from vendor/github.com/libvirt/libvirt-go/storage_pool_compat.h rename to vendor/libvirt.org/go/libvirt/storage_pool_compat.h index 4df1a0d7..0d17f8db 100644 --- a/vendor/github.com/libvirt/libvirt-go/storage_pool_compat.h +++ b/vendor/libvirt.org/go/libvirt/storage_pool_compat.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -88,5 +88,10 @@ typedef void (*virConnectStoragePoolEventGenericCallback)(virConnectPtr conn, #define VIR_STORAGE_POOL_EVENT_DELETED 5 #endif +/* 7.7.0 */ + +#ifndef VIR_STORAGE_POOL_DEFINE_VALIDATE +#define VIR_STORAGE_POOL_DEFINE_VALIDATE 1 << 0 +#endif #endif /* LIBVIRT_GO_STORAGE_POOL_COMPAT_H__ */ diff --git a/vendor/github.com/libvirt/libvirt-go/storage_pool_events.go b/vendor/libvirt.org/go/libvirt/storage_pool_events.go similarity index 98% rename from vendor/github.com/libvirt/libvirt-go/storage_pool_events.go rename to vendor/libvirt.org/go/libvirt/storage_pool_events.go index fd1b9979..c3d12690 100644 --- a/vendor/github.com/libvirt/libvirt-go/storage_pool_events.go +++ b/vendor/libvirt.org/go/libvirt/storage_pool_events.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/storage_pool_events_wrapper.go b/vendor/libvirt.org/go/libvirt/storage_pool_events_wrapper.go similarity index 98% rename from vendor/github.com/libvirt/libvirt-go/storage_pool_events_wrapper.go rename to vendor/libvirt.org/go/libvirt/storage_pool_events_wrapper.go index c5510381..02c010dd 100644 --- a/vendor/github.com/libvirt/libvirt-go/storage_pool_events_wrapper.go +++ b/vendor/libvirt.org/go/libvirt/storage_pool_events_wrapper.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/storage_pool_events_wrapper.h b/vendor/libvirt.org/go/libvirt/storage_pool_events_wrapper.h similarity index 97% rename from vendor/github.com/libvirt/libvirt-go/storage_pool_events_wrapper.h rename to vendor/libvirt.org/go/libvirt/storage_pool_events_wrapper.h index 7007f1c0..6f75d867 100644 --- a/vendor/github.com/libvirt/libvirt-go/storage_pool_events_wrapper.h +++ b/vendor/libvirt.org/go/libvirt/storage_pool_events_wrapper.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/storage_pool_wrapper.go b/vendor/libvirt.org/go/libvirt/storage_pool_wrapper.go similarity index 99% rename from vendor/github.com/libvirt/libvirt-go/storage_pool_wrapper.go rename to vendor/libvirt.org/go/libvirt/storage_pool_wrapper.go index 1cb041ec..696176e5 100644 --- a/vendor/github.com/libvirt/libvirt-go/storage_pool_wrapper.go +++ b/vendor/libvirt.org/go/libvirt/storage_pool_wrapper.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/storage_pool_wrapper.h b/vendor/libvirt.org/go/libvirt/storage_pool_wrapper.h similarity index 98% rename from vendor/github.com/libvirt/libvirt-go/storage_pool_wrapper.h rename to vendor/libvirt.org/go/libvirt/storage_pool_wrapper.h index 62d4861f..730b519e 100644 --- a/vendor/github.com/libvirt/libvirt-go/storage_pool_wrapper.h +++ b/vendor/libvirt.org/go/libvirt/storage_pool_wrapper.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/storage_volume.go b/vendor/libvirt.org/go/libvirt/storage_volume.go similarity index 97% rename from vendor/github.com/libvirt/libvirt-go/storage_volume.go rename to vendor/libvirt.org/go/libvirt/storage_volume.go index bb10813d..1d68b86a 100644 --- a/vendor/github.com/libvirt/libvirt-go/storage_volume.go +++ b/vendor/libvirt.org/go/libvirt/storage_volume.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -37,14 +37,14 @@ import ( "unsafe" ) -type StorageVolCreateFlags int +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) ) -type StorageVolDeleteFlags int +type StorageVolDeleteFlags uint const ( STORAGE_VOL_DELETE_NORMAL = StorageVolDeleteFlags(C.VIR_STORAGE_VOL_DELETE_NORMAL) // Delete metadata only (fast) @@ -52,7 +52,7 @@ const ( STORAGE_VOL_DELETE_WITH_SNAPSHOTS = StorageVolDeleteFlags(C.VIR_STORAGE_VOL_DELETE_WITH_SNAPSHOTS) // Force removal of volume, even if in use ) -type StorageVolResizeFlags int +type StorageVolResizeFlags uint const ( STORAGE_VOL_RESIZE_ALLOCATE = StorageVolResizeFlags(C.VIR_STORAGE_VOL_RESIZE_ALLOCATE) // force allocation of new size @@ -86,26 +86,26 @@ const ( STORAGE_VOL_WIPE_ALG_TRIM = StorageVolWipeAlgorithm(C.VIR_STORAGE_VOL_WIPE_ALG_TRIM) // Trim the underlying storage ) -type StorageXMLFlags int +type StorageXMLFlags uint const ( STORAGE_XML_INACTIVE = StorageXMLFlags(C.VIR_STORAGE_XML_INACTIVE) ) -type StorageVolInfoFlags int +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 int +type StorageVolUploadFlags uint const ( STORAGE_VOL_UPLOAD_SPARSE_STREAM = StorageVolUploadFlags(C.VIR_STORAGE_VOL_UPLOAD_SPARSE_STREAM) ) -type StorageVolDownloadFlags int +type StorageVolDownloadFlags uint const ( STORAGE_VOL_DOWNLOAD_SPARSE_STREAM = StorageVolDownloadFlags(C.VIR_STORAGE_VOL_DOWNLOAD_SPARSE_STREAM) diff --git a/vendor/github.com/libvirt/libvirt-go/storage_volume_compat.h b/vendor/libvirt.org/go/libvirt/storage_volume_compat.h similarity index 97% rename from vendor/github.com/libvirt/libvirt-go/storage_volume_compat.h rename to vendor/libvirt.org/go/libvirt/storage_volume_compat.h index bd3cee9a..3ed848c8 100644 --- a/vendor/github.com/libvirt/libvirt-go/storage_volume_compat.h +++ b/vendor/libvirt.org/go/libvirt/storage_volume_compat.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/storage_volume_wrapper.go b/vendor/libvirt.org/go/libvirt/storage_volume_wrapper.go similarity index 99% rename from vendor/github.com/libvirt/libvirt-go/storage_volume_wrapper.go rename to vendor/libvirt.org/go/libvirt/storage_volume_wrapper.go index 875a89fc..f63dfd2e 100644 --- a/vendor/github.com/libvirt/libvirt-go/storage_volume_wrapper.go +++ b/vendor/libvirt.org/go/libvirt/storage_volume_wrapper.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/storage_volume_wrapper.h b/vendor/libvirt.org/go/libvirt/storage_volume_wrapper.h similarity index 98% rename from vendor/github.com/libvirt/libvirt-go/storage_volume_wrapper.h rename to vendor/libvirt.org/go/libvirt/storage_volume_wrapper.h index c9183a48..47944564 100644 --- a/vendor/github.com/libvirt/libvirt-go/storage_volume_wrapper.h +++ b/vendor/libvirt.org/go/libvirt/storage_volume_wrapper.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/stream.go b/vendor/libvirt.org/go/libvirt/stream.go similarity index 98% rename from vendor/github.com/libvirt/libvirt-go/stream.go rename to vendor/libvirt.org/go/libvirt/stream.go index 4010b11c..fd668c13 100644 --- a/vendor/github.com/libvirt/libvirt-go/stream.go +++ b/vendor/libvirt.org/go/libvirt/stream.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 @@ -37,7 +37,7 @@ import ( "unsafe" ) -type StreamFlags int +type StreamFlags uint const ( STREAM_NONBLOCK = StreamFlags(C.VIR_STREAM_NONBLOCK) @@ -137,7 +137,7 @@ func (v *Stream) RecvFlags(p []byte, flags StreamRecvFlagsValues) (int, error) { } // See also https://libvirt.org/html/libvirt-libvirt-stream.html#virStreamRecvHole -func (v *Stream) RecvHole(flags uint) (int64, error) { +func (v *Stream) RecvHole(flags uint32) (int64, error) { if C.LIBVIR_VERSION_NUMBER < 3004000 { return 0, makeNotImplementedError("virStreamSparseRecvHole") } diff --git a/vendor/github.com/libvirt/libvirt-go/stream_compat.h b/vendor/libvirt.org/go/libvirt/stream_compat.h similarity index 96% rename from vendor/github.com/libvirt/libvirt-go/stream_compat.h rename to vendor/libvirt.org/go/libvirt/stream_compat.h index 92befd58..b6d2131f 100644 --- a/vendor/github.com/libvirt/libvirt-go/stream_compat.h +++ b/vendor/libvirt.org/go/libvirt/stream_compat.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/stream_wrapper.go b/vendor/libvirt.org/go/libvirt/stream_wrapper.go similarity index 99% rename from vendor/github.com/libvirt/libvirt-go/stream_wrapper.go rename to vendor/libvirt.org/go/libvirt/stream_wrapper.go index e563a742..abf7039f 100644 --- a/vendor/github.com/libvirt/libvirt-go/stream_wrapper.go +++ b/vendor/libvirt.org/go/libvirt/stream_wrapper.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/stream_wrapper.h b/vendor/libvirt.org/go/libvirt/stream_wrapper.h similarity index 98% rename from vendor/github.com/libvirt/libvirt-go/stream_wrapper.h rename to vendor/libvirt.org/go/libvirt/stream_wrapper.h index b9c6e57c..fb7f367e 100644 --- a/vendor/github.com/libvirt/libvirt-go/stream_wrapper.h +++ b/vendor/libvirt.org/go/libvirt/stream_wrapper.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/typedparams.go b/vendor/libvirt.org/go/libvirt/typedparams.go similarity index 99% rename from vendor/github.com/libvirt/libvirt-go/typedparams.go rename to vendor/libvirt.org/go/libvirt/typedparams.go index ccceee1e..761fe315 100644 --- a/vendor/github.com/libvirt/libvirt-go/typedparams.go +++ b/vendor/libvirt.org/go/libvirt/typedparams.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/typedparams_wrapper.go b/vendor/libvirt.org/go/libvirt/typedparams_wrapper.go similarity index 99% rename from vendor/github.com/libvirt/libvirt-go/typedparams_wrapper.go rename to vendor/libvirt.org/go/libvirt/typedparams_wrapper.go index 2209d604..383b56f4 100644 --- a/vendor/github.com/libvirt/libvirt-go/typedparams_wrapper.go +++ b/vendor/libvirt.org/go/libvirt/typedparams_wrapper.go @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/github.com/libvirt/libvirt-go/typedparams_wrapper.h b/vendor/libvirt.org/go/libvirt/typedparams_wrapper.h similarity index 98% rename from vendor/github.com/libvirt/libvirt-go/typedparams_wrapper.h rename to vendor/libvirt.org/go/libvirt/typedparams_wrapper.h index ee626b1b..fbd853b5 100644 --- a/vendor/github.com/libvirt/libvirt-go/typedparams_wrapper.h +++ b/vendor/libvirt.org/go/libvirt/typedparams_wrapper.h @@ -1,5 +1,5 @@ /* - * This file is part of the libvirt-go project + * 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 diff --git a/vendor/modules.txt b/vendor/modules.txt index de3ebb83..6cbb908d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -12,9 +12,6 @@ github.com/crc-org/machine/libmachine/version github.com/davecgh/go-spew/spew # github.com/kr/text v0.2.0 ## explicit -# github.com/libvirt/libvirt-go v6.0.0+incompatible -## explicit -github.com/libvirt/libvirt-go # github.com/pmezard/go-difflib v1.0.0 ## explicit github.com/pmezard/go-difflib/difflib @@ -34,6 +31,9 @@ golang.org/x/sys/windows # gopkg.in/yaml.v3 v3.0.1 ## explicit gopkg.in/yaml.v3 +# libvirt.org/go/libvirt v1.8000.0 +## explicit; go 1.11 +libvirt.org/go/libvirt # libvirt.org/go/libvirtxml v1.9004.0 ## explicit; go 1.11 libvirt.org/go/libvirtxml