From nobody Sun Nov 24 16:52:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1722356709; cv=none; d=zohomail.com; s=zohoarc; b=IkM4d7QJzn80rvZiwvbJLBHjNos6Ou2zpi0aFfWWyr/VJNiDipr+3TcPZzYPrh3NjstDarx5XeWGFpSMU1SqwMmvZNoDERvB+a1Xf5RyxJ/xAfGoNfNdI04lptXJzQqeUePW2Yo7riOBpOWiKcyZ4ngIjHLhvSymo0OMFzUpGNg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722356709; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=AUsqRXTeW3XYv9I38g7wul3S13NoPU/K/kBqTz9dI9c=; b=KKbj+xKWFX2Yn/f+IFbywH0UwEnQh3FY3j+JIej53ciGydosxTlQQHL29ZvjM4gjey7ovRo1f3Uil/+r3guatSOOSSG0S+cd59FfPbGPV874n+7sc+R0330U4Za7ph2kbgT2U2lS0EIgt/gGQAfHHQ4Ip6LTYh31meFck1Szz9s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722356709017915.4319332978406; Tue, 30 Jul 2024 09:25:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sYpch-00008Z-E1; Tue, 30 Jul 2024 12:22:51 -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 1sYpcg-0008VR-Cd for qemu-devel@nongnu.org; Tue, 30 Jul 2024 12:22:50 -0400 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sYpce-0003Yw-MP for qemu-devel@nongnu.org; Tue, 30 Jul 2024 12:22:50 -0400 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-a7ac469e4c4so5072566b.0 for ; Tue, 30 Jul 2024 09:22:48 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7acad411bcsm655186466b.109.2024.07.30.09.22.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jul 2024 09:22:45 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 1AB8A5FA0F; Tue, 30 Jul 2024 17:22:39 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722356567; x=1722961367; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AUsqRXTeW3XYv9I38g7wul3S13NoPU/K/kBqTz9dI9c=; b=vWppsQGgXHW3oQ6/lKX6BZudG7Y8hA2XpcOhpaxA27HEr8j+eoW2wIPG/OAK8AhsoE YCSTD+00v3Al3rsgqWgvxDC9wn6pqP/mr3X/50XiJkjKzmJlTb12ocIg/jTcCbS/Thrl 5evHY2xXb3VatZ659UCM0lOnv3j3zNG80TpC1vzzTMlki4Fke6oH2JPEAh/GBHNuo5sL lTDPe3AlTX28imCtIHWdzFYWS/Egh6mEyaiMCDJryGl5atiUY99P2PehlOku4RDTUJRX xdc6bh9oMvIOGAPHurBybm+HlZWtdg53PS2KXqOrsFz9QFblvVnTTcECh7BQ9e19DWBe TowQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722356567; x=1722961367; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AUsqRXTeW3XYv9I38g7wul3S13NoPU/K/kBqTz9dI9c=; b=rjz0XvuTVJF0WV5S/L01isTGCLCPVBQH5x0yZo2Vq5DOJn0LdxFL81HRbThd6f4acC 4OurimzSOI4691/Ww7XsuxrnhNYlCiGnVMiB+GSXdpgLuJ8tlN/foGpN681XA/Qv7kyl i54Kam3QZLu9ypkGWDYuN1jNS9EuhJRYGlr54AYTJwR9Zf5DWXaKKGZYNyCkQQnlYXMV 4iJx9c3hLJ2ePHboewKsnMHUNG48O7vKy+/QiicS6tOHWBMsSgMonGOLvXbIJpbfTnRN K2gG3z9xkDioDiVjRirfYa3e9Deq/cWw/3ZlTwvM2bBjsdnVOL842vYFX8D9Arh0q8ke cHZQ== X-Gm-Message-State: AOJu0YygrqgePLGOAm9FMzDwrHPbtA7uiea4Ho4dbXqPQcZReqSdTEG+ bgEZLH7ToHksUZqpdYTXvTQLWPAZySM0c0dh3lHHj3SGQBS4mvcm5nP+uubjgrY= X-Google-Smtp-Source: AGHT+IEemkYjxqr397Z5iEE5jkEbUAkPbEgoV8UFaCxLXwBdWOC1YI29FMc8YSHOQVwwXCBQ47RKkA== X-Received: by 2002:a17:907:3fa5:b0:a7a:bae8:f2b5 with SMTP id a640c23a62f3a-a7d85a9b845mr309430166b.36.1722356566935; Tue, 30 Jul 2024 09:22:46 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Alexandre Iooss , Mahmoud Mandour , Pierrick Bouvier Subject: [PULL 13/14] contrib/plugins: add compat for g_memdup2 Date: Tue, 30 Jul 2024 17:22:36 +0100 Message-Id: <20240730162237.1425515-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240730162237.1425515-1-alex.bennee@linaro.org> References: <20240730162237.1425515-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x631.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1722356709594116600 We were premature if bumping this because some of our builds are still on older glibs. Just copy the compat handler for now and we can remove it later. Fixes: ee293103b0 (plugins: update lockstep to use g_memdup2) Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2161 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Alex Benn=C3=A9e Message-Id: <20240729144414.830369-14-alex.bennee@linaro.org> diff --git a/contrib/plugins/lockstep.c b/contrib/plugins/lockstep.c index 6a7e9bbb39..62981d4e09 100644 --- a/contrib/plugins/lockstep.c +++ b/contrib/plugins/lockstep.c @@ -101,6 +101,31 @@ static void plugin_exit(qemu_plugin_id_t id, void *p) plugin_cleanup(id); } =20 +/* + * g_memdup has been deprecated in Glib since 2.68 and + * will complain about it if you try to use it. However until + * glib_req_ver for QEMU is bumped we make a copy of the glib-compat + * handler. + */ +static inline gpointer g_memdup2_qemu(gconstpointer mem, gsize byte_size) +{ +#if GLIB_CHECK_VERSION(2, 68, 0) + return g_memdup2(mem, byte_size); +#else + gpointer new_mem; + + if (mem && byte_size !=3D 0) { + new_mem =3D g_malloc(byte_size); + memcpy(new_mem, mem, byte_size); + } else { + new_mem =3D NULL; + } + + return new_mem; +#endif +} +#define g_memdup2(m, s) g_memdup2_qemu(m, s) + static void report_divergance(ExecState *us, ExecState *them) { DivergeState divrec =3D { log, 0 }; --=20 2.39.2