aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/i386/pc.c24
-rw-r--r--hw/mem/pc-dimm.c25
2 files changed, 25 insertions, 24 deletions
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 125cf0ad7c..2ec45a4be0 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1552,30 +1552,6 @@ void qemu_register_pc_machine(QEMUMachine *m)
g_free(name);
}
-static int pc_existing_dimms_capacity(Object *obj, void *opaque)
-{
- Error *local_err = NULL;
- uint64_t *size = opaque;
-
- if (object_dynamic_cast(obj, TYPE_PC_DIMM)) {
- DeviceState *dev = DEVICE(obj);
-
- if (dev->realized) {
- (*size) += object_property_get_int(obj, PC_DIMM_SIZE_PROP,
- &local_err);
- }
-
- if (local_err) {
- qerror_report_err(local_err);
- error_free(local_err);
- return 1;
- }
- }
-
- object_child_foreach(obj, pc_existing_dimms_capacity, opaque);
- return 0;
-}
-
static void pc_dimm_plug(HotplugHandler *hotplug_dev,
DeviceState *dev, Error **errp)
{
diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c
index d431834030..f02ce6e04c 100644
--- a/hw/mem/pc-dimm.c
+++ b/hw/mem/pc-dimm.c
@@ -22,6 +22,31 @@
#include "qemu/config-file.h"
#include "qapi/visitor.h"
#include "qemu/range.h"
+#include "qapi/qmp/qerror.h"
+
+int pc_existing_dimms_capacity(Object *obj, void *opaque)
+{
+ Error *local_err = NULL;
+ uint64_t *size = opaque;
+
+ if (object_dynamic_cast(obj, TYPE_PC_DIMM)) {
+ DeviceState *dev = DEVICE(obj);
+
+ if (dev->realized) {
+ (*size) += object_property_get_int(obj, PC_DIMM_SIZE_PROP,
+ &local_err);
+ }
+
+ if (local_err) {
+ qerror_report_err(local_err);
+ error_free(local_err);
+ return 1;
+ }
+ }
+
+ object_child_foreach(obj, pc_existing_dimms_capacity, opaque);
+ return 0;
+}
int qmp_pc_dimm_device_list(Object *obj, void *opaque)
{