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 X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,T_HK_NAME_DR,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3EC5C04AB4 for ; Tue, 14 May 2019 11:02:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B0E4120818 for ; Tue, 14 May 2019 11:02:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726515AbfENLCD (ORCPT ); Tue, 14 May 2019 07:02:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50930 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725892AbfENLCD (ORCPT ); Tue, 14 May 2019 07:02:03 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8FF6489C3E; Tue, 14 May 2019 11:02:02 +0000 (UTC) Received: from work-vm (ovpn-117-232.ams2.redhat.com [10.36.117.232]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8E57D61995; Tue, 14 May 2019 11:01:48 +0000 (UTC) Date: Tue, 14 May 2019 12:01:45 +0100 From: "Dr. David Alan Gilbert" To: Cornelia Huck Cc: Yan Zhao , Erik Skultety , "cjia@nvidia.com" , "kvm@vger.kernel.org" , "aik@ozlabs.ru" , "Zhengxiao.zx@alibaba-inc.com" , "shuangtai.tst@alibaba-inc.com" , "qemu-devel@nongnu.org" , "kwankhede@nvidia.com" , "eauger@redhat.com" , "Liu, Yi L" , "Yang, Ziye" , "mlevitsk@redhat.com" , "pasic@linux.ibm.com" , "libvir-list@redhat.com" , "arei.gonglei@huawei.com" , "felipe@nutanix.com" , "Ken.Xue@amd.com" , "Tian, Kevin" , "zhenyuw@linux.intel.com" , "dinechin@redhat.com" , Alex Williamson , "intel-gvt-dev@lists.freedesktop.org" , "Liu, Changpeng" , "berrange@redhat.com" , "linux-kernel@vger.kernel.org" , "Wang, Zhi A" , "jonathan.davies@nutanix.com" , "He, Shaopeng" Subject: Re: [PATCH v2 1/2] vfio/mdev: add version attribute for mdev device Message-ID: <20190514110143.GD2753@work-vm> References: <20190510110838.2df4c4d0.cohuck@redhat.com> <20190510093608.GD2854@work-vm> <20190510114838.7e16c3d6.cohuck@redhat.com> <20190513132804.GD11139@beluga.usersys.redhat.com> <20190514061235.GC20407@joy-OptiPlex-7040> <20190514072039.GA2089@beluga.usersys.redhat.com> <20190514073219.GD20407@joy-OptiPlex-7040> <20190514074344.GB2089@beluga.usersys.redhat.com> <20190514074736.GE20407@joy-OptiPlex-7040> <20190514115135.078bbaf7.cohuck@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190514115135.078bbaf7.cohuck@redhat.com> User-Agent: Mutt/1.11.4 (2019-03-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 14 May 2019 11:02:02 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Cornelia Huck (cohuck@redhat.com) wrote: > On Tue, 14 May 2019 03:47:36 -0400 > Yan Zhao wrote: > > > On Tue, May 14, 2019 at 03:43:44PM +0800, Erik Skultety wrote: > > > On Tue, May 14, 2019 at 03:32:19AM -0400, Yan Zhao wrote: > > > > On Tue, May 14, 2019 at 03:20:40PM +0800, Erik Skultety wrote: > > > > > > That said, from libvirt POV as a consumer, I'd expect there to be truly only 2 > > > > > errors (I believe Alex has mentioned something similar in one of his responses > > > > > in one of the threads): > > > > > a) read error indicating that an mdev type doesn't support migration > > > > > - I assume if one type doesn't support migration, none of the other > > > > > types exposed on the parent device do, is that a fair assumption? > > Probably; but there might be cases where the migratability depends not > on the device type, but how the partitioning has been done... or is > that too contrived? > > > > > > b) write error indicating that the mdev types are incompatible for > > > > > migration > > > > > > > > > > Regards, > > > > > Erik > > > > Thanks for this explanation. > > > > so, can we arrive at below agreements? > > > > > > > > 1. "not to define the specific errno returned for a specific situation, > > > > let the vendor driver decide, userspace simply needs to know that an errno on > > > > read indicates the device does not support migration version comparison and > > > > that an errno on write indicates the devices are incompatible or the target > > > > doesn't support migration versions. " > > > > 2. vendor driver should log detailed error reasons in kernel log. > > > > > > That would be my take on this, yes, but I open to hear any other suggestions and > > > ideas I couldn't think of as well. > > So, read to find out whether migration is supported at all, write to > find out whether it is supported for that concrete pairing is > reasonable for libvirt? > > > > > > > Erik > > got it. thanks a lot! > > > > hi Cornelia and Dave, > > do you also agree on: > > 1. "not to define the specific errno returned for a specific situation, > > let the vendor driver decide, userspace simply needs to know that an errno on > > read indicates the device does not support migration version comparison and > > that an errno on write indicates the devices are incompatible or the target > > doesn't support migration versions. " > > 2. vendor driver should log detailed error reasons in kernel log. > > Two questions: > - How reasonable is it to refer to the system log in order to find out > what exactly went wrong? > - If detailed error reporting is basically done to the syslog, do > different error codes still provide useful information? Or should the > vendor driver decide what it wants to do? I don't see error codes as being that helpful; if we can't actually get an error message back up the stack (which was my preference), then I guess syslog is as good as it will get. Dave -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK