[libvirt] [PATCH 00/19] Use '#pragma once' in headers

Jonathon Jongsma posted 19 patches 2 weeks ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20190607202030.29625-1-jjongsma@redhat.com
src/access/viraccessdriver.h         |  10 +-
src/access/viraccessdrivernop.h      |   7 +-
src/access/viraccessdriverpolkit.h   |   7 +-
src/access/viraccessdriverstack.h    |   7 +-
src/access/viraccessmanager.h        |  26 +--
src/access/viraccessperm.h           |  11 +-
src/admin/admin_server.h             |   9 +-
src/admin/admin_server_dispatch.h    |  11 +-
src/bhyve/bhyve_capabilities.h       |  11 +-
src/bhyve/bhyve_command.h            |  15 +-
src/bhyve/bhyve_conf.h               |   7 +-
src/bhyve/bhyve_device.h             |  11 +-
src/bhyve/bhyve_domain.h             |  11 +-
src/bhyve/bhyve_driver.h             |   9 +-
src/bhyve/bhyve_monitor.h            |  11 +-
src/bhyve/bhyve_parse_command.h      |   5 +-
src/bhyve/bhyve_process.h            |   7 +-
src/bhyve/bhyve_utils.h              |  31 ++-
src/conf/capabilities.h              |  23 +--
src/conf/cpu_conf.h                  |  23 +--
src/conf/device_conf.h               |  33 ++-
src/conf/domain_addr.h               |  16 +-
src/conf/domain_audit.h              |  10 +-
src/conf/domain_capabilities.h       |  15 +-
src/conf/domain_conf.h               |  91 ++++-----
src/conf/domain_event.h              |  11 +-
src/conf/domain_nwfilter.h           |   5 +-
src/conf/interface_conf.h            |  23 +--
src/conf/moment_conf.h               |  11 +-
src/conf/netdev_bandwidth_conf.h     |  15 +-
src/conf/netdev_vlan_conf.h          |  13 +-
src/conf/netdev_vport_profile_conf.h |  14 +-
src/conf/network_conf.h              |  52 +++--
src/conf/network_event.h             |  11 +-
src/conf/networkcommon_conf.h        |  17 +-
src/conf/node_device_conf.h          |  31 ++-
src/conf/node_device_event.h         |  11 +-
src/conf/node_device_util.h          |   7 +-
src/conf/numa_conf.h                 |  18 +-
src/conf/nwfilter_conf.h             |  93 ++++-----
src/conf/nwfilter_ipaddrmap.h        |   5 +-
src/conf/nwfilter_params.h           |  28 ++-
src/conf/object_event.h              |  11 +-
src/conf/object_event_private.h      |   7 +-
src/conf/secret_conf.h               |  15 +-
src/conf/secret_event.h              |  11 +-
src/conf/snapshot_conf.h             |  13 +-
src/conf/storage_adapter_conf.h      |  11 +-
src/conf/storage_capabilities.h      |   8 +-
src/conf/storage_conf.h              |  41 ++--
src/conf/storage_event.h             |  11 +-
src/conf/virchrdev.h                 |   9 +-
src/conf/virconftypes.h              |   5 +-
src/conf/virdomainmomentobjlist.h    |  17 +-
src/conf/virdomainobjlist.h          |  21 +-
src/conf/virdomainsnapshotobjlist.h  |  21 +-
src/conf/virinterfaceobj.h           |   7 +-
src/conf/virnetworkobj.h             |   9 +-
src/conf/virnodedeviceobj.h          |  13 +-
src/conf/virnwfilterbindingdef.h     |  13 +-
src/conf/virnwfilterbindingobj.h     |  11 +-
src/conf/virnwfilterbindingobjlist.h |   8 +-
src/conf/virnwfilterobj.h            |  11 +-
src/conf/virsavecookie.h             |  13 +-
src/conf/virsecretobj.h              |  11 +-
src/conf/virstorageobj.h             |  11 +-
src/cpu/cpu.h                        |  19 +-
src/cpu/cpu_arm.h                    |   7 +-
src/cpu/cpu_map.h                    |   7 +-
src/cpu/cpu_ppc64.h                  |   7 +-
src/cpu/cpu_ppc64_data.h             |   8 +-
src/cpu/cpu_s390.h                   |   7 +-
src/cpu/cpu_x86.h                    |   9 +-
src/cpu/cpu_x86_data.h               |  58 +++---
src/datatypes.h                      |  89 ++++----
src/driver-hypervisor.h              |  12 +-
src/driver-interface.h               |  12 +-
src/driver-network.h                 |  12 +-
src/driver-nodedev.h                 |  12 +-
src/driver-nwfilter.h                |  12 +-
src/driver-secret.h                  |  12 +-
src/driver-state.h                   |  12 +-
src/driver-storage.h                 |  12 +-
src/driver-stream.h                  |  12 +-
src/driver.h                         |  37 ++--
src/esx/esx_driver.h                 |   5 +-
src/esx/esx_interface_driver.h       |   7 +-
src/esx/esx_network_driver.h         |   7 +-
src/esx/esx_private.h                |  15 +-
src/esx/esx_storage_backend_iscsi.h  |   7 +-
src/esx/esx_storage_backend_vmfs.h   |   7 +-
src/esx/esx_storage_driver.h         |   7 +-
src/esx/esx_stream.h                 |   9 +-
src/esx/esx_util.h                   |  13 +-
src/esx/esx_vi.h                     |  37 ++--
src/esx/esx_vi_methods.h             |  11 +-
src/esx/esx_vi_types.h               |  13 +-
src/hyperv/hyperv_driver.h           |   5 +-
src/hyperv/hyperv_private.h          |  13 +-
src/hyperv/hyperv_util.h             |   9 +-
src/hyperv/hyperv_wmi.h              |  21 +-
src/hyperv/hyperv_wmi_classes.h      |  27 ++-
src/hyperv/openwsman.h               |  35 ++--
src/interface/interface_driver.h     |   5 +-
src/internal.h                       | 295 +++++++++++++--------------
src/libvirt_internal.h               |   7 +-
src/libxl/libxl_capabilities.h       |  29 ++-
src/libxl/libxl_conf.h               | 101 +++++----
src/libxl/libxl_domain.h             |  29 ++-
src/libxl/libxl_driver.h             |   5 +-
src/libxl/libxl_logger.h             |   7 +-
src/libxl/libxl_migration.h          |  11 +-
src/logging/log_daemon.h             |   9 +-
src/logging/log_daemon_config.h      |   7 +-
src/logging/log_daemon_dispatch.h    |   7 +-
src/logging/log_handler.h            |   9 +-
src/logging/log_manager.h            |   9 +-
117 files changed, 928 insertions(+), 1296 deletions(-)

