[libvirt] [PATCH 05/10] daemon: move libvirtd code into src/remote/ directory

Daniel P. Berrangé berrange at redhat.com
Thu Feb 22 11:36:55 UTC 2018


On Thu, Feb 22, 2018 at 11:24:24AM +0100, Michal Privoznik wrote:
> On 02/21/2018 04:35 PM, Daniel P. Berrangé wrote:
> > Having a daemon/ directory makes little sense from a code structure
> > point of view, as 90% of the code that is built into libvirtd already
> > lives in the src/ directory. The virtlockd and virlogd daemons also live
> > entirely in src/{locking,logging} directories. This moves the source
> > code for libvirtd into src/remote/, alongside the client code.
> > 
> > Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
> > ---
> >  .gitignore                                         |   2 +
> >  daemon/Makefile.am                                 | 125 +--------------------
> >  src/Makefile.am                                    |  93 ++++++++++++++-
> >  daemon/libvirtd.c => src/remote/remote_daemon.c    |  10 +-
> >  daemon/libvirtd.h => src/remote/remote_daemon.h    |  10 +-
> >  .../remote/remote_daemon_config.c                  |  10 +-
> >  .../remote/remote_daemon_config.h                  |  10 +-
> >  .../remote/remote_daemon_dispatch.c                |  16 +--
> >  .../remote/remote_daemon_dispatch.h                |  10 +-
> >  .../stream.c => src/remote/remote_daemon_stream.c  |   8 +-
> >  .../stream.h => src/remote/remote_daemon_stream.h  |  12 +-
> >  11 files changed, 136 insertions(+), 170 deletions(-)
> >  rename daemon/libvirtd.c => src/remote/remote_daemon.c (99%)
> >  rename daemon/libvirtd.h => src/remote/remote_daemon.h (93%)
> >  rename daemon/libvirtd-config.c => src/remote/remote_daemon_config.c (98%)
> >  rename daemon/libvirtd-config.h => src/remote/remote_daemon_config.h (92%)
> >  rename daemon/remote.c => src/remote/remote_daemon_dispatch.c (99%)
> >  rename daemon/remote.h => src/remote/remote_daemon_dispatch.h (85%)
> >  rename daemon/stream.c => src/remote/remote_daemon_stream.c (99%)>  rename daemon/stream.h => src/remote/remote_daemon_stream.h (85%)
> 
> Not that simple. Instead of pointing out in the patch, here's the diff
> you need to squash in:
> 
> 
> diff --git i/cfg.mk w/cfg.mk
> index 920b60917..3172822cf 100644
> --- i/cfg.mk
> +++ w/cfg.mk
> @@ -32,7 +32,7 @@ gnulib_dir = $(srcdir)/.gnulib
>  # List of additional files that we want to pick up in our POTFILES.in
>  # This is all gnulib files, as well as generated files for RPC code.
>  generated_files = \
> -  $(srcdir)/daemon/{lxc,qemu,remote}_dispatch.h \
> +  $(srcdir)/src/remote/remote_daemon_dispatch{_lxc,_qemu,_}_stubs.h \
>    $(srcdir)/src/*/{admin_server,log_daemon,lock_daemon}_dispatch_stubs.h \

I squashed the rule into the next line instead

  -  $(srcdir)/daemon/{lxc,qemu,remote}_dispatch.h \
  -  $(srcdir)/src/*/{admin_server,log_daemon,lock_daemon}_dispatch_stubs.h \
  +  $(srcdir)/src/*/{remote_daemon,admin_server,log_daemon,lock_daemon}_dispatch_*stubs.h \


> @@ -1116,17 +1116,26 @@ test-wrap-argv:
>  
>  # sc_po_check can fail if generated files are not built first
>  sc_po_check: \
> -		$(srcdir)/daemon/remote_dispatch.h \
> -		$(srcdir)/daemon/qemu_dispatch.h \
> +		$(srcdir)/src/remote/lxc_client_bodies.h \
> +		$(srcdir)/src/remote/qemu_client_bodies.h \

These two client_bodies.h additions are unrelated to this patch.

>  		$(srcdir)/src/remote/remote_client_bodies.h \
> +		$(srcdir)/src/remote/remote_daemon_dispatch_lxc_stubs.h \
> +		$(srcdir)/src/remote/remote_daemon_dispatch_qemu_stubs.h \
> +		$(srcdir)/src/remote/remote_daemon_dispatch_stubs.h \
>  		$(srcdir)/src/admin/admin_server_dispatch_stubs.h \
>  		$(srcdir)/src/admin/admin_client.h
> -$(srcdir)/daemon/remote_dispatch.h: $(srcdir)/src/remote/remote_protocol.x
> -	$(MAKE) -C daemon remote_dispatch.h
> -$(srcdir)/daemon/qemu_dispatch.h: $(srcdir)/src/remote/qemu_protocol.x
> -	$(MAKE) -C daemon qemu_dispatch.h
> +$(srcdir)/src/remote/lxc_client_bodies.h: $(srcdir)/src/remote/lxc_protocol.x
> +	$(MAKE) -C src remote/lxc_client_bodies.h
> +$(srcdir)/src/remote/qemu_client_bodies.h: $(srcdir)/src/remote/qemu_protocol.x
> +	$(MAKE) -C src remote/qemu_client_bodies.h


These two are unrelated too



> diff --git i/src/Makefile.am w/src/Makefile.am
> index a1e5fa573..decdb9c3e 100644
> --- i/src/Makefile.am
> +++ w/src/Makefile.am
> @@ -544,14 +544,14 @@ remote/remote_daemon_dispatch_stubs.h: $(top_srcdir)/src/rpc/gendispatch.pl \
>  	  --mode=server remote REMOTE $(REMOTE_PROTOCOL) \
>  	  > $(srcdir)/remote/remote_daemon_dispatch_stubs.h
>  
> -remote/remote_daemon_dispatch_lxc_stubs.h: $(top_srcdir)/src/rpc/gendispatch.pl \
> -		$(LXC_PROTOCOL) Makefile.am
> +remote/remote_daemon_dispatch_lxc_stubs.h: \
> +	$(top_srcdir)/src/rpc/gendispatch.pl $(LXC_PROTOCOL) Makefile.am

Better is to replace  $(top_srcdir)/src  with $(srcdir)


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




More information about the libvir-list mailing list