libvirt/src/qemu/Makefile.inc.am

268 lines
6.9 KiB
Makefile
Raw Normal View History

# vim: filetype=automake
QEMU_DRIVER_SOURCES = \
qemu/qemu_agent.c \
qemu/qemu_agent.h \
qemu/qemu_alias.c \
qemu/qemu_alias.h \
qemu/qemu_block.c \
qemu/qemu_block.h \
qemu/qemu_blockjob.c \
qemu/qemu_blockjob.h \
qemu/qemu_capabilities.c \
qemu/qemu_capabilities.h \
qemu/qemu_command.c \
qemu/qemu_command.h \
qemu/qemu_dbus.c \
qemu/qemu_dbus.h \
qemu/qemu_domain.c \
qemu/qemu_domain.h \
qemu/qemu_domain_address.c \
qemu/qemu_domain_address.h \
qemu/qemu_cgroup.c \
qemu/qemu_cgroup.h \
qemu/qemu_extdevice.c \
qemu/qemu_extdevice.h \
qemu/qemu_firmware.c \
qemu/qemu_firmware.h \
qemu/qemu_hostdev.c \
qemu/qemu_hostdev.h \
qemu/qemu_hotplug.c \
qemu/qemu_hotplug.h \
qemu/qemu_conf.c \
qemu/qemu_conf.h \
qemu/qemu_interop_config.c \
qemu/qemu_interop_config.h \
qemu/qemu_process.c \
qemu/qemu_process.h \
qemu/qemu_processpriv.h \
qemu/qemu_migration.c \
qemu/qemu_migration.h \
qemu/qemu_migration_cookie.c \
qemu/qemu_migration_cookie.h \
qemu/qemu_migration_params.c \
qemu/qemu_migration_params.h \
qemu/qemu_migration_paramspriv.h \
qemu/qemu_monitor.c \
qemu/qemu_monitor.h \
qemu/qemu_monitor_priv.h \
qemu/qemu_monitor_text.c \
qemu/qemu_monitor_text.h \
qemu/qemu_monitor_json.c \
qemu/qemu_monitor_json.h \
qemu/qemu_driver.c \
qemu/qemu_driver.h \
qemu/qemu_interface.c \
qemu/qemu_interface.h \
qemu/qemu_capspriv.h \
qemu/qemu_security.c \
qemu/qemu_security.h \
qemu/qemu_qapi.c \
qemu/qemu_qapi.h \
qemu/qemu_slirp.c \
qemu/qemu_slirp.h \
qemu/qemu_tpm.c \
qemu/qemu_tpm.h \
qemu/qemu_vhost_user.c \
qemu/qemu_vhost_user.h \
qemu/qemu_vhost_user_gpu.c \
qemu/qemu_vhost_user_gpu.h \
qemu/qemu_virtiofs.c \
qemu/qemu_virtiofs.h \
qemu/qemu_checkpoint.c \
qemu/qemu_checkpoint.h \
qemu/qemu_backup.c \
qemu/qemu_backup.h \
qemu/qemu_validate.c \
qemu/qemu_validate.h \
$(NULL)
DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(QEMU_DRIVER_SOURCES))
STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(QEMU_DRIVER_SOURCES))
EXTRA_DIST += $(QEMU_DRIVER_SOURCES)
if WITH_QEMU
noinst_LTLIBRARIES += libvirt_driver_qemu_impl.la
libvirt_driver_qemu_la_SOURCES =
libvirt_driver_qemu_la_LIBADD = \
libvirt_driver_qemu_impl.la \
libvirt.la \
build: link to glib library Add the main glib.h to internal.h so that all common code can use it. Historically glib allowed applications to register an alternative memory allocator, so mixing g_malloc/g_free with malloc/free was not safe. This was feature was dropped in 2.46.0 with: commit 3be6ed60aa58095691bd697344765e715a327fc1 Author: Alexander Larsson <alexl@redhat.com> Date: Sat Jun 27 18:38:42 2015 +0200 Deprecate and drop support for memory vtables Applications are still encourged to match g_malloc/g_free, but it is no longer a mandatory requirement for correctness, just stylistic. This is explicitly clarified in commit 1f24b36607bf708f037396014b2cdbc08d67b275 Author: Daniel P. Berrangé <berrange@redhat.com> Date: Thu Sep 5 14:37:54 2019 +0100 gmem: clarify that g_malloc always uses the system allocator Applications can still use custom allocators in general, but they must do this by linking to a library that replaces the core malloc/free implemenentation entirely, instead of via a glib specific call. This means that libvirt does not need to be concerned about use of g_malloc/g_free causing an ABI change in the public libary, and can avoid memory copying when talking to external libraries. This patch probes for glib, which provides the foundation layer with a collection of data structures, helper APIs, and platform portability logic. Later patches will introduce linkage to gobject which provides the object type system, built on glib, and gio which providing objects for various interesting tasks, most notably including DBus client and server support and portable sockets APIs, but much more too. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-08-29 15:12:24 +00:00
$(GLIB_LIBS) \
$(NULL)
mod_LTLIBRARIES += libvirt_driver_qemu.la
libvirt_driver_qemu_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
libvirt_driver_qemu_impl_la_CFLAGS = \
$(GNUTLS_CFLAGS) \
$(LIBNL_CFLAGS) \
$(SELINUX_CFLAGS) \
$(XDR_CFLAGS) \
-I$(srcdir)/access \
-I$(builddir)/access \
-I$(srcdir)/conf \
-I$(srcdir)/secret \
-I$(srcdir)/hypervisor \
$(AM_CFLAGS) \
$(NULL)
libvirt_driver_qemu_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_qemu_impl_la_LIBADD = \
$(CAPNG_LIBS) \
$(GNUTLS_LIBS) \
$(LIBNL_LIBS) \
$(SELINUX_LIBS) \
$(LIBXML_LIBS) \
$(NULL)
libvirt_driver_qemu_impl_la_SOURCES = $(QEMU_DRIVER_SOURCES)
if WITH_DTRACE_PROBES
libvirt_driver_qemu_la_LIBADD += libvirt_qemu_probes.lo
nodist_libvirt_driver_qemu_la_SOURCES = libvirt_qemu_probes.h
BUILT_SOURCES += libvirt_qemu_probes.h
tapset_DATA += libvirt_qemu_probes.stp
CLEANFILES += \
libvirt_qemu_probes.h \
libvirt_qemu_probes.o \
libvirt_qemu_probes.lo \
libvirt_qemu_probes.stp \
$(NULL)
endif WITH_DTRACE_PROBES
sbin_PROGRAMS += virtqemud
nodist_conf_DATA += qemu/virtqemud.conf
augeas_DATA += qemu/virtqemud.aug
augeastest_DATA += qemu/test_virtqemud.aug
CLEANFILES += qemu/virtqemud.aug
virtqemud_SOURCES = $(REMOTE_DAEMON_SOURCES)
nodist_virtqemud_SOURCES = $(REMOTE_DAEMON_GENERATED)
virtqemud_CFLAGS = \
$(REMOTE_DAEMON_CFLAGS) \
-DDAEMON_NAME="\"virtqemud\"" \
-DMODULE_NAME="\"qemu\"" \
$(NULL)
virtqemud_LDFLAGS = $(REMOTE_DAEMON_LD_FLAGS)
virtqemud_LDADD = $(REMOTE_DAEMON_LD_ADD)
SYSCONF_FILES += qemu/virtqemud.sysconf
SYSTEMD_UNIT_FILES += \
virtqemud.service \
virtqemud.socket \
virtqemud-ro.socket \
virtqemud-admin.socket \
$(NULL)
SYSTEMD_UNIT_FILES_IN += \
qemu/virtqemud.service.in \
$(NULL)
OPENRC_INIT_FILES += \
virtqemud.init \
$(NULL)
OPENRC_INIT_FILES_IN += \
qemu/virtqemud.init.in \
$(NULL)
VIRTQEMUD_UNIT_VARS = \
$(VIRTD_UNIT_VARS) \
-e 's|[@]name[@]|Libvirt qemu|g' \
-e 's|[@]service[@]|virtqemud|g' \
-e 's|[@]sockprefix[@]|virtqemud|g' \
$(NULL)
virtqemud.init: qemu/virtqemud.init.in $(top_builddir)/config.status
$(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@
virtqemud.service: qemu/virtqemud.service.in $(top_builddir)/config.status
$(AM_V_GEN)$(SED) $(VIRTQEMUD_UNIT_VARS) $< > $@-t && mv $@-t $@
virtqemu%.socket: remote/libvirt%.socket.in $(top_builddir)/config.status
$(AM_V_GEN)$(SED) $(VIRTQEMUD_UNIT_VARS) $< > $@-t && mv $@-t $@
qemu/virtqemud.conf: remote/libvirtd.conf.in
$(AM_V_GEN)$(SED) \
-e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \
-e 's/[@]DAEMON_NAME[@]/virtqemud/' \
$< > $@
qemu/virtqemud.aug: remote/libvirtd.aug.in
$(AM_V_GEN)$(SED) \
-e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \
-e 's/[@]DAEMON_NAME[@]/virtqemud/' \
-e 's/[@]DAEMON_NAME_UC[@]/Virtqemud/' \
$< > $@
qemu/test_virtqemud.aug: remote/test_libvirtd.aug.in \
qemu/virtqemud.conf $(AUG_GENTEST_SCRIPT)
$(AM_V_GEN)$(AUG_GENTEST) qemu/virtqemud.conf \
$(srcdir)/remote/test_libvirtd.aug.in | \
$(SED) \
-e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \
-e 's/[@]DAEMON_NAME[@]/virtqemud/' \
-e 's/[@]DAEMON_NAME_UC[@]/Virtqemud/' \
> $@ || rm -f $@
conf_DATA += qemu/qemu.conf
augeas_DATA += qemu/libvirtd_qemu.aug
augeastest_DATA += qemu/test_libvirtd_qemu.aug
qemu/test_libvirtd_qemu.aug: qemu/test_libvirtd_qemu.aug.in \
$(srcdir)/qemu/qemu.conf $(AUG_GENTEST_SCRIPT)
$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/qemu/qemu.conf $< > $@
INSTALL_DATA_DIRS += qemu
install-data-qemu:
$(MKDIR_P) -m 0751 "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu"
$(MKDIR_P) "$(DESTDIR)$(runstatedir)/libvirt/qemu"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt/qemu"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/qemu"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/swtpm"
$(MKDIR_P) "$(DESTDIR)$(runstatedir)/libvirt/qemu/swtpm"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/swtpm/libvirt/qemu"
uninstall-data-qemu:
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu" ||:
rmdir "$(DESTDIR)$(runstatedir)/libvirt/qemu" ||:
rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt/qemu" ||:
rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/qemu" ||:
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/swtpm"
rmdir "$(DESTDIR)$(runstatedir)/libvirt/qemu/swtpm" ||:
rmdir "$(DESTDIR)$(localstatedir)/log/swtpm/libvirt/qemu" ||:
endif WITH_QEMU
.PHONY: \
install-data-qemu \
uninstall-data-qemu \
$(NULL)
EXTRA_DIST += \
qemu/qemu.conf \
qemu/libvirtd_qemu.aug \
qemu/test_libvirtd_qemu.aug.in \
qemu/THREADS.txt \
libvirt_qemu_probes.d \
$(NULL)
qemu: introduce a new "virt-qemu-run" program The previous "QEMU shim" proof of concept was taking an approach of only caring about initial spawning of the QEMU process. It was then registered with the libvirtd daemon who took over management of it. The intent was that later libvirtd would be refactored so that the shim retained control over the QEMU monitor and libvirt just forwarded APIs to each shim as needed. This forwarding of APIs would require quite alot of significant refactoring of libvirtd to achieve. This impl thus takes a quite different approach, explicitly deciding to keep the VMs completely separate from those seen & managed by libvirtd. Instead it uses the new "qemu:///embed" URI scheme to embed the entire QEMU driver in the shim, running with a custom root directory. Once the driver is initialization, the shim starts a VM and then waits to shutdown automatically when QEMU shuts down, or should kill QEMU if it is terminated itself. This ought to use the AUTO_DESTROY feature but that is not yet available in embedded mode, so we rely on installing a few signal handlers to gracefully kill QEMU. This isn't reliable if we crash of course, but you can restart with the same root dir. Note this program does not expose any way to manage the QEMU process, since there's no RPC interface enabled. It merely starts the VM and cleans up when the guest shuts down at the end. This program is installed to /usr/bin/virt-qemu-run enabling direct use by end users. Most use cases will probably want to integrate the concept directly into their respective application codebases. This standalone binary serves as a nice demo though, and also provides a way to measure performance of the startup process quite simply. Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-05-17 12:01:59 +00:00
QEMU_SHIM_SOURCES = qemu/qemu_shim.c
EXTRA_DIST += $(QEMU_SHIM_SOURCES)
if WITH_QEMU
bin_PROGRAMS += virt-qemu-run
virt_qemu_run_SOURCES = $(QEMU_SHIM_SOURCES)
virt_qemu_run_LDADD = \
libvirt.la \
$(GLIB_LIBS) \
$(NULL)
virt_qemu_run_LDFLAGS = -export-dynamic
qemu: introduce a new "virt-qemu-run" program The previous "QEMU shim" proof of concept was taking an approach of only caring about initial spawning of the QEMU process. It was then registered with the libvirtd daemon who took over management of it. The intent was that later libvirtd would be refactored so that the shim retained control over the QEMU monitor and libvirt just forwarded APIs to each shim as needed. This forwarding of APIs would require quite alot of significant refactoring of libvirtd to achieve. This impl thus takes a quite different approach, explicitly deciding to keep the VMs completely separate from those seen & managed by libvirtd. Instead it uses the new "qemu:///embed" URI scheme to embed the entire QEMU driver in the shim, running with a custom root directory. Once the driver is initialization, the shim starts a VM and then waits to shutdown automatically when QEMU shuts down, or should kill QEMU if it is terminated itself. This ought to use the AUTO_DESTROY feature but that is not yet available in embedded mode, so we rely on installing a few signal handlers to gracefully kill QEMU. This isn't reliable if we crash of course, but you can restart with the same root dir. Note this program does not expose any way to manage the QEMU process, since there's no RPC interface enabled. It merely starts the VM and cleans up when the guest shuts down at the end. This program is installed to /usr/bin/virt-qemu-run enabling direct use by end users. Most use cases will probably want to integrate the concept directly into their respective application codebases. This standalone binary serves as a nice demo though, and also provides a way to measure performance of the startup process quite simply. Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-05-17 12:01:59 +00:00
endif WITH_QEMU