[libvirt] [PATCH 00/19] Use '#pragma once' in headers

Posted by Jonathon Jongsma 2 weeks ago
Hi all,

I'm trying to get up to speed with libvirt code, so I decided to start out with a slightly
"mindless" task. I grabbed the '#pragma once' task from
https://wiki.libvirt.org/page/BiteSizedTasks. This series covers the first part of the conversion. I
chatted with Daniel Berrange briefly on IRC before starting, and he suggested that I should try to
keep patches under 100k, and maybe each driver's source files as a single patch.

I had a bit of difficulty deciding where to split the src/conf/ and src/util/ directories. So some
of the files with more changes ended up being single-file patches. I tried to combine some related
source files into patches, but at a certain point I ran out of obvious files to combine, so I
combined a bunch of smaller miscellaneous files into one larger patch. It may not be ideal, but it's
the best I could come up with. Alternative suggestions welcome.

I'll follow up with the remaining changes if this division looks acceptable.

Jonathon Jongsma (19):
  Use #pragma once in driver headers
  src/access: use #pragma once in headers
  src/admin: use #pragma once in headers
  src/bhyve: use #pragma once in headers
  conf: domain: use #pragma once in headers
  conf: network: use #pragma once in headers
  conf: nwfilter: use #pragma once in headers
  conf: node device: use #pragma once in headers
  conf: storage: use #pragma once in headers
  conf: misc: use #pragma once in headers
  src/cpu: use #pragma once in headers
  src/datatypes.h: use #pragma once
  src/esx: use #pragma once in headers
  src/hyperv: use #pragma once in headers
  src/interface: use #pragma once in headers
  src/internal.h: use #pragma once
  src/libvirt_internal.h: use #pragma once
  src/libxl: use #pragma once in headers
  src/logging: use #pragma once in headers

 src/access/viraccessdriver.h         |  10 +-
 src/access/viraccessdrivernop.h      |   7 +-
 src/access/viraccessdriverpolkit.h   |   7 +-
 src/access/viraccessdriverstack.h    |   7 +-
 src/access/viraccessmanager.h        |  26 +--
 src/access/viraccessperm.h           |  11 +-
 src/admin/admin_server.h             |   9 +-
 src/admin/admin_server_dispatch.h    |  11 +-
 src/bhyve/bhyve_capabilities.h       |  11 +-
 src/bhyve/bhyve_command.h            |  15 +-
 src/bhyve/bhyve_conf.h               |   7 +-
 src/bhyve/bhyve_device.h             |  11 +-
 src/bhyve/bhyve_domain.h             |  11 +-
 src/bhyve/bhyve_driver.h             |   9 +-
 src/bhyve/bhyve_monitor.h            |  11 +-
 src/bhyve/bhyve_parse_command.h      |   5 +-
 src/bhyve/bhyve_process.h            |   7 +-
 src/bhyve/bhyve_utils.h              |  31 ++-
 src/conf/capabilities.h              |  23 +--
 src/conf/cpu_conf.h                  |  23 +--
 src/conf/device_conf.h               |  33 ++-
 src/conf/domain_addr.h               |  16 +-
 src/conf/domain_audit.h              |  10 +-
 src/conf/domain_capabilities.h       |  15 +-
 src/conf/domain_conf.h               |  91 ++++-----
 src/conf/domain_event.h              |  11 +-
 src/conf/domain_nwfilter.h           |   5 +-
 src/conf/interface_conf.h            |  23 +--
 src/conf/moment_conf.h               |  11 +-
 src/conf/netdev_bandwidth_conf.h     |  15 +-
 src/conf/netdev_vlan_conf.h          |  13 +-
 src/conf/netdev_vport_profile_conf.h |  14 +-
 src/conf/network_conf.h              |  52 +++--
 src/conf/network_event.h             |  11 +-
 src/conf/networkcommon_conf.h        |  17 +-
 src/conf/node_device_conf.h          |  31 ++-
 src/conf/node_device_event.h         |  11 +-
 src/conf/node_device_util.h          |   7 +-
 src/conf/numa_conf.h                 |  18 +-
 src/conf/nwfilter_conf.h             |  93 ++++-----
 src/conf/nwfilter_ipaddrmap.h        |   5 +-
 src/conf/nwfilter_params.h           |  28 ++-
 src/conf/object_event.h              |  11 +-
 src/conf/object_event_private.h      |   7 +-
 src/conf/secret_conf.h               |  15 +-
 src/conf/secret_event.h              |  11 +-
 src/conf/snapshot_conf.h             |  13 +-
 src/conf/storage_adapter_conf.h      |  11 +-
 src/conf/storage_capabilities.h      |   8 +-
 src/conf/storage_conf.h              |  41 ++--
 src/conf/storage_event.h             |  11 +-
 src/conf/virchrdev.h                 |   9 +-
 src/conf/virconftypes.h              |   5 +-
 src/conf/virdomainmomentobjlist.h    |  17 +-
 src/conf/virdomainobjlist.h          |  21 +-
 src/conf/virdomainsnapshotobjlist.h  |  21 +-
 src/conf/virinterfaceobj.h           |   7 +-
 src/conf/virnetworkobj.h             |   9 +-
 src/conf/virnodedeviceobj.h          |  13 +-
 src/conf/virnwfilterbindingdef.h     |  13 +-
 src/conf/virnwfilterbindingobj.h     |  11 +-
 src/conf/virnwfilterbindingobjlist.h |   8 +-
 src/conf/virnwfilterobj.h            |  11 +-
 src/conf/virsavecookie.h             |  13 +-
 src/conf/virsecretobj.h              |  11 +-
 src/conf/virstorageobj.h             |  11 +-
 src/cpu/cpu.h                        |  19 +-
 src/cpu/cpu_arm.h                    |   7 +-
 src/cpu/cpu_map.h                    |   7 +-
 src/cpu/cpu_ppc64.h                  |   7 +-
 src/cpu/cpu_ppc64_data.h             |   8 +-
 src/cpu/cpu_s390.h                   |   7 +-
 src/cpu/cpu_x86.h                    |   9 +-
 src/cpu/cpu_x86_data.h               |  58 +++---
 src/datatypes.h                      |  89 ++++----
 src/driver-hypervisor.h              |  12 +-
 src/driver-interface.h               |  12 +-
 src/driver-network.h                 |  12 +-
 src/driver-nodedev.h                 |  12 +-
 src/driver-nwfilter.h                |  12 +-
 src/driver-secret.h                  |  12 +-
 src/driver-state.h                   |  12 +-
 src/driver-storage.h                 |  12 +-
 src/driver-stream.h                  |  12 +-
 src/driver.h                         |  37 ++--
 src/esx/esx_driver.h                 |   5 +-
 src/esx/esx_interface_driver.h       |   7 +-
 src/esx/esx_network_driver.h         |   7 +-
 src/esx/esx_private.h                |  15 +-
 src/esx/esx_storage_backend_iscsi.h  |   7 +-
 src/esx/esx_storage_backend_vmfs.h   |   7 +-
 src/esx/esx_storage_driver.h         |   7 +-
 src/esx/esx_stream.h                 |   9 +-
 src/esx/esx_util.h                   |  13 +-
 src/esx/esx_vi.h                     |  37 ++--
 src/esx/esx_vi_methods.h             |  11 +-
 src/esx/esx_vi_types.h               |  13 +-
 src/hyperv/hyperv_driver.h           |   5 +-
 src/hyperv/hyperv_private.h          |  13 +-
 src/hyperv/hyperv_util.h             |   9 +-
 src/hyperv/hyperv_wmi.h              |  21 +-
 src/hyperv/hyperv_wmi_classes.h      |  27 ++-
 src/hyperv/openwsman.h               |  35 ++--
 src/interface/interface_driver.h     |   5 +-
 src/internal.h                       | 295 +++++++++++++--------------
 src/libvirt_internal.h               |   7 +-
 src/libxl/libxl_capabilities.h       |  29 ++-
 src/libxl/libxl_conf.h               | 101 +++++----
 src/libxl/libxl_domain.h             |  29 ++-
 src/libxl/libxl_driver.h             |   5 +-
 src/libxl/libxl_logger.h             |   7 +-
 src/libxl/libxl_migration.h          |  11 +-
 src/logging/log_daemon.h             |   9 +-
 src/logging/log_daemon_config.h      |   7 +-
 src/logging/log_daemon_dispatch.h    |   7 +-
 src/logging/log_handler.h            |   9 +-
 src/logging/log_manager.h            |   9 +-
 117 files changed, 928 insertions(+), 1296 deletions(-)

