From patchwork Thu Mar 7 07:22:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elena Ufimtseva X-Patchwork-Id: 10842309 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2585214E1 for ; Thu, 7 Mar 2019 07:39:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D5EB2E22D for ; Thu, 7 Mar 2019 07:39:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F2BDA2E237; Thu, 7 Mar 2019 07:39:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8778E2E22D for ; Thu, 7 Mar 2019 07:39:44 +0000 (UTC) Received: from localhost ([127.0.0.1]:46796 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1nd1-0008RK-IX for patchwork-qemu-devel@patchwork.kernel.org; Thu, 07 Mar 2019 02:39:43 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59934) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1nMH-0002Up-3A for qemu-devel@nongnu.org; Thu, 07 Mar 2019 02:22:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1nMF-0005ZP-H2 for qemu-devel@nongnu.org; Thu, 07 Mar 2019 02:22:24 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:55842) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h1nMD-0005YX-UC for qemu-devel@nongnu.org; Thu, 07 Mar 2019 02:22:22 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x277JMEl037951; Thu, 7 Mar 2019 07:22:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2018-07-02; bh=vb4bE9v6nX+5DQelgEoIGN2MZCiTDOYJfOIW1+ZX7GY=; b=3cXumAvFmCxwpp/hapbZdh50uttq55iJfCqNnyEiv96fFHgV5CtdUpsd4SuYeK3MlhcV mEAo21IucMUwbuj2iqrZCkJlnGCA9qBd+44b4PbMSu8XdQpYtIZ+Ge3FC11O8O9+Qc7N elWH241zGYLKHJTBVldSugE90CVviOhoKh1QJIEYVbzk8oaDTWWEjgIQUe6ljJZKybxj e8dtwbM4etFiKnrDGjRctGYMyLFQLd7jC97N5v6S60b6QdjC6dSbt8ucKyrTnltEGVA1 tNoT7ZS8QSeQX/oit3ZeV9XKQvh4a16qhR/OGWGm8bJtNoQv1civvFRZV1p1NO7aYGxZ wg== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2qyjfrr5ee-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Mar 2019 07:22:18 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x277MC2U016587 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 7 Mar 2019 07:22:12 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x277MCIG004151; Thu, 7 Mar 2019 07:22:12 GMT Received: from heatpipe.hsd1.ca.comcast.net (/73.170.27.202) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 06 Mar 2019 23:22:12 -0800 From: elena.ufimtseva@oracle.com To: qemu-devel@nongnu.org Date: Wed, 6 Mar 2019 23:22:05 -0800 Message-Id: <20190307072205.8990-1-elena.ufimtseva@oracle.com> X-Mailer: git-send-email 2.17.1 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9187 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903070053 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 156.151.31.85 Subject: [Qemu-devel] [multiprocess RFC PATCH 19/37] multi-process: store info about the remote process X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: elena.ufimtseva@oracle.com, john.g.johnson@oracle.com, sstabellini@kernel.org, jag.raman@oracle.com, konrad.wilk@oracle.com, mst@redhat.com, ehabkost@redhat.com, ross.lagerwall@citrix.com, liran.alon@oracle.com, stefanha@redhat.com, pbonzini@redhat.com, kanth.ghatraju@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Elena Ufimtseva 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 Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- 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 + #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;