From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bflLa-0005Zm-04 for qemu-devel@nongnu.org; Fri, 02 Sep 2016 06:05:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bflLT-0006rR-Vn for qemu-devel@nongnu.org; Fri, 02 Sep 2016 06:05:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43712) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bflLT-0006rL-NM for qemu-devel@nongnu.org; Fri, 02 Sep 2016 06:05:11 -0400 References: <1472097235-6332-1-git-send-email-kwankhede@nvidia.com> <20160830101638.49df467d@t450s.home> <78fedd65-6d62-e849-ff3b-d5105b2da816@redhat.com> <20160901105948.62f750aa@t450s.home> <98bbdbbf-c388-9120-3306-64f0cfb820a7@nvidia.com> From: Paolo Bonzini Message-ID: <8682faeb-0331-f014-c13e-03c20f3f2bdf@redhat.com> Date: Fri, 2 Sep 2016 12:05:01 +0200 MIME-Version: 1.0 In-Reply-To: <98bbdbbf-c388-9120-3306-64f0cfb820a7@nvidia.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v7 0/4] Add Mediated device support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kirti Wankhede , Michal Privoznik , Alex Williamson Cc: "Song, Jike" , "cjia@nvidia.com" , "kvm@vger.kernel.org" , "libvir-list@redhat.com" , "Tian, Kevin" , "qemu-devel@nongnu.org" , "kraxel@redhat.com" , Laine Stump , "bjsdjshi@linux.vnet.ibm.com" On 02/09/2016 07:21, Kirti Wankhede wrote: > On 9/2/2016 10:18 AM, Michal Privoznik wrote: > > Okay, maybe I'm misunderstanding something. I just thought that users > > will consult libvirt's nodedev driver (e.g. virsh nodedev-list && vir= sh > > nodedev-dumpxml $id) to fetch vGPU capabilities and then use that inf= o > > to construct domain XML. >=20 > I'm not familiar with libvirt code, curious how libvirt's nodedev drive= r > enumerates devices in the system? It looks at sysfs and/or the udev database and transforms what it finds there to XML. I think people would consult the nodedev driver to fetch vGPU capabilities, use "virsh nodedev-create" to create the vGPU device on the host, and then somehow refer to the nodedev in the domain XML. There isn't very much documentation on nodedev-create, but it's used mostly for NPIV (virtual fibre channel adapter) and the XML looks like th= is: scsi_host6 scsi_host5 2001001b32a9da5e 2101001b32a9da5e so I suppose for vGPU it would look like this: my-vgpu pci_0000_86_00_0 0695d332-7831-493f-9e71-1c85c8911a08 while the parent would have: pci_0000_86_00_0 0 134 0 0 GRID M60-0B 2 45 524288 2560 1600 GRID M60 NVIDIA After creating the vGPU, if required by the host driver, all the other type ids would disappear from "virsh nodedev-dumpxml pci_0000_86_00_0" to= o. When dumping the mdev with nodedev-dumpxml, it could show more complete info, again taken from sysfs: my-vgpu pci_0000_86_00_0 0695d332-7831-493f-9e71-1c85c8911a08 GRID M60-0B 2 45 524288 2560 1600 ... NVIDIA Notice how the parent has mdev inside pci; the vGPU, if it has to have pci at all, would have it inside mdev. This represents the difference between the mdev provider and the mdev device. Random proposal for the domain XML too: 0695d332-7831-493f-9e71-1c85c8911a08
Paolo