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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> ---
>  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 :|

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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]