Build system and KVM changes for 2021-12-23
Subsystems (2)
[PULL v5 04/18] block/file-posix: Simplify the XFS_IOC_DIOINFO handling
In reply to Paolo BonziniFrom: Thomas Huth <[email protected]>
The handling for the XFS_IOC_DIOINFO ioctl is currently quite excessive:
This is not a "real" feature like the other features that we provide with the "--enable-xxx" and "--disable-xxx" switches for the configure script, since this does not influence lots of code (it's only about one call to xfsctl() in file-posix.c), so people don't gain much with the ability to disable this with "--disable-xfsctl".
It's also unfortunate that the ioctl will be disabled on Linux in case the user did not install the right xfsprogs-devel package before running configure. Thus let's simplify this by providing the ioctl definition on our own, so we can completely get rid of the header dependency and thus the related code in the configure script.
Message-Id: <[email protected]>
--- block/file-posix.c | 37 ++++++++----------- configure | 31 ---------------- meson.build | 1 - .../ci/org.centos/stream/8/x86_64/configure | 1 - scripts/coverity-scan/run-coverity-scan | 2 +- 5 files changed, 17 insertions(+), 55 deletions(-)
block/file-posix.c +16 -21
@@ -106,10 +106,6 @@#include <sys/diskslice.h> #endif -#ifdef CONFIG_XFS -#include <xfs/xfs.h> -#endif -/* OS X does not have O_DSYNC */ #ifndef O_DSYNC #ifdef O_SYNC
@@ -156,9 +152,6 @@ typedef struct BDRVRawState {int perm_change_flags;BDRVReopenState *reopen_state; -#ifdef CONFIG_XFS - bool is_xfs:1; -#endif bool has_discard:1; bool has_write_zeroes:1; bool discard_zeroes:1;
@@ -409,14 +402,22 @@ static void raw_probe_alignment(BlockDriverState *bs, int fd, Error **errp)if (probe_logical_blocksize (fd, &bs->bl.request_alignment) <0 ) { bs->bl.request_alignment =0 ; } -#ifdef CONFIG_XFS -if (s->is_xfs) { -struct dioattr da; -if (xfsctl (NULL , fd,XFS_IOC_DIOINFO , &da) >=0 ) { - bs->bl.request_alignment = da.d_miniosz; -/* The kernel returns wrong information for d_mem */ -/* s->buf_align = da.d_mem; */ - } + +#ifdef __linux__ +/* +* The XFS ioctl definitions are shipped in extra packages that might +* not always be available. Since we just need the XFS_IOC_DIOINFO ioctl +* here, we simply use our own definition instead: +*/ +struct xfs_dioattr { +uint32_t d_mem; +uint32_t d_miniosz; +uint32_t d_maxiosz; + } da; + if (ioctl(fd, _IOR('X', 30, struct xfs_dioattr), &da) >= 0) { + bs->bl.request_alignment = da.d_miniosz; +/* The kernel returns wrong information for d_mem */ +/* s->buf_align = da.d_mem; */ }#endif
@@ -798,12 +799,6 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,#endif s->needs_alignment =raw_needs_alignment (bs); -#ifdef CONFIG_XFS -if (platform_test_xfs_fd (s->fd)) { - s->is_xfs = true; - } -#endif - bs->supported_zero_flags =BDRV_REQ_MAY_UNMAP |BDRV_REQ_NO_FALLBACK ;if (S_ISREG (st.st_mode)) {/* When extending regular files, we get zeros from the OS */
configure +0 -31
@@ -291,7 +291,6 @@ EXTRA_CXXFLAGS="" EXTRA_LDFLAGS="" xen_ctrl_version="$default_feature" -xfs="$default_feature" membarrier="$default_feature" vhost_kernel="$default_feature" vhost_net="$default_feature"
@@ -1021,10 +1020,6 @@ for opt do ;; --enable-opengl) opengl="yes" ;; - --disable-xfsctl) xfs="no" - ;; - --enable-xfsctl) xfs="yes" - ;; --disable-zlib-test) ;; --enable-guest-agent) guest_agent="yes"
@@ -1431,7 +1426,6 @@ cat << EOF avx512f AVX512F optimization support replication replication support opengl opengl support - xfsctl xfsctl support qom-cast-debug cast debugging support tools build qemu-io, qemu-nbd and qemu-img tools bochs bochs image format support
@@ -2323,28 +2317,6 @@ EOF fi fi -########################################## -# xfsctl() probe, used for file-posix.c -if test "$xfs" != "no" ; then - cat > $TMPC << EOF -#include <stddef.h> /* NULL */ -#include <xfs/xfs.h> -int main(void) -{ - xfsctl(NULL, 0, 0, NULL); - return 0; -} -EOF - if compile_prog "" "" ; then - xfs="yes" - else - if test "$xfs" = "yes" ; then - feature_not_found "xfs" "Install xfsprogs/xfslibs devel" - fi - xfs=no - fi -fi - ########################################## # plugin linker support probe
@@ -3456,9 +3428,6 @@ echo "CONFIG_BDRV_RO_WHITELIST=$block_drv_ro_whitelist" >> $config_host_mak if test "$block_drv_whitelist_tools" = "yes" ; then echo "CONFIG_BDRV_WHITELIST_TOOLS=y" >> $config_host_mak fi -if test "$xfs" = "yes" ; then - echo "CONFIG_XFS=y" >> $config_host_mak -fi qemu_version=$(head $source_path/VERSION) echo "PKGVERSION=$pkgversion" >>$config_host_mak echo "SRC_PATH=$source_path" >> $config_host_mak
meson.build +0 -1
@@ -3445,7 +3445,6 @@ if spice_protocol.found() summary_info += {' spice server support': spice} endif summary_info += {'rbd support': rbd} -summary_info += {'xfsctl support': config_host.has_key('CONFIG_XFS')} summary_info += {'smartcard support': cacard} summary_info += {'U2F support': u2f} summary_info += {'libusb': libusb}
scripts/ci/org.centos/stream/8/x86_64/configure +0 -1
@@ -151,7 +151,6 @@ --disable-whpx \ --disable-xen \ --disable-xen-pci-passthrough \ ---disable-xfsctl \ --disable-xkbcommon \ --disable-zstd \ --enable-attr \
scripts/coverity-scan/run-coverity-scan +1 -1
@@ -398,7 +398,7 @@ echo "Configuring..." --enable-xen --enable-brlapi \ --enable-linux-aio --enable-attr \ --enable-cap-ng --enable-trace-backends=log --enable-spice --enable-rbd \ - --enable-xfsctl --enable-libusb --enable-usb-redir \ + --enable-libusb --enable-usb-redir \ --enable-libiscsi --enable-libnfs --enable-seccomp \ --enable-tpm --enable-libssh --enable-lzo --enable-snappy --enable-bzip2 \ --enable-numa --enable-rdma --enable-smartcard --enable-virglrenderer \
Signature · 1 line
2.33.1
The following changes since commit b37778b840f6dc6d1bbaf0e8e0641b3d48ad77c5:
linux-user: Fix clang warning for nios2-linux-user code (2022-01-12 09:22:01 +0000)
are available in the Git repository at:
https://gitlab.com/bonzini/qemu.git tags/for-upstream
for you to fetch changes up to 9d30c78c7d3b994825cbe63fa277279ae3ef4248:
meson: reenable filemonitor-inotify compilation (2022-01-12 14:09:06 +0100)
----------------------------------------------------------------
* configure and meson cleanups
* KVM_GET/SET_SREGS2 support for x86
----------------------------------------------------------------v4->v5: remove --enable/disable-xfsctl
Maxim Levitsky (1):
KVM: use KVM_{GET|SET}_SREGS2 when supported.
Paolo Bonzini (14):
meson: reuse common_user_inc when building files specific to user-mode emulators
user: move common-user includes to a subdirectory of {bsd,linux}-user/
meson: cleanup common-user/ build
configure: simplify creation of plugin symbol list
configure: do not set bsd_user/linux_user early
configure, makefile: remove traces of really old files
configure: parse --enable/--disable-strip automatically, flip default
configure: move non-command-line variables away from command-line parsing section
meson: build contrib/ executables after generated headers configure, meson: move config-poison.h to meson
meson: add comments in the target-specific flags section
KVM: x86: ignore interrupt_bitmap field of KVM_GET/SET_SREGS
configure: do not create roms/seabios/config.mak if SeaBIOS not present
meson: build all modules by default
Philippe Mathieu-Daudé (1):
tests/tcg: Fix target-specific Makefile variables path for user-mode
Thomas Huth (1):
block/file-posix: Simplify the XFS_IOC_DIOINFO handling
Volker Rümelin (1):
meson: reenable filemonitor-inotify compilation
Makefile | 11 +-
block/file-posix.c | 37 ++--
bsd-user/{ => include}/special-errno.h | 0
bsd-user/meson.build | 2 +-
common-user/meson.build | 2 +-
configure | 189 ++++-----------------
contrib/elf2dmp/meson.build | 2 +-
contrib/ivshmem-client/meson.build | 2 +-
contrib/ivshmem-server/meson.build | 2 +-
contrib/rdmacm-mux/meson.build | 2 +-
.../{ => include}/host/aarch64/host-signal.h | 0
linux-user/{ => include}/host/alpha/host-signal.h | 0
linux-user/{ => include}/host/arm/host-signal.h | 0
linux-user/{ => include}/host/i386/host-signal.h | 0
.../{ => include}/host/loongarch64/host-signal.h | 0
linux-user/{ => include}/host/mips/host-signal.h | 0
linux-user/{ => include}/host/ppc/host-signal.h | 0
linux-user/{ => include}/host/ppc64/host-signal.h | 0
linux-user/{ => include}/host/riscv/host-signal.h | 0
linux-user/{ => include}/host/s390/host-signal.h | 0
linux-user/{ => include}/host/s390x/host-signal.h | 0
linux-user/{ => include}/host/sparc/host-signal.h | 0
.../{ => include}/host/sparc64/host-signal.h | 0
linux-user/{ => include}/host/x32/host-signal.h | 0
linux-user/{ => include}/host/x86_64/host-signal.h | 0
linux-user/{ => include}/special-errno.h | 0
linux-user/meson.build | 4 +-
meson.build | 37 ++--
pc-bios/s390-ccw/Makefile | 2 -
plugins/meson.build | 13 +-
scripts/ci/org.centos/stream/8/x86_64/configure | 1 -
scripts/coverity-scan/run-coverity-scan | 2 +-
scripts/make-config-poison.sh | 16 ++
scripts/meson-buildoptions.py | 21 ++-
scripts/meson-buildoptions.sh | 3 +
target/i386/cpu.h | 3 +
target/i386/kvm/kvm.c | 130 ++++++++++++--
target/i386/machine.c | 29 ++++
tests/qtest/meson.build | 3 +-
tests/tcg/Makefile.target | 2 +-
tests/unit/meson.build | 2 +-
util/meson.build | 7 +-
42 files changed, 276 insertions(+), 248 deletions(-)
rename bsd-user/{ => include}/special-errno.h (100%)
rename linux-user/{ => include}/host/aarch64/host-signal.h (100%)
rename linux-user/{ => include}/host/alpha/host-signal.h (100%)
rename linux-user/{ => include}/host/arm/host-signal.h (100%)
rename linux-user/{ => include}/host/i386/host-signal.h (100%)
rename linux-user/{ => include}/host/loongarch64/host-signal.h (100%)
rename linux-user/{ => include}/host/mips/host-signal.h (100%)
rename linux-user/{ => include}/host/ppc/host-signal.h (100%)
rename linux-user/{ => include}/host/ppc64/host-signal.h (100%)
rename linux-user/{ => include}/host/riscv/host-signal.h (100%)
rename linux-user/{ => include}/host/s390/host-signal.h (100%)
rename linux-user/{ => include}/host/s390x/host-signal.h (100%)
rename linux-user/{ => include}/host/sparc/host-signal.h (100%)
rename linux-user/{ => include}/host/sparc64/host-signal.h (100%)
rename linux-user/{ => include}/host/x32/host-signal.h (100%)
rename linux-user/{ => include}/host/x86_64/host-signal.h (100%)
rename linux-user/{ => include}/special-errno.h (100%)
create mode 100755 scripts/make-config-poison.shSignature · 1 line
2.33.1
Peter Maydell
AppliedQuoted 9 lines · Paolo Bonzini
The following changes since commit
b37778b840f6dc6d1bbaf0e8e0641b3d48ad77c5:linux-user: Fix clang warning for nios2-linux-user code (2022-01-12 09:22:01 +0000)
are available in the Git repository at:
https://gitlab.com/bonzini/qemu.git tags/for-upstream
Quoted 8 lines
for you to fetch changes up to
9d30c78c7d3b994825cbe63fa277279ae3ef4248:meson: reenable filemonitor-inotify compilation (2022-01-12 14:09:06 +0100)
----------------------------------------------------------------
* configure and meson cleanups
* KVM_GET/SET_SREGS2 support for x86
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/7.0
for any user-visible changes.
-- PMM