[PATCH v3 00/30] Add 'version' to other exported types

Victor Toso posted 30 patches 2 years ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20220420190819.3093205-1-victortoso@redhat.com
There is a newer version of this series
build-aux/syntax-check.mk                   |    4 +-
include/libvirt/libvirt-admin.h             |   95 +-
include/libvirt/libvirt-common.h.in         |   54 +-
include/libvirt/libvirt-domain-checkpoint.h |   62 +-
include/libvirt/libvirt-domain-snapshot.h   |  100 +-
include/libvirt/libvirt-domain.h            | 2665 +++++++++++++++----
include/libvirt/libvirt-event.h             |   35 +-
include/libvirt/libvirt-host.h              |  320 ++-
include/libvirt/libvirt-interface.h         |   33 +-
include/libvirt/libvirt-network.h           |  195 +-
include/libvirt/libvirt-nodedev.h           |  100 +-
include/libvirt/libvirt-nwfilter.h          |   29 +-
include/libvirt/libvirt-qemu.h              |   39 +-
include/libvirt/libvirt-secret.h            |   81 +-
include/libvirt/libvirt-storage.h           |  316 ++-
include/libvirt/libvirt-stream.h            |   48 +-
include/libvirt/virterror.h                 |  428 +--
scripts/apibuild.py                         |  212 +-
scripts/version-quest.py                    |  190 ++
src/admin/libvirt-admin.c                   |   93 +
src/libvirt-domain-checkpoint.c             |   36 +
src/libvirt-domain-snapshot.c               |   63 +
src/libvirt-domain.c                        |  557 +++-
src/libvirt-host.c                          |  102 +
src/libvirt-interface.c                     |   63 +
src/libvirt-lxc.c                           |   12 +
src/libvirt-network.c                       |  135 +
src/libvirt-nodedev.c                       |   81 +
src/libvirt-nwfilter.c                      |   72 +
src/libvirt-qemu.c                          |   18 +
src/libvirt-secret.c                        |   60 +
src/libvirt-storage.c                       |  171 ++
src/libvirt-stream.c                        |   51 +
src/libvirt.c                               |   29 +-
src/util/virerror.c                         |   45 +
src/util/virevent.c                         |   27 +
src/util/virtypedparam-public.c             |   57 +
37 files changed, 5533 insertions(+), 1145 deletions(-)
create mode 100644 scripts/version-quest.py
[PATCH v3 00/30] Add 'version' to other exported types
Posted by Victor Toso 2 years ago
Hi,

Here it comes, version 3.

    v1: https://listman.redhat.com/archives/libvir-list/2022-April/229881.html
    v2: https://listman.redhat.com/archives/libvir-list/2022-April/230097.html

In this version, I have:
 - dropped the changes to .sym files (Peter, Daniel)

 - improved commit log: 'doc' -> 'docstring' (and more) (Peter)

 - fixed all versions prior to v1.0.0 (Peter, Andrea)

 - created a validate script, to confirm all is good. Not expecting it
   to be merged, just added to help review that the outcome is
   acceptable.

 - lots of fixes found by the script above.

 - dropped the concept of generated/manual in git shortlog of the series.

 - added an allow list for functions where there is a mismatch between
   version in the sym file and the git tag they were introduced (Peter)

I hope that it'll be useful to other generators, besides:

    https://gitlab.com/libvirt/libvirt-go-module/-/merge_requests/7

Gitlab run of this series (fails with codestyle of do-not-commit
script).

    https://gitlab.com/victortoso/libvirt/-/pipelines/520901763

Have a wonderful day,
Victor

