[tip:tools/kvm] kvm tools: virtio-mmio: use subsys_id instead of pci device ID

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  d897c8b5b02876cc9f045cedbcd756b794c94154
Gitweb:     http://git.kernel.org/tip/d897c8b5b02876cc9f045cedbcd756b794c94154
Author:     Will Deacon <will.deacon@xxxxxxx>
AuthorDate: Mon, 12 Nov 2012 11:57:24 +0000
Committer:  Pekka Enberg <penberg@xxxxxxxxxx>
CommitDate: Tue, 13 Nov 2012 09:28:15 +0200

kvm tools: virtio-mmio: use subsys_id instead of pci device ID

The virtio MMIO code attempts to map PCI device IDs to virtio MMIO
device IDs by subtracting 0x1000 and adding 1, however this conversion
only works for NET and BLK devices.

This patch uses the subsys_id (which is actually the virtio device ID
for virtio-mmio devices) instead of the PCI device ID when populating
the mmio device header.

Signed-off-by: Will Deacon <will.deacon@xxxxxxx>
Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxx>
---
 tools/kvm/virtio/mmio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/kvm/virtio/mmio.c b/tools/kvm/virtio/mmio.c
index 6ec33ec..fe42e95 100644
--- a/tools/kvm/virtio/mmio.c
+++ b/tools/kvm/virtio/mmio.c
@@ -230,7 +230,7 @@ int virtio_mmio_init(struct kvm *kvm, void *dev, struct virtio_device *vdev,
 	vmmio->hdr = (struct virtio_mmio_hdr) {
 		.magic		= {'v', 'i', 'r', 't'},
 		.version	= 1,
-		.device_id	= device_id - 0x1000 + 1,
+		.device_id	= subsys_id,
 		.vendor_id	= 0x4d564b4c , /* 'LKVM' */
 		.queue_num_max	= 256,
 	};
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux