From patchwork Tue May 21 15:15:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Qiang X-Patchwork-Id: 1102882 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=163.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=163.com header.i=@163.com header.b="AbmPP46Z"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 457fXL6Gdtz9s6w for ; Wed, 22 May 2019 01:17:54 +1000 (AEST) Received: from localhost ([127.0.0.1]:55390 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hT6WW-0007X9-8q for incoming@patchwork.ozlabs.org; Tue, 21 May 2019 11:17:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54097) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hT6VR-0007Vt-3y for qemu-devel@nongnu.org; Tue, 21 May 2019 11:16:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hT6VQ-0001ZG-80 for qemu-devel@nongnu.org; Tue, 21 May 2019 11:16:45 -0400 Received: from m12-16.163.com ([220.181.12.16]:57269) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hT6VO-0001Uo-PE; Tue, 21 May 2019 11:16:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=YF+Y59FtV25KxIFj7L w31u+auxIodjqyp94VvLhiljw=; b=AbmPP46ZNC6kq1swgcEN4Bg//Iz7uX+Aaz +MxS1DZUWXy4w9daecrullGfR1Q0tOHHKzTGj6x/1bhEGdPzksiWxUaLzyQYzTWk R/vv3ODPFf1hzSpYOTNC6tVS3Za7UoqPGnt/9osDO0G8M0xvx5+BKB4TmHm3jN1f lFTSYlefk= Received: from localhost.localdomain (unknown [115.192.71.0]) by smtp12 (Coremail) with SMTP id EMCowAC31lxJFuRcie7uGw--.4521S3; Tue, 21 May 2019 23:16:29 +0800 (CST) From: Li Qiang To: alex.williamson@redhat.com, lvivier@redhat.com Date: Tue, 21 May 2019 08:15:40 -0700 Message-Id: <20190521151543.92274-2-liq3ea@163.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190521151543.92274-1-liq3ea@163.com> References: <20190521151543.92274-1-liq3ea@163.com> X-CM-TRANSID: EMCowAC31lxJFuRcie7uGw--.4521S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7Xw1xXF48ZrWDCFWrXw13Arb_yoWkKwcEy3 ZrZw4v9wn5Cay3KwsrZa43Cw48Aw4YqF4kJ34rtrs2yr4UJFs8CryDArn7Zr1fur4fAry8 Grs2qr13Kry3KjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUbrOzDUUUUU== X-Originating-IP: [115.192.71.0] X-CM-SenderInfo: 5oltjvrd6rljoofrz/1tbiTw27bVsGPbUeDAAAsT X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 220.181.12.16 Subject: [Qemu-devel] [PATCH v2 1/4] vfio: pci: make "vfio-pci-nohotplug" as MACRO X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, philmd@redhat.com, liq3ea@gmail.com, qemu-devel@nongnu.org, Li Qiang Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The QOMConventions recommends we should use TYPE_FOO for a TypeInfo's name. Though "vfio-pci-nohotplug" is not used in other parts, for consistency we should make this change. CC: qemu-trivial@nongnu.org Signed-off-by: Li Qiang --- hw/vfio/pci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 8cecb53d5c..08729e5875 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -40,6 +40,8 @@ #define TYPE_VFIO_PCI "vfio-pci" #define PCI_VFIO(obj) OBJECT_CHECK(VFIOPCIDevice, obj, TYPE_VFIO_PCI) +#define TYPE_VIFO_PCI_NOHOTPLUG "vfio-pci-nohotplug" + static void vfio_disable_interrupts(VFIOPCIDevice *vdev); static void vfio_mmap_set_enabled(VFIOPCIDevice *vdev, bool enabled); @@ -3304,8 +3306,8 @@ static void vfio_pci_nohotplug_dev_class_init(ObjectClass *klass, void *data) } static const TypeInfo vfio_pci_nohotplug_dev_info = { - .name = "vfio-pci-nohotplug", - .parent = "vfio-pci", + .name = TYPE_VIFO_PCI_NOHOTPLUG, + .parent = TYPE_VFIO_PCI, .instance_size = sizeof(VFIOPCIDevice), .class_init = vfio_pci_nohotplug_dev_class_init, }; From patchwork Tue May 21 15:15:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Qiang X-Patchwork-Id: 1102888 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=163.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=163.com header.i=@163.com header.b="d0Eb1yX2"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 457fd859myz9s6w for ; Wed, 22 May 2019 01:22:04 +1000 (AEST) Received: from localhost ([127.0.0.1]:55465 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hT6aY-0002Fx-Kp for incoming@patchwork.ozlabs.org; Tue, 21 May 2019 11:22:02 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54099) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hT6VR-0007Vw-4Z for qemu-devel@nongnu.org; Tue, 21 May 2019 11:16:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hT6VQ-0001Z5-2c for qemu-devel@nongnu.org; Tue, 21 May 2019 11:16:45 -0400 Received: from m12-16.163.com ([220.181.12.16]:57272) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hT6VP-0001Un-1W; Tue, 21 May 2019 11:16:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=UttzqMXxBg3C9gsY9v k62bseHEktjhLCwusQrF5t6iU=; b=d0Eb1yX2cEeDo3yIo2BrterEh+AAV6fDzV VTRe/lWxAmdG9E5Zwi5PAZs6gffxwxxyK+yxSdxIvZc2pDcFuHt1QD8W0q1OBria ZPZ8OmzX0kbT4q85tYlyahUrLO7vh+Q9CG+UcE/4OKDyD1+dxYsa6iILwY4cUTfi t9dmrfi1Q= Received: from localhost.localdomain (unknown [115.192.71.0]) by smtp12 (Coremail) with SMTP id EMCowAC31lxJFuRcie7uGw--.4521S4; Tue, 21 May 2019 23:16:33 +0800 (CST) From: Li Qiang To: alex.williamson@redhat.com, lvivier@redhat.com Date: Tue, 21 May 2019 08:15:41 -0700 Message-Id: <20190521151543.92274-3-liq3ea@163.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190521151543.92274-1-liq3ea@163.com> References: <20190521151543.92274-1-liq3ea@163.com> X-CM-TRANSID: EMCowAC31lxJFuRcie7uGw--.4521S4 X-Coremail-Antispam: 1Uf129KBjvJXoW7CFW7tFy5Wr48JFy5Kr13twb_yoW8KrykpF n7Ja4fWF1jgr4Yvw4xC3W5AFZ8GF4kG347K34kCw1ay3W5Gr17ZrWjyF4UArZ8Cry5ZFWa vF42yr4rAa1Fvr7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jcMa8UUUUU= X-Originating-IP: [115.192.71.0] X-CM-SenderInfo: 5oltjvrd6rljoofrz/xtbBaxS7bVetvgGjDgAAsB X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 220.181.12.16 Subject: [Qemu-devel] [PATCH v2 2/4] hw: vfio: drop TYPE_FOO MACRO in VMStateDescription X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, philmd@redhat.com, liq3ea@gmail.com, qemu-devel@nongnu.org, Li Qiang Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It's recommended that VMStateDescription names are decoupled from QOM type names as the latter may freely change without consideration of migration compatibility. Link: https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg02175.html CC: qemu-trivial@nongnu.org Signed-off-by: Li Qiang --- hw/vfio/amd-xgbe.c | 2 +- hw/vfio/ap.c | 2 +- hw/vfio/calxeda-xgmac.c | 2 +- hw/vfio/ccw.c | 2 +- hw/vfio/platform.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/vfio/amd-xgbe.c b/hw/vfio/amd-xgbe.c index ee64a3b4a2..1b06c0f3ea 100644 --- a/hw/vfio/amd-xgbe.c +++ b/hw/vfio/amd-xgbe.c @@ -26,7 +26,7 @@ static void amd_xgbe_realize(DeviceState *dev, Error **errp) } static const VMStateDescription vfio_platform_amd_xgbe_vmstate = { - .name = TYPE_VFIO_AMD_XGBE, + .name = "vfio-amd-xgbe", .unmigratable = 1, }; diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c index d8b79ebe53..564751650f 100644 --- a/hw/vfio/ap.c +++ b/hw/vfio/ap.c @@ -155,7 +155,7 @@ static void vfio_ap_reset(DeviceState *dev) } static const VMStateDescription vfio_ap_vmstate = { - .name = VFIO_AP_DEVICE_TYPE, + .name = "vfio-ap", .unmigratable = 1, }; diff --git a/hw/vfio/calxeda-xgmac.c b/hw/vfio/calxeda-xgmac.c index e7767c4b02..6cc608b6ca 100644 --- a/hw/vfio/calxeda-xgmac.c +++ b/hw/vfio/calxeda-xgmac.c @@ -26,7 +26,7 @@ static void calxeda_xgmac_realize(DeviceState *dev, Error **errp) } static const VMStateDescription vfio_platform_calxeda_xgmac_vmstate = { - .name = TYPE_VFIO_CALXEDA_XGMAC, + .name = "vfio-calxeda-xgmac", .unmigratable = 1, }; diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c index 31dd3a2a87..d9e39552e2 100644 --- a/hw/vfio/ccw.c +++ b/hw/vfio/ccw.c @@ -468,7 +468,7 @@ static Property vfio_ccw_properties[] = { }; static const VMStateDescription vfio_ccw_vmstate = { - .name = TYPE_VFIO_CCW, + .name = "vfio-ccw", .unmigratable = 1, }; diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index 398db38f14..e59a0234dd 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -697,7 +697,7 @@ out: } static const VMStateDescription vfio_platform_vmstate = { - .name = TYPE_VFIO_PLATFORM, + .name = "vfio-platform", .unmigratable = 1, }; From patchwork Tue May 21 15:15:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Qiang X-Patchwork-Id: 1102884 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=163.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=163.com header.i=@163.com header.b="gm/NhhWA"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 457fYf6FHhz9s6w for ; Wed, 22 May 2019 01:19:02 +1000 (AEST) Received: from localhost ([127.0.0.1]:55406 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hT6Xc-0008KL-QO for incoming@patchwork.ozlabs.org; Tue, 21 May 2019 11:19:00 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54074) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hT6VQ-0007VV-C6 for qemu-devel@nongnu.org; Tue, 21 May 2019 11:16:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hT6VP-0001YO-FN for qemu-devel@nongnu.org; Tue, 21 May 2019 11:16:44 -0400 Received: from m12-16.163.com ([220.181.12.16]:57274) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hT6VO-0001Up-8w; Tue, 21 May 2019 11:16:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=GphRRHXPmZj/YCwTEB a/ZbIMgwXVEM5rbWw176Y/gW0=; b=gm/NhhWAj+Q+4XUulj057PTfL5SWSJA3j4 Jy4LbqMfOke7przrYr6MEoJA7WWFIo3B1d1kfIC4k3yoppV35fVDfhvOAVTRIXQH hf6Fy8Od7+Io6qAAKctKs+kASJXG2iz908tG6zwPtqRxpyCobNtFirfFVFUbEhXU RqjqI3trw= Received: from localhost.localdomain (unknown [115.192.71.0]) by smtp12 (Coremail) with SMTP id EMCowAC31lxJFuRcie7uGw--.4521S5; Tue, 21 May 2019 23:16:36 +0800 (CST) From: Li Qiang To: alex.williamson@redhat.com, lvivier@redhat.com Date: Tue, 21 May 2019 08:15:42 -0700 Message-Id: <20190521151543.92274-4-liq3ea@163.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190521151543.92274-1-liq3ea@163.com> References: <20190521151543.92274-1-liq3ea@163.com> X-CM-TRANSID: EMCowAC31lxJFuRcie7uGw--.4521S5 X-Coremail-Antispam: 1Uf129KBjvdXoWrZryfGFW3uF13JrWrCr1xXwb_yoWftFbEv3 W8K397C3WvgrZa9rWqyrW3Zry7Zw4UKFsakFyxt3Wq93y5Aa15CwnruFZ7Xr47Cr12y34D Cw4kC3ZxAF13ujkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU8tDG7UUUUU== X-Originating-IP: [115.192.71.0] X-CM-SenderInfo: 5oltjvrd6rljoofrz/xtbBLxS7bVUMJbPrPAAAs1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 220.181.12.16 Subject: [Qemu-devel] [PATCH v2 3/4] vfio: platform: fix a typo X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, philmd@redhat.com, liq3ea@gmail.com, qemu-devel@nongnu.org, Li Qiang Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'eventd' should be 'eventfd'. CC: qemu-trivial@nongnu.org Signed-off-by: Li Qiang --- hw/vfio/platform.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index e59a0234dd..d52d6552e0 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -72,7 +72,7 @@ static VFIOINTp *vfio_init_intp(VFIODevice *vbasedev, g_free(intp->interrupt); g_free(intp); error_setg_errno(errp, -ret, - "failed to initialize trigger eventd notifier"); + "failed to initialize trigger eventfd notifier"); return NULL; } if (vfio_irq_is_automasked(intp)) { @@ -84,7 +84,7 @@ static VFIOINTp *vfio_init_intp(VFIODevice *vbasedev, g_free(intp->unmask); g_free(intp); error_setg_errno(errp, -ret, - "failed to initialize resample eventd notifier"); + "failed to initialize resample eventfd notifier"); return NULL; } } From patchwork Tue May 21 15:15:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Qiang X-Patchwork-Id: 1102889 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=163.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=163.com header.i=@163.com header.b="XMe/Ant6"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 457fh92ww5z9s6w for ; Wed, 22 May 2019 01:24:41 +1000 (AEST) Received: from localhost ([127.0.0.1]:55496 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hT6d4-0004Fr-3m for incoming@patchwork.ozlabs.org; Tue, 21 May 2019 11:24:38 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54169) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hT6VV-0007Yx-0H for qemu-devel@nongnu.org; Tue, 21 May 2019 11:16:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hT6VU-0001ce-1i for qemu-devel@nongnu.org; Tue, 21 May 2019 11:16:48 -0400 Received: from m12-16.163.com ([220.181.12.16]:57339) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hT6VR-0001VI-UR; Tue, 21 May 2019 11:16:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=JmlbMI8+rNjltu5NEn UC7kK/0d8byMc075r+nhfmo6c=; b=XMe/Ant6o7Wm413n39LYWjdl5r1IuZO/hU OEWiG2efN9NSKuOL7OHRnnbCXapi6pdmD0do1spJt3611sSXiJ66eK7TdWY7/c6z qMPjr2I9EUvWUXu8dZW1pUdAagaQ8mJ/z6OgpWzIzgYuAkvgoZeXMs62EobCmgXH UGqXiiiJw= Received: from localhost.localdomain (unknown [115.192.71.0]) by smtp12 (Coremail) with SMTP id EMCowAC31lxJFuRcie7uGw--.4521S6; Tue, 21 May 2019 23:16:37 +0800 (CST) From: Li Qiang To: alex.williamson@redhat.com, lvivier@redhat.com Date: Tue, 21 May 2019 08:15:43 -0700 Message-Id: <20190521151543.92274-5-liq3ea@163.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190521151543.92274-1-liq3ea@163.com> References: <20190521151543.92274-1-liq3ea@163.com> X-CM-TRANSID: EMCowAC31lxJFuRcie7uGw--.4521S6 X-Coremail-Antispam: 1Uf129KBjvJXoW7AF4fAF15Wr15Gw1rXw1UZFb_yoW8XFykpF Z8CF9a9r4Fqw17Crsayw4avF17JF4DWr12vF4vg3y7ta1xGF1ktr4DtFy7u34xXFW0vFyr Gr9rZ345tF1UZrJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UBWl9UUUUU= X-Originating-IP: [115.192.71.0] X-CM-SenderInfo: 5oltjvrd6rljoofrz/xtbBZhW7bVaD1l5SdQAAsf X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 220.181.12.16 Subject: [Qemu-devel] [PATCH v2 4/4] pci: msix: move 'MSIX_CAP_LENGTH' to header file X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, philmd@redhat.com, liq3ea@gmail.com, qemu-devel@nongnu.org, Li Qiang Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'MSIX_CAP_LENGTH' is defined in two .c file. Move it to hw/pci/msix.h file to reduce duplicated code. CC: qemu-trivial@nongnu.org Signed-off-by: Li Qiang --- hw/pci/msix.c | 2 -- hw/vfio/pci.c | 2 -- include/hw/pci/msix.h | 2 ++ 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/pci/msix.c b/hw/pci/msix.c index 4e336416a7..d39dcf32e8 100644 --- a/hw/pci/msix.c +++ b/hw/pci/msix.c @@ -24,8 +24,6 @@ #include "qapi/error.h" #include "trace.h" -#define MSIX_CAP_LENGTH 12 - /* MSI enable bit and maskall bit are in byte 1 in FLAGS register */ #define MSIX_CONTROL_OFFSET (PCI_MSIX_FLAGS + 1) #define MSIX_ENABLE_MASK (PCI_MSIX_FLAGS_ENABLE >> 8) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 08729e5875..8e555db12e 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -35,8 +35,6 @@ #include "trace.h" #include "qapi/error.h" -#define MSIX_CAP_LENGTH 12 - #define TYPE_VFIO_PCI "vfio-pci" #define PCI_VFIO(obj) OBJECT_CHECK(VFIOPCIDevice, obj, TYPE_VFIO_PCI) diff --git a/include/hw/pci/msix.h b/include/hw/pci/msix.h index 1f27658d35..08acfa836e 100644 --- a/include/hw/pci/msix.h +++ b/include/hw/pci/msix.h @@ -4,6 +4,8 @@ #include "qemu-common.h" #include "hw/pci/pci.h" +#define MSIX_CAP_LENGTH 12 + void msix_set_message(PCIDevice *dev, int vector, MSIMessage msg); MSIMessage msix_get_message(PCIDevice *dev, unsigned int vector); int msix_init(PCIDevice *dev, unsigned short nentries,