From patchwork Mon Oct 5 16:28:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11817019 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7D5BD139A for ; Mon, 5 Oct 2020 16:29:24 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 43F0120756 for ; Mon, 5 Oct 2020 16:29:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RL0UDXRu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 43F0120756 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:39488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPTMZ-0000FA-9u for patchwork-qemu-devel@patchwork.kernel.org; Mon, 05 Oct 2020 12:29:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40570) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPTLd-0007S8-8a for qemu-devel@nongnu.org; Mon, 05 Oct 2020 12:28:25 -0400 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]:37136) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kPTLb-0006o4-MP for qemu-devel@nongnu.org; Mon, 05 Oct 2020 12:28:24 -0400 Received: by mail-pj1-x102c.google.com with SMTP id kk9so77221pjb.2 for ; Mon, 05 Oct 2020 09:28:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uqucitEH4/4+GS3KmukO0nlTVwKYBiH1PWiLYzxk3YM=; b=RL0UDXRuizz+aWjp1ng2Y1riRG1furOoFYce5B8k1088jongDp6tfLBvREwV3WkaB0 IhcM0p9C2VE4tXcfIGE31zLZeIuIutm8ieW5ZABAoBB6mkDL92FXmccnhTihb7WDOwOz Zu7BO4qtZAtfNc777YmHDXyjHjaxUosGaueK1yT9jwq9nMHJ2EjzYmwWJ/rNPMOfVbjn NTbEDHDaAc/yrKk1Kg3pXlf8DEdN8wFphWNrwbuDhjzXyTNxOSRsbgIszhVmpUt7IOPO Mlfxd5lyOKvVtkO4/YnyR4O1PP/DgXMMOE32qC5I+RP8WEO46xIgT/y3c3MerGbfY9bj cQtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uqucitEH4/4+GS3KmukO0nlTVwKYBiH1PWiLYzxk3YM=; b=VsPzXRQdjK0uFO8FpgswqcxN6IMgRG4s+Hv91IheUEqZYrjByNUb/0JJ44PJmjaXr0 Ukv+bXFFng2JMFPbyfJA5690HjDpZhR1wWtlWl81QC3NeOw/sGLO758AppBuULYxiISP gXY6EzIM9sxyXESvbY7L8u2pvxpVekjQYcBAbWzPTzmp4HuvyfBw8Axs8muAgbT1Noww ApxXCrcRVMah68qMH3nF7RCnJEFOcb/ossZ6mhJ6JSKofV9BLaCp9N6wyt/0IacdpuUT q/OiZA2bzinmQz8FYFPmeXlzh4BJc81yjXdvskhGHUXSDM/8c//rjspr9UGzm8x3rI7F AY7Q== X-Gm-Message-State: AOAM531cGAlald5Q02TdTh4IB3p6R8iRp63t4d1b9R0V3+OHp9C4IU1y ozgfOWydKVFPGNDdZys48p4EIpa/x+W2Lw== X-Google-Smtp-Source: ABdhPJywz6sdmuk5Cx+GUrs5uFJbvruPte2mQ9hxexBKp4XQaLOY7gObpG3zRorfuVuGQgMVLObcnw== X-Received: by 2002:a17:90a:e697:: with SMTP id s23mr228554pjy.16.1601915301419; Mon, 05 Oct 2020 09:28:21 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id x13sm374725pfj.199.2020.10.05.09.28.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Oct 2020 09:28:20 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v4 0/6] Enable plugin support on msys2/mingw Date: Tue, 6 Oct 2020 00:28:00 +0800 Message-Id: <20201005162806.1350-1-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=luoyonggang@gmail.com; helo=mail-pj1-x102c.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Paolo Bonzini , Yonggang Luo , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" V3-V4 Split plugin: Fixes typo in qemu-plugin.h out Trying to explain the design of plugin: Getting qemu-plugin works under win32. V1-V2 1. Fixes review comments 2. Increase QEMU_PLUGIN_VERSION to 1 for compat QEMU_PLUGIN_VERSION 0 3. Revise the loader to support for version 0 and 1 4. By export function qemu_plugin_initialize in plugin, and call it in loader= , so we have no need call it in every plugin. And also provide a standard implem= entation, anyway, use can also override it. Add this feature on msys2/mingw by using glib provided cross-platform dlsym f= unctional. Yonggang Luo (6): plugins: Fixes a issue when dlsym failed, the handle not closed plugin: Fixes compiling errors on msys2/mingw plugin: getting qemu_plugin_get_hwaddr only expose one function prototype plugin: Fixes typo in qemu-plugin.h plugin: Getting qemu-plugin works under win32. cirrus: Enable plugin in cirrus for windows .cirrus.yml | 3 +- Makefile | 1 - configure | 71 ------------- contrib/plugins/hotblocks.c | 3 +- contrib/plugins/hotpages.c | 1 + contrib/plugins/howvec.c | 1 + contrib/plugins/lockstep.c | 1 + include/qemu/qemu-plugin.h | 197 +++++++++++++++++++++++++++-------- meson.build | 6 +- plugins/api.c | 76 +++++++------- plugins/core.c | 16 ++- plugins/loader.c | 51 ++++++++- plugins/meson.build | 10 +- plugins/plugin.h | 1 + plugins/qemu-plugins.symbols | 40 ------- tests/plugin/bb.c | 5 +- tests/plugin/empty.c | 1 + tests/plugin/insn.c | 1 + tests/plugin/mem.c | 1 + 19 files changed, 272 insertions(+), 214 deletions(-) delete mode 100644 plugins/qemu-plugins.symbols --=20 2.28.0.windows.1