From patchwork Thu Oct 24 09:09:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jag Raman X-Patchwork-Id: 11208653 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2D99F14E5 for ; Thu, 24 Oct 2019 09:30:21 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 035CE205F4 for ; Thu, 24 Oct 2019 09:30:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="S8/reBYo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 035CE205F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:36686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNZRj-0002Pv-BN for patchwork-qemu-devel@patchwork.kernel.org; Thu, 24 Oct 2019 05:30:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44071) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNZ9f-000054-LE for qemu-devel@nongnu.org; Thu, 24 Oct 2019 05:11:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNZ9e-0004o0-GN for qemu-devel@nongnu.org; Thu, 24 Oct 2019 05:11:39 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:33272) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iNZ9e-0004nQ-8c for qemu-devel@nongnu.org; Thu, 24 Oct 2019 05:11:38 -0400 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 x9O94LMx094844; Thu, 24 Oct 2019 09:11:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : in-reply-to : references; s=corp-2019-08-05; bh=R9sV97ruVWh3xNTYa4ewtCCK7oypj4YQjLeFW289P68=; b=S8/reBYoJALU3TiRGzqszc8w6epYK5DUJy0BMeJfexpbqaXHmQby475XTE1/0RidCM1U hJs7kOis2vJk5vcQRpk0AcNEKm2GLdcf7J9FFRi+omGRtPoWIwoOyziqfr4fcaxFXrsW 547JIRcpC+RqMtZXfgC4yQd8t94Au6JJgDSy6lhgagURctzWE+izYe/ul3fGBASj/sEr Qn5TPKAofqMFLWT4g68ovWohTDWvRn8H5PUG6dp8AlRNbvhlx3HDAPbzKN8XjmCqMjWT 3Btr240VjoJn8F+BbXwfXLQufev0l2TPpwqaVpJJ4Gt6fs4k6Cli2zNLJFp0OPzw3mn0 4w== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 2vqu4r24sa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Oct 2019 09:11:33 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x9O98m3f076178; Thu, 24 Oct 2019 09:11:33 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3030.oracle.com with ESMTP id 2vtjkj306b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Oct 2019 09:11:32 +0000 Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x9O9BVol002630; Thu, 24 Oct 2019 09:11:31 GMT Received: from jaraman-bur-1.us.oracle.com (/10.152.33.39) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 24 Oct 2019 02:11:31 -0700 From: Jagannathan Raman To: qemu-devel@nongnu.org Subject: [RFC v4 PATCH 38/49] multi-process/mon: Initialize QMP module for remote processes Date: Thu, 24 Oct 2019 05:09:19 -0400 Message-Id: <453f1f773d33c9b37d6d2777a303883bda16dba7.1571905346.git.jag.raman@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: In-Reply-To: References: X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9419 signatures=668684 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1910240089 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9419 signatures=668684 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1910240089 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 156.151.31.85 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: elena.ufimtseva@oracle.com, fam@euphon.net, john.g.johnson@oracle.com, kraxel@redhat.com, jag.raman@oracle.com, quintela@redhat.com, mst@redhat.com, armbru@redhat.com, kanth.ghatraju@oracle.com, thuth@redhat.com, ehabkost@redhat.com, konrad.wilk@oracle.com, dgilbert@redhat.com, liran.alon@oracle.com, stefanha@redhat.com, rth@twiddle.net, kwolf@redhat.com, berrange@redhat.com, mreitz@redhat.com, ross.lagerwall@citrix.com, marcandre.lureau@gmail.com, pbonzini@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- New patch in v3 remote/remote-main.c | 11 +++++++++++ remote/remote-opts.c | 10 ++++++++++ 2 files changed, 21 insertions(+) diff --git a/remote/remote-main.c b/remote/remote-main.c index 30182dc..341b7cf 100644 --- a/remote/remote-main.c +++ b/remote/remote-main.c @@ -69,6 +69,7 @@ #include "monitor/monitor.h" #include "chardev/char.h" #include "sysemu/reset.h" +#include "vl.h" static MPQemuLinkState *mpqemu_link; @@ -476,6 +477,8 @@ int main(int argc, char *argv[]) module_call_init(MODULE_INIT_QOM); + monitor_init_globals(); + bdrv_init_with_whitelist(); if (qemu_init_main_loop(&err)) { @@ -491,6 +494,8 @@ int main(int argc, char *argv[]) qemu_add_opts(&qemu_device_opts); qemu_add_opts(&qemu_drive_opts); + qemu_add_opts(&qemu_chardev_opts); + qemu_add_opts(&qemu_mon_opts); qemu_add_drive_opts(&qemu_legacy_drive_opts); qemu_add_drive_opts(&qemu_common_drive_opts); qemu_add_drive_opts(&qemu_drive_opts); @@ -521,6 +526,12 @@ int main(int argc, char *argv[]) mpqemu_link_set_callback(mpqemu_link, process_msg); + qemu_opts_foreach(qemu_find_opts("chardev"), + chardev_init_func, NULL, &error_fatal); + + qemu_opts_foreach(qemu_find_opts("mon"), + mon_init_func, NULL, &error_fatal); + mpqemu_start_coms(mpqemu_link); return 0; diff --git a/remote/remote-opts.c b/remote/remote-opts.c index 7de6195..1b1824e 100644 --- a/remote/remote-opts.c +++ b/remote/remote-opts.c @@ -98,6 +98,16 @@ void parse_cmdline(int argc, char **argv, char **envp) exit(1); } break; + case QEMU_OPTION_qmp: + monitor_parse(optarg, "control", false); + break; + case QEMU_OPTION_monitor: + if (!strncmp(optarg, "stdio", 5)) { + warn_report("STDIO not supported in remote process"); + } else if (strncmp(optarg, "none", 4)) { + monitor_parse(optarg, "readline", false); + } + break; default: break; }