From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LRV3m-00059n-4Y for qemu-devel@nongnu.org; Mon, 26 Jan 2009 12:15:42 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LRV3l-000590-Eu for qemu-devel@nongnu.org; Mon, 26 Jan 2009 12:15:41 -0500 Received: from [199.232.76.173] (port=38360 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LRV3l-00058t-By for qemu-devel@nongnu.org; Mon, 26 Jan 2009 12:15:41 -0500 Received: from mx20.gnu.org ([199.232.41.8]:51943) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LRV3h-0004dU-8B for qemu-devel@nongnu.org; Mon, 26 Jan 2009 12:15:37 -0500 Received: from savannah.gnu.org ([199.232.41.3] helo=sv.gnu.org) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LRTKN-0005Jl-7O for qemu-devel@nongnu.org; Mon, 26 Jan 2009 10:24:43 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LRTIf-0002Ph-E7 for qemu-devel@nongnu.org; Mon, 26 Jan 2009 15:22:57 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LRTIf-0002Pd-96 for qemu-devel@nongnu.org; Mon, 26 Jan 2009 15:22:57 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Mon, 26 Jan 2009 15:22:57 +0000 Subject: [Qemu-devel] [6440] Use the default subsystem vendor ID for virtio devices ( Mark McLoughlin) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 6440 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6440 Author: aliguori Date: 2009-01-26 15:22:57 +0000 (Mon, 26 Jan 2009) Log Message: ----------- Use the default subsystem vendor ID for virtio devices (Mark McLoughlin) A subsystem vendor ID of zero isn't allowed, so we use our default ID. Gerd points out that although the PCI subsystem vendor ID is treated by the guest as the virtio vendor ID: /* we use the subsystem vendor/device id as the virtio vendor/device * id. this allows us to use the same PCI vendor/device id for all * virtio devices and to identify the particular virtio driver by * the subsytem ids */ vp_dev->vdev.id.vendor = pci_dev->subsystem_vendor; vp_dev->vdev.id.device = pci_dev->subsystem_device; it looks like only the device ID is used right now: # grep virtio modules.alias alias virtio:d00000001v* virtio_net alias virtio:d00000002v* virtio_blk alias virtio:d00000003v* virtio_console alias virtio:d00000004v* virtio-rng alias virtio:d00000005v* virtio_balloon alias pci:v00001AF4d*sv*sd*bc*sc*i* virtio_pci alias virtio:d00000009v* 9pnet_virtio so setting the subsystem vendor id to something != zero shouldn't cause trouble. Signed-off-by: Mark McLoughlin Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/hw/virtio-balloon.c trunk/hw/virtio-blk.c trunk/hw/virtio-console.c trunk/hw/virtio-net.c Modified: trunk/hw/virtio-balloon.c =================================================================== --- trunk/hw/virtio-balloon.c 2009-01-26 15:22:46 UTC (rev 6439) +++ trunk/hw/virtio-balloon.c 2009-01-26 15:22:57 UTC (rev 6440) @@ -174,7 +174,8 @@ s = (VirtIOBalloon *)virtio_init_pci(bus, "virtio-balloon", PCI_VENDOR_ID_REDHAT_QUMRANET, PCI_DEVICE_ID_VIRTIO_BALLOON, - 0, VIRTIO_ID_BALLOON, + PCI_VENDOR_ID_REDHAT_QUMRANET, + VIRTIO_ID_BALLOON, 0x05, 0x00, 0x00, 8, sizeof(VirtIOBalloon)); if (s == NULL) Modified: trunk/hw/virtio-blk.c =================================================================== --- trunk/hw/virtio-blk.c 2009-01-26 15:22:46 UTC (rev 6439) +++ trunk/hw/virtio-blk.c 2009-01-26 15:22:57 UTC (rev 6440) @@ -303,7 +303,8 @@ s = (VirtIOBlock *)virtio_init_pci(bus, "virtio-blk", PCI_VENDOR_ID_REDHAT_QUMRANET, PCI_DEVICE_ID_VIRTIO_BLOCK, - 0, VIRTIO_ID_BLOCK, + PCI_VENDOR_ID_REDHAT_QUMRANET, + VIRTIO_ID_BLOCK, 0x01, 0x80, 0x00, sizeof(struct virtio_blk_config), sizeof(VirtIOBlock)); if (!s) Modified: trunk/hw/virtio-console.c =================================================================== --- trunk/hw/virtio-console.c 2009-01-26 15:22:46 UTC (rev 6439) +++ trunk/hw/virtio-console.c 2009-01-26 15:22:57 UTC (rev 6440) @@ -128,7 +128,8 @@ s = (VirtIOConsole *)virtio_init_pci(bus, "virtio-console", PCI_VENDOR_ID_REDHAT_QUMRANET, PCI_DEVICE_ID_VIRTIO_CONSOLE, - 0, VIRTIO_ID_CONSOLE, + PCI_VENDOR_ID_REDHAT_QUMRANET, + VIRTIO_ID_CONSOLE, 0x03, 0x80, 0x00, 0, sizeof(VirtIOConsole)); if (s == NULL) Modified: trunk/hw/virtio-net.c =================================================================== --- trunk/hw/virtio-net.c 2009-01-26 15:22:46 UTC (rev 6439) +++ trunk/hw/virtio-net.c 2009-01-26 15:22:57 UTC (rev 6440) @@ -323,7 +323,8 @@ n = (VirtIONet *)virtio_init_pci(bus, "virtio-net", PCI_VENDOR_ID_REDHAT_QUMRANET, PCI_DEVICE_ID_VIRTIO_NET, - 0, VIRTIO_ID_NET, + PCI_VENDOR_ID_REDHAT_QUMRANET, + VIRTIO_ID_NET, 0x02, 0x00, 0x00, sizeof(struct virtio_net_config), sizeof(VirtIONet));