[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/18] virtiofsd: Let meson check for statx.stx_mnt_id
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[PULL 02/18] virtiofsd: Let meson check for statx.stx_mnt_id |
Date: |
Wed, 2 Mar 2022 18:29:20 +0000 |
From: Hanna Reitz <hreitz@redhat.com>
In virtiofsd, we assume that the presence of the STATX_MNT_ID macro
implies existence of the statx.stx_mnt_id field. Unfortunately, that is
not necessarily the case: glibc has introduced the macro in its commit
88a2cf6c4bab6e94a65e9c0db8813709372e9180, but the statx.stx_mnt_id field
is still missing from its own headers.
Let meson.build actually chek for both STATX_MNT_ID and
statx.stx_mnt_id, and set CONFIG_STATX_MNT_ID if both are present.
Then, use this config macro in virtiofsd.
Closes: https://gitlab.com/qemu-project/qemu/-/issues/882
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220223092340.9043-1-hreitz@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
meson.build | 13 +++++++++++++
tools/virtiofsd/passthrough_ll.c | 2 +-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 8df40bfac4..a5b63e62cd 100644
--- a/meson.build
+++ b/meson.build
@@ -1306,6 +1306,18 @@ statx_test = gnu_source_prefix + '''
has_statx = cc.links(statx_test)
+# Check whether statx() provides mount ID information
+
+statx_mnt_id_test = gnu_source_prefix + '''
+ #include <sys/stat.h>
+ int main(void) {
+ struct statx statxbuf;
+ statx(0, "", 0, STATX_BASIC_STATS | STATX_MNT_ID, &statxbuf);
+ return statxbuf.stx_mnt_id;
+ }'''
+
+has_statx_mnt_id = cc.links(statx_mnt_id_test)
+
have_vhost_user_blk_server = get_option('vhost_user_blk_server') \
.require(targetos == 'linux',
error_message: 'vhost_user_blk_server requires linux') \
@@ -1553,6 +1565,7 @@ config_host_data.set('CONFIG_NETTLE', nettle.found())
config_host_data.set('CONFIG_QEMU_PRIVATE_XTS', xts == 'private')
config_host_data.set('CONFIG_MALLOC_TRIM', has_malloc_trim)
config_host_data.set('CONFIG_STATX', has_statx)
+config_host_data.set('CONFIG_STATX_MNT_ID', has_statx_mnt_id)
config_host_data.set('CONFIG_ZSTD', zstd.found())
config_host_data.set('CONFIG_FUSE', fuse.found())
config_host_data.set('CONFIG_FUSE_LSEEK', fuse_lseek.found())
diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
index dfa2fc250d..028dacdd8f 100644
--- a/tools/virtiofsd/passthrough_ll.c
+++ b/tools/virtiofsd/passthrough_ll.c
@@ -1039,7 +1039,7 @@ static int do_statx(struct lo_data *lo, int dirfd, const
char *pathname,
{
int res;
-#if defined(CONFIG_STATX) && defined(STATX_MNT_ID)
+#if defined(CONFIG_STATX) && defined(CONFIG_STATX_MNT_ID)
if (lo->use_statx) {
struct statx statxbuf;
--
2.35.1
- [PULL 00/18] migration queue, Dr. David Alan Gilbert (git), 2022/03/02
- [PULL 01/18] clock-vmstate: Add missing END_OF_LIST, Dr. David Alan Gilbert (git), 2022/03/02
- [PULL 03/18] monitor/hmp: add support for flag argument with value, Dr. David Alan Gilbert (git), 2022/03/02
- [PULL 04/18] qapi/monitor: refactor set/expire_password with enums, Dr. David Alan Gilbert (git), 2022/03/02
- [PULL 02/18] virtiofsd: Let meson check for statx.stx_mnt_id,
Dr. David Alan Gilbert (git) <=
- [PULL 08/18] migration: Finer grained tracepoints for POSTCOPY_LISTEN, Dr. David Alan Gilbert (git), 2022/03/02
- [PULL 07/18] migration: Dump sub-cmd name in loadvm_process_command tp, Dr. David Alan Gilbert (git), 2022/03/02
- [PULL 05/18] qapi/monitor: allow VNC display id in set/expire_password, Dr. David Alan Gilbert (git), 2022/03/02
- [PULL 06/18] migration/rdma: set the REUSEADDR option for destination, Dr. David Alan Gilbert (git), 2022/03/02
- [PULL 09/18] migration: Tracepoint change in postcopy-run bottom half, Dr. David Alan Gilbert (git), 2022/03/02
- [PULL 11/18] migration: Dump ramblock and offset too when non-same-page detected, Dr. David Alan Gilbert (git), 2022/03/02
- [PULL 14/18] migration: Enlarge postcopy recovery to capture !-EIO too, Dr. David Alan Gilbert (git), 2022/03/02
- [PULL 10/18] migration: Introduce postcopy channels on dest node, Dr. David Alan Gilbert (git), 2022/03/02
- [PULL 13/18] migration: Move static var in ram_block_from_stream() into global, Dr. David Alan Gilbert (git), 2022/03/02
- [PULL 12/18] migration: Add postcopy_thread_create(), Dr. David Alan Gilbert (git), 2022/03/02