1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-12-13 00:23:49 +03:00
Commit Graph

1162 Commits

Author SHA1 Message Date
Daniel P. Berrangé
9d4b183b4e setup: replace distutils.spawn with subprocess
The distutils.spawn method has no compelling benefit over using the
standard python subprocess module.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 12:34:06 +01:00
Daniel P. Berrangé
7d14f77224 setup: replace distutils.spawn.find_executable with shutils
The distutils.spawn.find_executable method has no compelling benefit
over using the standard python shutils module.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 12:34:06 +01:00
Daniel P. Berrangé
49f0b4c16f setup: introduce an explicit check for pkg-config operation
Instead of searching for the pkg-config binary manually, just try to run
it and catch the exception raised if it isn't found. Use the --version
flag as a way to validate that it is at least somewhat functional.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 12:34:06 +01:00
Daniel P. Berrangé
a965c91c6f setup: stop inheriting from 'clean' command
The default 'clean' command impl deletes only intermediate files from
the 'build' directory. We've overridden it to delete everything. There
is no benefit in inheriting from the default impl, given our subclass
will delete everything.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 12:34:06 +01:00
Daniel P. Berrangé
6ea035b0e3 setup: drop the 'rpm' command
This duplicates funtionality already provided by the 'bdist_rpm'
command.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 12:34:06 +01:00
Daniel P. Berrangé
f8c9ec5387 generator: introduce ability to selectively generate code
Currently we always generate both the C code and Python code at the same
time. To cope with following changes to the build process, we want to be
able to generate C and Python separately.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 12:34:06 +01:00
Daniel P. Berrangé
47b434b142 generator: rename methods for code generation
The names make it clearer exactly what is being generated by each.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 12:34:06 +01:00
Daniel P. Berrangé
83595da93f generator: split function skip logic out of C generator
The python generator needs to know whether certain functions were
skipped in the C generator. This is achieved by the C generator
deleting skipped functions as it runs. This is an unhelpful side
effect as it makes it impossible to run the python generator
without first running the C generator.

This refactors buildStubs to get rid of the global side effects
it has, by providing some helper functions for buildWrappers
to use.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 12:34:01 +01:00
Daniel P. Berrangé
8ec1b5aa16 generator: split function type validation out of C generator
As a side effect of generating the C code, the buildStubs methods
checks for various unsupported types and reports errors. This is
an undesirable side effect, if we want to skip C code generation.

Splitting function type validation out into a separate method
allows better reuse.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 12:32:51 +01:00
Daniel P. Berrangé
2fb2e54136 generator: split loading of APIs out from writing stubs
The buildStubs method has a side effect of loading and parsing the API
XML files, which the buildWrappers method then relies on.

Splitting API loading into a separate method will facilitate running
only the buildWrappers method in future.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 12:32:51 +01:00
Daniel P. Berrangé
3950e1ddd5 generator: merge python wrapper generator methods
Instead of having three separate methods for generating python
wrappers, merge them all together.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 12:32:51 +01:00
Daniel P. Berrangé
c8abe55d4c generator: refactor buildWrappers to make it more generic
Prepare for using buildWrappers to generate code for the QEMU / LXC
APIs too.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 12:32:51 +01:00
Daniel P. Berrangé
f1e5b5c18f generator: simplify some repeated code patterns
Now that we're using common data structures for all the main libvirt,
QEMU and LXC APIs, several of the functions have code duplication
that can be eliminated.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 12:32:51 +01:00
Daniel P. Berrangé
01303d79fa generator: use single function for registering all enums
Now that we only use a single dict for tracking all enums, we
only need a single function for registering them.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 12:32:51 +01:00
Daniel P. Berrangé
ff65b9c67c generator: use single dict for tracking all enums
A single invokation of the generator only handles processing of one
libvirt API module, so there is no need to use separate dicts for
tracking enums.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 12:32:51 +01:00
Daniel P. Berrangé
054c9e9b73 generator: use single function for registering all functions
Now that we only use a single dict for tracking all functions, we
only need a single function for registering them.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 12:32:51 +01:00
Daniel P. Berrangé
6b2cef6182 generator: use single dict for tracking all skipped functions
A single invokation of the generator only handles processing of one
libvirt API module, so there is no need to use separate dicts for
tracking skipped functions.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 12:32:51 +01:00
Daniel P. Berrangé
f4c43ef581 generator: use single dict for tracking all functions
A single invokation of the generator only handles processing of one
libvirt API module, so there is no need to use separate dicts for
tracking functions.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21 12:32:51 +01:00
Jiri Denemark
fdd2034c1d Post-release version bump to 8.3.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-04-01 12:30:58 +02:00
Daniel P. Berrangé
545cc70f2f gitlab: switch to using 'pip' for package installation
The distutils/setuptools 'install' command is deprecated in favour of
'pip', and with recent versiosn, using it will create a bad install
that triggers a traceback on all future use of setuptools:

