From: elena.ufimtseva@oracle.com
To: qemu-devel@nongnu.org
Cc: elena.ufimtseva@oracle.com, ross.lagerwall@citrix.com,
stefanha@redhat.com, liran.alon@oracle.com,
kanth.ghatraju@oracle.com, john.g.johnson@oracle.com,
jag.raman@oracle.com, konrad.wilk@oracle.com,
sstabellini@kernel.org, mst@redhat.com,
marcel.apfelbaum@gmail.com, pbonzini@redhat.com, rth@twiddle.net,
ehabkost@redhat.com
Subject: [Qemu-devel] [multiprocess RFC PATCH 19/37] multi-process: store info about the remote process
Date: Wed, 6 Mar 2019 23:22:05 -0800 [thread overview]
Message-ID: <20190307072205.8990-1-elena.ufimtseva@oracle.com> (raw)
From: Elena Ufimtseva <elena.ufimtseva@oracle.com>
Store info about the remote process in a hash table, so that
it could be used later for QMP/HMP commands.
Signed-off-by: John G Johnson <john.g.johnson@oracle.com>
Signed-off-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>
Signed-off-by: Jagannathan Raman <jag.raman@oracle.com>
---
hw/i386/pc.c | 1 +
hw/proxy/qemu-proxy.c | 7 +++++++
include/hw/i386/pc.h | 3 +++
3 files changed, 11 insertions(+)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 4212818..9f569cf 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -2643,6 +2643,7 @@ static void pc_machine_initfn(Object *obj)
pcms->smbus_enabled = true;
pcms->sata_enabled = true;
pcms->pit_enabled = true;
+ pcms->remote_devs = g_hash_table_new(g_str_hash, g_str_equal);
}
static void pc_machine_reset(void)
diff --git a/hw/proxy/qemu-proxy.c b/hw/proxy/qemu-proxy.c
index d525344..d1560d9 100644
--- a/hw/proxy/qemu-proxy.c
+++ b/hw/proxy/qemu-proxy.c
@@ -50,6 +50,8 @@
#include "qemu/event_notifier.h"
#include "sysemu/kvm.h"
#include "util/event_notifier-posix.c"
+#include "hw/i386/pc.h"
+#include "hw/boards.h"
/*
* TODO: kvm_vm_ioctl is only available for per-target objects (NEED_CPU_H).
@@ -234,6 +236,7 @@ static void init_emulation_process(PCIProxyDev *pdev, char *command, Error **err
}
pdev->proxy_link = proxy_link_create();
+ pdev->remote_pid = rpid;
if (!pdev->proxy_link) {
error_setg(errp, "Failed to create proxy link");
@@ -252,9 +255,13 @@ 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;
+ PCMachineState *pcms = PC_MACHINE(current_machine);
+ DeviceState *d = DEVICE(dev);
init_emulation_process(dev, k->command, errp);
+ (void)g_hash_table_insert(pcms->remote_devs, (gpointer)d->id, (gpointer)dev);
+
if (k->realize) {
k->realize(dev, &local_err);
if (local_err) {
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 54222a2..ded7cf0 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -1,6 +1,8 @@
#ifndef HW_PC_H
#define HW_PC_H
+#include <gmodule.h>
+
#include "qemu-common.h"
#include "exec/memory.h"
#include "hw/boards.h"
@@ -39,6 +41,7 @@ struct PCMachineState {
PCIBus *bus;
FWCfgState *fw_cfg;
qemu_irq *gsi;
+ GHashTable *remote_devs;
/* Configuration options: */
uint64_t max_ram_below_4g;
--
1.8.3.1
reply other threads:[~2019-03-07 7:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190307072205.8990-1-elena.ufimtseva@oracle.com \
--to=elena.ufimtseva@oracle.com \
--cc=ehabkost@redhat.com \
--cc=jag.raman@oracle.com \
--cc=john.g.johnson@oracle.com \
--cc=kanth.ghatraju@oracle.com \
--cc=konrad.wilk@oracle.com \
--cc=liran.alon@oracle.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=ross.lagerwall@citrix.com \
--cc=rth@twiddle.net \
--cc=sstabellini@kernel.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).