summaryrefslogtreecommitdiff
path: root/scripts
Commit message (Collapse)AuthorAgeFilesLines
...
* esx: generator: fix free of elements in listsPino Toscano2020-09-141-5/+21
| | | | | | | | | | | | | | | | | | | | | | | When a list is freed, we iterate through all the items, invoking the free function for each; the actual free function called for each element is the function of the actual type of each element, and thus the @_next pointer in the element struct has the same type as the element itself. Currently, the free function gets the parent of the current element type, and invoke its free function to continue freeing the list. However, in case the hierarchy of the classes has more than 1 level (i.e. Class <- SubClass <- SubSubClass), the invoked free function is only the parent class' one, and not the actual base class of the hierarchy. To fix that, change the generator to get the base class of a class, and invoking that instead. Also, avoid to set the @_next back, as it is not needed. Fixes commits 5cff36e39ae691fbd7c40597df1732eecf294150 and f76c6dde2e33233566e886d96e76b5fe0c102d9a. Signed-off-by: Pino Toscano <ptoscano@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
* libvirt: add stateShutdownPrepare/stateShutdownWait to driversNikolay Shirokovskiy2020-09-071-0/+2
| | | | | | | | | | stateShutdownPrepare is supposed to inform driver that it will be closed soon so that the driver can prepare and finish all background threads quickly on stateShutdownWait call. Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
* tests: Add simple test for virDomainMigrateCheckNotLocalMartin Kletzander2020-09-041-0/+1
| | | | | | | | | For this we need to make the function accessible (at least privately). The behaviour will change in following patches and the test helps explaining the change. Signed-off-by: Martin Kletzander <mkletzan@redhat.com> Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
* AUTHORS: Convert to reStructuredTextAndrea Bolognani2020-09-021-1/+1
| | | | | | | | | | Now that we have moved to Meson, we are no longer required to use a specific name for this file, and since the rest of our documentation is in reStructuredText format and uses a matching file extension, we can give the AUTHORS file the same treatment. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* scripts: Fix meson-install-symlink.py overwriting existing linksErik Skultety2020-08-051-0/+4
| | | | | | | | | | | | | | | | | | By default, symlink re-creation fails if the link already exists, more specifically in case of meson-install-symlink.py: Traceback (most recent call last): File "/<path_to_libvirt_repo>/scripts/meson-install-symlink.py", line 15, in <module> os.symlink(target, link) FileExistsError: File exists: '../default.xml' -> 'default.xml' Unfortunately, Python can't mimic "ln -sf", so we have to fix this differently - remove the existing link first and then try re-creating it. Signed-off-by: Erik Skultety <eskultet@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
* src: add G_GNUC_NO_INLINE annotations for mocked symbolsDaniel P. Berrangé2020-08-041-1/+1
| | | | | | | | | | | We should prevent inlining of symbols from the driver .so files that are mocked, as well as those in the main libvirt.so This isn't fixing any currently known problem, just trying to prevent future issues. Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* docs: fix libvirt go-import metadata in pages and links in 404 pageDaniel P. Berrangé2020-08-041-4/+0
| | | | | | | | | | | | | The meson conversion lost the <meta> tags providing the go-import, because the "$pagename" variable lost the .html suffix. Rather than fix that, just change to using "$pagesrc" instead, as it is a better fit. The 404 page also needs to use absolute links to work correctly for pages in sub-folders. Reviewed-by: Pavel Hrdina <phrdina@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* docs: build: Use proper path to file in 'contribute' linkPeter Krempa2020-08-031-1/+1
| | | | | | | | | | | | | | | | | NEWS.rst is based in the root of the repository and 'hvsupport.html' doesn't have a backing file which can be edited since it's fully generated. Our 'contribute -> edit this page' link on the bottom of the page is wrong in those cases. Fix it by adding the contribute section only when there's a source and base the 'source' of a html file in the root of the repository. Along with that we need to modify the scripts/meson-html-gen.py script to accept optional 'pagesrc' and the XSL template to skip the 'contribute' section when we don't have a source. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* meson: add rule to build and install only web documentationPavel Hrdina2020-08-032-0/+11
| | | | | | Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Neal Gompa <ngompa13@gmail.com>
* meson: generate and distribute spec files and AUTHORSPavel Hrdina2020-08-033-0/+24
| | | | | | Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Neal Gompa <ngompa13@gmail.com>
* meson: docs: introduce meson-html-gen.py helperPavel Hrdina2020-08-032-0/+42
| | | | | | Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Neal Gompa <ngompa13@gmail.com>
* meson: docs: generate docs timestampPavel Hrdina2020-08-032-0/+14
| | | | | | Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Neal Gompa <ngompa13@gmail.com>
* meson: docs: build api XML filesPavel Hrdina2020-08-031-9/+17
| | | | | | Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Neal Gompa <ngompa13@gmail.com>
* meson: tests: add file access test setupPavel Hrdina2020-08-031-6/+22
| | | | | | | | | | | | | | | | | | | | | | | | | We need to modify check-file-access.py to be usable as wrapper for libvirt tests. This way we can run the tests using this command: meson test --setup access which will run all tests using check-file-access.py as a wrapper. With autotools all file access are written into single file for all tests and compared once the whole test suite is done. With Meson we will compare the file access after every single test because it is used as wrapper now. That requires writing the file access into separate files for every single test as they are executed in parallel. Since the wrapper is used for all tests in Meson including tests outside of tests directory we have to check for presence of the output file. We should also cleanup after ourselves. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Neal Gompa <ngompa13@gmail.com>
* meson: src: add check*protocol testsPavel Hrdina2020-08-031-40/+31
| | | | | | Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Neal Gompa <ngompa13@gmail.com>
* meson: src/network: install default network xmlPavel Hrdina2020-08-032-0/+16
| | | | | | Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Neal Gompa <ngompa13@gmail.com>
* meson: src: install empty directoriesPavel Hrdina2020-08-032-0/+10
| | | | | | Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Neal Gompa <ngompa13@gmail.com>
* meson: scripts: introduce meson-gen-sym.py scriptPavel Hrdina2020-08-032-0/+30
| | | | | | Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Neal Gompa <ngompa13@gmail.com>
* meson: scripts: introduce meson-gen-def.py scriptPavel Hrdina2020-08-032-0/+24
| | | | | | Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Neal Gompa <ngompa13@gmail.com>
* meson: src: build libvirt_driver_hyperv.a static libraryPavel Hrdina2020-08-031-9/+4
| | | | | | | | Drop automake like print from scripts/hyperv_wmi_generator.py as well. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Neal Gompa <ngompa13@gmail.com>
* meson: src: build libvirt_driver_esx.a static libraryPavel Hrdina2020-08-031-17/+12
| | | | | | | | Drop automake like print from scripts/esx_vi_generator.py as well. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Neal Gompa <ngompa13@gmail.com>
* meson: add runutf8 env vars and meson-python.sh scriptPavel Hrdina2020-08-032-0/+4
| | | | | | | | | | | | | | With meson we have to use both env vars and wrapper script to run python with correct LANG settings. run_command() and test() have 'env' attribute so we can use it, but custom_target() doesn't support that attribute. Environment variables cannot by configured using 'command' because meson checks if the first item in the list is executable so we have to use a wrapper. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Neal Gompa <ngompa13@gmail.com>
* meson: add scripts directoryPavel Hrdina2020-08-031-0/+29
| | | | | | Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Neal Gompa <ngompa13@gmail.com>
* scripts: check-remote-protocol: remove unused OBJEXT argumentPavel Hrdina2020-07-101-3/+2
| | | | | | Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
* scripts: remove use of the term 'whitelist' from build helpersDaniel P. Berrangé2020-06-263-13/+12
| | | | | | | | The term "permitted list" is a better choice for the filtering logic applied. Reviewed-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* news: Convert to reStructuredTextAndrea Bolognani2020-06-051-102/+0
| | | | | | | | | | | Instead of storing release notes as XML and then converting them to HTML and ASCII at build time using XSLT and a custom script, we can use reStructuredText as both the source and ASCII representation and generate HTML from it using the same tooling we already use for the rest of the documentation. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* news: Output reStructuredText for the ASCII versionAndrea Bolognani2020-06-051-10/+10
| | | | | | | | | The ASCII output our scripts produce is already very close to reStructuredText, and with just a few extra tweaks we can get almost all of the way there. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* po: stop stripping non-translated strings from po filesDaniel P. Berrangé2020-06-041-54/+0
| | | | | | | | | | | | | | | | | | | We previously adopted a minimization technique for po files which stripped source locations and non-translated msgids in order to save space in the git repos and have saner commit diffs. At this time it is not possible to integrate with weblate while having non-translated msgids stripped, as it will immediately add them back again. By keeping all non-translated msgids, our .po files are about x2 the size at 37 MB vs the original 18 MB. This is still way better than the original po/ directory which was 109 MB. We're saving 38 MB by still omitting source file locations, and another 34 MB are saved by the dropping of all languages which are 100% untranslated. Reviewed-by: Pavel Hrdina <phrdina@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* scripts: Fix E741 that pycodesyle is pointing out during syntax-checkErik Skultety2020-05-261-2/+2
| | | | | | | | | | | | | | | With newer pycodestyle 2.6.0 (which is part of flake8-3.8.2) reports the following pep violation during syntax-check: ../scripts/check-remote-protocol.py:95:9: E741 ambiguous variable name 'l' for l in err.strip().split("\n") On all the distros we test on, this hasn't occurred yet, but with the future update of flake8 it likely would. The fix is easy, just name the variable appropriately. Signed-off-by: Erik Skultety <eskultet@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
* scripts: emit raw enum value in API build descriptionDaniel P. Berrangé2020-05-221-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the value for an enum is only emitted if it is a plain string. If the enum is an integer or hex value, or a complex code block, it is omitted from the API build. This fixes that by emitting the raw value if no string value is present. With this change: <macro name='LIBVIR_CHECK_VERSION' file='libvirt-common' params='major,minor,micro'> <macro name='LIBVIR_VERSION_NUMBER' file='libvirt-common'> <macro name='VIR_COPY_CPUMAP' file='libvirt-domain' params='cpumaps,maplen,vcpu,cpumap'> ...snip... <macro name='LIBVIR_CHECK_VERSION' file='libvirt-common' params='major,minor,micro' raw='((major) * 1000000 + (minor) * 1000 + (micro) <= LIBVIR_VERSION_NUMBER)'> <macro name='LIBVIR_VERSION_NUMBER' file='libvirt-common' raw='6004000'> <macro name='VIR_COPY_CPUMAP' file='libvirt-domain' params='cpumaps,maplen,vcpu,cpumap' raw='memcpy(cpumap, VIR_GET_CPUMAP(cpumaps, maplen, vcpu), maplen)'> ...snip... Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* scripts: emit enum parameters in API build descriptionDaniel P. Berrangé2020-05-221-6/+11
| | | | | | | | | | | | | | | | | | | Currently the information about enums in the API document lacks any mention of parameters, so it is impossible to tell what kind of enum declaration is present in the libvirt API header. With this change <macro name='LIBVIR_CHECK_VERSION' file='libvirt-common'> <macro name='VIR_COPY_CPUMAP' file='libvirt-domain'> ...snip... becomes <macro name='LIBVIR_CHECK_VERSION' file='libvirt-common' params='major,minor,micro'> <macro name='VIR_COPY_CPUMAP' file='libvirt-domain' params='cpumaps,maplen,vcpu,cpumap'> ...snip... Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* scripts: fix tokenizing of enum parameters in API builderDaniel P. Berrangé2020-05-221-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The API build script tokenizes enums declarations by first splitting on whitespace. This is unhelpful as it means an enum # define VIR_USE_CPU(cpumap, cpu) ((cpumap)[(cpu) / 8] |= (1 << ((cpu) % 8))) Gets tokenized as #define VIR_USE_CPU(cpumap, cpu) ((cpumap)[(cpu) / 8] |= (1 << ((cpu) % 8))) With this change, the set of parameters are all merged into the first token: #define VIR_USE_CPU(cpumap,cpu) ((cpumap)[(cpu) / 8] |= (1 << ((cpu) % 8))) which is more convenient to process later on in the script. Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* scripts: use UTF-8 for API XML filesDaniel P. Berrangé2020-05-221-1/+1
| | | | | | | | The build system will be running in UTF-8 locale, so any content in the API XML files will also end up being UTF-8, not ISO-8859-1. Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* gitlab: convert to shared container for DCO checkDaniel P. Berrangé2020-05-041-99/+0
| | | | | | | | This removes the locally maintained DCO checking script in favour of the shared container image provided by libvirt-ci.git. Reviewed-by: Andrea Bolognani <abologna@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* scripts: avoid error in DCO check on empty branchesDaniel P. Berrangé2020-03-271-1/+4
| | | | | | | | | If the DCO check is run on an empty branch (ie one which has no commits different from master), it throws an error due to trying to interpret the empty string as a git commit SHA. Reviewed-by: Andrea Bolognani <abologna@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* gitlab: introduce a check for validate DCO sign-offDaniel P. Berrangé2020-03-271-0/+96
| | | | | | | | | | | | This introduces a CI job for validating DCO sign-off in every commit message. The CI jobs are not provided any information on what the baseline commit for the branch was. We can't compare against the forked repo's master branch, as there's no guarantee the user is keeping master up2date in their fork. Thus we add the master upstream repo as a git remote and identify the common ancestor. Reviewed-by: Andrea Bolognani <abologna@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* virerror: Make it easier to add new error numberMichal Privoznik2020-01-101-0/+7
| | | | | | | | | | | In v5.0.0-rc1~94 we switched from one huge switch() to an array for translating error numbers into error messages. However, the array is declared to have VIR_ERR_NUMBER_LAST items which makes it impossible to spot this place by compile checking when adding new error number. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
* docs: rewrite polkit docs generator in PythonDaniel P. Berrangé2019-12-201-0/+121
| | | | | | | | | | | | | As part of a goal to eliminate Perl from libvirt build tools, rewrite the genaclperms.pl tool in Python. This was a straight conversion, manually going line-by-line to change the syntax from Perl to Python. Thus the overall structure of the file and approach is the same. Tested-by: Cole Robinson <crobinso@redhat.com> Reviewed-by: Cole Robinson <crobinso@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* docs: rewrite hvsupport.html page generator in pythonDaniel P. Berrangé2019-12-201-0/+502
| | | | | | | | | | | | | | | | As part of a goal to eliminate Perl from libvirt build tools, rewrite the hvsupport.pl tool in Python. This was a straight conversion, manually going line-by-line to change the syntax from Perl to Python. Thus the overall structure of the file and approach is the same. The new impl generates byte-for-byte identical output to the old impl. Tested-by: Cole Robinson <crobinso@redhat.com> Reviewed-by: Cole Robinson <crobinso@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* tests: rewrite file access checker in PythonDaniel P. Berrangé2019-12-201-0/+125
| | | | | | | | | | | | As part of a goal to eliminate Perl from libvirt build tools, rewrite the check-file-access.pl tool in Python. This was a straight conversion, manually going line-by-line to change the syntax from Perl to Python. Thus the overall structure of the file and approach is the same. Reviewed-by: Cole Robinson <crobinso@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* tests: rewrite qemu capability grouper in PythonDaniel P. Berrangé2019-12-201-0/+121
| | | | | | | | | | | | | As part of a goal to eliminate Perl from libvirt build tools, rewrite the group-qemu-caps.pl tool in Python. This was a straight conversion, manually going line-by-line to change the syntax from Perl to Python. Thus the overall structure of the file and approach is the same. Tested-by: Cole Robinson <crobinso@redhat.com> Reviewed-by: Cole Robinson <crobinso@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* scripts: ignore remote protocol checks if pdwtags crashesDaniel P. Berrangé2019-12-061-2/+6
| | | | | | | | | | | On Debian 10, pdwtags reliably segfaults when parsing the libvirt remote protocol files. This crash was previously ignored by 'make check' because of the way we piped the pdwtags output to the perl post-processing scripts. When this was converted to use python it mistakenly started being a fatal error. We need to explicitly ignore pdwtags output if it exited with non-zero return code. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* tests: rewrite test argv line wrapper in PythonDaniel P. Berrangé2019-12-041-0/+168
| | | | | | | | | | | | As part of a goal to eliminate Perl from libvirt build tools, rewrite the test-wrap-argv.pl tool in Python. This was a straight conversion, manually going line-by-line to change the syntax from Perl to Python. Thus the overall structure of the file and approach is the same. Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* src: rewrite remote protocol checker in PythonDaniel P. Berrangé2019-12-041-0/+134
| | | | | | | | | | | | | As part of a goal to eliminate Perl from libvirt build tools, rewrite the pdwtags processing script in Python. The original inline shell and perl code was completely unintelligible. The new python code is a manual conversion that attempts todo basically the same thing. Tested-by: Cole Robinson <crobinso@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* build: only support python3 binaryDaniel P. Berrangé2019-12-0418-54/+18
| | | | | | | | python2 will be end of life by the time of the next libvirt release. All our supported build targets, including CentOS7, have a python3 build available. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* scripts: fix list indexing when printing mis-ordered symbolsDaniel P. Berrangé2019-12-041-2/+2
| | | | | | | | The python array slice syntax expects the first and last indexes, not the first length and element count. Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* docs: move hyperv_wmi_generator.py to the scripts/ directoryDaniel P. Berrangé2019-12-041-0/+496
| | | | | Reviewed-by: Cole Robinson <crobinso@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* docs: move esx_vi_generator.py to the scripts/ directoryDaniel P. Berrangé2019-12-041-0/+1689
| | | | | Reviewed-by: Cole Robinson <crobinso@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* docs: move reformat-news.py to the scripts/ directoryDaniel P. Berrangé2019-12-041-0/+104
| | | | | Reviewed-by: Cole Robinson <crobinso@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* docs: move apibuild.py to the scripts/ directoryDaniel P. Berrangé2019-12-041-0/+2415
| | | | | Reviewed-by: Cole Robinson <crobinso@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>