Victor Toso (30):
  syntax-check: sc_prohibit_nonreentrant: skip comments
  syntax-check: prohibit_virXXXFree: skip strings
  docstring: Fix generated documentation of
    virConnectListAllNodeDeviceFlags
  docstring: variable: Move docstring from source to header file
  docstring: enums: libvirt: Add 'Since version' metadata
  docstring: enums: qemu: Add 'Since version' metadata
  docstring: enums: admin: Add 'Since version' metadata
  docstring: macros: libvirt: Add 'Since version' metadata
  docstring: macros: admin: Add 'Since version' metadata
  docstring: typedef: libvirt:: Add 'Since version' metadata
  docstring: typedef: qemu:: Add 'Since version' metadata
  docstring: typedef: admin:: Add 'Since version' metadata
  docstring: function: libvirt: Add 'Since version' metadata
  docstring: function: qemu: Add 'Since version' metadata
  docstring: function: lxc: Add 'Since version' metadata
  docstring: function: admin: Add 'Since version' metadata
  docstring: libvirt-common: Add 'Since version' metadata
  docstring: Fix generated documentation of virStorageVolInfoFlags
  docstring: Fix and append Since to virConnectListAllStoragePoolsFlags
  docstring: Fix and append Since to virDomainDeviceModifyFlags
  docstring: Fix and append Since to virDomainMemoryModFlags
  docstring: Fix and append Since to virDomainVcpuFlags
  scripts: apibuild: parse 'Since' version for enums
  scripts: apibuild: fix parsing block comments from typedef enum
  scripts: apibuild: parse 'Since' for typedefs
  scripts: apibuild: parse 'Since' for macros
  scripts: apibuild: parse 'Since' for functions
  scripts: apibuild: factor out comment cleaning
  scripts: apibuild: add parsing variable's comments
  do-not-commit: script to validate output

 build-aux/syntax-check.mk                   |    4 +-
 include/libvirt/libvirt-admin.h             |   95 +-
 include/libvirt/libvirt-common.h.in         |   54 +-
 include/libvirt/libvirt-domain-checkpoint.h |   62 +-
 include/libvirt/libvirt-domain-snapshot.h   |  100 +-
 include/libvirt/libvirt-domain.h            | 2665 +++++++++++++++----
 include/libvirt/libvirt-event.h             |   35 +-
 include/libvirt/libvirt-host.h              |  320 ++-
 include/libvirt/libvirt-interface.h         |   33 +-
 include/libvirt/libvirt-network.h           |  195 +-
 include/libvirt/libvirt-nodedev.h           |  100 +-
 include/libvirt/libvirt-nwfilter.h          |   29 +-
 include/libvirt/libvirt-qemu.h              |   39 +-
 include/libvirt/libvirt-secret.h            |   81 +-
 include/libvirt/libvirt-storage.h           |  316 ++-
 include/libvirt/libvirt-stream.h            |   48 +-
 include/libvirt/virterror.h                 |  428 +--
 scripts/apibuild.py                         |  212 +-
 scripts/version-quest.py                    |  190 ++
 src/admin/libvirt-admin.c                   |   93 +
 src/libvirt-domain-checkpoint.c             |   36 +
 src/libvirt-domain-snapshot.c               |   63 +
 src/libvirt-domain.c                        |  557 +++-
 src/libvirt-host.c                          |  102 +
 src/libvirt-interface.c                     |   63 +
 src/libvirt-lxc.c                           |   12 +
 src/libvirt-network.c                       |  135 +
 src/libvirt-nodedev.c                       |   81 +
 src/libvirt-nwfilter.c                      |   72 +
 src/libvirt-qemu.c                          |   18 +
 src/libvirt-secret.c                        |   60 +
 src/libvirt-storage.c                       |  171 ++
 src/libvirt-stream.c                        |   51 +
 src/libvirt.c                               |   29 +-
 src/util/virerror.c                         |   45 +
 src/util/virevent.c                         |   27 +
 src/util/virtypedparam-public.c             |   57 +
 37 files changed, 5533 insertions(+), 1145 deletions(-)
 create mode 100644 scripts/version-quest.py

