From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Eduardo Habkost" <ehabkost@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
qemu-trivial@nongnu.org,
"Richard Henderson" <richard.henderson@linaro.org>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Paolo Bonzini" <pbonzini@redhat.com>
Subject: [PATCH 3/3] hw/i386/amd_iommu: Add description/category to TYPE_AMD_IOMMU_PCI
Date: Sun, 26 Sep 2021 19:56:48 +0200 [thread overview]
Message-ID: <20210926175648.1649075-4-f4bug@amsat.org> (raw)
In-Reply-To: <20210926175648.1649075-1-f4bug@amsat.org>
TYPE_AMD_IOMMU_PCI is user-creatable but not well described.
Implement its class_init() handler to add it to the 'Misc
devices' category, and add a description.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/i386/amd_iommu.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c
index 9014690ba3a..9242a0d3ed8 100644
--- a/hw/i386/amd_iommu.c
+++ b/hw/i386/amd_iommu.c
@@ -1621,10 +1621,19 @@ static const TypeInfo amdvi_sysbus = {
.class_init = amdvi_sysbus_class_init
};
+static void amdvi_pci_class_init(ObjectClass *klass, void *data)
+{
+ DeviceClass *dc = DEVICE_CLASS(klass);
+
+ set_bit(DEVICE_CATEGORY_MISC, dc->categories);
+ dc->desc = "AMD IOMMU (AMD-Vi) DMA Remapping device";
+}
+
static const TypeInfo amdvi_pci = {
.name = TYPE_AMD_IOMMU_PCI,
.parent = TYPE_PCI_DEVICE,
.instance_size = sizeof(AMDVIPCIState),
+ .class_init = amdvi_pci_class_init,
.interfaces = (InterfaceInfo[]) {
{ INTERFACE_CONVENTIONAL_PCI_DEVICE },
{ },
--
2.31.1
prev parent reply other threads:[~2021-09-26 18:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-26 17:56 [PATCH 0/3] hw/i386/amd_iommu: Add description/category to TYPE_AMD_IOMMU_PCI Philippe Mathieu-Daudé
2021-09-26 17:56 ` [PATCH 1/3] hw/i386/amd_iommu: Rename amdviPCI TypeInfo Philippe Mathieu-Daudé
2021-09-26 17:56 ` [PATCH 2/3] hw/i386/amd_iommu: Rename SysBus specific functions as amdvi_sysbus_X() Philippe Mathieu-Daudé
2021-09-26 17:56 ` Philippe Mathieu-Daudé [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210926175648.1649075-4-f4bug@amsat.org \
--to=f4bug@amsat.org \
--cc=ehabkost@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).