-- 
2.20.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 00/19] Use '#pragma once' in headers

Posted by Ján Tomko 1 week ago
On Fri, Jun 07, 2019 at 03:20:11PM -0500, Jonathon Jongsma wrote:
>Hi all,

Welcome,

>
>I'm trying to get up to speed with libvirt code,

please if you have something you wish we mentioned in our HACKING page
or elsewhere to make the first contribution easier, let us know.

>so I decided to start out with a slightly
>"mindless" task. I grabbed the '#pragma once' task from
>https://wiki.libvirt.org/page/BiteSizedTasks. This series covers the first part of the conversion. I
>chatted with Daniel Berrange briefly on IRC before starting, and he suggested that I should try to
>keep patches under 100k, and maybe each driver's source files as a single patch.
>
>I had a bit of difficulty deciding where to split the src/conf/ and src/util/ directories. So some
>of the files with more changes ended up being single-file patches. I tried to combine some related
>source files into patches, but at a certain point I ran out of obvious files to combine, so I
>combined a bunch of smaller miscellaneous files into one larger patch. It may not be ideal, but it's
>the best I could come up with. Alternative suggestions welcome.
>
>I'll follow up with the remaining changes if this division looks acceptable.
>
>Jonathon Jongsma (19):
>  Use #pragma once in driver headers
>  src/access: use #pragma once in headers
>  src/admin: use #pragma once in headers
>  src/bhyve: use #pragma once in headers
>  conf: domain: use #pragma once in headers
>  conf: network: use #pragma once in headers
>  conf: nwfilter: use #pragma once in headers
>  conf: node device: use #pragma once in headers
>  conf: storage: use #pragma once in headers
>  conf: misc: use #pragma once in headers
>  src/cpu: use #pragma once in headers
>  src/datatypes.h: use #pragma once
>  src/esx: use #pragma once in headers
>  src/hyperv: use #pragma once in headers
>  src/interface: use #pragma once in headers
>  src/internal.h: use #pragma once
>  src/libvirt_internal.h: use #pragma once
>  src/libxl: use #pragma once in headers
>  src/logging: use #pragma once in headers
>
> src/access/viraccessdriver.h         |  10 +-
> src/access/viraccessdrivernop.h      |   7 +-
[...]
> src/logging/log_daemon_dispatch.h    |   7 +-
> src/logging/log_handler.h            |   9 +-
> src/logging/log_manager.h            |   9 +-
> 117 files changed, 928 insertions(+), 1296 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>
and pushed.

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 00/19] Use '#pragma once' in headers

