From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vasile Catalin-B50542 Subject: [virtio] dummy device Date: Fri, 9 Jan 2015 14:31:21 +0200 Message-ID: <54AFCA19.9010108@freescale.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit To: "open list:KERNEL VIRTUAL MA..." Return-path: Received: from mail-by2on0145.outbound.protection.outlook.com ([207.46.100.145]:28165 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756640AbbAIMrI (ORCPT ); Fri, 9 Jan 2015 07:47:08 -0500 Sender: kvm-owner@vger.kernel.org List-ID: Hi, I'm trying to add a new virtio device. I've managed to make qemu connect my virtio device to the pci bus. I'm now trying to make a dummy driver in the guest's kernel. My "lspci" binary version isn't very verbose. For example the output for "lspci" and "lspci -n" are the same: 00:00.0 Class 0604: 1957:0030 00:01.0 Class 0200: 1af4:1000 00:02.0 Class 0b40: 1af4:100d (That's all I get from them.) My device is on the last line. I have tried using another solution to see if there is a driver doing something with my device (at least probing it): ls /sys/bus/pci/devices/0000\:00\:02.0/driver/module/drivers/ It outputs: pci:virtio-pci Should I see here the name of my device/driver module, or this is what I would see for any device on an emulated machine with virtio pci based bus? I currently just defined the "struct virtio_driver" with it's related things, and called: module_virtio_driver(); MODULE_DEVICE_TABLE(); Is there anything left to do in order to have a functional dummy device? Is there a better way to see the name of the module associated with a PCI device (virtio device)?