qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel]  [PATCH v3 1/3] Categorize devices: DIMM
@ 2019-04-01 18:11 Ernest Esene
  2019-04-02  9:50 ` Igor Mammedov
  0 siblings, 1 reply; 2+ messages in thread
From: Ernest Esene @ 2019-04-01 18:11 UTC (permalink / raw)
  To: qemu-devel
  Cc: Stefan Hajnoczi, Paolo Bonzini, Xiao Guangrong,
	Michael S. Tsirkin, Igor Mammedov

[-- Attachment #1: Type: text/plain, Size: 2186 bytes --]

Set category and describe DIMM devices

Signed-off-by: Ernest Esene <eroken1@gmail.com>

---
v3:
  * add MEMORY device category
  * set category to MEMORY
v2:
  * split into separate patches
---
 hw/mem/nvdimm.c        | 1 +
 hw/mem/pc-dimm.c       | 1 +
 include/hw/qdev-core.h | 1 +
 qdev-monitor.c         | 1 +
 4 files changed, 4 insertions(+)

diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c
index bf2adf5e16..a334dbe1f5 100644
--- a/hw/mem/nvdimm.c
+++ b/hw/mem/nvdimm.c
@@ -200,6 +200,7 @@ static void nvdimm_class_init(ObjectClass *oc, void *data)
     ddc->realize = nvdimm_realize;
     mdc->get_memory_region = nvdimm_md_get_memory_region;
     dc->props = nvdimm_properties;
+    dc->desc = "NVDIMM memory module";
 
     nvc->read_label_data = nvdimm_read_label_data;
     nvc->write_label_data = nvdimm_write_label_data;
diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c
index 152400b1fc..3ace8077b5 100644
--- a/hw/mem/pc-dimm.c
+++ b/hw/mem/pc-dimm.c
@@ -259,6 +259,7 @@ static void pc_dimm_class_init(ObjectClass *oc, void *data)
     dc->unrealize = pc_dimm_unrealize;
     dc->props = pc_dimm_properties;
     dc->desc = "DIMM memory module";
+    set_bit(DEVICE_CATEGORY_MEMORY, dc->categories);
 
     ddc->get_vmstate_memory_region = pc_dimm_get_memory_region;
 
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index 33ed3b8dde..a7d9ea1fbe 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -26,6 +26,7 @@ typedef enum DeviceCategory {
     DEVICE_CATEGORY_SOUND,
     DEVICE_CATEGORY_MISC,
     DEVICE_CATEGORY_CPU,
+    DEVICE_CATEGORY_MEMORY,
     DEVICE_CATEGORY_MAX
 } DeviceCategory;
 
diff --git a/qdev-monitor.c b/qdev-monitor.c
index d4320986a2..5318df205b 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -143,6 +143,7 @@ static void qdev_print_devinfos(bool show_no_user)
         [DEVICE_CATEGORY_SOUND]   = "Sound",
         [DEVICE_CATEGORY_MISC]    = "Misc",
         [DEVICE_CATEGORY_CPU]     = "CPU",
+        [DEVICE_CATEGORY_MEMORY]  = "Memory",
         [DEVICE_CATEGORY_MAX]     = "Uncategorized",
     };
     GSList *list, *elt;
-- 
2.14.2


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-02 10:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-01 18:11 [Qemu-devel] [PATCH v3 1/3] Categorize devices: DIMM Ernest Esene
2019-04-02  9:50 ` Igor Mammedov

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).