qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/4] Move CONFIG_XFS handling to meson.build


From: Thomas Huth
Subject: Re: [PATCH 3/4] Move CONFIG_XFS handling to meson.build
Date: Fri, 10 Dec 2021 09:46:39 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0

On 10/12/2021 09.39, Paolo Bonzini wrote:
On 12/10/21 08:53, Thomas Huth wrote:
On 02/11/2021 12.34, Paolo Bonzini wrote:
On 28/10/21 20:59, Thomas Huth wrote:
Checking for xfsctl() can be done more easily in meson.build. Also,
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".
Let's rather treat this like the other cc.has_function() checks in
meson.build, i.e. don't add a new option for this in meson_options.txt.

Signed-off-by: Thomas Huth <thuth@redhat.com>

I think we should just use ioctl and copy the relevant definitions from Linux:

struct dioattr {
         u32           d_mem;          /* data buffer memory alignment */
         u32           d_miniosz;      /* min xfer size                */
         u32           d_maxiosz;      /* max xfer size                */
};

#define XFS_IOC_DIOINFO        _IOR ('X', 30, struct dioattr)

I've now had a closer look at this idea, but it's getting messy: We'd additionally also need the platform_test_xfs_fd() function that is called from file-posix.c ...

platform_test_xfs_fd() is only used to decide whether to invoke XFS_IOC_DIOINFO; but failures of XFS_IOC_DIOINFO are ignored anyway, so we can get rid of is_xfs in BDRVRawState, too.

After staring at the code for a while, I wonder why we're not simply using fstat() here instead to get the st_blksize value... wouldn't that be better anyway since it also works with other file system types?

 Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]