* [patch 0/2] Fix and enhance virtio device id matching
@ 2009-05-26 13:46 Christian Borntraeger
2009-05-26 13:46 ` [patch 1/2] virtio: fix id_matching for virtio drivers Christian Borntraeger
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Christian Borntraeger @ 2009-05-26 13:46 UTC (permalink / raw)
To: Rusty Russell; +Cc: virtualization, kvm
Hello Rusty,
here are two patches that change the device matching of the virtio bus.
The patches have been refreshed agains linux-next and should apply
to your private virtio tree.
OK for linux-next?
Christian
^ permalink raw reply [flat|nested] 4+ messages in thread
* [patch 1/2] virtio: fix id_matching for virtio drivers
2009-05-26 13:46 [patch 0/2] Fix and enhance virtio device id matching Christian Borntraeger
@ 2009-05-26 13:46 ` Christian Borntraeger
2009-05-26 13:46 ` [patch 2/2] virtio: enhance " Christian Borntraeger
2009-05-27 2:41 ` [patch 0/2] Fix and enhance virtio device id matching Rusty Russell
2 siblings, 0 replies; 4+ messages in thread
From: Christian Borntraeger @ 2009-05-26 13:46 UTC (permalink / raw)
To: Rusty Russell; +Cc: virtualization, kvm, Christian Borntraeger
[-- Attachment #1: virtio_id_fix.patch --]
[-- Type: text/plain, Size: 960 bytes --]
From: Christian Borntraeger <borntraeger@de.ibm.com>
This bug never appeared, since all current virtio drivers use
VIRTIO_DEV_ANY_ID for the vendor field. If a real vendor would be used,
the check in virtio_id_match is wrong - it returns 0 if
id->vendor == dev->id.vendor.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
drivers/virtio/virtio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux-next/drivers/virtio/virtio.c
===================================================================
--- linux-next.orig/drivers/virtio/virtio.c
+++ linux-next/drivers/virtio/virtio.c
@@ -61,7 +61,7 @@ static inline int virtio_id_match(const
if (id->device != dev->id.device)
return 0;
- return id->vendor == VIRTIO_DEV_ANY_ID || id->vendor != dev->id.vendor;
+ return id->vendor == VIRTIO_DEV_ANY_ID || id->vendor == dev->id.vendor;
}
/* This looks through all the IDs a driver claims to support. If any of them
^ permalink raw reply [flat|nested] 4+ messages in thread
* [patch 2/2] virtio: enhance id_matching for virtio drivers
2009-05-26 13:46 [patch 0/2] Fix and enhance virtio device id matching Christian Borntraeger
2009-05-26 13:46 ` [patch 1/2] virtio: fix id_matching for virtio drivers Christian Borntraeger
@ 2009-05-26 13:46 ` Christian Borntraeger
2009-05-27 2:41 ` [patch 0/2] Fix and enhance virtio device id matching Rusty Russell
2 siblings, 0 replies; 4+ messages in thread
From: Christian Borntraeger @ 2009-05-26 13:46 UTC (permalink / raw)
To: Rusty Russell; +Cc: virtualization, kvm, Christian Borntraeger
[-- Attachment #1: virtio_id_enhance.patch --]
[-- Type: text/plain, Size: 1472 bytes --]
From: Christian Borntraeger <borntraeger@de.ibm.com>
This patch allows a virtio driver to use VIRTIO_DEV_ANY_ID for the
device id. This will be used by a test module that can be bound to
any virtio device.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
drivers/virtio/virtio.c | 2 +-
scripts/mod/file2alias.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Index: linux-next/drivers/virtio/virtio.c
===================================================================
--- linux-next.orig/drivers/virtio/virtio.c
+++ linux-next/drivers/virtio/virtio.c
@@ -58,7 +58,7 @@ static struct device_attribute virtio_de
static inline int virtio_id_match(const struct virtio_device *dev,
const struct virtio_device_id *id)
{
- if (id->device != dev->id.device)
+ if (id->device != dev->id.device && id->device != VIRTIO_DEV_ANY_ID)
return 0;
return id->vendor == VIRTIO_DEV_ANY_ID || id->vendor == dev->id.vendor;
Index: linux-next/scripts/mod/file2alias.c
===================================================================
--- linux-next.orig/scripts/mod/file2alias.c
+++ linux-next/scripts/mod/file2alias.c
@@ -641,7 +641,7 @@ static int do_virtio_entry(const char *f
id->vendor = TO_NATIVE(id->vendor);
strcpy(alias, "virtio:");
- ADD(alias, "d", 1, id->device);
+ ADD(alias, "d", id->device != VIRTIO_DEV_ANY_ID, id->device);
ADD(alias, "v", id->vendor != VIRTIO_DEV_ANY_ID, id->vendor);
add_wildcard(alias);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch 0/2] Fix and enhance virtio device id matching
2009-05-26 13:46 [patch 0/2] Fix and enhance virtio device id matching Christian Borntraeger
2009-05-26 13:46 ` [patch 1/2] virtio: fix id_matching for virtio drivers Christian Borntraeger
2009-05-26 13:46 ` [patch 2/2] virtio: enhance " Christian Borntraeger
@ 2009-05-27 2:41 ` Rusty Russell
2 siblings, 0 replies; 4+ messages in thread
From: Rusty Russell @ 2009-05-27 2:41 UTC (permalink / raw)
To: Christian Borntraeger; +Cc: virtualization, kvm
On Tue, 26 May 2009 11:16:08 pm Christian Borntraeger wrote:
> Hello Rusty,
>
> here are two patches that change the device matching of the virtio bus.
> The patches have been refreshed agains linux-next and should apply
> to your private virtio tree.
>
> OK for linux-next?
Sure, added.
Thanks!
Rusty.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-05-27 2:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-26 13:46 [patch 0/2] Fix and enhance virtio device id matching Christian Borntraeger
2009-05-26 13:46 ` [patch 1/2] virtio: fix id_matching for virtio drivers Christian Borntraeger
2009-05-26 13:46 ` [patch 2/2] virtio: enhance " Christian Borntraeger
2009-05-27 2:41 ` [patch 0/2] Fix and enhance virtio device id matching Rusty Russell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox