Changeset
src/qemu/qemu_alias.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Git apply log
Switched to a new branch '20180309032415.5299-1-jcfaracco@gmail.com'
Applying: qemu: different declarations for the same method.
To https://github.com/patchew-project/libvirt
 * [new tag]             patchew/20180309032415.5299-1-jcfaracco@gmail.com -> patchew/20180309032415.5299-1-jcfaracco@gmail.com
Test passed: syntax-check

loading

[libvirt] [PATCH] qemu: different declarations for the same method.
Posted by Julio Faracco, 15 weeks ago
Recently, this warning is appearing while libvirt is being compiled:
Function 'qemuAssignDeviceDiskAlias' argument order different:
declaration 'vmdef, def' definition 'def, disk'

This commit change the default declaration for qemuAssignDeviceDiskAlias
specified at src/qemu/qemu_alias.c.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
---
 src/qemu/qemu_alias.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_alias.h b/src/qemu/qemu_alias.h
index 2246e712f..8c744138c 100644
--- a/src/qemu/qemu_alias.h
+++ b/src/qemu/qemu_alias.h
@@ -38,8 +38,8 @@ int qemuAssignDeviceControllerAlias(virDomainDefPtr domainDef,
                                     virQEMUCapsPtr qemuCaps,
                                     virDomainControllerDefPtr controller);
 