Traceback (most recent call last):
  File "/builds/berrange/libvirt-python/setup.py", line 328, in <module>
    setup(name = 'libvirt-python',
  File "/usr/lib/python3.10/site-packages/setuptools/__init__.py", line 154, in setup
    _install_setup_requires(attrs)
  File "/usr/lib/python3.10/site-packages/setuptools/__init__.py", line 143, in _install_setup_requires
    dist = MinimalDistribution(attrs)
  File "/usr/lib/python3.10/site-packages/setuptools/__init__.py", line 135, in __init__
    super().__init__(filtered)
  File "/usr/lib/python3.10/site-packages/setuptools/dist.py", line 456, in __init__
    for ep in metadata.entry_points(group='distutils.setup_keywords'):
  File "/usr/lib64/python3.10/importlib/metadata/__init__.py", line 1009, in entry_points
    return SelectableGroups.load(eps).select(**params)
  File "/usr/lib64/python3.10/importlib/metadata/__init__.py", line 459, in load
    ordered = sorted(eps, key=by_group)
  File "/usr/lib64/python3.10/importlib/metadata/__init__.py", line 1006, in <genexpr>
    eps = itertools.chain.from_iterable(
  File "/usr/lib64/python3.10/importlib/metadata/_itertools.py", line 16, in unique_everseen
    k = key(element)
  File "/usr/lib64/python3.10/importlib/metadata/__init__.py", line 941, in _normalized_name
    return self._name_from_stem(stem) or super()._normalized_name
  File "/usr/lib64/python3.10/importlib/metadata/__init__.py", line 622, in _normalized_name
    return Prepared.normalize(self.name)
  File "/usr/lib64/python3.10/importlib/metadata/__init__.py", line 871, in normalize
    return re.sub(r"[-_.]+", "-", name).lower().replace('-', '_')
  File "/usr/lib64/python3.10/re.py", line 209, in sub
    return _compile(pattern, flags).sub(repl, string, count)

This is certainly a bug in distutils/setuptools, but given the
'install' command is deprecated, instead of waiting for a fix,
just switch to the recommend 'pip install .' command.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
v8.2.0
2022-03-28 15:44:48 +01:00
Daniel P. Berrangé
c9950c1654 ci: refresh from lcitool manifest
This drops the CentOS 8 job and replaces Fedora 33 with 35.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-03-28 11:48:35 +01:00
Michal Privoznik
050ed3e629 Implement virDomainQemuMonitorCommandWithFiles() override
With libvirt-8.2.0 there's a new API:
virDomainQemuMonitorCommandWithFiles(). Since the API has both
input and output arguments we need to provide an alternative
implementation. Moreover, since FD passing works only on
UNIX-like systems we can query the returned FDs for their flags
and construct mode for python File object.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2022-03-10 09:51:33 +01:00
Jiri Denemark
a80412bf8c Post-release version bump to 8.2.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-03-01 10:16:39 +01:00
Daniel P. Berrangé
4b1681e7fa add missing files to MANIFEST.in
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
v8.1.0
2022-02-11 11:20:26 +00:00
Jiri Denemark
c19804df59 Post-release version bump to 8.1.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-01-14 15:17:49 +01:00
Daniel P. Berrangé
322fc085cb Add an override impl for virDomainSetLaunchSecurityState
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
v8.0.0
2022-01-05 18:17:02 +00:00
Jiri Denemark
2d36853d57 Post-release version bump to 8.0.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2021-12-01 10:53:47 +01:00
Daniel P. Berrangé
8f6f402142 Switch to new GitHub repo-lockdown configuration
The repo-lockdown service used to run as a bot outside GitHub, but has
now switched to using the GitHub Actions workflow framework. This
requires use of a new configuration file.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
v7.10.0
2021-12-01 09:27:50 +00:00
Jiri Denemark
a4eed6751b Post-release version bump to 7.10.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2021-11-01 13:23:27 +01:00
Daniel P. Berrangé
13ddf17f83 Add support for domain event for memory device size change
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
v7.9.0
2021-10-08 11:23:27 +01:00
Jiri Denemark
aa0286fa6c Post-release version bump to 7.9.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2021-10-01 10:40:13 +02:00
Michal Privoznik
7d47523bb0 sanitytest: Add virNetworkCreateXMLFlags() to list of name fixups
When checking whether each C API is exported to Python and vice
versa the sanitytest script is doing some name fixing. For
instance virNetworkCreateXML() is translated into
virConnect.networkCreateXML(). However, we have new C API on the
way: virNetworkCreateXMLFlags() which is not on the list for
these name fixups. Add it there.

Mind you, the python code generator works just fine because
generator.py:1082 compares just the prefix.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
v7.8.0
2021-09-24 08:34:50 +02:00
Jonathon Jongsma
cd18f45235 Don't mention email patch submission in README
Since patches are now submitted via gitlab merge requests, don't mention
mailing list patch submission in the README. Point to the CONTRIBUTING
file instead.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
2021-09-21 16:11:07 -05:00
Jonathon Jongsma
2c9ad18dd1 Update readme to mention pytest instead of nose
Commit a376a2ab switch from python-nose to python-pytest for tests, but
the README was not updated.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
2021-09-21 16:11:07 -05:00
Jonathon Jongsma
066af64107 Add new autostart API for node devices
Provide a manual override for the virNodeDeviceGetAutostart() API
modeled on what's done for the network and storage APIs.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
2021-09-21 16:11:07 -05:00
Daniel P. Berrangé
e78e2bae31 ci: remove obsolete refresh script and documentation
We now use lcitool's manifest feature to generate files.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-09-02 17:53:58 +01:00
Daniel P. Berrangé
d5d4676631 ci: re-generate containers/gitlab config from manifest
This uses the command "lcitool manifest ci/manifest.yml" to re-generate
all existing dockerfiles and gitlab CI config.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-09-02 17:53:58 +01:00
Daniel P. Berrangé
cf3c20bb4f ci: define a CI manifest file
This is to be used with the command "lcitool manifest ci/manifest.yml"
to re-generate all existing dockerfiles and gitlab CI config.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-09-02 17:53:58 +01:00
Daniel P. Berrangé
5d7bd23980 rpm: drop support for RHEL-7
We no longer support libvirt on this distro

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-09-01 18:33:28 +01:00
Jiri Denemark
dd5e2d796e Post-release version bump to 7.8.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2021-09-01 13:47:00 +02:00
Jiri Denemark
3ec079df29 Post-release version bump to 7.7.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
v7.7.0
2021-08-02 12:28:43 +02:00
Daniel P. Berrangé
27f55b0130 gitlab: use custom docker:dind image
The current docker:dind container has broken default seccomp filter that
results in clone3 being blocked, which in turn breaks Fedora 35 rawhide.

This custom image has a workaround that causes the seccomp filter to
return ENOSYS for clone3 instad of EPERM, thus triggering glibc to
fallback to clone correctly.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
v7.6.0
2021-07-27 14:53:31 +01:00
Jiri Denemark
f18d6b038e Post-release version bump to 7.6.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2021-07-01 15:44:56 +02:00
Peter Krempa
b5cd547bfd Fix BlockThreshold Callback argument conversion once more
The conversion was changed from "OssiiO" to "OssLLO". Unfortunately the
arguments are unsigned long long, where the proper coversion character
is 'K'.

Fixes: https://gitlab.com/libvirt/libvirt-python/-/merge_requests/40
Fixes: fd069ac85c
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1976109
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
v7.5.0
2021-06-25 10:48:56 +02:00
Jiri Denemark
7df337cad2 Post-release version bump to 7.5.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2021-06-01 12:08:38 +02:00
w00506750
b47727460e iothread: fix memory access out of bounds
When the 'pcpu' is larger then the last 'iothr->cpumap' bits,
set the list element to False to avoid out of bounds access
'iothr->cpumap'.

Signed-off-by: suruifeng <suruifeng@huawei.com>
Reviewed-by: Hogan Wang <hogan.wang@huawei.com>
v7.4.0
2021-05-27 13:23:16 +00:00
Jiri Denemark
23ea62992f Post-release version bump to 7.4.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2021-05-27 12:33:31 +00:00
Daniel P. Berrangé
3475abfa54 containers: refresh containers with latest libvirt-ci
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-05-25 13:07:58 +01:00
Daniel P. Berrangé
4cf9e531e3 gitlab: don't set RPM variable on container job
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-05-25 13:07:47 +01:00
Daniel P. Berrangé
27bc9111b0 gitlab: add OpenSUSE Tumbleweed container and build
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-05-25 13:07:15 +01:00