2019-07-18 11:19:02 +00:00
|
|
|
qga_qapi_outputs = [
|
|
|
|
'qga-qapi-commands.c',
|
|
|
|
'qga-qapi-commands.h',
|
|
|
|
'qga-qapi-emit-events.c',
|
|
|
|
'qga-qapi-emit-events.h',
|
|
|
|
'qga-qapi-events.c',
|
|
|
|
'qga-qapi-events.h',
|
|
|
|
'qga-qapi-init-commands.c',
|
|
|
|
'qga-qapi-init-commands.h',
|
|
|
|
'qga-qapi-introspect.c',
|
|
|
|
'qga-qapi-introspect.h',
|
|
|
|
'qga-qapi-types.c',
|
|
|
|
'qga-qapi-types.h',
|
|
|
|
'qga-qapi-visit.c',
|
|
|
|
'qga-qapi-visit.h',
|
|
|
|
]
|
|
|
|
|
|
|
|
qga_qapi_files = custom_target('QGA QAPI files',
|
2020-09-25 16:23:03 +00:00
|
|
|
output: qga_qapi_outputs,
|
2019-07-18 11:19:02 +00:00
|
|
|
input: 'qapi-schema.json',
|
|
|
|
command: [ qapi_gen, '-o', 'qga', '-p', 'qga-', '@INPUT0@' ],
|
|
|
|
depend_files: qapi_gen_depends)
|
2020-08-05 11:07:48 +00:00
|
|
|
|
2019-07-18 11:19:02 +00:00
|
|
|
qga_ss = ss.source_set()
|
2020-10-20 08:12:56 +00:00
|
|
|
qga_ss.add(qga_qapi_files.to_list())
|
2019-07-18 11:19:02 +00:00
|
|
|
qga_ss.add(files(
|
|
|
|
'commands.c',
|
|
|
|
'guest-agent-command-state.c',
|
|
|
|
'main.c',
|
|
|
|
))
|
|
|
|
qga_ss.add(when: 'CONFIG_POSIX', if_true: files(
|
|
|
|
'channel-posix.c',
|
2020-10-20 08:12:52 +00:00
|
|
|
'commands-posix.c',
|
|
|
|
'commands-posix-ssh.c',
|
|
|
|
))
|
2019-07-18 11:19:02 +00:00
|
|
|
qga_ss.add(when: 'CONFIG_WIN32', if_true: files(
|
|
|
|
'channel-win32.c',
|
|
|
|
'commands-win32.c',
|
|
|
|
'service-win32.c',
|
|
|
|
'vss-win32.c'
|
|
|
|
))
|
|
|
|
|
|
|
|
qga_ss = qga_ss.apply(config_host, strict: false)
|
|
|
|
|
|
|
|
qga = executable('qemu-ga', qga_ss.sources(),
|
|
|
|
link_args: config_host['LIBS_QGA'].split(),
|
|
|
|
dependencies: [qemuutil, libudev],
|
|
|
|
install: true)
|
2020-01-28 14:06:16 +00:00
|
|
|
all_qga = [qga]
|
2019-07-15 07:39:13 +00:00
|
|
|
|
|
|
|
if targetos == 'windows'
|
|
|
|
if 'CONFIG_QGA_VSS' in config_host
|
|
|
|
subdir('vss-win32')
|
2019-07-15 09:06:20 +00:00
|
|
|
else
|
|
|
|
gen_tlb = []
|
|
|
|
endif
|
|
|
|
|
2021-01-21 10:49:04 +00:00
|
|
|
qemu_ga_msi_arch = {
|
|
|
|
'x86': ['-D', 'Arch=32'],
|
|
|
|
'x86_64': ['-a', 'x64', '-D', 'Arch=64']
|
|
|
|
}
|
|
|
|
wixl = not_found
|
|
|
|
if cpu in qemu_ga_msi_arch
|
|
|
|
wixl = find_program('wixl', required: get_option('guest_agent_msi'))
|
|
|
|
elif get_option('guest_agent_msi').enabled()
|
|
|
|
error('CPU not supported for building guest agent installation package')
|
|
|
|
endif
|
|
|
|
|
2019-07-15 09:06:20 +00:00
|
|
|
if wixl.found()
|
|
|
|
deps = [gen_tlb, qga]
|
2021-01-21 10:49:04 +00:00
|
|
|
qemu_ga_msi_vss = []
|
|
|
|
if 'CONFIG_QGA_VSS' in config_host
|
|
|
|
qemu_ga_msi_vss = ['-D', 'InstallVss']
|
2019-07-15 09:06:20 +00:00
|
|
|
deps += qga_vss
|
|
|
|
endif
|
2021-01-21 10:49:04 +00:00
|
|
|
qga_msi = custom_target('QGA MSI',
|
|
|
|
input: files('installer/qemu-ga.wxs'),
|
|
|
|
output: 'qemu-ga-@0@.msi'.format(config_host['ARCH']),
|
|
|
|
depends: deps,
|
|
|
|
command: [
|
|
|
|
find_program('env'),
|
|
|
|
'QEMU_GA_VERSION=' + config_host['QEMU_GA_VERSION'],
|
|
|
|
'QEMU_GA_MANUFACTURER=' + config_host['QEMU_GA_MANUFACTURER'],
|
|
|
|
'QEMU_GA_DISTRO=' + config_host['QEMU_GA_DISTRO'],
|
|
|
|
'BUILD_DIR=' + meson.build_root(),
|
|
|
|
wixl, '-o', '@OUTPUT0@', '@INPUT0@',
|
|
|
|
qemu_ga_msi_arch[cpu],
|
|
|
|
qemu_ga_msi_vss,
|
|
|
|
'-D', 'Mingw_dlls=' + config_host['QEMU_GA_MSI_MINGW_DLL_PATH'],
|
|
|
|
])
|
|
|
|
all_qga += [qga_msi]
|
|
|
|
alias_target('msi', qga_msi)
|
2019-07-15 07:39:13 +00:00
|
|
|
endif
|
2020-08-26 13:06:21 +00:00
|
|
|
else
|
2021-01-21 10:49:04 +00:00
|
|
|
if get_option('guest_agent_msi').enabled()
|
|
|
|
error('MSI guest agent package is available only for MinGW Windows cross-compilation')
|
|
|
|
endif
|
2020-08-26 13:06:21 +00:00
|
|
|
install_subdir('run', install_dir: get_option('localstatedir'))
|
2019-07-15 07:39:13 +00:00
|
|
|
endif
|
2020-01-28 14:06:16 +00:00
|
|
|
|
|
|
|
alias_target('qemu-ga', all_qga)
|
2020-10-20 08:12:52 +00:00
|
|
|
|
|
|
|
test_env = environment()
|
|
|
|
test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
|
|
|
|
test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
|
|
|
|
|
|
|
|
# disable qga-ssh-test for now. glib's G_TEST_OPTION_ISOLATE_DIRS triggers
|
|
|
|
# the leak detector in build-oss-fuzz Gitlab CI test. we should re-enable
|
|
|
|
# this when an alternative is implemented or when the underlying glib
|
|
|
|
# issue is identified/fix
|
|
|
|
#if 'CONFIG_POSIX' in config_host
|
|
|
|
if false
|
2020-10-20 08:12:57 +00:00
|
|
|
srcs = [files('commands-posix-ssh.c')]
|
|
|
|
i = 0
|
|
|
|
foreach output: qga_qapi_outputs
|
|
|
|
if output.startswith('qga-qapi-types') or output.startswith('qga-qapi-visit')
|
|
|
|
srcs += qga_qapi_files[i]
|
|
|
|
endif
|
|
|
|
i = i + 1
|
|
|
|
endforeach
|
|
|
|
qga_ssh_test = executable('qga-ssh-test', srcs,
|
2020-10-20 08:12:52 +00:00
|
|
|
dependencies: [qemuutil],
|
|
|
|
c_args: ['-DQGA_BUILD_UNIT_TEST'])
|
|
|
|
|
|
|
|
test('qga-ssh-test',
|
|
|
|
qga_ssh_test,
|
|
|
|
env: test_env,
|
|
|
|
suite: ['unit', 'qga'])
|
|
|
|
endif
|