2020-10-13 15:19:50 +00:00
|
|
|
html_xslt_gen_install_dir = docs_html_dir / 'manpages'
|
|
|
|
html_xslt_gen = []
|
|
|
|
|
2020-06-25 12:33:22 +00:00
|
|
|
# docs_man_files
|
|
|
|
# each entry is a dictionary with following items:
|
|
|
|
# name - man page name (required)
|
|
|
|
# section - man page section (required)
|
|
|
|
# install - whether to build and install the man page (required)
|
|
|
|
# file - generated RST file (optional, default none)
|
|
|
|
|
|
|
|
docs_man_files = [
|
|
|
|
{ 'name': 'index', 'section': '', 'install': false },
|
|
|
|
|
|
|
|
{ 'name': 'virsh', 'section': '1', 'install': true },
|
|
|
|
{ 'name': 'virt-admin', 'section': '1', 'install': true },
|
|
|
|
{ 'name': 'virt-host-validate', 'section': '1', 'install': conf.has('WITH_HOST_VALIDATE') },
|
|
|
|
{ 'name': 'virt-login-shell', 'section': '1', 'install': conf.has('WITH_LOGIN_SHELL') },
|
2021-12-09 17:36:34 +00:00
|
|
|
{ 'name': 'virt-pki-query-dn', 'section': '1', 'install': true },
|
2020-06-25 12:33:22 +00:00
|
|
|
{ 'name': 'virt-pki-validate', 'section': '1', 'install': true },
|
|
|
|
{ 'name': 'virt-qemu-run', 'section': '1', 'install': conf.has('WITH_QEMU') },
|
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
|
|
|
{ 'name': 'virt-qemu-qmp-proxy', 'section': '1', 'install': conf.has('WITH_QEMU') },
|
2020-06-25 12:33:22 +00:00
|
|
|
{ 'name': 'virt-xml-validate', 'section': '1', 'install': true },
|
2021-12-09 20:33:22 +00:00
|
|
|
{ 'name': 'virt-qemu-sev-validate', 'section': '1', 'install': conf.has('WITH_QEMU') },
|
2020-06-25 12:33:22 +00:00
|
|
|
|
2022-01-07 21:35:10 +00:00
|
|
|
{ 'name': 'libvirt-guests', 'section': '8', 'install': conf.has('WITH_LIBVIRTD') },
|
2020-06-25 12:33:22 +00:00
|
|
|
{ 'name': 'libvirtd', 'section': '8', 'install': conf.has('WITH_LIBVIRTD') },
|
2020-08-05 08:04:12 +00:00
|
|
|
{ 'name': 'virt-sanlock-cleanup', 'section': '8', 'install': conf.has('WITH_SANLOCK') },
|
2022-01-13 13:42:21 +00:00
|
|
|
{ 'name': 'virt-ssh-helper', 'section': '8', 'install': conf.has('WITH_LIBVIRTD') },
|
2020-09-24 14:08:37 +00:00
|
|
|
{ 'name': 'virtbhyved', 'section': '8', 'install': conf.has('WITH_BHYVE') },
|
2020-09-24 14:08:37 +00:00
|
|
|
{ 'name': 'virtinterfaced', 'section': '8', 'install': conf.has('WITH_INTERFACE') },
|
2020-06-25 12:33:22 +00:00
|
|
|
{ 'name': 'virtlockd', 'section': '8', 'install': conf.has('WITH_LIBVIRTD') },
|
|
|
|
{ 'name': 'virtlogd', 'section': '8', 'install': conf.has('WITH_LIBVIRTD') },
|
2020-09-24 14:08:37 +00:00
|
|
|
{ 'name': 'virtlxcd', 'section': '8', 'install': conf.has('WITH_LXC') },
|
2020-09-24 14:08:37 +00:00
|
|
|
{ 'name': 'virtnetworkd', 'section': '8', 'install': conf.has('WITH_NETWORK') },
|
2020-09-24 14:08:37 +00:00
|
|
|
{ 'name': 'virtnodedevd', 'section': '8', 'install': conf.has('WITH_NODE_DEVICES') },
|
2020-09-24 14:08:37 +00:00
|
|
|
{ 'name': 'virtnwfilterd', 'section': '8', 'install': conf.has('WITH_NWFILTER') },
|
2020-09-24 14:08:37 +00:00
|
|
|
{ 'name': 'virtproxyd', 'section': '8', 'install': conf.has('WITH_LIBVIRTD') },
|
2020-09-24 14:08:37 +00:00
|
|
|
{ 'name': 'virtqemud', 'section': '8', 'install': conf.has('WITH_QEMU') },
|
2020-09-24 14:08:37 +00:00
|
|
|
{ 'name': 'virtsecretd', 'section': '8', 'install': conf.has('WITH_SECRETS') },
|
2020-09-24 14:08:37 +00:00
|
|
|
{ 'name': 'virtstoraged', 'section': '8', 'install': conf.has('WITH_STORAGE') },
|
2020-09-24 14:08:37 +00:00
|
|
|
{ 'name': 'virtvboxd', 'section': '8', 'install': conf.has('WITH_VBOX') },
|
2020-09-24 14:08:37 +00:00
|
|
|
{ 'name': 'virtvzd', 'section': '8', 'install': conf.has('WITH_VZ') },
|
2020-09-24 14:08:37 +00:00
|
|
|
{ 'name': 'virtxend', 'section': '8', 'install': conf.has('WITH_LIBXL') },
|
2020-06-25 12:33:22 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
foreach name : keycode_list
|
|
|
|
rst_file = custom_target(
|
|
|
|
'virkeycode-@0@.rst'.format(name),
|
|
|
|
input: keymap_src_file,
|
|
|
|
output: 'virkeycode-@0@.rst'.format(name),
|
|
|
|
command: [
|
2020-11-09 13:52:10 +00:00
|
|
|
meson_python_prog, python3_prog, keymap_gen_prog, 'code-docs',
|
2020-06-25 12:33:22 +00:00
|
|
|
'--lang', 'rst',
|
|
|
|
'--title', 'virkeycode-@0@'.format(name),
|
|
|
|
'--subtitle', 'Key code values for @0@'.format(name),
|
|
|
|
'@INPUT@', name,
|
|
|
|
],
|
|
|
|
capture: true,
|
|
|
|
build_by_default: true,
|
|
|
|
)
|
|
|
|
|
|
|
|
docs_man_files += {
|
|
|
|
'name': 'virkeycode-@0@'.format(name), 'section': '7', 'install': true, 'file': rst_file,
|
|
|
|
}
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
foreach name : keyname_list
|
|
|
|
rst_file = custom_target(
|
|
|
|
'virkeyname-@0@.rst'.format(name),
|
|
|
|
input: keymap_src_file,
|
|
|
|
output: 'virkeyname-@0@.rst'.format(name),
|
|
|
|
command: [
|
2020-11-09 13:52:10 +00:00
|
|
|
meson_python_prog, python3_prog, keymap_gen_prog, 'name-docs',
|
2020-06-25 12:33:22 +00:00
|
|
|
'--lang', 'rst',
|
|
|
|
'--title', 'virkeyname-@0@'.format(name),
|
|
|
|
'--subtitle', 'Key name values for @0@'.format(name),
|
|
|
|
'@INPUT@', name,
|
|
|
|
],
|
|
|
|
capture: true,
|
|
|
|
build_by_default: true,
|
|
|
|
)
|
|
|
|
|
|
|
|
docs_man_files += {
|
|
|
|
'name': 'virkeyname-@0@'.format(name), 'section': '7', 'install': true, 'file': rst_file,
|
|
|
|
}
|
|
|
|
endforeach
|
|
|
|
|
2022-03-29 09:43:36 +00:00
|
|
|
docs_man_conf = configuration_data({
|
|
|
|
'SYSCONFDIR': sysconfdir,
|
|
|
|
'RUNSTATEDIR': runstatedir,
|
|
|
|
'VERSION': meson.project_version(),
|
|
|
|
})
|
2020-06-25 12:33:22 +00:00
|
|
|
|
|
|
|
foreach data : docs_man_files
|
|
|
|
rst_in_file = '@0@.rst'.format(data['name'])
|
|
|
|
html_in_file = '@0@.html.in'.format(data['name'])
|
|
|
|
html_file = '@0@.html'.format(data['name'])
|
|
|
|
|
|
|
|
if data.has_key('file')
|
|
|
|
rst_file = data['file']
|
|
|
|
else
|
|
|
|
rst_file = configure_file(
|
|
|
|
input: rst_in_file,
|
|
|
|
output: '@0@.rst'.format(data['name']),
|
|
|
|
configuration: docs_man_conf,
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
|
|
|
if data['install']
|
|
|
|
man_file = '@0@.@1@'.format(data['name'], data['section'])
|
|
|
|
man_page = custom_target(
|
|
|
|
man_file,
|
|
|
|
input: rst_file,
|
|
|
|
output: man_file,
|
2020-09-23 13:13:57 +00:00
|
|
|
# 'contents' element is the table of contents which is undesired in manpage
|
|
|
|
command: [ rst2man_prog, '--strip-elements-with-class', 'contents', '--strict', '@INPUT@', '@OUTPUT@' ],
|
2020-06-25 12:33:22 +00:00
|
|
|
install: true,
|
|
|
|
install_dir: mandir / 'man@0@'.format(data['section']),
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
|
|
|
html_in = custom_target(
|
|
|
|
html_in_file,
|
|
|
|
input: rst_file,
|
|
|
|
output: html_in_file,
|
2021-08-09 14:48:58 +00:00
|
|
|
command: [ rst2html5_prog, '--stylesheet=', '--strict', '@INPUT@' ],
|
2020-06-25 12:33:22 +00:00
|
|
|
capture: true,
|
|
|
|
)
|
|
|
|
|
2020-10-13 15:19:50 +00:00
|
|
|
html_xslt_gen += {
|
|
|
|
'name': data['name'],
|
|
|
|
'file': html_in,
|
2021-08-10 14:46:07 +00:00
|
|
|
'source': 'docs' / 'manpages' / rst_in_file,
|
2022-04-05 14:52:57 +00:00
|
|
|
'href_base': '../',
|
2020-10-13 15:19:50 +00:00
|
|
|
}
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
# keep the XSLT processing code block in sync with docs/meson.build
|
|
|
|
|
|
|
|
# --- begin of XSLT processing ---
|
|
|
|
|
|
|
|
foreach data : html_xslt_gen
|
|
|
|
html_filename = data['name'] + '.html'
|
|
|
|
|
|
|
|
html_file = custom_target(
|
|
|
|
html_filename,
|
|
|
|
input: data.get('file', data['name'] + '.html.in'),
|
|
|
|
output: html_filename,
|
2020-06-25 12:33:22 +00:00
|
|
|
command: [
|
2020-10-13 15:19:50 +00:00
|
|
|
xsltproc_prog,
|
|
|
|
'--stringparam', 'pagesrc', data.get('source', ''),
|
2022-10-07 07:31:32 +00:00
|
|
|
'--stringparam', 'builddir', meson.project_build_root(),
|
2020-10-13 15:19:50 +00:00
|
|
|
'--stringparam', 'timestamp', docs_timestamp,
|
2022-04-05 14:52:57 +00:00
|
|
|
'--stringparam', 'href_base', data.get('href_base', ''),
|
2020-10-13 15:19:50 +00:00
|
|
|
'--nonet',
|
2022-04-05 14:52:57 +00:00
|
|
|
site_xsl,
|
2020-06-25 12:33:22 +00:00
|
|
|
'@INPUT@',
|
|
|
|
],
|
2020-10-13 15:19:50 +00:00
|
|
|
depends: data.get('depends', []),
|
2020-06-25 12:33:22 +00:00
|
|
|
depend_files: [ page_xsl ],
|
2020-10-13 15:19:50 +00:00
|
|
|
capture: true,
|
2020-06-25 12:33:22 +00:00
|
|
|
install: true,
|
2020-10-13 15:19:50 +00:00
|
|
|
install_dir: html_xslt_gen_install_dir,
|
2020-06-25 12:33:22 +00:00
|
|
|
)
|
2020-07-23 16:40:12 +00:00
|
|
|
|
2020-10-13 15:19:50 +00:00
|
|
|
install_web_deps += html_file
|
|
|
|
install_web_files += html_file.full_path() + ':' + html_xslt_gen_install_dir
|
2020-06-25 12:33:22 +00:00
|
|
|
endforeach
|
2020-10-13 15:19:50 +00:00
|
|
|
|
|
|
|
html_xslt_gen = []
|
|
|
|
|
|
|
|
# --- end of XSLT processing ---
|