Re: [libvirt PATCH 1/7] nodedev: add internal virNodeDeviceObjListFind()

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

 



On 7/23/21 6:40 PM, Jonathon Jongsma wrote:
> This is a generic function that you can provide your own predicate
> function to search for a particular device. It will be used in an
> upcoming commit.
> 
> Signed-off-by: Jonathon Jongsma <jjongsma@xxxxxxxxxx>
> ---
>  src/conf/virnodedeviceobj.c | 53 +++++++++++++++++++++++++++++++------
>  src/conf/virnodedeviceobj.h | 11 +++++---
>  src/libvirt_private.syms    |  1 +
>  3 files changed, 54 insertions(+), 11 deletions(-)
> 
> diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c
> index b213592b56..6e7b354f96 100644
> --- a/src/conf/virnodedeviceobj.c
> +++ b/src/conf/virnodedeviceobj.c
> @@ -1026,19 +1026,19 @@ virNodeDeviceObjSetPersistent(virNodeDeviceObj *obj,
>  }
>  
>  
> -struct virNodeDeviceObjListRemoveHelperData
> +typedef struct
>  {
> -    virNodeDeviceObjListRemoveIterator callback;
> +    virNodeDeviceObjListPredicate predicate;
>      void *opaque;
> -};
> +} PredicateHelperData;
>  

We usually split this into:

typedef struct _virXXX virXXX;
struct _virXXX {
  ...
};

and honestly I've never understood why. I blamed coding style.

Michal




[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]

  Powered by Linux