2020-06-24 11:32:04 +00:00
|
|
|
tools_inc_dir = include_directories('.')
|
|
|
|
|
|
|
|
tools_dep = declare_dependency(
|
|
|
|
compile_args: coverage_flags,
|
|
|
|
dependencies: [
|
|
|
|
libxml_dep,
|
|
|
|
glib_dep,
|
|
|
|
],
|
|
|
|
include_directories: [
|
|
|
|
libvirt_inc,
|
|
|
|
src_inc_dir,
|
|
|
|
util_inc_dir,
|
|
|
|
top_inc_dir,
|
|
|
|
],
|
|
|
|
link_args: (
|
|
|
|
libvirt_relro
|
|
|
|
+ libvirt_no_indirect
|
|
|
|
+ libvirt_no_undefined
|
2023-11-03 17:07:19 +00:00
|
|
|
+ libvirt_no_warn_duplicate_libraries
|
2020-06-24 11:32:04 +00:00
|
|
|
),
|
|
|
|
)
|
2020-06-24 11:32:30 +00:00
|
|
|
|
|
|
|
libvirt_shell_lib = static_library(
|
|
|
|
'virt_shell',
|
|
|
|
[
|
|
|
|
'vsh.c',
|
|
|
|
'vsh-table.c',
|
|
|
|
],
|
|
|
|
dependencies: [
|
|
|
|
tools_dep,
|
|
|
|
readline_dep,
|
|
|
|
],
|
|
|
|
link_with: [
|
|
|
|
libvirt_lib,
|
|
|
|
],
|
|
|
|
link_args: [
|
|
|
|
coverage_flags,
|
|
|
|
],
|
|
|
|
)
|
2020-07-27 09:11:55 +00:00
|
|
|
|
|
|
|
if conf.has('WITH_HOST_VALIDATE')
|
|
|
|
virt_host_validate_sources = [
|
|
|
|
'virt-host-validate.c',
|
|
|
|
'virt-host-validate-common.c',
|
|
|
|
]
|
|
|
|
|
|
|
|
if conf.has('WITH_QEMU')
|
|
|
|
virt_host_validate_sources += [
|
|
|
|
'virt-host-validate-qemu.c',
|
|
|
|
]
|
|
|
|
endif
|
|
|
|
if conf.has('WITH_LXC')
|
|
|
|
virt_host_validate_sources += [
|
|
|
|
'virt-host-validate-lxc.c',
|
|
|
|
]
|
|
|
|
endif
|
|
|
|
if conf.has('WITH_BHYVE')
|
|
|
|
virt_host_validate_sources += [
|
|
|
|
'virt-host-validate-bhyve.c',
|
|
|
|
]
|
|
|
|
endif
|
2021-10-07 21:49:37 +00:00
|
|
|
if conf.has('WITH_CH')
|
|
|
|
virt_host_validate_sources += [
|
|
|
|
'virt-host-validate-ch.c',
|
|
|
|
]
|
|
|
|
endif
|
2020-07-27 09:11:55 +00:00
|
|
|
|
|
|
|
executable(
|
|
|
|
'virt-host-validate',
|
|
|
|
[
|
|
|
|
virt_host_validate_sources,
|
|
|
|
],
|
|
|
|
dependencies: [
|
|
|
|
tools_dep,
|
|
|
|
],
|
|
|
|
link_args: [
|
|
|
|
coverage_flags,
|
|
|
|
],
|
|
|
|
link_with: [
|
|
|
|
libvirt_lib,
|
|
|
|
],
|
|
|
|
install: true,
|
|
|
|
install_dir: bindir,
|
2020-08-19 09:15:35 +00:00
|
|
|
install_rpath: libvirt_rpath,
|
2020-07-27 09:11:55 +00:00
|
|
|
)
|
|
|
|
endif
|
2020-05-20 14:28:46 +00:00
|
|
|
|
|
|
|
if conf.has('WITH_LOGIN_SHELL')
|
|
|
|
# virt-login-shell will be setuid, and must not link to anything
|
2021-04-15 08:12:12 +00:00
|
|
|
# except glibc. It will scrub the environment and then invoke the
|
2020-05-20 14:28:46 +00:00
|
|
|
# real virt-login-shell-helper binary.
|
|
|
|
executable(
|
|
|
|
'virt-login-shell',
|
|
|
|
[
|
|
|
|
'virt-login-shell.c',
|
|
|
|
],
|
|
|
|
include_directories: [
|
|
|
|
top_inc_dir,
|
|
|
|
],
|
|
|
|
install: true,
|
|
|
|
install_dir: bindir,
|
|
|
|
)
|
2020-06-24 11:33:04 +00:00
|
|
|
|
|
|
|
executable(
|
|
|
|
'virt-login-shell-helper',
|
|
|
|
[
|
|
|
|
'virt-login-shell-helper.c',
|
|
|
|
],
|
|
|
|
dependencies: [
|
|
|
|
tools_dep,
|
|
|
|
],
|
|
|
|
link_args: [
|
|
|
|
coverage_flags,
|
|
|
|
],
|
|
|
|
link_with: [
|
|
|
|
libvirt_lib,
|
|
|
|
libvirt_lxc_lib,
|
|
|
|
],
|
|
|
|
install: true,
|
|
|
|
install_dir: libexecdir,
|
2020-08-19 09:15:35 +00:00
|
|
|
install_rpath: libvirt_rpath,
|
2020-06-24 11:33:04 +00:00
|
|
|
)
|
2020-06-17 23:49:58 +00:00
|
|
|
|
|
|
|
install_data('virt-login-shell.conf', install_dir: sysconfdir / 'libvirt')
|
2020-05-20 14:28:46 +00:00
|
|
|
endif
|
2020-07-01 01:08:06 +00:00
|
|
|
|
|
|
|
if host_machine.system() == 'windows'
|
|
|
|
# Before you edit virsh_win_icon.rc, please note the following
|
|
|
|
# limitations of the resource file format:
|
|
|
|
#
|
|
|
|
# (1) '..' is not permitted in the icon filename field.
|
|
|
|
# (2) '-' is not permitted in the icon filename field.
|
|
|
|
# (3) Comments are not permitted in the file.
|
|
|
|
#
|
|
|
|
# Windows appears to choose the first <= 32x32 icon it finds
|
|
|
|
# in the resource file. Therefore you should list the available
|
|
|
|
# icons from largest to smallest, and make sure that the 32x32
|
|
|
|
# icon is the most legible.
|
|
|
|
#
|
|
|
|
# Windows .ICO is a special MS-only format. GIMP and other
|
|
|
|
# tools can write it. However there are several variations,
|
|
|
|
# and Windows seems to do its own colour quantization. More
|
|
|
|
# information is needed in this area.
|
|
|
|
windres = import('windows')
|
|
|
|
virsh_icon_res = windres.compile_resources(
|
|
|
|
'virsh_win_icon.rc',
|
|
|
|
depend_files: [
|
|
|
|
'libvirt_win_icon_16x16.ico',
|
|
|
|
'libvirt_win_icon_32x32.ico',
|
|
|
|
'libvirt_win_icon_48x48.ico',
|
|
|
|
'libvirt_win_icon_64x64.ico',
|
|
|
|
],
|
|
|
|
)
|
|
|
|
else
|
|
|
|
virsh_icon_res = []
|
|
|
|
endif
|
2020-06-24 11:33:22 +00:00
|
|
|
|
2024-03-22 09:02:02 +00:00
|
|
|
virsh_prog = executable(
|
2020-06-24 11:33:22 +00:00
|
|
|
'virsh',
|
|
|
|
[
|
|
|
|
'virsh.c',
|
|
|
|
'virsh-backup.c',
|
|
|
|
'virsh-checkpoint.c',
|
|
|
|
'virsh-completer.c',
|
|
|
|
'virsh-completer-domain.c',
|
|
|
|
'virsh-completer-checkpoint.c',
|
|
|
|
'virsh-completer-host.c',
|
|
|
|
'virsh-completer-interface.c',
|
|
|
|
'virsh-completer-network.c',
|
|
|
|
'virsh-completer-nodedev.c',
|
|
|
|
'virsh-completer-nwfilter.c',
|
|
|
|
'virsh-completer-pool.c',
|
|
|
|
'virsh-completer-secret.c',
|
|
|
|
'virsh-completer-snapshot.c',
|
|
|
|
'virsh-completer-volume.c',
|
|
|
|
'virsh-console.c',
|
|
|
|
'virsh-domain.c',
|
2022-02-21 13:02:19 +00:00
|
|
|
'virsh-domain-event.c',
|
2020-06-24 11:33:22 +00:00
|
|
|
'virsh-domain-monitor.c',
|
|
|
|
'virsh-host.c',
|
|
|
|
'virsh-interface.c',
|
|
|
|
'virsh-network.c',
|
|
|
|
'virsh-nodedev.c',
|
|
|
|
'virsh-nwfilter.c',
|
|
|
|
'virsh-pool.c',
|
|
|
|
'virsh-secret.c',
|
|
|
|
'virsh-snapshot.c',
|
|
|
|
'virsh-util.c',
|
|
|
|
'virsh-volume.c',
|
|
|
|
virsh_icon_res,
|
|
|
|
],
|
|
|
|
dependencies: [
|
|
|
|
tools_dep,
|
|
|
|
readline_dep,
|
|
|
|
thread_dep,
|
2021-03-03 02:40:01 +00:00
|
|
|
keycode_dep,
|
2020-06-24 11:33:22 +00:00
|
|
|
],
|
|
|
|
link_args: [
|
|
|
|
coverage_flags,
|
|
|
|
],
|
|
|
|
link_with: [
|
|
|
|
libvirt_lxc_lib,
|
|
|
|
libvirt_qemu_lib,
|
|
|
|
libvirt_shell_lib,
|
|
|
|
],
|
|
|
|
install: true,
|
|
|
|
install_dir: bindir,
|
2020-08-19 09:15:35 +00:00
|
|
|
install_rpath: libvirt_rpath,
|
2020-06-24 11:33:22 +00:00
|
|
|
)
|
2020-07-27 07:13:31 +00:00
|
|
|
|
2021-12-08 11:16:28 +00:00
|
|
|
if conf.has('WITH_REMOTE')
|
2024-03-22 09:02:02 +00:00
|
|
|
virt_admin_prog = executable(
|
2021-12-08 11:16:28 +00:00
|
|
|
'virt-admin',
|
|
|
|
[
|
|
|
|
'virt-admin.c',
|
|
|
|
'virt-admin-completer.c',
|
|
|
|
],
|
|
|
|
dependencies: [
|
|
|
|
tools_dep,
|
|
|
|
readline_dep,
|
|
|
|
],
|
|
|
|
link_args: [
|
|
|
|
coverage_flags,
|
|
|
|
],
|
|
|
|
link_with: [
|
|
|
|
libvirt_admin_lib,
|
|
|
|
libvirt_shell_lib,
|
|
|
|
],
|
|
|
|
install: true,
|
|
|
|
install_dir: bindir,
|
|
|
|
install_rpath: libvirt_rpath,
|
|
|
|
)
|
|
|
|
endif
|
2020-06-17 23:47:11 +00:00
|
|
|
|
2022-03-29 09:43:36 +00:00
|
|
|
tools_conf = configuration_data({
|
|
|
|
'PACKAGE': meson.project_name(),
|
|
|
|
'VERSION': meson.project_version(),
|
|
|
|
'bindir': bindir,
|
|
|
|
'libexecdir': libexecdir,
|
|
|
|
'localedir': localedir,
|
|
|
|
'localstatedir': localstatedir,
|
|
|
|
'sbindir': sbindir,
|
|
|
|
'schemadir': pkgdatadir / 'schemas',
|
|
|
|
'sysconfdir': sysconfdir,
|
2023-04-29 16:23:12 +00:00
|
|
|
'initconfdir': initconfdir,
|
2022-03-29 09:43:36 +00:00
|
|
|
})
|
2020-06-17 23:47:11 +00:00
|
|
|
|
|
|
|
configure_file(
|
|
|
|
input: 'virt-xml-validate.in',
|
2020-08-25 16:30:57 +00:00
|
|
|
output: '@BASENAME@',
|
2020-06-17 23:47:11 +00:00
|
|
|
configuration: tools_conf,
|
|
|
|
install: true,
|
|
|
|
install_dir: bindir,
|
2022-12-08 07:39:24 +00:00
|
|
|
install_mode: 'rwxr-xr-x',
|
2020-06-17 23:47:11 +00:00
|
|
|
)
|
2020-06-17 23:47:36 +00:00
|
|
|
|
|
|
|
configure_file(
|
|
|
|
input: 'virt-pki-validate.in',
|
2020-08-25 16:30:57 +00:00
|
|
|
output: '@BASENAME@',
|
2020-06-17 23:47:36 +00:00
|
|
|
configuration: tools_conf,
|
|
|
|
install: true,
|
|
|
|
install_dir: bindir,
|
2022-12-08 07:39:24 +00:00
|
|
|
install_mode: 'rwxr-xr-x',
|
2020-06-17 23:47:36 +00:00
|
|
|
)
|
2020-06-17 23:48:45 +00:00
|
|
|
|
2021-11-11 14:35:38 +00:00
|
|
|
executable(
|
|
|
|
'virt-pki-query-dn',
|
|
|
|
[
|
|
|
|
'virt-pki-query-dn.c',
|
|
|
|
],
|
|
|
|
dependencies: [
|
|
|
|
glib_dep,
|
|
|
|
gnutls_dep,
|
|
|
|
],
|
|
|
|
include_directories: [
|
|
|
|
libvirt_inc,
|
|
|
|
src_inc_dir,
|
|
|
|
top_inc_dir,
|
|
|
|
util_inc_dir,
|
|
|
|
],
|
|
|
|
link_args: (
|
|
|
|
libvirt_relro
|
|
|
|
+ libvirt_no_indirect
|
|
|
|
+ libvirt_no_undefined
|
|
|
|
),
|
|
|
|
link_with: [
|
|
|
|
libvirt_lib
|
|
|
|
],
|
|
|
|
install: true,
|
|
|
|
install_dir: bindir,
|
|
|
|
)
|
|
|
|
|
2020-06-17 23:48:45 +00:00
|
|
|
if conf.has('WITH_SANLOCK')
|
|
|
|
configure_file(
|
|
|
|
input: 'virt-sanlock-cleanup.in',
|
2020-08-25 16:30:57 +00:00
|
|
|
output: '@BASENAME@',
|
2020-06-17 23:48:45 +00:00
|
|
|
configuration: tools_conf,
|
|
|
|
install: true,
|
|
|
|
install_dir: sbindir,
|
2022-12-08 07:39:24 +00:00
|
|
|
install_mode: 'rwxr-xr-x',
|
2020-06-17 23:48:45 +00:00
|
|
|
)
|
|
|
|
endif
|
2020-07-27 07:14:24 +00:00
|
|
|
|
2021-12-09 20:33:22 +00:00
|
|
|
if conf.has('WITH_QEMU')
|
|
|
|
install_data('virt-qemu-sev-validate',
|
|
|
|
install_dir: bindir)
|
|
|
|
endif
|
|
|
|
|
2022-01-10 18:42:58 +00:00
|
|
|
if conf.has('WITH_LIBVIRTD')
|
2020-07-27 07:15:24 +00:00
|
|
|
configure_file(
|
2022-01-10 18:42:58 +00:00
|
|
|
input: 'libvirt-guests.sh.in',
|
2020-08-25 16:30:57 +00:00
|
|
|
output: '@BASENAME@',
|
2020-07-27 07:15:24 +00:00
|
|
|
configuration: tools_conf,
|
|
|
|
install: true,
|
2022-01-10 18:42:58 +00:00
|
|
|
install_dir: libexecdir,
|
2022-12-08 07:39:24 +00:00
|
|
|
install_mode: 'rwxr-xr-x',
|
2020-07-27 07:15:24 +00:00
|
|
|
)
|
2022-01-10 18:42:58 +00:00
|
|
|
|
|
|
|
if init_script == 'systemd'
|
|
|
|
configure_file(
|
|
|
|
input: 'libvirt-guests.service.in',
|
|
|
|
output: '@BASENAME@',
|
|
|
|
configuration: tools_conf,
|
|
|
|
install: true,
|
|
|
|
install_dir: prefix / 'lib' / 'systemd' / 'system',
|
|
|
|
)
|
|
|
|
endif
|
2020-06-17 23:50:48 +00:00
|
|
|
endif
|
2020-06-17 23:53:04 +00:00
|
|
|
|
tools: add virt-qemu-qmp-proxy for proxying QMP via libvirt QEMU guests
Libvirt provides QMP passthrough APIs for the QEMU driver and these are
exposed in virsh. It is not especially pleasant, however, using the raw
QMP JSON syntax. QEMU has a tool 'qmp-shell' which can speak QMP and
exposes a human friendly interactive shell. It is not possible to use
this with libvirt managed guest, however, since only one client can
attach to the QMP socket at any point in time. While it would be
possible to configure a second QMP socket for a VM, it may not be
an known requirement at the time the guest is provisioned.
The virt-qmp-proxy tool aims to solve this problem. It opens a UNIX
socket and listens for incoming client connections, speaking QMP on
the connected socket. It will forward any QMP commands received onto
the running libvirt QEMU guest, and forward any replies back to the
QMP client. It will also forward back events.
$ virsh start demo
$ virt-qmp-proxy demo demo.qmp &
$ qmp-shell demo.qmp
Welcome to the QMP low-level shell!
Connected to QEMU 6.2.0
(QEMU) query-kvm
{
"return": {
"enabled": true,
"present": true
}
}
Note this tool of course has the same risks as the raw libvirt
QMP passthrough. It is safe to run query commands to fetch information
but commands which change the QEMU state risk disrupting libvirt's
management of QEMU, potentially resulting in data loss/corruption in
the worst case. Any use of this tool will cause the guest to be marked
as tainted as an warning that it could be in an unexpected state.
Since this tool introduces a python dependency it is not desirable
to include it in any of the existing RPMs in libvirt. This tool is
also QEMU specific, so isn't appropriate to bundle with the generic
tools. Thus a new RPM is introduced 'libvirt-clients-qemu', to
contain additional QEMU specific tools, with extra external deps.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-27 09:34:47 +00:00
|
|
|
if conf.has('WITH_QEMU')
|
|
|
|
install_data('virt-qemu-qmp-proxy',
|
|
|
|
install_dir: bindir)
|
|
|
|
endif
|
|
|
|
|
2020-06-17 23:53:04 +00:00
|
|
|
if bash_completion_dep.found()
|
|
|
|
subdir('bash-completion')
|
|
|
|
endif
|
2020-06-17 23:54:09 +00:00
|
|
|
|
|
|
|
if conf.has('WITH_NSS')
|
|
|
|
subdir('nss')
|
|
|
|
endif
|
2020-06-17 23:55:59 +00:00
|
|
|
|
|
|
|
if wireshark_dep.found()
|
|
|
|
subdir('wireshark')
|
|
|
|
endif
|
2024-04-16 14:32:26 +00:00
|
|
|
|
|
|
|
subdir('ssh-proxy')
|