Posted by Eric Blake 1 week ago
On 6/13/19 10:06 AM, Ján Tomko wrote:

>> Jonathon Jongsma (19):
>>  Use #pragma once in driver headers
>>  src/access: use #pragma once in headers
>>  src/admin: use #pragma once in headers
>>  src/bhyve: use #pragma once in headers
>>  conf: domain: use #pragma once in headers
>>  conf: network: use #pragma once in headers
>>  conf: nwfilter: use #pragma once in headers
>>  conf: node device: use #pragma once in headers
>>  conf: storage: use #pragma once in headers
>>  conf: misc: use #pragma once in headers
>>  src/cpu: use #pragma once in headers
>>  src/datatypes.h: use #pragma once
>>  src/esx: use #pragma once in headers
>>  src/hyperv: use #pragma once in headers
>>  src/interface: use #pragma once in headers
>>  src/internal.h: use #pragma once
>>  src/libvirt_internal.h: use #pragma once
>>  src/libxl: use #pragma once in headers
>>  src/logging: use #pragma once in headers
>>


Does this series add a syntax-check rule to prevent reversion back to
older styles when new files are introduced?  For example, I now have to
rebase my pending incremental backup work on top of this, which adds new
files, but without a syntax-check rule addition, I can't quickly
identify which files I plan to add that need a tweak.

