Skip to contentSkip to conversation

multi-process: add qdev_proxy_add to create proxy devices

RFC PATCH Superseded [email protected] 1 participant 1 message Mar 7, 2019

v1 of 15 Superseded Latest is v15 →

lore
Share & tools
lore
#0 lore raw

RFC PATCH 26/37 multi-process: add qdev_proxy_add to create proxy devices

From: Elena Ufimtseva <[email protected]>

This is handled while parsing the command line options. The parsed options are being sent to remote process as the messgaes containing JSON strings.

---
 include/hw/proxy/qemu-proxy.h |   7 ++
 include/monitor/qdev.h        |   4 ++
 qdev-monitor.c                | 159 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 170 insertions(+)
include/hw/proxy/qemu-proxy.h +7 -0
index 6b61bb7..3639792 100644
@@ -74,6 +74,13 @@ typedef struct PCIProxyDevClass {
     char *command;
 } PCIProxyDevClass;
 
+typedef struct PCIProxyDevList {
+    QLIST_HEAD(, PCIProxyDev) devices;
+} proxy_dev_list_t;
+
+extern QemuMutex proxy_list_lock;
+extern proxy_dev_list_t proxy_dev_list;
+
 void proxy_default_bar_write(PCIProxyDev *dev, MemoryRegion *mr, hwaddr addr,
                              uint64_t val, unsigned size, bool memory);
 
include/monitor/qdev.h +4 -0
index 0ca0833..089429c 100644
@@ -11,8 +11,12 @@ void hmp_info_qom_tree(Monitor *mon, const QDict *dict);
 void qmp_device_add(QDict *qdict, QObject **ret_data, Error **errp);
 
 #ifdef CONFIG_MPQEMU
+#include "hw/proxy/qemu-proxy.h"
 void qmp_rdevice_add(QDict *qdict, QObject **ret_data, Error **errp);
 void qmp_rdevice_del(QDict *qdict, QObject **ret_data, Error **errp);
+DeviceState *qdev_proxy_add(const char *rid, const char *id, Error **errp);
+DeviceState *qdev_remote_add(QemuOpts *opts, bool device, Error **errp);
+void qdev_proxy_fire(void);
 #endif
 
 int qdev_device_help(QemuOpts *opts);
qdev-monitor.c +159 -0

177 lines not on this page · raw message

Signature · 1 line
1.8.3.1