From patchwork Wed Nov 22 07:58:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liu, Yi L" X-Patchwork-Id: 10069905 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 55B7660353 for ; Wed, 22 Nov 2017 08:15:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 46A0D29BFA for ; Wed, 22 Nov 2017 08:15:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A7F429BFC; Wed, 22 Nov 2017 08:15:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DEEAD29BFA for ; Wed, 22 Nov 2017 08:15:46 +0000 (UTC) Received: from localhost ([::1]:38301 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHQCA-0005NX-64 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 22 Nov 2017 03:15:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54359) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHQBK-0005MN-TP for qemu-devel@nongnu.org; Wed, 22 Nov 2017 03:14:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eHQBG-0007xu-4U for qemu-devel@nongnu.org; Wed, 22 Nov 2017 03:14:54 -0500 Received: from mga03.intel.com ([134.134.136.65]:57618) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eHQBF-0007wv-FL for qemu-devel@nongnu.org; Wed, 22 Nov 2017 03:14:50 -0500 Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Nov 2017 00:14:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,436,1505804400"; d="scan'208";a="179213738" Received: from sky-dev.bj.intel.com ([10.238.144.127]) by fmsmga006.fm.intel.com with ESMTP; 22 Nov 2017 00:14:36 -0800 From: "Liu, Yi L" To: qemu-devel@nongnu.org Date: Wed, 22 Nov 2017 15:58:02 +0800 Message-Id: <1511337482-15505-1-git-send-email-yi.l.liu@linux.intel.com> X-Mailer: git-send-email 1.9.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 134.134.136.65 Subject: [Qemu-devel] [PATCH] vfio/common: init giommu_list and hostwin_list of vfio container 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: "Liu, Yi L" , yi.l.liu@intel.com, mst@redhat.com, aik@ozlabs.ru, alex.williamson@redhat.com, pbonzini@redhat.com, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The init of giommu_list and hostwin_list is missed during container initialization. Signed-off-by: Liu, Yi L --- hw/vfio/common.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 7b2924c..14c5940 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -990,6 +990,8 @@ static int vfio_connect_container(VFIOGroup *group, AddressSpace *as, container = g_malloc0(sizeof(*container)); container->space = space; container->fd = fd; + QLIST_INIT(&container->giommu_list); + QLIST_INIT(&container->hostwin_list); if (ioctl(fd, VFIO_CHECK_EXTENSION, VFIO_TYPE1_IOMMU) || ioctl(fd, VFIO_CHECK_EXTENSION, VFIO_TYPE1v2_IOMMU)) { bool v2 = !!ioctl(fd, VFIO_CHECK_EXTENSION, VFIO_TYPE1v2_IOMMU);