From patchwork Tue Oct 6 12:08:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11818541 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 C44706CB for ; Tue, 6 Oct 2020 12:10:27 +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 41DB520663 for ; Tue, 6 Oct 2020 12:10:27 +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="H1XhP/OW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 41DB520663 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]:43438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPlnW-0003bt-5g for patchwork-qemu-devel@patchwork.kernel.org; Tue, 06 Oct 2020 08:10:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48860) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPlmS-0002cd-2B for qemu-devel@nongnu.org; Tue, 06 Oct 2020 08:09:20 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]:40081) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kPlmQ-0004AB-20 for qemu-devel@nongnu.org; Tue, 06 Oct 2020 08:09:19 -0400 Received: by mail-pf1-x435.google.com with SMTP id w21so8896842pfc.7 for ; Tue, 06 Oct 2020 05:09:17 -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=liAqzqJi6x0FFlXweFeNjShDJp3/OT1BsfjThbI6yqw=; b=H1XhP/OWEnAgwAKQQ62JO3GDQQwqpuu9FXlXrX0+q5zfTO+9BGN1Nqp4hq4IArw53V 8KN/XxG7B/ZaWbTBZFvMQ3tXbj1MBhCbIAYb4Y1a322uZp4NknP0tuWmZswr05gY+DwC dOPlh3hZ7eSvAtgl6SoM89zjc9MQSaqTQ6LGEehb7NlNaazZ13NU/NdmXe5Ux7v/U0vL QxQ9vTmhvoTlvYJVoU9xIzEDJxNiUXVK3bahEPep4jpb6+6tFYlUXQ6WSXZ4mM9/ea8p gllYESLQbv+ZB3ytwu6xoehTptqu+c61IuZ6POs91HKUn2ntNc5gdhkzqOkf19FWyXnJ EC8w== 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=liAqzqJi6x0FFlXweFeNjShDJp3/OT1BsfjThbI6yqw=; b=mwboi+hW0mREW32Z+iCCCMlfXsDir1ah3dB8YYQldDNk04n5500hFfH2TBLDarfrHu m0YTVF1QtnDLkDaVsQIVhhqQToA1k3C24LmR+L/W1NZxuVyZKHBgGcHwKmRm4AOBmg5c Je56hPdrQl/9t9H77aoewWLfyrt0t6ka9ZsYoK99ZTHXUeuBR+14Z02dCdXBSN3SkvHN Tds0Th1FoqerKDgAW8bbdSEp2cuzspaxvMqZYZjoZyUd8ZnPPcRzAa/LaqXzaw9eP4dC sC9qQlrQS28dKPwPylIw9pMm/MgTZV4323xYPiKyM3lxQc5WLNP1Cre39Wt2LxsCGMNv G2Zw== X-Gm-Message-State: AOAM530MsFBncxYonG+EVGkqwa9QF6RQNfEuL0Yd3to9M2JErPfbG4I5 hrU5/GdkzQ+eKq66NFkOWn58KTag3gzOmg== X-Google-Smtp-Source: ABdhPJwN5WSKLUQFSd6R69fuwldB9NlfAnOfOkRQ3zLZNT/Ux1vQhAgbh8jM/s/f/il11N+ylvKtrg== X-Received: by 2002:a63:5966:: with SMTP id j38mr3722471pgm.187.1601986155980; Tue, 06 Oct 2020 05:09:15 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id f4sm2965681pgk.19.2020.10.06.05.09.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Oct 2020 05:09:15 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v5 0/7] Enable plugin support on msys2/mingw Date: Tue, 6 Oct 2020 20:08:53 +0800 Message-Id: <20201006120900.1579-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::435; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x435.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 (7): 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. plugin: Getting qemu-plugin.h can be included in multiple source file 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