From patchwork Tue May 26 13:46:10 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Borntraeger X-Patchwork-Id: 26025 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4QDqbrm020392 for ; Tue, 26 May 2009 13:52:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753073AbZEZNwd (ORCPT ); Tue, 26 May 2009 09:52:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752967AbZEZNwd (ORCPT ); Tue, 26 May 2009 09:52:33 -0400 Received: from mtagate5.de.ibm.com ([195.212.29.154]:50823 "EHLO mtagate5.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752747AbZEZNwc (ORCPT ); Tue, 26 May 2009 09:52:32 -0400 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate5.de.ibm.com (8.14.3/8.13.8) with ESMTP id n4QDpgvv615340 for ; Tue, 26 May 2009 13:51:42 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n4QDpgml3154146 for ; Tue, 26 May 2009 15:51:42 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n4QDpfvL026931 for ; Tue, 26 May 2009 15:51:41 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n4QDpfkt026928; Tue, 26 May 2009 15:51:41 +0200 Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 25651) id 6FE34122422D; Tue, 26 May 2009 15:51:41 +0200 (CEST) Message-Id: <20090526135141.256078000@de.ibm.com> User-Agent: quilt/0.47-1 Date: Tue, 26 May 2009 15:46:10 +0200 From: Christian Borntraeger To: Rusty Russell Cc: virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, Christian Borntraeger Subject: [patch 2/2] virtio: enhance id_matching for virtio drivers References: <20090526134608.545964000@de.ibm.com> Content-Disposition: inline; filename=virtio_id_enhance.patch Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Christian Borntraeger 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 --- drivers/virtio/virtio.c | 2 +- scripts/mod/file2alias.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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);