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 6C734C433EF for ; Tue, 12 Jul 2022 15:06:07 +0000 (UTC) Received: from localhost ([::1]:39344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBHSg-0003wk-9u for qemu-devel@archiver.kernel.org; Tue, 12 Jul 2022 11:06:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35746) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBHNE-0000xN-90 for qemu-devel@nongnu.org; Tue, 12 Jul 2022 11:00:28 -0400 Received: from mail-vs1-xe34.google.com ([2607:f8b0:4864:20::e34]:38417) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oBHNC-0003s4-HH for qemu-devel@nongnu.org; Tue, 12 Jul 2022 11:00:28 -0400 Received: by mail-vs1-xe34.google.com with SMTP id k2so8063733vsc.5 for ; Tue, 12 Jul 2022 08:00:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ig0DW22a6HJraWUZcXC1C2HS+YYiaLjEPXbYvFDDjV4=; b=fbXRSu3QnfmQR5jJVNI3EGWpPV7cQnL2WuW6f14C7lLD4ffcA26otp4bBDkNopeT3B MAe5fqirql08WcrjO2kK2GcS0yV6LJj+HY+sYbteQHiBBxoq0kRrLG984uCMrNjwCrto waUAiHMSgcbwYRSAt+m9gWJYQRvgiQfzbgedPNh+WaGUyNWxPnxjaTh4mXkpxaJd13kf 2yuiQ6A5Der6j+ufZLRL7XbsFdOAq/tgsArB2zeOrsIifeXSDno9CYHqAgu6H4oH7+s1 C/pKLT+0mjUsa2aU4dm0h8HVHdjL82lD4ZjRPuYUW35fDV0/ZQR6fIo3/I7/cyUcLBwI +lDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ig0DW22a6HJraWUZcXC1C2HS+YYiaLjEPXbYvFDDjV4=; b=Mt93IquiG7lXEQbXuec8BDM5ugZ0hDwXtWxU/DRUjq1JeHPFRYUBw10bG1otgAu0IZ /OjihHmxxfxtSAZztmxU1Iw1+2aUgC2u3ReUvSQI94t++APOANQmZwHqxHYzwOtsFbnp WYnf6vWy7fnzq5d4Yl5UAnFSlO6hdWQyX6x0dw7ndGCG4e/oSPHFKXAPpvhyeEReFGIb Y6xOU4522IH4z2qS/V3k7RfMArosyrNXV8uZEVxFL3EndRN86CG510LNicOhg0k4WKRz VwbIK0BGsziG/pvbGINWADpMradydxQYMsTCHGxxId8weYoMLGiwC66YsqJfF4NKL8QD AwxQ== X-Gm-Message-State: AJIora/SJC9WR0NNB8Wgccb2ae5PC43Wtyggqo5aAoN9hsuR1Dz8PgWV 4Y8rmAtJSXsIuktEeQ+AIH3/VMsuINSudPqbU8DFEQ== X-Google-Smtp-Source: AGRyM1sIx9kCe1PPc/qw0PlzYIaioQu4+UB3kQj5hWrH+pr6IA7AkjYEDizzXz4+M4UZnggTdHvnv+LyGE9nNe4iD44= X-Received: by 2002:a05:6102:346:b0:357:79f5:63ae with SMTP id e6-20020a056102034600b0035779f563aemr1495207vsa.40.1657638025352; Tue, 12 Jul 2022 08:00:25 -0700 (PDT) MIME-Version: 1.0 References: <20220712093528.4144184-1-marcandre.lureau@redhat.com> <20220712093528.4144184-13-marcandre.lureau@redhat.com> In-Reply-To: <20220712093528.4144184-13-marcandre.lureau@redhat.com> From: Warner Losh Date: Tue, 12 Jul 2022 09:00:14 -0600 Message-ID: Subject: Re: [PATCH v2 12/15] qemu-common: move glib-compat.h To: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= Cc: QEMU Developers , Eric Blake , Cleber Rosa , "open list:Block layer core" , Paolo Bonzini , Xie Yongji , Kyle Evans , Peter Maydell , John Snow , Michael Roth , Kevin Wolf , "Dr. David Alan Gilbert" , Markus Armbruster , Vladimir Sementsov-Ogievskiy , Laurent Vivier , Fam Zheng , Hanna Reitz Content-Type: multipart/alternative; boundary="000000000000aaeb6305e39cedcd" Received-SPF: none client-ip=2607:f8b0:4864:20::e34; envelope-from=wlosh@bsdimp.com; helo=mail-vs1-xe34.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=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" --000000000000aaeb6305e39cedcd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jul 12, 2022 at 3:37 AM wrote: > From: Marc-Andr=C3=A9 Lureau > > qemu-common will have compatible dependency requirements with QEMU. > > Since qemu-common won't have a toplevel qemu/osdep.h which would include > various system headers, include stdbool.h (bool is used for some > declarations here). > > Replace getenv() with g_getenv() to avoid extra header inclusion. > > Signed-off-by: Marc-Andr=C3=A9 Lureau > --- > {include =3D> subprojects/qemu-common/include}/glib-compat.h | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > rename {include =3D> subprojects/qemu-common/include}/glib-compat.h (97%= ) > Reviewed-by: Warner Losh > > diff --git a/include/glib-compat.h > b/subprojects/qemu-common/include/glib-compat.h > similarity index 97% > rename from include/glib-compat.h > rename to subprojects/qemu-common/include/glib-compat.h > index 43a562974d80..2b0f2962f322 100644 > --- a/include/glib-compat.h > +++ b/subprojects/qemu-common/include/glib-compat.h > @@ -30,6 +30,8 @@ > #pragma GCC diagnostic ignored "-Wdeprecated-declarations" > > #include > +#include > + > #if defined(G_OS_UNIX) > #include > #include > @@ -133,7 +135,7 @@ qemu_g_test_slow(void) > { > static int cached =3D -1; > if (cached =3D=3D -1) { > - cached =3D g_test_slow() || getenv("G_TEST_SLOW") !=3D NULL; > + cached =3D g_test_slow() || g_getenv("G_TEST_SLOW") !=3D NULL; > } > return cached; > } > -- > 2.37.0.rc0 > > --000000000000aaeb6305e39cedcd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Tue, Jul 12, 2022 at 3:37 AM <<= a href=3D"mailto:marcandre.lureau@redhat.com">marcandre.lureau@redhat.com> wrote:
Fr= om: Marc-Andr=C3=A9 Lureau <marcandre.lureau@redhat.com>

