qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/6] qemu/queue.h: leave head structs anonymous


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 2/6] qemu/queue.h: leave head structs anonymous unless necessary
Date: Fri, 7 Dec 2018 14:47:47 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1

On 07/12/18 08:28, Markus Armbruster wrote:
> 
>     $ git-grep 'Q[A-Z]*_HEAD([^,]' | grep -v '#define' | grep -v QTAILQ_HEAD
>     block/qcow2-bitmap.c:typedef QSIMPLEQ_HEAD(Qcow2BitmapList, Qcow2Bitmap) 
> Qcow2BitmapList;
>     include/block/block.h:typedef QSIMPLEQ_HEAD(BlockReopenQueue, 
> BlockReopenQueueEntry) BlockReopenQueue;
>     include/hw/vfio/vfio-common.h:typedef QLIST_HEAD(VFIOGroupList, 
> VFIOGroup) VFIOGroupList;
>     qemu-bridge-helper.c:typedef QSIMPLEQ_HEAD(ACLList, ACLRule) ACLList;
> 
> Are these four names left in intentionally?

Yes, they are the ones which are used in extern global variables or in
function parameters.  If they are static variables or struct fields, on
the other hand, you don't need the typedef.

The same is also true of the handful of QTAILQ head structs that are
typedefed in 3/6.

I'll add this to the commit message.

> If the name is indeed not needed for lists of other kinds, should we
> simplify the macros so their users don't have to supply an empty first
> argument?

No, it's just a coincidence.  For example QTAILQ needs it (patch 3/6).

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]