mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
pc-dimm: Make pc_existing_dimms_capacity global
Move pc_existing_dimms_capacity() to pc-dimm.c since it would be needed by PowerPC memory hotplug code too. Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
759048ac20
commit
9967c94957
3 changed files with 26 additions and 24 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue