Re: [PATCH 05/11] daemon: Refactor connection driver module loading

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

 




On 02/08/2017 11:27 AM, Peter Krempa wrote:
> Pass the registration function name to virDriverLoadModule so that we
> can later call specific functions if necessary (e.g. for testing
> purposes). This gets rid of the rather ugly automatic name generator and
> unifies the code to load/initialize the modules.
> 
> It's also clear which registration function gets called.
> ---
>  daemon/libvirtd.c           | 136 ++++++++++++++++----------------------------
>  src/driver.c                |  37 +++---------
>  src/driver.h                |   3 +-
>  tests/virdrivermoduletest.c |  23 ++++++--
>  4 files changed, 77 insertions(+), 122 deletions(-)
> 
> diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
> index b6d76ed84..2f9f5c77d 100644
> --- a/daemon/libvirtd.c
> +++ b/daemon/libvirtd.c
> @@ -341,6 +341,14 @@ static int daemonErrorLogFilter(virErrorPtr err, int priority)
>      return priority;
>  }
> 
> +
> +#ifdef WITH_DRIVER_MODULES
> +# define VIR_DAEMON_LOAD_MODULE(func, module) \
> +    virDriverLoadModule(module, #func)
> +#else
> +# define VIR_DAEMON_LOAD_MODULE(func, module) \
> +    func()
> +#endif

I found the ordering of arguments to the macro in a different order than
to the virDriverLoadModule to be confusing.  Your call to change,

Also wasn't sure if there was a "compelling enough" reason to check
status from virDriverLoadModule and perhaps spit out a
VIR_{DEBUG|INFO|WARN} type message...

ACK for the change though - your call on the debug stuff.

John

--
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]
  Powered by Linux