> 
> Reviewed-by: Ján Tomko <jtomko@redhat.com>
> and pushed.
Thus, it would be a nice followup patch for you to work on.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 00/19] Use '#pragma once' in headers

Posted by Ján Tomko 1 week ago
On Thu, Jun 13, 2019 at 10:23:30AM -0500, Eric Blake wrote:
>On 6/13/19 10:06 AM, Ján Tomko wrote:
>
>>> Jonathon Jongsma (19):
>>>  Use #pragma once in driver headers
>>>  src/access: use #pragma once in headers
>>>  src/admin: use #pragma once in headers
>>>  src/bhyve: use #pragma once in headers
>>>  conf: domain: use #pragma once in headers
>>>  conf: network: use #pragma once in headers
>>>  conf: nwfilter: use #pragma once in headers
>>>  conf: node device: use #pragma once in headers
>>>  conf: storage: use #pragma once in headers
>>>  conf: misc: use #pragma once in headers
>>>  src/cpu: use #pragma once in headers
>>>  src/datatypes.h: use #pragma once
>>>  src/esx: use #pragma once in headers
>>>  src/hyperv: use #pragma once in headers
>>>  src/interface: use #pragma once in headers
>>>  src/internal.h: use #pragma once
>>>  src/libvirt_internal.h: use #pragma once
>>>  src/libxl: use #pragma once in headers
>>>  src/logging: use #pragma once in headers
>>>
>
>
>Does this series add a syntax-check rule to prevent reversion back to
>older styles when new files are introduced?  For example, I now have to
>rebase my pending incremental backup work on top of this, which adds new
>files, but without a syntax-check rule addition, I can't quickly
>identify which files I plan to add that need a tweak.
>

