summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* generator: split function skip logic out of C generatorDaniel P. Berrangé2022-04-211-29/+55
| | | | | | | | | | | | | | 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>
* generator: split function type validation out of C generatorDaniel P. Berrangé2022-04-211-29/+62
| | | | | | | | | | | 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>
* generator: split loading of APIs out from writing stubsDaniel P. Berrangé2022-04-211-4/+9
| | | | | | | | | | 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>
* generator: merge python wrapper generator methodsDaniel P. Berrangé2022-04-212-232/+71
| | | | | | | Instead of having three separate methods for generating python wrappers, merge them all together. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* generator: refactor buildWrappers to make it more genericDaniel P. Berrangé2022-04-212-21/+33
| | | | | | | Prepare for using buildWrappers to generate code for the QEMU / LXC APIs too. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* generator: simplify some repeated code patternsDaniel P. Berrangé2022-04-211-56/+17
| | | | | | | | 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>
* generator: use single function for registering all enumsDaniel P. Berrangé2022-04-211-18/+7
| | | | | | | 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>
* generator: use single dict for tracking all enumsDaniel P. Berrangé2022-04-211-8/+6
| | | | | | | | 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>
* generator: use single function for registering all functionsDaniel P. Berrangé2022-04-211-39/+11
| | | | | | | 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>
* generator: use single dict for tracking all skipped functionsDaniel P. Berrangé2022-04-211-34/+8
| | | | | | | | 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>
* generator: use single dict for tracking all functionsDaniel P. Berrangé2022-04-211-14/+12
| | | | | | | | 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>
* Post-release version bump to 8.3.0Jiri Denemark2022-04-011-1/+1
| | | | Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* gitlab: switch to using 'pip' for package installationv8.2.0Daniel P. Berrangé2022-03-2811-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* ci: refresh from lcitool manifestDaniel P. Berrangé2022-03-288-102/+43
| | | | | | This drops the CentOS 8 job and replaces Fedora 33 with 35. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Implement virDomainQemuMonitorCommandWithFiles() overrideMichal Privoznik2022-03-103-1/+149
| | | | | | | | | | | 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>
* Post-release version bump to 8.2.0Jiri Denemark2022-03-011-1/+1
| | | | Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* add missing files to MANIFEST.inv8.1.0Daniel P. Berrangé2022-02-111-0/+11
| | | | Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Post-release version bump to 8.1.0Jiri Denemark2022-01-141-1/+1
| | | | Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* Add an override impl for virDomainSetLaunchSecurityStatev8.0.0Daniel P. Berrangé2022-01-053-0/+59
| | | | Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Post-release version bump to 8.0.0Jiri Denemark2021-12-011-1/+1
| | | | Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* Switch to new GitHub repo-lockdown configurationv7.10.0Daniel P. Berrangé2021-12-012-36/+52
| | | | | | | | 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>
* Post-release version bump to 7.10.0Jiri Denemark2021-11-011-1/+1
| | | | Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* Add support for domain event for memory device size changev7.9.0Daniel P. Berrangé2021-10-083-0/+74
| | | | Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Post-release version bump to 7.9.0Jiri Denemark2021-10-011-1/+1
| | | | Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* sanitytest: Add virNetworkCreateXMLFlags() to list of name fixupsv7.8.0Michal Privoznik2021-09-241-1/+2
| | | | | | | | | | | | | | 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>
* Don't mention email patch submission in READMEJonathon Jongsma2021-09-211-13/+2
| | | | | | | | 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>
* Update readme to mention pytest instead of noseJonathon Jongsma2021-09-211-1/+1
| | | | | | | 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>
* Add new autostart API for node devicesJonathon Jongsma2021-09-213-0/+35
| | | | | | | 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>
* ci: remove obsolete refresh script and documentationDaniel P. Berrangé2021-09-022-41/+0
| | | | | | We now use lcitool's manifest feature to generate files. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* ci: re-generate containers/gitlab config from manifestDaniel P. Berrangé2021-09-0213-210/+271
| | | | | | | 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>
* ci: define a CI manifest fileDaniel P. Berrangé2021-09-021-0/+54
| | | | | | | 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>
* rpm: drop support for RHEL-7Daniel P. Berrangé2021-09-011-15/+2
| | | | | | We no longer support libvirt on this distro Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Post-release version bump to 7.8.0Jiri Denemark2021-09-011-1/+1
| | | | Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* Post-release version bump to 7.7.0v7.7.0Jiri Denemark2021-08-021-1/+1
| | | | Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* gitlab: use custom docker:dind imagev7.6.0Daniel P. Berrangé2021-07-271-1/+2
| | | | | | | | | | | 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>
* Post-release version bump to 7.6.0Jiri Denemark2021-07-011-1/+1
| | | | Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* Fix BlockThreshold Callback argument conversion once morev7.5.0Peter Krempa2021-06-251-1/+1
| | | | | | | | | | | 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: fd069ac85c8cf1593587dc9287a3d5eb6bd4bdb9 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1976109 Signed-off-by: Peter Krempa <pkrempa@redhat.com>
* Post-release version bump to 7.5.0Jiri Denemark2021-06-011-1/+1
| | | | Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* iothread: fix memory access out of boundsv7.4.0w005067502021-05-271-4/+8
| | | | | | | | | 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>
* Post-release version bump to 7.4.0Jiri Denemark2021-05-271-1/+1
| | | | Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* containers: refresh containers with latest libvirt-ciDaniel P. Berrangé2021-05-259-15/+13
| | | | Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* gitlab: don't set RPM variable on container jobDaniel P. Berrangé2021-05-251-1/+0
| | | | Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* gitlab: add OpenSUSE Tumbleweed container and buildDaniel P. Berrangé2021-05-252-0/+45
| | | | Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* gitlab: introduce Fedora 34 container and buildDaniel P. Berrangé2021-05-252-0/+55
| | | | Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* gitlab: rename opensuse-152 to opensuse-leap-152Daniel P. Berrangé2021-05-252-5/+5
| | | | Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* gitlab: rename centos-stream to centos-stream-8Daniel P. Berrangé2021-05-252-5/+5
| | | | Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* gitlab: drop Fedora 32 container and buildDaniel P. Berrangé2021-05-252-55/+0
| | | | Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* gitlab: drop centos-7 container and buildDaniel P. Berrangé2021-05-252-47/+0
| | | | Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* generator.py: Untangle virNodeDevice name fixupv7.3.0Michal Privoznik2021-04-151-8/+9
| | | | | | | | | The way that virNodeDevice method name fixup is written makes it hard to find via grep (matching the virNodeDevice prefix and then matching only the operation like "Get", "Lookup", ...). Expand the string matching to match the pattern of other cases. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
* generator.py: Fix method names for new virNodeDevice*() APIsMichal Privoznik2021-04-151-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In the 7.3.0 release we are going to have three new public APIs: virNodeDeviceDefineXML() virNodeDeviceUndefine() virNodeDeviceCreate() The first one is slightly problematic, because it takes virConnectPtr argument and thus our generator wants to put its wrapper under virConnect python class, which is correct, but what's incorrect is the name it chooses for the method: defineXML(). Such method already exists and wraps virDomainDefineXML() around. Also, the name is rather confusing anyway - it's missing the 'nodeDevice' prefix. Fortunately, the fix is easy - add another case into nameFixup(). The story with virNodeDeviceCreate() is similar. Except, this time the class in which the method was put is correct. But the name is still wrong, because our generator matched 'virNodeDeviceCreate' thinking it's the good old virNodeDeviceCreateXML() API and "fixed" the name of the method to nodeDeviceCreate(). Luckily, virNodeDeviceUndefine() is just fine. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>