From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2C37C4321E for ; Mon, 5 Dec 2022 13:39:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232249AbiLENjk (ORCPT ); Mon, 5 Dec 2022 08:39:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231327AbiLENji (ORCPT ); Mon, 5 Dec 2022 08:39:38 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EAC1DF03 for ; Mon, 5 Dec 2022 05:39:37 -0800 (PST) Received: from kwepemm600005.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NQl4g2HYszFqXq; Mon, 5 Dec 2022 21:38:43 +0800 (CST) Received: from [10.67.103.158] (10.67.103.158) by kwepemm600005.china.huawei.com (7.193.23.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 5 Dec 2022 21:39:29 +0800 Subject: Re: [PATCH v4 1/5] vfio/migration: Add debugfs to live migration driver To: Jason Gunthorpe CC: , , , , , References: <20221202092625.35075-1-liulongfang@huawei.com> <20221202092625.35075-2-liulongfang@huawei.com> From: liulongfang Message-ID: Date: Mon, 5 Dec 2022 21:39:29 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="gbk" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.103.158] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600005.china.huawei.com (7.193.23.191) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/12/2 23:17, Jason Gunthorpe wrote: > On Fri, Dec 02, 2022 at 05:26:21PM +0800, Longfang Liu wrote: > >> +static ssize_t vfio_pci_vf_state_read(struct file *filp, char __user *buffer, >> + size_t count, loff_t *pos) >> +{ > > This would be better to use debugfs_create_devm_seqfile() > > Then you can simply use seq_printf() > The previous debugfs used this method in my patch. Is it now recommended to use the interface with "devm" ? >> @@ -119,6 +129,8 @@ struct vfio_migration_ops { >> enum vfio_device_mig_state *curr_state); >> int (*migration_get_data_size)(struct vfio_device *device, >> unsigned long *stop_copy_length); >> + int (*migration_get_data)(struct vfio_device *device, char *buffer); >> + int (*migration_get_attr)(struct vfio_device *device, char >> *buffer); > > Still no to passing through debugfs ops, create these files in the > driver. > If this part is also created and enabled in the device driver, why do we need to put this debugfs in the vfio public framework? Thanks, Longfang. > Jason > . >