Add a meson option and config probe for librpmi so RISC-V machines can opt into RPMI support when the library is available. Keep the dependency optional so default builds without librpmi continue to work.
Require the System Suspend constructor used by this series. If a found library lacks it, warn and disable RPMI in auto mode; explicit enablement still fails with the unsupported-library diagnostic. Signed-off-by: Subrahmanya Lingappa <[email protected]> --- Kconfig.host | 3 +++ meson.build | 19 +++++++++++++++++++ meson_options.txt | 2 ++ scripts/meson-buildoptions.sh | 3 +++ 4 files changed, 27 insertions(+) diff --git a/Kconfig.host b/Kconfig.host index 933425c74b..6f98dadb2e 100644 --- a/Kconfig.host +++ b/Kconfig.host @@ -8,6 +8,9 @@ config LINUX config LIBCBOR bool +config LIBRPMI + bool + config GNUTLS bool diff --git a/meson.build b/meson.build index 71f135f053..3dd63772e7 100644 --- a/meson.build +++ b/meson.build @@ -2026,6 +2026,22 @@ if lzo.found() and not cc.links(''' endif endif +librpmi = not_found +if not get_option('librpmi').auto() or have_system + librpmi = dependency('librpmi', required: get_option('librpmi'), + method: 'pkg-config') + if librpmi.found() and not cc.has_header_symbol('librpmi.h', + 'rpmi_service_group_syssusp_create', + dependencies: librpmi) + librpmi = not_found + if get_option('librpmi').enabled() + error('librpmi support requires the RPMI system suspend service group API') + else + warning('librpmi lacks the system suspend service group API, disabling') + endif + endif +endif + numa = not_found if not get_option('numa').auto() or have_system or have_tools numa = cc.find_library('numa', has_headers: ['numa.h'], @@ -2449,6 +2465,7 @@ config_host_data.set('CONFIG_LINUX', host_os == 'linux') config_host_data.set('CONFIG_POSIX', host_os != 'windows') config_host_data.set('CONFIG_WIN32', host_os == 'windows') config_host_data.set('CONFIG_LZO', lzo.found()) +config_host_data.set('CONFIG_LIBRPMI', librpmi.found()) config_host_data.set('CONFIG_MPATH', mpathpersist.found()) config_host_data.set('CONFIG_BLKIO', blkio.found()) if blkio.found() @@ -3286,6 +3303,7 @@ host_kconfig = \ (multiprocess_allowed ? ['CONFIG_MULTIPROCESS_ALLOWED=y'] : []) + \ (vfio_user_server_allowed ? ['CONFIG_VFIO_USER_SERVER_ALLOWED=y'] : []) + \ (hv_balloon ? ['CONFIG_HV_BALLOON_POSSIBLE=y'] : []) + \ + (librpmi.found() ? ['CONFIG_LIBRPMI=y'] : []) + \ (have_rust ? ['CONFIG_HAVE_RUST=y'] : []) ignored = [ 'TARGET_XML_FILES', 'TARGET_ABI_DIR' ] @@ -5036,6 +5054,7 @@ summary_info += {'TPM support': have_tpm} summary_info += {'IGVM support': igvm} summary_info += {'libssh support': libssh} summary_info += {'lzo support': lzo} +summary_info += {'RPMI support': librpmi} summary_info += {'snappy support': snappy} summary_info += {'bzip2 support': libbzip2} summary_info += {'lzfse support': liblzfse} diff --git a/meson_options.txt b/meson_options.txt index 9ae8e44ab5..62c9eaa20b 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -208,6 +208,8 @@ option('lzfse', type : 'feature', value : 'auto', description: 'lzfse support for DMG images') option('lzo', type : 'feature', value : 'auto', description: 'lzo compression support') +option('librpmi', type : 'feature', value : 'auto', + description: 'RPMI support') option('pvg', type: 'feature', value: 'auto', description: 'macOS paravirtualized graphics support') option('rbd', type : 'feature', value : 'auto', diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index 0f8b56bd7f..1c2ad8f0f4 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -147,6 +147,7 @@ meson_options_help() { printf "%s\n" ' libkeyutils Linux keyutils support' printf "%s\n" ' libnfs libnfs block device driver' printf "%s\n" ' libpmem libpmem support' + printf "%s\n" ' librpmi RPMI support' printf "%s\n" ' libssh ssh block device support' printf "%s\n" ' libudev Use libudev to enumerate host devices' printf "%s\n" ' libusb libusb support for USB passthrough' @@ -390,6 +391,8 @@ _meson_option_parse() { --disable-libnfs) printf "%s" -Dlibnfs=disabled ;; --enable-libpmem) printf "%s" -Dlibpmem=enabled ;; --disable-libpmem) printf "%s" -Dlibpmem=disabled ;; + --enable-librpmi) printf "%s" -Dlibrpmi=enabled ;; + --disable-librpmi) printf "%s" -Dlibrpmi=disabled ;; --enable-libssh) printf "%s" -Dlibssh=enabled ;; --disable-libssh) printf "%s" -Dlibssh=disabled ;; --enable-libudev) printf "%s" -Dlibudev=enabled ;;
