From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.3 (2019-12-06) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FORGED_SPF_HELO,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.3 Received: by atuin.qyliss.net (Postfix, from userid 496) id 43D6EE730; Mon, 22 Jun 2020 22:07:06 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 51B1DE6CA; Mon, 22 Jun 2020 22:07:00 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 496) id 1EC26E5FA; Mon, 22 Jun 2020 22:06:58 +0000 (UTC) Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-oln040092003034.outbound.protection.outlook.com [40.92.3.34]) by atuin.qyliss.net (Postfix) with ESMTPS id BA4D8E5F8 for ; Mon, 22 Jun 2020 22:06:54 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W+fGcffMJjLy/pDmXTep98U8MNJ5+vAjLn+8qTAUxHcDNpgORAye3ewE9DcWhNGaC67uNao13kdT4U8xQh61ubywkvZ6JYbSGh3NnjoMWEyzd9OS3L96lXo2+UME90balRP5PSJWuGLJiUqhe4TbnOMjItBuDY7cWCU9m2aOb9TK7K+OhSqQtZefIVsFI3Q0FtSuTm0pPuDwKwy+Ub72OCEl2U0rDFZNdVCtxUL44OyMPJBjuLntc1rAH2/qtzO0go83NqWxROkZ3U+/qHVuHiyb60kX7RybytPAleuvyJlEQP5jRejxLiEIgx5xYE3GmhtELF8R/qJ+G3z3qdJnGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GU1+Ky1QFUxrd3BCsEDvzc7CgT/FRmlWnpCRDz8rdqQ=; b=YjuxdSdyh9PBgvJYs6t/cnuZf+TWB8fX13NCjd29OfzhAGz+hb7+5jij796O/HCv9WevPYDxo7StgF2LmpGQcmMwW7mlkAbL/89o0IZwBDmOmMkMXu+z/zKgFjk6631LiYcQ7IeDUzmGQOHeAXeuk7fGhhSQQBV+3d/sWnDoia9zDri927eZiR4Zit+RnlionYST0H5Wc+fMvTClrOI+WxSgXaunFyC261DbJLeRDcn/rOuIJz26TGvlwvhloGeqQiYQwfrwD6D+TgxaC6BtmgQmkbK/eKVft/BMGU3bWDmOY1K1CAVq52RiKEPxQSHMNXRS0fk0DtIlzTZX30WG1Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GU1+Ky1QFUxrd3BCsEDvzc7CgT/FRmlWnpCRDz8rdqQ=; b=GgHF6kMQibWubNzt3VI/QUrIv67WSmaX9WXN6kggOUu/Mxzq5xaI6LYp3DlH1TosnSz3wBQa8r4rzPqsLS77tmcmC7m+Y6D5CqGibV+CLWJr35DZYAqk3+C4zpZpWaJUyb+aIbxc0en3sHTH8dJnKO9JiwlpTQ/OtXM0HZodD9t7+nZPlMybvGt+BGkF41EsXxVTOC4qOa1vWyxKuMD6UohSvToBEkXbA1PcJOj+NwgLkZs/qSwn5QwUgF1dpUjJ/Mnvev39VGc6VIZAB5JEzhKqeBa0gnF2hMmSumpiyVA4T3DM4SrytCFR+Y2T4yysXsHMSU52HTZHTcDluQva3Q== Received: from SN1NAM02FT016.eop-nam02.prod.protection.outlook.com (10.152.72.52) by SN1NAM02HT186.eop-nam02.prod.protection.outlook.com (10.152.72.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Mon, 22 Jun 2020 22:06:52 +0000 Received: from CH2PR14MB3579.namprd14.prod.outlook.com (2a01:111:e400:7e44::46) by SN1NAM02FT016.mail.protection.outlook.com (2a01:111:e400:7e44::113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Mon, 22 Jun 2020 22:06:52 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:6925F844DDB5D79421F455270810215BED812C2B78FCF3095DED3AFD0E2D3E33;UpperCasedChecksum:AF4666D446791E64B586F5878DD12B9F9A111093F46303A299CACFDF4148A2D7;SizeAsReceived:7477;Count:46 Received: from CH2PR14MB3579.namprd14.prod.outlook.com ([fe80::2948:142c:3047:102c]) by CH2PR14MB3579.namprd14.prod.outlook.com ([fe80::2948:142c:3047:102c%5]) with mapi id 15.20.3109.027; Mon, 22 Jun 2020 22:06:52 +0000 From: Cole Helbling To: Alyssa Ross , Cole Helbling Subject: Re: [PATCH crosvm 1/2] msg_socket: introduce UnixSeqpacketExt In-Reply-To: <87a713qrto.fsf@alyssa.is> References: <87a713qrto.fsf@alyssa.is> Date: Mon, 22 Jun 2020 15:06:50 -0700 Message-ID: Content-Type: text/plain X-ClientProxiedBy: BY5PR17CA0057.namprd17.prod.outlook.com (2603:10b6:a03:167::34) To CH2PR14MB3579.namprd14.prod.outlook.com (2603:10b6:610:62::18) X-Microsoft-Original-Message-ID: <87r1u6ycud.fsf@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost (67.187.170.40) by BY5PR17CA0057.namprd17.prod.outlook.com (2603:10b6:a03:167::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Mon, 22 Jun 2020 22:06:52 +0000 X-Microsoft-Original-Message-ID: <87r1u6ycud.fsf@outlook.com> X-TMN: [28BnN20sbFWJRsqeeFEhTXg+Y/9R84Fa] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: aeb93922-b6bc-4f90-82c6-08d816f8918f X-MS-Exchange-SLBlob-MailProps: LtmIgUwM0qR0AVaNbeLodVHtwjJT9+z5HBDjBr4D+fHtuoRcMtRaP23KRlPm2Qnk+XZa0utOY5kKnBoafHpyG2Np1yVbsSIgf70mrv7duNCWY+bZhaAhjQJj08UQQTGfAxxuJ7C3gMLTruPqjBVX6ZVpYvpCf1vl6GzKQjHkmMYRR3Ju02uHbHxExLdwctLgNL2vZ6QZadYM42Dss5Z9IfqsYfpG5NGwcyrxuL4AWCZ197jBynfEIs3yMdovJ94GwwCIbId18v8bBmDOrLSG0ja0fnDL8mIaK9zDmuJjWv86RtvpLpbZosHI4qRGLixSYjzTaja24ayLrE4fKxY41yLQJk+J7khVbs+txU0g8e7KXR5nyi0fL/ov1RNnghDAJAqB13LnbpneuqR2toz8mjwyIJ3J89fYi9GVoFe2qpwZpaU0i6JC1aXMgnq2cSSJbOD/Ws9/1Nh7B9h7CkD6rEKa2QLkxRDaSA7enmO9BywUsS5W+XqbWzvl1ev06C6TseqR1NzqkBZqTnhEuEbZsImisOL8lP9iz73DqCdk6/aAo6yNkB5g0eNh+64jEZqcEKgbyF6HDgMA/N3T16HAp9BD4RaCGqyjQkSzF7Ca2L9vFxQIC/OWaEGmbraSFjqz//epSrD0qIIDIljCfyziDFqsDSkq+9UntALnRUTpnbROrwWuEXSZ3sMUG6BivDNeUzQuK7Fc8YlauFwssq9SdVBiERP0T9A8F6Pth93BgYmtFtOoRHM6TpeLYR+d1uoxepaYs7OitJF4zwPgh9TpBQ== X-MS-TrafficTypeDiagnostic: SN1NAM02HT186: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2BdDGoppAancLU0YHTlifbE1rY3H1SUo2vBzvQMmA45zt0qsGokt1drR6sE6iS2QQA0m8NBTfaDlZ+PLSqN4mJe01FtPptSqGmMTgsAof8Pvr7590uhHH4Y/N9gmNZKNQjaZW8DfnnYWcZ2AIhDgUyl3WaymLBRVLdxNIS1HkXK79ZvVZ2z4lFy0kV4LsTU0MxvRLqL4Mvl+hyIWDviXeQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:CH2PR14MB3579.namprd14.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; X-MS-Exchange-AntiSpam-MessageData: vlINvS60IaAcGhXI3MWwR+iU7yfF5FpyfeQcEx2hzmmwLrxk2vFQNKQkneZyhey0SHKyoQJebvcda7KJAlAiEZzPWZG/vEKHkN4qtqwULkSl9wW4C0W3R4x3RiUesJUxOyhDZlwGUACqo8qGYcDKgQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: aeb93922-b6bc-4f90-82c6-08d816f8918f X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2020 22:06:52.6590 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1NAM02HT186 Message-ID-Hash: VNCQXMYZODX4TXBWF765ATY3OKUHFNI7 X-Message-ID-Hash: VNCQXMYZODX4TXBWF765ATY3OKUHFNI7 X-MailFrom: cole.e.helbling@outlook.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: devel@spectrum-os.org X-Mailman-Version: 3.3.1 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Alyssa Ross writes: > Did you see the way it was used in the second patch? We put all the > sockets into a Vec<&UnixSeqpacket>, ask a function which is the right > socket to send the message to, and then send the message to that > socket. It's not really possible to do that sort of thing while > preserving type information, because you can't really have a collection > containing members of different types. Ah, yeah. That's pretty obvious now that you've explained it... > --->8--- > > Both 1 and 3 would provide full compile-time type safety, at the expense > of being a bit more horrible than 2. I think I'm leaning towards 1, but > I don't have strong feelings about any of them. Having thought about > this now though, in response to your question (thanks!), I definitely > think that we should do something here better than what I presented in > these patches. > > I'd be very curious to hear your thoughts. I think that options 1 or 3 are the best choices. My only qualm with option 1 is that it uses a callback. I can't even really explain *why* I don't like callbacks (maybe because I had a bad time trying to use them within Rust before, when I was lacking experience), but it just feels somehow wrong to me. (Maybe it's also because I stereotype callbacks to C -- which isn't necessarily a bad thing -- but it would certainly make me happier to find a more Rust-y way to approach this.) Thinking about it for a little bit longer, I'm leaning a bit more towards option 3, just because I think it would be a better idea to associate a trait and a socket type. My gut feeling (keeping in mind my very brief knowledge of traits, and even less in that of callbacks) is that this would end up being nicer to implement, though maybe not as simple. > You might also be interested in implementing one of them. Would be a > good starter crosvm exercise. It's probably the type of thing where you > could be pretty confident you'd got it right if it compiled, but I could > offer some guidance on testing it as well, if you wanted. If not, > though, please give me your thoughts on approach anyway, and I'll > implement whichever one we think is best myself at some point. :) Although I would be interested in implementing one of them (#3, specifically), time is not on my side at the moment. I've recently started my first 40-hour-per-week job, so I'd like to adjust to that schedule before I really start doing things again. > I'll definitely wait longer to push crosvm patches in future, now that I > know somebody might be looking at them! Don't worry about it; it's because I took so long to respond. :P Cole P.S. I've switched to composing emails using notmuch inside Emacs. There should be no more whitespace weirdness (though we'll find out when the next patch comes through for sure ;^) ). P.P.S. Thanks for going into such detail in all your responses (and apologies for not doing the same)!