From patchwork Thu Mar 7 07:22:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elena Ufimtseva X-Patchwork-Id: 10842305 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 CBD861515 for ; Thu, 7 Mar 2019 07:39:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4EFB2DDBB for ; Thu, 7 Mar 2019 07:39:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A248A2DE08; Thu, 7 Mar 2019 07:39:07 +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 4E1E92DDBB for ; Thu, 7 Mar 2019 07:39:07 +0000 (UTC) Received: from localhost ([127.0.0.1]:46792 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1ncO-0007mN-7M for patchwork-qemu-devel@patchwork.kernel.org; Thu, 07 Mar 2019 02:39:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1nMj-0002t5-Nd for qemu-devel@nongnu.org; Thu, 07 Mar 2019 02:22:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1nMh-0005sZ-MN for qemu-devel@nongnu.org; Thu, 07 Mar 2019 02:22:53 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:50980) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h1nMg-0005mn-59 for qemu-devel@nongnu.org; Thu, 07 Mar 2019 02:22:50 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x277JnR7034494; Thu, 7 Mar 2019 07:22:42 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=OJJxlAbzXwXwhBc30c/4bc0GpJrkjE4U05SN6gxcngk=; b=2mYMpz4Ve0+2S9e4BLuXawz9eWfj2ltEe6Ju0De/Pi3Hf/jphQTpS2B6YWztVx6qyUgy zTBq28BfqIjoyUPTMqttL5pO84sFGec37iNtIp/hdVQ9uuHZSxfxM98tt0Qy+1e9zeFR HAMmf1fULlwhtcHeQ4bsfnJ7ZHSz9nD4KoBE6LXxOhXCpLxh/LD7RpJZ8R6Q5pR9inIV ZMHfFt73e38GRKDB6UuT0hOZSfGNIvLeNEgrteJDapZNqcw6emSsi2vV9hCWrHd4btHp v155uLmbO1F+tX3dwsIRZ9f+Sn1Ktp3HbOOc+gbaEmSIHEPNQ32/g6VsaAz0mC8rXVTQ Bw== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2qyfbeggk6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Mar 2019 07:22:42 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x277MbHJ002065 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 7 Mar 2019 07:22:37 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x277Ma1Y005755; Thu, 7 Mar 2019 07:22:36 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:36 -0800 From: elena.ufimtseva@oracle.com To: qemu-devel@nongnu.org Date: Wed, 6 Mar 2019 23:22:34 -0800 Message-Id: <20190307072234.9503-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=1015 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: 141.146.126.79 Subject: [Qemu-devel] [multiprocess RFC PATCH 28/37] multi-process: remote: use fd for socket from parent 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, ross.lagerwall@citrix.com, liran.alon@oracle.com, stefanha@redhat.com, kanth.ghatraju@oracle.com 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 Signed-off-by: Jagannathan Raman Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva --- remote/remote-main.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/remote/remote-main.c b/remote/remote-main.c index 52da3c8..fa32f2a 100644 --- a/remote/remote-main.c +++ b/remote/remote-main.c @@ -63,6 +63,7 @@ #include "block/qdict.h" #include "qapi/qmp/qlist.h" #include "qemu/log.h" +#include "qemu/cutils.h" static ProxyLinkState *proxy_link; PCIDevice *remote_pci_dev; @@ -437,6 +438,7 @@ int main(int argc, char *argv[]) { Error *err = NULL; QemuThread main_loop_thread; + int fd = -1; module_call_init(MODULE_INIT_QOM); @@ -461,7 +463,13 @@ int main(int argc, char *argv[]) return -1; } - proxy_link_set_sock(proxy_link, STDIN_FILENO); + fd = qemu_parse_fd(argv[1]); + if (fd == -1) { + printf("Failed to parse fd for remote process.\n"); + return -EINVAL; + } + + proxy_link_set_sock(proxy_link, fd); proxy_link_set_callback(proxy_link, process_msg); qemu_thread_create(&main_loop_thread, "remote-main-loop", remote_main_loop,