qemu-common will have compatible dependency requirements with QEMU.

Since qemu-common won't have a toplevel qemu/osdep.h which would includ= e
various system headers, include stdbool.h (bool is used for some
declarations here).

Replace getenv() with g_getenv() to avoid extra header inclusion.

Signed-off-by: Marc-Andr=C3=A9 Lureau <marcandre.lureau@redhat.com>
---
=C2=A0{include =3D> subprojects/qemu-common/include}/glib-compat.h | 4 += ++-
=C2=A01 file changed, 3 insertions(+), 1 deletion(-)
=C2=A0rename {include =3D> subprojects/qemu-common/include}/glib-compat.= h (97%)

Reviewed-by: Warner Losh <imp@bsdimp.com>
=C2=A0

diff --git a/include/glib-compat.h b/subprojects/qemu-common/include/glib-c= ompat.h
similarity index 97%
rename from include/glib-compat.h
rename to subprojects/qemu-common/include/glib-compat.h
index 43a562974d80..2b0f2962f322 100644
--- a/include/glib-compat.h
+++ b/subprojects/qemu-common/include/glib-compat.h
@@ -30,6 +30,8 @@
=C2=A0#pragma GCC diagnostic ignored "-Wdeprecated-declarations"<= br>
=C2=A0#include <glib.h>
+#include <stdbool.h>
+
=C2=A0#if defined(G_OS_UNIX)
=C2=A0#include <glib-unix.h>
=C2=A0#include <sys/types.h>
@@ -133,7 +135,7 @@ qemu_g_test_slow(void)
=C2=A0{
=C2=A0 =C2=A0 =C2=A0static int cached =3D -1;
=C2=A0 =C2=A0 =C2=A0if (cached =3D=3D -1) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 cached =3D g_test_slow() || getenv("G_TES= T_SLOW") !=3D NULL;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 cached =3D g_test_slow() || g_getenv("G_T= EST_SLOW") !=3D NULL;
=C2=A0 =C2=A0 =C2=A0}
=C2=A0 =C2=A0 =C2=A0return cached;
=C2=A0}
--
2.37.0.rc0

--000000000000aaeb6305e39cedcd--