From patchwork Sat Jun 27 17:09:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elena Ufimtseva X-Patchwork-Id: 11629805 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 219111392 for ; Sat, 27 Jun 2020 17:19: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 EA7E920775 for ; Sat, 27 Jun 2020 17:19:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="xKE9/7JG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EA7E920775 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]:37888 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jpEU4-0006X7-4v for patchwork-qemu-devel@patchwork.kernel.org; Sat, 27 Jun 2020 13:19:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35248) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jpENC-0002U2-1B for qemu-devel@nongnu.org; Sat, 27 Jun 2020 13:12:14 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:48282) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jpEN9-0007S1-W4 for qemu-devel@nongnu.org; Sat, 27 Jun 2020 13:12:13 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 05RHC44G177247; Sat, 27 Jun 2020 17:12:04 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 : mime-version : content-transfer-encoding; s=corp-2020-01-29; bh=oL6SUAb8+PiyIJlETuoaL5WPbhF1wckiiQRfNXErwjU=; b=xKE9/7JG4B7ZBHpb3gUNbusSUmizKUuwJ8G8Wcbm4hUbVFoSXfaR2f3IjACPT2dp1XNa 8uldDVIkGa/7pMfk54yQKRLpYS142tkARusiJlrLOnUK2IAO1tDq6mfWRonc6eqtGLj6 /x+SCF2lBfhPSmctspaz6FMV8lGB1WsJHbsl+22F5uxtbyNJomG5rsp3Vp20pBoOw3M9 XP5Y9zfyvcmm5TIKPW0b7CVHHCfg8X86bCvHtUlib54Y6rt+qsn/0iwRlMkkXIGB965Z +YxPiasre6fVybRBJJSqyfIktPeEqTLYvWUbbulXJ63E6IHm9bqTy5B/440mOr2efpof LA== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 31wx2m9b17-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 27 Jun 2020 17:12:04 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 05RH8mPF172225; Sat, 27 Jun 2020 17:10:03 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3020.oracle.com with ESMTP id 31wwehn4uq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 27 Jun 2020 17:10:03 +0000 Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 05RHA2A7002843; Sat, 27 Jun 2020 17:10:02 GMT Received: from flaka.hsd1.ca.comcast.net (/67.180.143.163) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 27 Jun 2020 10:10:01 -0700 From: elena.ufimtseva@oracle.com To: qemu-devel@nongnu.org Subject: [PATCH v7 08/21] multi-process: Initialize communication channel at the remote end Date: Sat, 27 Jun 2020 10:09:30 -0700 Message-Id: X-Mailer: git-send-email 2.25.GIT In-Reply-To: References: MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9665 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 mlxscore=0 malwarescore=0 adultscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006270124 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9665 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 lowpriorityscore=0 bulkscore=0 mlxlogscore=999 clxscore=1015 adultscore=0 impostorscore=0 cotscore=-2147483648 priorityscore=1501 malwarescore=0 phishscore=0 suspectscore=1 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006270124 Received-SPF: pass client-ip=141.146.126.78; envelope-from=elena.ufimtseva@oracle.com; helo=aserp2120.oracle.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/27 13:10:09 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -63 X-Spam_score: -6.4 X-Spam_bar: ------ X-Spam_report: (-6.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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, swapnil.ingle@nutanix.com, 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, felipe@nutanix.com, thuth@redhat.com, ehabkost@redhat.com, konrad.wilk@oracle.com, dgilbert@redhat.com, liran.alon@oracle.com, stefanha@redhat.com, thanos.makatos@nutanix.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" From: Elena Ufimtseva Initialize the common QIOChannel at remote the end Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/i386/remote.c | 16 ++++++++++++++++ include/hw/i386/remote.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/hw/i386/remote.c b/hw/i386/remote.c index 4d13abe9f3..1a1becffe0 100644 --- a/hw/i386/remote.c +++ b/hw/i386/remote.c @@ -15,6 +15,7 @@ #include "exec/address-spaces.h" #include "exec/memory.h" #include "qapi/error.h" +#include "io/channel-util.h" static void remote_machine_init(MachineState *machine) { @@ -42,6 +43,20 @@ static void remote_machine_init(MachineState *machine) qdev_realize(DEVICE(rem_host), sysbus_get_default(), &error_fatal); } +static void remote_set_socket(Object *obj, const char *str, Error **errp) +{ + RemMachineState *s = REMOTE_MACHINE(obj); + Error *local_err = NULL; + int fd = atoi(str); + + s->ioc = qio_channel_new_fd(fd, &local_err); +} + +static void remote_instance_init(Object *obj) +{ + object_property_add_str(obj, "socket", NULL, remote_set_socket); +} + static void remote_machine_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); @@ -53,6 +68,7 @@ static const TypeInfo remote_machine = { .name = TYPE_REMOTE_MACHINE, .parent = TYPE_MACHINE, .instance_size = sizeof(RemMachineState), + .instance_init = remote_instance_init, .class_init = remote_machine_class_init, }; diff --git a/include/hw/i386/remote.h b/include/hw/i386/remote.h index d118a940be..0f8b861e7a 100644 --- a/include/hw/i386/remote.h +++ b/include/hw/i386/remote.h @@ -17,11 +17,13 @@ #include "qom/object.h" #include "hw/boards.h" #include "hw/pci-host/remote.h" +#include "io/channel.h" typedef struct RemMachineState { MachineState parent_obj; RemotePCIHost *host; + QIOChannel *ioc; } RemMachineState; #define TYPE_REMOTE_MACHINE "remote-machine"