From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2619DC4727D for ; Thu, 24 Sep 2020 17:22:36 +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 9339A238A1 for ; Thu, 24 Sep 2020 17:22:35 +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="zz8FdUiT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9339A238A1 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+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:37858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLUx0-0005VT-E0 for qemu-devel@archiver.kernel.org; Thu, 24 Sep 2020 13:22:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49610) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLUuw-00044r-NR for qemu-devel@nongnu.org; Thu, 24 Sep 2020 13:20:26 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:37002) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLUuu-0006fO-N0 for qemu-devel@nongnu.org; Thu, 24 Sep 2020 13:20:26 -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 08OHJRe0144106; Thu, 24 Sep 2020 17:20:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=WIr5ZMcHcoMHP3sv4L7GoD29QUesbZJqzPa7WRgv1OY=; b=zz8FdUiTuTzE5EKXnNYkXVL5D4vTTzLPQYsUdj0xozjfvTYW048oHDK+qoBZinL6LC91 W0ks97NhvVWxq8g1evsGg/3NKbCAKuG3x6fXSicXiUx5g3q+PYPzdcWoR9maEQtZsfIT X1wxlRYPDZO9tZHZo3XI0oYGiIm44SzKAeNXPntBWomT5T6T8hy3AaURtZq5EsBh5J3+ sPIJW2Sc8CN7wxAk1cr4UrVmPIW2l7Y7Z9m+e/iXBAdAmrl4PO6mJRoAwhH8dXyj1SXy 4GI7yKfV8Y5e0ITq8BBpRN6+mm/tB2gE06yymmFI/JxIfoCgK5mFtd6SeytcVtJEPQA8 Dw== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 33q5rgqxk9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 24 Sep 2020 17:20:14 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08OHKBDL036330; Thu, 24 Sep 2020 17:20:14 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 33r28x9072-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Sep 2020 17:20:14 +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 08OHKCn9004872; Thu, 24 Sep 2020 17:20:12 GMT Received: from flaka (/67.180.143.163) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 24 Sep 2020 10:20:11 -0700 Date: Thu, 24 Sep 2020 10:20:08 -0700 From: Elena Ufimtseva To: Stefan Hajnoczi Subject: Re: [PATCH v9 08/20] multi-process: Initialize message handler in remote device Message-ID: <20200924172008.GB11701@flaka> References: <20200827181231.22778-1-elena.ufimtseva@oracle.com> <20200827181231.22778-9-elena.ufimtseva@oracle.com> <20200923141039.GC62770@stefanha-x1.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200923141039.GC62770@stefanha-x1.localdomain> User-Agent: Mutt/1.10.1 (2018-07-13) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9754 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 mlxlogscore=999 suspectscore=0 adultscore=0 bulkscore=0 malwarescore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009240128 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9754 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 impostorscore=0 clxscore=1015 suspectscore=0 phishscore=0 malwarescore=0 priorityscore=1501 mlxlogscore=999 adultscore=0 bulkscore=0 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009240128 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/09/24 13:20:22 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -55 X-Spam_score: -5.6 X-Spam_bar: ----- X-Spam_report: (-5.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.199, 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=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001 autolearn=ham autolearn_force=no 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: fam@euphon.net, john.g.johnson@oracle.com, swapnil.ingle@nutanix.com, mst@redhat.com, qemu-devel@nongnu.org, kraxel@redhat.com, jag.raman@oracle.com, quintela@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, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Wed, Sep 23, 2020 at 03:10:39PM +0100, Stefan Hajnoczi wrote: > This is the function that can be converted from a callback to a > coroutine like this: > > void coroutine_fn mpqemu_loop(...) > { > for (;;) { > if (mpqemu_msg_read(...) < 0) { > /* Fatal connection error (disconnected, etc) */ > break; > } > > if (!mpqemu_msg_valid(&msg)) { > /* Protocol violation, terminate connection */ > break; > } > > switch (msg.cmd) { > /* Dispatch command */ > } > } > } Ok, thank you! I have something similar. Elena