Note that we do have syntax-check for this, it had to be loosened in:
commit ac41ffb8fa1235c226377397842c6c240a677d87
Author:     Cole Robinson <crobinso@redhat.com>
AuthorDate: 2019-04-03 17:45:02 -0400
Commit:     Cole Robinson <crobinso@redhat.com>
CommitDate: 2019-04-04 18:42:09 -0400

    build-aux: header-ifdef: Handle #pragma once

    If we see it, skip all remaining header guard checks

    Acked-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Cole Robinson <crobinso@redhat.com>

But currently it accepts both variants.

Jano

>>
>> Reviewed-by: Ján Tomko <jtomko@redhat.com>
>> and pushed.
>Thus, it would be a nice followup patch for you to work on.
>
>-- 
>Eric Blake, Principal Software Engineer
>Red Hat, Inc.           +1-919-301-3226
>Virtualization:  qemu.org | libvirt.org
>



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 00/19] Use '#pragma once' in headers

Posted by Jonathon Jongsma 1 week ago
On Fri, 2019-06-14 at 08:07 +0200, Ján Tomko wrote:
> On Thu, Jun 13, 2019 at 10:23:30AM -0500, Eric Blake wrote:
> > On 6/13/19 10:06 AM, Ján Tomko wrote:
> > 
> > > > Jonathon Jongsma (19):
> > > >  Use #pragma once in driver headers
> > > >  src/access: use #pragma once in headers
> > > >  src/admin: use #pragma once in headers
> > > >  src/bhyve: use #pragma once in headers
> > > >  conf: domain: use #pragma once in headers
> > > >  conf: network: use #pragma once in headers
> > > >  conf: nwfilter: use #pragma once in headers
> > > >  conf: node device: use #pragma once in headers
> > > >  conf: storage: use #pragma once in headers
> > > >  conf: misc: use #pragma once in headers
> > > >  src/cpu: use #pragma once in headers
> > > >  src/datatypes.h: use #pragma once
> > > >  src/esx: use #pragma once in headers
> > > >  src/hyperv: use #pragma once in headers
> > > >  src/interface: use #pragma once in headers
> > > >  src/internal.h: use #pragma once
> > > >  src/libvirt_internal.h: use #pragma once
> > > >  src/libxl: use #pragma once in headers
> > > >  src/logging: use #pragma once in headers
> > > > 
> > 
> > Does this series add a syntax-check rule to prevent reversion back
> > to
> > older styles when new files are introduced?  For example, I now
> > have to
> > rebase my pending incremental backup work on top of this, which
> > adds new
> > files, but without a syntax-check rule addition, I can't quickly
> > identify which files I plan to add that need a tweak.
> > 
> 
> Note that we do have syntax-check for this, it had to be loosened in:
> commit ac41ffb8fa1235c226377397842c6c240a677d87
> Author:     Cole Robinson <crobinso@redhat.com>
> AuthorDate: 2019-04-03 17:45:02 -0400
> Commit:     Cole Robinson <crobinso@redhat.com>
> CommitDate: 2019-04-04 18:42:09 -0400
> 
>     build-aux: header-ifdef: Handle #pragma once
> 
>     If we see it, skip all remaining header guard checks
> 
>     Acked-by: Eric Blake <eblake@redhat.com>
>     Signed-off-by: Cole Robinson <crobinso@redhat.com>
> 
> But currently it accepts both variants.
> 
> Jano

Out of curiosity, do we want to use #pragma once in the public headers
as well, or only the internal ones?

Jonathon

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 00/19] Use '#pragma once' in headers

Posted by Eric Blake 1 week ago
On 6/14/19 11:18 AM, Jonathon Jongsma wrote:

>>
>> Note that we do have syntax-check for this, it had to be loosened in:
>> commit ac41ffb8fa1235c226377397842c6c240a677d87
>> Author:     Cole Robinson <crobinso@redhat.com>
>> AuthorDate: 2019-04-03 17:45:02 -0400
>> Commit:     Cole Robinson <crobinso@redhat.com>
>> CommitDate: 2019-04-04 18:42:09 -0400
>>
>>     build-aux: header-ifdef: Handle #pragma once
>>
>>     If we see it, skip all remaining header guard checks
>>
>>     Acked-by: Eric Blake <eblake@redhat.com>
>>     Signed-off-by: Cole Robinson <crobinso@redhat.com>
>>
>> But currently it accepts both variants.
>>
>> Jano
> 
> Out of curiosity, do we want to use #pragma once in the public headers
> as well, or only the internal ones?
> 

Only internal. Our public headers (in theory) should be usable from any
non-gcc/clang C99 compiler.  #pragma once is a non-portable compiler
extension that happens to be portable to the only two compilers we admit
for building libvirt itself, but that does not imply that we are going
to force other projects using the public headers to do the same.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 00/19] Use '#pragma once' in headers

Posted by Jonathon Jongsma 1 week ago
On Thu, 2019-06-13 at 10:23 -0500, Eric Blake wrote:
> On 6/13/19 10:06 AM, Ján Tomko wrote:
> 
> > > Jonathon Jongsma (19):
> > >  Use #pragma once in driver headers
> > >  src/access: use #pragma once in headers
> > >  src/admin: use #pragma once in headers
> > >  src/bhyve: use #pragma once in headers
> > >  conf: domain: use #pragma once in headers
> > >  conf: network: use #pragma once in headers
> > >  conf: nwfilter: use #pragma once in headers
> > >  conf: node device: use #pragma once in headers
> > >  conf: storage: use #pragma once in headers
> > >  conf: misc: use #pragma once in headers
> > >  src/cpu: use #pragma once in headers
> > >  src/datatypes.h: use #pragma once
> > >  src/esx: use #pragma once in headers
> > >  src/hyperv: use #pragma once in headers
> > >  src/interface: use #pragma once in headers
> > >  src/internal.h: use #pragma once
> > >  src/libvirt_internal.h: use #pragma once
> > >  src/libxl: use #pragma once in headers
> > >  src/logging: use #pragma once in headers
> > > 
> 
> Does this series add a syntax-check rule to prevent reversion back to
> older styles when new files are introduced?  For example, I now have
> to
> rebase my pending incremental backup work on top of this, which adds
> new
> files, but without a syntax-check rule addition, I can't quickly
> identify which files I plan to add that need a tweak.

Good point. I did not add a syntax check yet. In fact, this is not even
the complete patch series. The whole patch series is actually about 60
patches, but I didn't want to flood the mailing list right away on my
first submission. So I just sent the first 20 or so in case people
wanted to split them up differently. I can try to add a syntax check to
include when I send the rest of the series.

> 
> > Reviewed-by: Ján Tomko <jtomko@redhat.com>
> > and pushed.
> Thus, it would be a nice followup patch for you to work on.
> 

Sure thing.

Jonathon

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 00/19] Use '#pragma once' in headers

Posted by Eric Blake 1 week ago
On 6/13/19 2:33 PM, Jonathon Jongsma wrote:

>> Does this series add a syntax-check rule to prevent reversion back to
>> older styles when new files are introduced?  For example, I now have
>> to
>> rebase my pending incremental backup work on top of this, which adds
>> new
>> files, but without a syntax-check rule addition, I can't quickly
>> identify which files I plan to add that need a tweak.
> 
> Good point. I did not add a syntax check yet. In fact, this is not even
> the complete patch series. The whole patch series is actually about 60
> patches, but I didn't want to flood the mailing list right away on my
> first submission. So I just sent the first 20 or so in case people
> wanted to split them up differently. I can try to add a syntax check to
> include when I send the rest of the series.
> 
>>
>>> Reviewed-by: Ján Tomko <jtomko@redhat.com>
>>> and pushed.
>> Thus, it would be a nice followup patch for you to work on.
>>
> 
> Sure thing.

In fact, if you're not done patching things, a syntax check would fire
prematurely :) So it must be last in your series, but it's also nice
knowing that there is more to come.

If nothing else, you can test that applying the syntax check early flags
things you still need to fix, and that applying it at the end of your
work finds nothing wrong.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list