-- 
2.35.1
Re: [PATCH v3 00/30] Add 'version' to other exported types
Posted by Peter Krempa 2 years ago
On Wed, Apr 20, 2022 at 21:07:49 +0200, Victor Toso wrote:
> Hi,
>

Based on discussions on individual patches I've applied the feedback I
had including Andrea's request to remove the extra empty line on the
following patches:

docstring: Fix generated documentation of virStorageVolInfoFlags
docstring: libvirt-common: Add 'Since version' metadata
docstring: function: lxc: Add 'Since version' metadata
docstring: function: qemu: Add 'Since version' metadata
docstring: typedef: qemu:: Add 'Since version' metadata
docstring: typedef: libvirt:: Add 'Since version' metadata
docstring: macros: libvirt: Add 'Since version' metadata
docstring: enums: qemu: Add 'Since version' metadata
docstring: variable: Move docstring from source to header file
docstring: Fix generated documentation of virConnectListAllNodeDeviceFlags

And went ahead and pushed them so that we don't have to keep re-sending
them.
Re: [PATCH v3 00/30] Add 'version' to other exported types
Posted by Andrea Bolognani 2 years ago
On Fri, Apr 22, 2022 at 10:20:11AM +0200, Peter Krempa wrote:
> Based on discussions on individual patches I've applied the feedback I
> had including Andrea's request to remove the extra empty line on the
> following patches:
>
> docstring: Fix generated documentation of virStorageVolInfoFlags
> docstring: libvirt-common: Add 'Since version' metadata
> docstring: function: lxc: Add 'Since version' metadata
> docstring: function: qemu: Add 'Since version' metadata
> docstring: typedef: qemu:: Add 'Since version' metadata
> docstring: typedef: libvirt:: Add 'Since version' metadata
> docstring: macros: libvirt: Add 'Since version' metadata
> docstring: enums: qemu: Add 'Since version' metadata
> docstring: variable: Move docstring from source to header file
> docstring: Fix generated documentation of virConnectListAllNodeDeviceFlags
>
> And went ahead and pushed them so that we don't have to keep re-sending
> them.

Mh, maybe pushing those patches right now was not an entirely good
idea.

If you build the HTML documentation locally and browse it, you'll
notice that the Since information for many of the symbols is now
showing up, just tacked on to the end.

This is particularly bad for functions, where the result will end up
looking like

  Returns    0 on success, -1 on error. Since: v1.0.2

That will of course stop happening once apibuild.py learns to parse
the Since tag and exclude it from the symbol's description.

Are we confident that we can get the rest of the series in before the
next release? I don't think having messed up documentation showing up
on the website for a few days is necessarily a big deal, but we
should probably not ship that as part of a release.

-- 
Andrea Bolognani / Red Hat / Virtualization
Re: [PATCH v3 00/30] Add 'version' to other exported types
Posted by Victor Toso 2 years ago
On Fri, Apr 22, 2022 at 07:21:11AM -0700, Andrea Bolognani wrote:
> On Fri, Apr 22, 2022 at 10:20:11AM +0200, Peter Krempa wrote:
> > Based on discussions on individual patches I've applied the feedback I
> > had including Andrea's request to remove the extra empty line on the
> > following patches:
> >
> > docstring: Fix generated documentation of virStorageVolInfoFlags
> > docstring: libvirt-common: Add 'Since version' metadata
> > docstring: function: lxc: Add 'Since version' metadata
> > docstring: function: qemu: Add 'Since version' metadata
> > docstring: typedef: qemu:: Add 'Since version' metadata
> > docstring: typedef: libvirt:: Add 'Since version' metadata
> > docstring: macros: libvirt: Add 'Since version' metadata
> > docstring: enums: qemu: Add 'Since version' metadata
> > docstring: variable: Move docstring from source to header file
> > docstring: Fix generated documentation of virConnectListAllNodeDeviceFlags
> >
> > And went ahead and pushed them so that we don't have to keep re-sending
> > them.
> 
> Mh, maybe pushing those patches right now was not an entirely good
> idea.
> 
> If you build the HTML documentation locally and browse it, you'll
> notice that the Since information for many of the symbols is now
> showing up, just tacked on to the end.
> 
> This is particularly bad for functions, where the result will end up
> looking like
> 
>   Returns    0 on success, -1 on error. Since: v1.0.2
> 
> That will of course stop happening once apibuild.py learns to parse
> the Since tag and exclude it from the symbol's description.
> 
> Are we confident that we can get the rest of the series in before the
> next release? I don't think having messed up documentation showing up
> on the website for a few days is necessarily a big deal, but we
> should probably not ship that as part of a release.