-int qemuAssignDeviceDiskAlias(virDomainDefPtr vmdef,
-                              virDomainDiskDefPtr def);
+int qemuAssignDeviceDiskAlias(virDomainDefPtr def,
+                              virDomainDiskDefPtr disk);
 
 int qemuAssignDeviceHostdevAlias(virDomainDefPtr def,
                                  char **alias,
-- 
2.14.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: different declarations for the same method.
Posted by Andrea Bolognani, 14 weeks ago
On Fri, 2018-03-09 at 00:24 -0300, Julio Faracco wrote:
> Recently, this warning is appearing while libvirt is being compiled:
> Function 'qemuAssignDeviceDiskAlias' argument order different:
> declaration 'vmdef, def' definition 'def, disk'
> 
> This commit change the default declaration for qemuAssignDeviceDiskAlias
> specified at src/qemu/qemu_alias.c.
> 
> Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
> ---
>  src/qemu/qemu_alias.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/qemu/qemu_alias.h b/src/qemu/qemu_alias.h
> index 2246e712f..8c744138c 100644
> --- a/src/qemu/qemu_alias.h
> +++ b/src/qemu/qemu_alias.h
> @@ -38,8 +38,8 @@ int qemuAssignDeviceControllerAlias(virDomainDefPtr domainDef,
>                                      virQEMUCapsPtr qemuCaps,
>                                      virDomainControllerDefPtr controller);
>  
> -int qemuAssignDeviceDiskAlias(virDomainDefPtr vmdef,
> -                              virDomainDiskDefPtr def);
> +int qemuAssignDeviceDiskAlias(virDomainDefPtr def,
> +                              virDomainDiskDefPtr disk);
>  
>  int qemuAssignDeviceHostdevAlias(virDomainDefPtr def,
>                                   char **alias,

I'm not seeing the compiler warning myself, and I know there's some
work going on to make the names of function parameters all nice and
consistent, but in the meantime this is harmless enough so

  Reviewed-by: Andrea Bolognani <abologna@redhat.com>

and pushed.

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: different declarations for the same method.
Posted by Daniel P. Berrangé, 14 weeks ago
On Fri, Mar 09, 2018 at 12:24:15AM -0300, Julio Faracco wrote:
> Recently, this warning is appearing while libvirt is being compiled:
> Function 'qemuAssignDeviceDiskAlias' argument order different:
> declaration 'vmdef, def' definition 'def, disk'

No objection to the patch, but can you say which compiler you are using and
which warning flags you have enabled. AFAIK, we've not seeng this warning
with our current preferred compiler flags on either clang or gcc.

> 
> This commit change the default declaration for qemuAssignDeviceDiskAlias
> specified at src/qemu/qemu_alias.c.
> 
> Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
> ---
>  src/qemu/qemu_alias.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/qemu/qemu_alias.h b/src/qemu/qemu_alias.h
> index 2246e712f..8c744138c 100644
> --- a/src/qemu/qemu_alias.h
> +++ b/src/qemu/qemu_alias.h
> @@ -38,8 +38,8 @@ int qemuAssignDeviceControllerAlias(virDomainDefPtr domainDef,
>                                      virQEMUCapsPtr qemuCaps,
>                                      virDomainControllerDefPtr controller);
>  
> -int qemuAssignDeviceDiskAlias(virDomainDefPtr vmdef,
> -                              virDomainDiskDefPtr def);
> +int qemuAssignDeviceDiskAlias(virDomainDefPtr def,
> +                              virDomainDiskDefPtr disk);
>  
>  int qemuAssignDeviceHostdevAlias(virDomainDefPtr def,
>                                   char **alias,
> -- 
> 2.14.1
> 
> --
> libvir-list mailing list
> libvir-list@redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: different declarations for the same method.
Posted by Julio Faracco, 14 weeks ago
Hi guys,

I'm using cppcheck with gcc as template.
See virsocketaddr as an example.

$ cppcheck --template=gcc --enable=warning --inconclusive
src/util/virsocketaddr.c
Checking src/util/virsocketaddr.c ...
src/util/virsocketaddr.c:204: warning: Function
'virSocketAddrSetIPv4AddrNetOrder' argument order different:
declaration 's, addr' definition 'addr, val'
src/util/virsocketaddr.c:220: warning: Function
'virSocketAddrSetIPv4Addr' argument order different: declaration 's,
addr' definition 'addr, val'
src/util/virsocketaddr.c:233: warning: Function
'virSocketAddrSetIPv6AddrNetOrder' argument order different:
declaration 's, addr' definition 'addr, val'
src/util/virsocketaddr.c:248: warning: Function
'virSocketAddrSetIPv6Addr' argument order different: declaration 's,
addr' definition 'addr, val'
Checking src/util/virsocketaddr.c: HAVE_SYS_UN_H...
$

--
Julio Cesar Faracco

2018-03-12 7:19 GMT-03:00 Daniel P. Berrangé <berrange@redhat.com>:
> On Fri, Mar 09, 2018 at 12:24:15AM -0300, Julio Faracco wrote:
>> Recently, this warning is appearing while libvirt is being compiled:
>> Function 'qemuAssignDeviceDiskAlias' argument order different:
>> declaration 'vmdef, def' definition 'def, disk'
>
> No objection to the patch, but can you say which compiler you are using and
> which warning flags you have enabled. AFAIK, we've not seeng this warning
> with our current preferred compiler flags on either clang or gcc.
>
>>
>> This commit change the default declaration for qemuAssignDeviceDiskAlias
>> specified at src/qemu/qemu_alias.c.
>>
>> Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
>> ---
>>  src/qemu/qemu_alias.h | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/qemu/qemu_alias.h b/src/qemu/qemu_alias.h
>> index 2246e712f..8c744138c 100644
>> --- a/src/qemu/qemu_alias.h
>> +++ b/src/qemu/qemu_alias.h
>> @@ -38,8 +38,8 @@ int qemuAssignDeviceControllerAlias(virDomainDefPtr domainDef,
>>                                      virQEMUCapsPtr qemuCaps,
>>                                      virDomainControllerDefPtr controller);
>>
>> -int qemuAssignDeviceDiskAlias(virDomainDefPtr vmdef,
>> -                              virDomainDiskDefPtr def);
>> +int qemuAssignDeviceDiskAlias(virDomainDefPtr def,
>> +                              virDomainDiskDefPtr disk);
>>
>>  int qemuAssignDeviceHostdevAlias(virDomainDefPtr def,
>>                                   char **alias,
>> --
>> 2.14.1
>>
>> --
>> libvir-list mailing list
>> libvir-list@redhat.com
>> https://www.redhat.com/mailman/listinfo/libvir-list
>
> Regards,
> Daniel
> --
> |: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org         -o-            https://fstop138.berrange.com :|
> |: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: different declarations for the same method.
Posted by Daniel P. Berrangé, 14 weeks ago
On Mon, Mar 12, 2018 at 11:26:42AM -0300, Julio Faracco wrote:
> Hi guys,
> 
> I'm using cppcheck with gcc as template.
> See virsocketaddr as an example.
> 
> $ cppcheck --template=gcc --enable=warning --inconclusive
> src/util/virsocketaddr.c
> Checking src/util/virsocketaddr.c ...
> src/util/virsocketaddr.c:204: warning: Function
> 'virSocketAddrSetIPv4AddrNetOrder' argument order different:
> declaration 's, addr' definition 'addr, val'
> src/util/virsocketaddr.c:220: warning: Function
> 'virSocketAddrSetIPv4Addr' argument order different: declaration 's,
> addr' definition 'addr, val'
> src/util/virsocketaddr.c:233: warning: Function
> 'virSocketAddrSetIPv6AddrNetOrder' argument order different:
> declaration 's, addr' definition 'addr, val'
> src/util/virsocketaddr.c:248: warning: Function
> 'virSocketAddrSetIPv6Addr' argument order different: declaration 's,
> addr' definition 'addr, val'
> Checking src/util/virsocketaddr.c: HAVE_SYS_UN_H...

Oh, so these warnings aren't coming from the compiler at all, as
described in the commit msg. For future commits please explicitly
say if they are cleaning a warning from cppcheck, as opposed to
the compiler.

> $
> 
> --
> Julio Cesar Faracco
> 
> 2018-03-12 7:19 GMT-03:00 Daniel P. Berrangé <berrange@redhat.com>:
> > On Fri, Mar 09, 2018 at 12:24:15AM -0300, Julio Faracco wrote:
> >> Recently, this warning is appearing while libvirt is being compiled:
> >> Function 'qemuAssignDeviceDiskAlias' argument order different:
> >> declaration 'vmdef, def' definition 'def, disk'
> >
> > No objection to the patch, but can you say which compiler you are using and
> > which warning flags you have enabled. AFAIK, we've not seeng this warning
> > with our current preferred compiler flags on either clang or gcc.
> >
> >>
> >> This commit change the default declaration for qemuAssignDeviceDiskAlias
> >> specified at src/qemu/qemu_alias.c.
> >>
> >> Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
> >> ---
> >>  src/qemu/qemu_alias.h | 4 ++--
> >>  1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/src/qemu/qemu_alias.h b/src/qemu/qemu_alias.h
> >> index 2246e712f..8c744138c 100644
> >> --- a/src/qemu/qemu_alias.h
> >> +++ b/src/qemu/qemu_alias.h
> >> @@ -38,8 +38,8 @@ int qemuAssignDeviceControllerAlias(virDomainDefPtr domainDef,
> >>                                      virQEMUCapsPtr qemuCaps,
> >>                                      virDomainControllerDefPtr controller);
> >>
> >> -int qemuAssignDeviceDiskAlias(virDomainDefPtr vmdef,
> >> -                              virDomainDiskDefPtr def);
> >> +int qemuAssignDeviceDiskAlias(virDomainDefPtr def,
> >> +                              virDomainDiskDefPtr disk);
> >>
> >>  int qemuAssignDeviceHostdevAlias(virDomainDefPtr def,
> >>                                   char **alias,
> >> --
> >> 2.14.1
> >>
> >> --
> >> libvir-list mailing list
> >> libvir-list@redhat.com
> >> https://www.redhat.com/mailman/listinfo/libvir-list
> >
> > Regards,
> > Daniel
> > --
> > |: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
> > |: https://libvirt.org         -o-            https://fstop138.berrange.com :|
> > |: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

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