From patchwork Thu Jul 18 08:27:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcel Apfelbaum X-Patchwork-Id: 260052 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 503392C009C for ; Thu, 18 Jul 2013 22:10:08 +1000 (EST) Received: from localhost ([::1]:36900 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uzn25-0003zH-RD for incoming@patchwork.ozlabs.org; Thu, 18 Jul 2013 08:10:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzjZs-0000iS-2F for qemu-devel@nongnu.org; Thu, 18 Jul 2013 04:28:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UzjZp-0001ep-2q for qemu-devel@nongnu.org; Thu, 18 Jul 2013 04:28:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25052) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzjZo-0001e5-SI for qemu-devel@nongnu.org; Thu, 18 Jul 2013 04:28:41 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6I8Sdcl013428 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 18 Jul 2013 04:28:40 -0400 Received: from localhost.localdomain.com (vpn-200-223.tlv.redhat.com [10.35.200.223]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r6I8SOrV024640; Thu, 18 Jul 2013 04:28:35 -0400 From: Marcel Apfelbaum To: qemu-devel@nongnu.org Date: Thu, 18 Jul 2013 11:27:43 +0300 Message-Id: <1374136063-24399-3-git-send-email-marcel.a@redhat.com> In-Reply-To: <1374136063-24399-1-git-send-email-marcel.a@redhat.com> References: <1374136063-24399-1-git-send-email-marcel.a@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 X-Mailman-Approved-At: Thu, 18 Jul 2013 08:09:38 -0400 Cc: pbonzini@redhat.com, aliguori@us.ibm.com, afaerber@suse.de, Marcel Apfelbaum Subject: [Qemu-devel] [RFC PATCH 2/2] devices: Associate devices to their logical category X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The category will be used to sort the devices displayed in the command line help. Signed-off-by: Marcel Apfelbaum --- Note that these are not all the needed changes, the only purpose of this patch is to be a proof of concept. hw/audio/ac97.c | 1 + hw/display/cirrus_vga.c | 1 + hw/net/eepro100.c | 1 + hw/scsi/scsi-disk.c | 4 ++++ hw/usb/dev-hid.c | 1 + 5 files changed, 8 insertions(+) diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c index 365b2f1..cbedf11 100644 --- a/hw/audio/ac97.c +++ b/hw/audio/ac97.c @@ -1420,6 +1420,7 @@ static void ac97_class_init (ObjectClass *klass, void *data) k->device_id = PCI_DEVICE_ID_INTEL_82801AA_5; k->revision = 0x01; k->class_id = PCI_CLASS_MULTIMEDIA_AUDIO; + dc->category = DEVICE_CATEGORY_SOUND; dc->desc = "Intel 82801AA AC97 Audio"; dc->vmsd = &vmstate_ac97; dc->props = ac97_properties; diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c index a440575..0f4be70 100644 --- a/hw/display/cirrus_vga.c +++ b/hw/display/cirrus_vga.c @@ -3002,6 +3002,7 @@ static void cirrus_vga_class_init(ObjectClass *klass, void *data) k->vendor_id = PCI_VENDOR_ID_CIRRUS; k->device_id = CIRRUS_ID_CLGD5446; k->class_id = PCI_CLASS_DISPLAY_VGA; + dc->category = DEVICE_CATEGORY_DISPLAY; dc->desc = "Cirrus CLGD 54xx VGA"; dc->vmsd = &vmstate_pci_cirrus_vga; dc->props = pci_vga_cirrus_properties; diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c index e0befb2..944a7ac 100644 --- a/hw/net/eepro100.c +++ b/hw/net/eepro100.c @@ -2084,6 +2084,7 @@ static void eepro100_class_init(ObjectClass *klass, void *data) info = eepro100_get_class_by_name(object_class_get_name(klass)); dc->props = e100_properties; + dc->category = DEVICE_CATEGORY_NETWORK; dc->desc = info->desc; k->vendor_id = PCI_VENDOR_ID_INTEL; k->class_id = PCI_CLASS_NETWORK_ETHERNET; diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 74e6a14..3b2cd99 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -2428,6 +2428,7 @@ static void scsi_hd_class_initfn(ObjectClass *klass, void *data) sc->alloc_req = scsi_new_request; sc->unit_attention_reported = scsi_disk_unit_attention_reported; dc->fw_name = "disk"; + dc->category = DEVICE_CATEGORY_STORAGE; dc->desc = "virtual SCSI disk"; dc->reset = scsi_disk_reset; dc->props = scsi_hd_properties; @@ -2457,6 +2458,7 @@ static void scsi_cd_class_initfn(ObjectClass *klass, void *data) sc->alloc_req = scsi_new_request; sc->unit_attention_reported = scsi_disk_unit_attention_reported; dc->fw_name = "disk"; + dc->category = DEVICE_CATEGORY_STORAGE; dc->desc = "virtual SCSI CD-ROM"; dc->reset = scsi_disk_reset; dc->props = scsi_cd_properties; @@ -2486,6 +2488,7 @@ static void scsi_block_class_initfn(ObjectClass *klass, void *data) sc->destroy = scsi_destroy; sc->alloc_req = scsi_block_new_request; dc->fw_name = "disk"; + dc->category = DEVICE_CATEGORY_STORAGE; dc->desc = "SCSI block device passthrough"; dc->reset = scsi_disk_reset; dc->props = scsi_block_properties; @@ -2520,6 +2523,7 @@ static void scsi_disk_class_initfn(ObjectClass *klass, void *data) sc->alloc_req = scsi_new_request; sc->unit_attention_reported = scsi_disk_unit_attention_reported; dc->fw_name = "disk"; + dc->category = DEVICE_CATEGORY_STORAGE; dc->desc = "virtual SCSI disk or CD-ROM (legacy)"; dc->reset = scsi_disk_reset; dc->props = scsi_disk_properties; diff --git a/hw/usb/dev-hid.c b/hw/usb/dev-hid.c index 31f3cde..9d006ba 100644 --- a/hw/usb/dev-hid.c +++ b/hw/usb/dev-hid.c @@ -677,6 +677,7 @@ static void usb_mouse_class_initfn(ObjectClass *klass, void *data) uc->product_desc = "QEMU USB Mouse"; uc->usb_desc = &desc_mouse; dc->vmsd = &vmstate_usb_ptr; + dc->category = DEVICE_CATEGORY_INPUT; } static const TypeInfo usb_mouse_info = {