I'll be sending v4 Today with all previous comments addressed.
We should still have some time to minor fixes if we spot them.

Cheers,
Victor
Re: [PATCH v3 00/30] Add 'version' to other exported types
Posted by Andrea Bolognani 2 years ago
On Fri, Apr 22, 2022 at 10:20:11AM +0200, Peter Krempa wrote:
> Based on discussions on individual patches I've applied the feedback I
> had including Andrea's request to remove the extra empty line on the
> following patches:
>
> docstring: Fix generated documentation of virStorageVolInfoFlags
> docstring: libvirt-common: Add 'Since version' metadata
> docstring: function: lxc: Add 'Since version' metadata
> docstring: function: qemu: Add 'Since version' metadata
> docstring: typedef: qemu:: Add 'Since version' metadata
> docstring: typedef: libvirt:: Add 'Since version' metadata
> docstring: macros: libvirt: Add 'Since version' metadata
> docstring: enums: qemu: Add 'Since version' metadata
> docstring: variable: Move docstring from source to header file
> docstring: Fix generated documentation of virConnectListAllNodeDeviceFlags
>
> And went ahead and pushed them so that we don't have to keep re-sending
> them.

Thanks!

I've noticed that a number of unnecessary empty lines have still
managed to sneak their way into the repository, so I've posted a
couple of follow-up patches to (hopefully) eliminate all occurrences.

https://listman.redhat.com/archives/libvir-list/2022-April/230328.html

-- 
Andrea Bolognani / Red Hat / Virtualization
Re: [PATCH v3 00/30] Add 'version' to other exported types
Posted by Victor Toso 2 years ago
Hi,

On Fri, Apr 22, 2022 at 10:20:11AM +0200, Peter Krempa wrote:
> On Wed, Apr 20, 2022 at 21:07:49 +0200, Victor Toso wrote:
> > Hi,
> >
> 
> Based on discussions on individual patches I've applied the feedback I
> had including Andrea's request to remove the extra empty line on the
> following patches:
> 
> docstring: Fix generated documentation of virStorageVolInfoFlags
> docstring: libvirt-common: Add 'Since version' metadata
> docstring: function: lxc: Add 'Since version' metadata
> docstring: function: qemu: Add 'Since version' metadata
> docstring: typedef: qemu:: Add 'Since version' metadata
> docstring: typedef: libvirt:: Add 'Since version' metadata
> docstring: macros: libvirt: Add 'Since version' metadata
> docstring: enums: qemu: Add 'Since version' metadata
> docstring: variable: Move docstring from source to header file
> docstring: Fix generated documentation of virConnectListAllNodeDeviceFlags
> 
> And went ahead and pushed them so that we don't have to keep re-sending
> them.

That made my life so much easier. Many thanks!

Cheers,
Victor
Re: [PATCH v3 00/30] Add 'version' to other exported types
Posted by Victor Toso 2 years ago
Hi,

On Wed, Apr 20, 2022 at 09:07:49PM +0200, Victor Toso wrote:
> Gitlab run of this series (fails with codestyle of do-not-commit
> script).

Actually, I fixed before sending.

>     https://gitlab.com/victortoso/libvirt/-/pipelines/520901763

Cheers,
Victor