@@ -821,6 +821,14 @@ static void machine_class_base_init(ObjectClass *oc, void *data)
}
}
+#ifdef CONFIG_MPQEMU
+static void rem_list_destroy_key(gpointer data)
+{
+ void *key = data;
+ g_free(key);
+}
+#endif
+
static void machine_initfn(Object *obj)
{
MachineState *ms = MACHINE(obj);
@@ -854,6 +862,10 @@ static void machine_initfn(Object *obj)
NULL);
}
+#ifdef CONFIG_MPQEMU
+ ms->remote_devs = g_hash_table_new_full(g_str_hash, g_str_equal,
+ rem_list_destroy_key, NULL);
+#endif
/* Register notifier when init is done for sysbus sanity checks */
ms->sysbus_notifier.notify = machine_init_notify;
@@ -50,6 +50,7 @@
#include "qemu/event_notifier.h"
#include "sysemu/kvm.h"
#include "util/event_notifier-posix.c"
+#include "hw/boards.h"
/*
* TODO: kvm_vm_ioctl is only available for per-target objects (NEED_CPU_H).
@@ -299,6 +300,12 @@ static void pci_proxy_dev_realize(PCIDevice *device, Error **errp)
PCIProxyDev *dev = PCI_PROXY_DEV(device);
PCIProxyDevClass *k = PCI_PROXY_DEV_GET_CLASS(dev);
Error *local_err = NULL;
+ MachineState *ms = MACHINE(current_machine);
+ DeviceState *d = DEVICE(dev);
+
+
+ (void)g_hash_table_insert(ms->remote_devs, (gpointer)g_strdup(d->id),
+ (gpointer)dev);
if (k->realize) {
k->realize(dev, &local_err);
@@ -3,6 +3,8 @@
#ifndef HW_BOARDS_H
#define HW_BOARDS_H
+#include <gmodule.h>
+
#include "sysemu/blockdev.h"
#include "sysemu/accel.h"
#include "hw/qdev.h"
@@ -274,6 +276,8 @@ struct MachineState {
AccelState *accelerator;
CPUArchIdList *possible_cpus;
struct NVDIMMState *nvdimms_state;
+
+ GHashTable *remote_devs;
};
#define DEFINE_MACHINE(namestr, machine_initfn) \