From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CED6AC27C52 for ; Wed, 5 Jun 2024 08:48:51 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEmJI-0005uo-Qm; Wed, 05 Jun 2024 04:47:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sEmJH-0005uV-B2 for qemu-devel@nongnu.org; Wed, 05 Jun 2024 04:47:55 -0400 Received: from mail-yw1-x1136.google.com ([2607:f8b0:4864:20::1136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEmJF-0001cP-C5 for qemu-devel@nongnu.org; Wed, 05 Jun 2024 04:47:55 -0400 Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-627e3368394so56173407b3.2 for ; Wed, 05 Jun 2024 01:47:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717577272; x=1718182072; darn=nongnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=rxc3CMML855BVv+uxpgbhTs+5rL63qfFjl3yEpBtKJU=; b=ftm7d4rUYNjeolSOZ8SNr716okR5k9e+yAbQQ7HYfXRqSkhZjub8yjm+tMeA8dX2ya cXFPbLNCTrbG0nJm0nUn1MbjMU7rEMPCc8hhE8ksPip3fv+J6rll0Vrj1s1wPAHATXum bm2oCDtfLMajA8BHlclCkfxrl/kMF6Yho3oHIVT5rLmFvaJfm8nIoMoIMX5qqZyhKWzh qdHNBaldNz+VnoS2BGxBanLSufjWnC5iBoohH7TfXX1dIBs5/h2nGEDr7d3om9G6nQKF sKZbAPZXegx4BJBVIomtDenPwNyxwfKQq73fSiXk2xLRt7g9337FdAA3mk4uv19NFumR ANtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717577272; x=1718182072; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rxc3CMML855BVv+uxpgbhTs+5rL63qfFjl3yEpBtKJU=; b=lzaCFfpXdOzB2nlnjUD+1yDhHMCYCRFeEwHhvV6P7IIyL/uiqNUwvsHpfMxJw6S8QX xk+SmHXcrHvG1KGN8h05y7tJy5mA2FJ57cWM3029ykqw31WdJaIrVtXjQvAOoOVR+oQB TasSGA8ghqzVdMd8C56PEK9e4mQ1orwZ1khdrKBDq0HFCzP9IC8vNFciUGBPHyO0KPo+ 6ppi9OKRxF1fJBo+pJzHMFu/O4oR/LUjl+Jk/Bex7rrtBstzjiS5jBXek4df3stRL0W3 66CF1PuQcUHag5l/+zshveLipJa9gea/gUvUgniwzkn0WCWbhQtlXCCe+ip8Mo9t+doD KCxA== X-Gm-Message-State: AOJu0YxTbtHKW1PoI2O29GJPb+35WPrui65SPi99uP+oyogUcVB/EMYL UTTw/VzzVYVzGd4GL6WTv1A35ISnZnh3feirxeMN4EMDM9iBKXb2D7Pk4AlYKK9i4g0jqz5QiME Ipdhfm8gIWEvnU9REjhalOHfC38U= X-Google-Smtp-Source: AGHT+IFya1Y5u/CX8Kl/oJKoq3ONPpeKV/NrHUO9g9BJJ7RFIq+8DMmyUEHKK0zrHFXzT/WlCV2rYqnV87tVenbjWD8= X-Received: by 2002:a81:c20a:0:b0:61b:df5:7871 with SMTP id 00721157ae682-62cbb4d9151mr17035457b3.16.1717577272033; Wed, 05 Jun 2024 01:47:52 -0700 (PDT) MIME-Version: 1.0 References: <20240604134933.220112-1-berrange@redhat.com> <20240604134933.220112-8-berrange@redhat.com> In-Reply-To: <20240604134933.220112-8-berrange@redhat.com> From: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= Date: Wed, 5 Jun 2024 12:47:39 +0400 Message-ID: Subject: Re: [PATCH 07/20] qga: move CONFIG_FSFREEZE/TRIM to be meson defined options To: =?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?= Cc: qemu-devel@nongnu.org, Thomas Huth , Konstantin Kostiuk , Michael Roth , =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= , Paolo Bonzini Content-Type: multipart/alternative; boundary="0000000000002c89cb061a209f6b" Received-SPF: pass client-ip=2607:f8b0:4864:20::1136; envelope-from=marcandre.lureau@gmail.com; helo=mail-yw1-x1136.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org --0000000000002c89cb061a209f6b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi On Tue, Jun 4, 2024 at 5:50=E2=80=AFPM Daniel P. Berrang=C3=A9 wrote: > Defining these at the meson level allows them to be used a conditional > tests in the QAPI schemas. > > Signed-off-by: Daniel P. Berrang=C3=A9 > --- > meson.build | 18 ++++++++++++++++++ > qga/commands-common.h | 9 --------- > 2 files changed, 18 insertions(+), 9 deletions(-) > > diff --git a/meson.build b/meson.build > index 6386607144..356b2a4817 100644 > --- a/meson.build > +++ b/meson.build > @@ -2141,6 +2141,22 @@ have_virtfs_proxy_helper =3D > get_option('virtfs_proxy_helper') \ > .require(libcap_ng.found(), error_message: 'the virtfs proxy helper > requires libcap-ng') \ > .allowed() > > +qga_fsfreeze =3D false > +qga_fstrim =3D false > +if host_os =3D=3D 'windows' > + qga_fsfreeze =3D true > + qga_fstrim =3D true > The hook code in qga/main.c compiles for win32, but it is not used. Did you intentionally enabled that? +elif host_os =3D=3D 'linux' > + if cc.has_header_symbol('linux/fs.h', 'FIFREEZE') > + qga_fsfreeze =3D true > + endif > + if cc.has_header_symbol('linux/fs.h', 'FITRIM') > + qga_fstrim =3D true > + endif > +elif host_os =3D=3D 'freebsd' and cc.has_header_symbol('ufs/ffs/fs.h', > 'UFSSUSPEND') > + qga_fsfreeze =3D true > +endif > + > if get_option('block_drv_ro_whitelist') =3D=3D '' > config_host_data.set('CONFIG_BDRV_RO_WHITELIST', '') > else > @@ -2375,6 +2391,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 > -#ifdef FIFREEZE > -#define CONFIG_FSFREEZE > -#endif > -#ifdef FITRIM > -#define CONFIG_FSTRIM > -#endif > #endif /* __linux__ */ > > #ifdef __FreeBSD__ > #include > -#ifdef UFSSUSPEND > -#define CONFIG_FSFREEZE > -#endif > #endif /* __FreeBSD__ */ > > #if defined(CONFIG_FSFREEZE) || defined(CONFIG_FSTRIM) > -- > 2.45.1 > > > --=20 Marc-Andr=C3=A9 Lureau --0000000000002c89cb061a209f6b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

On Tue, Jun 4, 2024 at 5:50=E2=80= =AFPM Daniel P. Berrang=C3=A9 <be= rrange@redhat.com> wrote:
Defining these at the meson level allows them to be used a= conditional
tests in the QAPI schemas.

Signed-off-by: Daniel P. Berrang=C3=A9 <berrange@redhat.com>
---
=C2=A0meson.build=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 18 ++++++++++++= ++++++
=C2=A0qga/commands-common.h |=C2=A0 9 ---------
=C2=A02 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/meson.build b/meson.build
index 6386607144..356b2a4817 100644
--- a/meson.build
+++ b/meson.build
@@ -2141,6 +2141,22 @@ have_virtfs_proxy_helper =3D get_option('virtfs_= proxy_helper') \
=C2=A0 =C2=A0 =C2=A0.require(libcap_ng.found(), error_message: 'the vir= tfs proxy helper requires libcap-ng') \
=C2=A0 =C2=A0 =C2=A0.allowed()

+qga_fsfreeze =3D false
+qga_fstrim =3D false
+if host_os =3D=3D 'windows'
+=C2=A0 =C2=A0 qga_fsfreeze =3D true
+=C2=A0 =C2=A0 qga_fstrim =3D true

The = hook code in qga/main.c compiles for win32, but it is not used. Did you int= entionally enabled that?

+elif host_os =3D=3D 'linux'
+=C2=A0 =C2=A0 if cc.has_header_symbol('linux/fs.h', 'FIFREEZE&= #39;)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 qga_fsfreeze =3D true
+=C2=A0 =C2=A0 endif
+=C2=A0 =C2=A0 if cc.has_header_symbol('linux/fs.h', 'FITRIM= 9;)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 qga_fstrim =3D true
+=C2=A0 =C2=A0 endif
+elif host_os =3D=3D 'freebsd' and cc.has_header_symbol('ufs/ff= s/fs.h', 'UFSSUSPEND')
+=C2=A0 =C2=A0 qga_fsfreeze =3D true
+endif
+
=C2=A0if get_option('block_drv_ro_whitelist') =3D=3D ''
=C2=A0 =C2=A0config_host_data.set('CONFIG_BDRV_RO_WHITELIST', '= ')
=C2=A0else
@@ -2375,6 +2391,8 @@ config_host_data.set('CONFIG_DEBUG_TCG', get_= option('debug_tcg'))
=C2=A0config_host_data.set('CONFIG_DEBUG_REMAP', get_option('de= bug_remap'))
=C2=A0config_host_data.set('CONFIG_QOM_CAST_DEBUG', get_option('= ;qom_cast_debug'))
=C2=A0config_host_data.set('CONFIG_REPLICATION', get_option('re= plication').allowed())
+config_host_data.set('CONFIG_FSFREEZE', qga_fsfreeze)
+config_host_data.set('CONFIG_FSTRIM', qga_fstrim)

=C2=A0# has_header
=C2=A0config_host_data.set('CONFIG_EPOLL', cc.has_header('sys/e= poll.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 @@

=C2=A0#if defined(__linux__)
=C2=A0#include <linux/fs.h>
-#ifdef FIFREEZE
-#define CONFIG_FSFREEZE
-#endif
-#ifdef FITRIM
-#define CONFIG_FSTRIM
-#endif
=C2=A0#endif /* __linux__ */

=C2=A0#ifdef __FreeBSD__
=C2=A0#include <ufs/ffs/fs.h>
-#ifdef UFSSUSPEND
-#define CONFIG_FSFREEZE
-#endif
=C2=A0#endif /* __FreeBSD__ */

=C2=A0#if defined(CONFIG_FSFREEZE) || defined(CONFIG_FSTRIM)
--
2.45.1




--
Marc-Andr=C3= =A9 Lureau
--0000000000002c89cb061a209f6b--