[libvirt] [PATCH 04/15] maint: avoid 'const fooPtr' in virnet files

Daniel P. Berrange berrange at redhat.com
Mon Oct 14 15:19:16 UTC 2013


On Tue, Oct 08, 2013 at 11:25:01AM -0600, Eric Blake wrote:
> 'const fooPtr' is the same as 'foo * const' (the pointer won't
> change, but it's contents can).  But in general, if an interface
> is trying to be const-correct, it should be using 'const foo *'
> (the pointer is to data that can't be changed).
> 
> Fix up remaining offenders in src/util.
> 
> * src/util/virnetdev.h (virNetDevSetMAC)
> (virNetDevReplaceMacAddress, virNetDevValidateConfig)
> (virNetDevReplaceNetConfig): Use intended type.
> * src/util/virnetdevbandwidth.h (virNetDevBandwidthCopy)
> (virNetDevBandwidthPlug): Likewise.
> * src/util/virnetdevmacvlan.h (virNetDevMacVLanCreate)
> (virNetDevMacVLanCreateWithVPortProfile)
> (virNetDevMacVLanDeleteWithVPortProfile)
> (virNetDevMacVLanRestartWithVPortProfile)
> (virNetDevMacVLanVPortProfileRegisterCallback): Likewise.
> * src/util/virnetdevopenvswitch.h (virNetDevOpenvswitchAddPort):
> Likewise.
> * src/util/virnetdevtap.h (virNetDevTapCreateInBridgePort):
> Likewise.
> * src/util/virnetdevvlan.h (virNetDevVlanEqual)
> (virNetDevVlanCopy): Likewise.
> * src/util/virnetdevvportprofile.h
> (virNetDevVPortProfileAssociate)
> (virNetDevVPortProfileDisassociate): Likewise.
> * src/util/virnetlink.h (virNetlinkEventRemoveCallback)
> (virNetlinkEventAddClient, virNetlinkEventRemoveClient):
> Likewise.
> * src/util/virnetdev.c (virNetDevSetMAC)
> (virNetDevReplaceMacAddress, virNetDevValidateConfig)
> (virNetDevReplaceNetConfig): Fix fallout.
> * src/util/virnetdevbandwidth.c (virNetDevBandwidthCopy)
> (virNetDevBandwidthPlug): Likewise.
> * src/util/virnetdevmacvlan.c (virNetDevMacVLanCreate)
> (virNetDevMacVLanCreateWithVPortProfile)
> (virNetDevMacVLanDeleteWithVPortProfile)
> (virNetDevMacVLanRestartWithVPortProfile)
> (virNetDevMacVLanVPortProfileRegisterCallback): Likewise.
> * src/util/virnetdevopenvswitch.c (virNetDevOpenvswitchAddPort):
> Likewise.
> * src/util/virnetdevtap.c (virNetDevTapCreateInBridgePort):
> Likewise.
> * src/util/virnetdevvlan.c (virNetDevVlanEqual)
> (virNetDevVlanCopy): Likewise.
> * src/util/virnetdevvportprofile.c
> (virNetDevVPortProfileAssociate)
> (virNetDevVPortProfileDisassociate)
> (virNetDevVPortProfileOpSetLink, virNetDevVPortProfileOpCommon)
> (virNetDevVPortProfileOp8021Qbg, virNetDevVPortProfileOp8021Qbh):
> Likewise.
> * src/util/virnetlink.c (virNetlinkEventRemoveCallback)
> (virNetlinkEventAddClient, virNetlinkEventRemoveClient):
> Likewise.
> 
> Signed-off-by: Eric Blake <eblake at redhat.com>
> ---
>  src/util/virnetdev.c             | 20 ++++++++++----------
>  src/util/virnetdev.h             |  8 ++++----
>  src/util/virnetdevbandwidth.c    |  6 +++---
>  src/util/virnetdevbandwidth.h    |  7 ++++---
>  src/util/virnetdevmacvlan.c      | 22 +++++++++++-----------
>  src/util/virnetdevmacvlan.h      | 12 ++++++------
>  src/util/virnetdevopenvswitch.c  |  3 ++-
>  src/util/virnetdevopenvswitch.h  |  3 ++-
>  src/util/virnetdevtap.c          |  2 +-
>  src/util/virnetdevtap.h          |  4 ++--
>  src/util/virnetdevvlan.c         |  6 +++---
>  src/util/virnetdevvlan.h         |  6 +++---
>  src/util/virnetdevvportprofile.c | 28 ++++++++++++++--------------
>  src/util/virnetdevvportprofile.h | 10 +++++-----
>  src/util/virnetlink.c            | 10 +++++-----
>  src/util/virnetlink.h            |  8 +++++---
>  16 files changed, 80 insertions(+), 75 deletions(-)

ACK

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list