qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Konstantin Kostiuk <kkostiuk@redhat.com>
To: qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: [PULL 07/25] qga: move CONFIG_FSFREEZE/TRIM to be meson defined options
Date: Mon, 22 Jul 2024 10:01:04 +0300	[thread overview]
Message-ID: <20240722070122.27615-8-kkostiuk@redhat.com> (raw)
In-Reply-To: <20240722070122.27615-1-kkostiuk@redhat.com>

From: Daniel P. Berrangé <berrange@redhat.com>

Defining these at the meson level allows them to be used a conditional
tests in the QAPI schemas.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240712132459.3974109-8-berrange@redhat.com>
Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
---
 meson.build           | 15 +++++++++++++++
 qga/commands-common.h |  9 ---------
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/meson.build b/meson.build
index a1e51277b0..83f9728524 100644
--- a/meson.build
+++ b/meson.build
@@ -2187,6 +2187,19 @@ have_virtfs_proxy_helper = get_option('virtfs_proxy_helper') \
     .require(libcap_ng.found(), error_message: 'the virtfs proxy helper requires libcap-ng') \
     .allowed()
 
+qga_fsfreeze = false
+qga_fstrim = false
+if host_os == 'linux'
+    if cc.has_header_symbol('linux/fs.h', 'FIFREEZE')
+        qga_fsfreeze = true
+    endif
+    if cc.has_header_symbol('linux/fs.h', 'FITRIM')
+        qga_fstrim = true
+    endif
+elif host_os == 'freebsd' and cc.has_header_symbol('ufs/ffs/fs.h', 'UFSSUSPEND')
+    qga_fsfreeze = true
+endif
+
 if get_option('block_drv_ro_whitelist') == ''
   config_host_data.set('CONFIG_BDRV_RO_WHITELIST', '')
 else
@@ -2423,6 +2436,8 @@ config_host_data.set('CONFIG_DEBUG_TCG', get_option('debug_tcg'))
 config_host_data.set('CONFIG_DEBUG_REMAP', get_option('debug_remap'))
 config_host_data.set('CONFIG_QOM_CAST_DEBUG', get_option('qom_cast_debug'))
 config_host_data.set('CONFIG_REPLICATION', get_option('replication').allowed())
+config_host_data.set('CONFIG_FSFREEZE', qga_fsfreeze)
+config_host_data.set('CONFIG_FSTRIM', qga_fstrim)
 
 # has_header
 config_host_data.set('CONFIG_EPOLL', cc.has_header('sys/epoll.h'))
diff --git a/qga/commands-common.h b/qga/commands-common.h
index 8c1c56aac9..263e7c0525 100644
--- a/qga/commands-common.h
+++ b/qga/commands-common.h
@@ -15,19 +15,10 @@
 
 #if defined(__linux__)
 #include <linux/fs.h>
-#ifdef FIFREEZE
-#define CONFIG_FSFREEZE
-#endif
-#ifdef FITRIM
-#define CONFIG_FSTRIM
-#endif
 #endif /* __linux__ */
 
 #ifdef __FreeBSD__
 #include <ufs/ffs/fs.h>
-#ifdef UFSSUSPEND
-#define CONFIG_FSFREEZE
-#endif
 #endif /* __FreeBSD__ */
 
 #if defined(CONFIG_FSFREEZE) || defined(CONFIG_FSTRIM)
-- 
2.45.2



  parent reply	other threads:[~2024-07-22  7:04 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-22  7:00 [PULL 00/25] Misc QEMU-GA patches 2024-07-22 Konstantin Kostiuk
2024-07-22  7:00 ` [PULL 01/25] qga: drop blocking of guest-get-memory-block-size command Konstantin Kostiuk
2024-07-22  7:00 ` [PULL 02/25] qga: move linux vcpu command impls to commands-linux.c Konstantin Kostiuk
2024-07-22  7:01 ` [PULL 03/25] qga: move linux suspend " Konstantin Kostiuk
2024-07-22  7:01 ` [PULL 04/25] qga: move linux fs/disk " Konstantin Kostiuk
2024-07-22  7:01 ` [PULL 05/25] qga: move linux disk/cpu stats " Konstantin Kostiuk
2024-07-22  7:01 ` [PULL 06/25] qga: move linux memory block " Konstantin Kostiuk
2024-07-22  7:01 ` Konstantin Kostiuk [this message]
2024-07-22  7:01 ` [PULL 08/25] qga: conditionalize schema for commands unsupported on Windows Konstantin Kostiuk
2024-07-22  7:01 ` [PULL 09/25] qga: conditionalize schema for commands unsupported on non-Linux POSIX Konstantin Kostiuk
2024-07-22  7:01 ` [PULL 10/25] qga: conditionalize schema for commands requiring getifaddrs Konstantin Kostiuk
2024-07-22  7:01 ` [PULL 11/25] qga: conditionalize schema for commands requiring linux/win32 Konstantin Kostiuk
2024-07-22  7:01 ` [PULL 12/25] qga: conditionalize schema for commands only supported on Windows Konstantin Kostiuk
2024-07-22  7:01 ` [PULL 13/25] qga: conditionalize schema for commands requiring fsfreeze Konstantin Kostiuk
2024-07-22  7:01 ` [PULL 14/25] qga: conditionalize schema for commands requiring fstrim Konstantin Kostiuk
2024-07-22  7:01 ` [PULL 15/25] qga: conditionalize schema for commands requiring libudev Konstantin Kostiuk
2024-07-22  7:01 ` [PULL 16/25] qga: conditionalize schema for commands requiring utmpx Konstantin Kostiuk
2024-07-22  7:01 ` [PULL 17/25] qga: conditionalize schema for commands not supported on other UNIX Konstantin Kostiuk
2024-07-22  7:01 ` [PULL 18/25] qga: don't disable fsfreeze commands if vss_init fails Konstantin Kostiuk
2024-07-22  7:01 ` [PULL 19/25] qga: move declare of QGAConfig struct to top of file Konstantin Kostiuk
2024-07-22  7:01 ` [PULL 20/25] qga: remove pointless 'blockrpcs_key' variable Konstantin Kostiuk
2024-07-22  7:01 ` [PULL 21/25] qga: allow configuration file path via the cli Konstantin Kostiuk
2024-07-22  7:01 ` [PULL 22/25] qga: centralize logic for disabling/enabling commands Konstantin Kostiuk
2024-07-22  7:01 ` [PULL 23/25] qga/commands-posix: Make ga_wait_child() return boolean Konstantin Kostiuk
2024-07-22  7:01 ` [PULL 24/25] guest-agent: document allow-rpcs in config file section Konstantin Kostiuk
2024-07-22  7:01 ` [PULL 25/25] qga/linux: Add new api 'guest-network-get-route' Konstantin Kostiuk
2024-07-22 22:26 ` [PULL 00/25] Misc QEMU-GA patches 2024-07-22 Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240722070122.27615-8-kkostiuk@redhat.com \
    --to=kkostiuk@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).