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=-1.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.3 Received: by atuin.qyliss.net (Postfix, from userid 496) id 851E5E8C9; Tue, 23 Jun 2020 03:29:32 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 73B5EE82A; Tue, 23 Jun 2020 03:29:27 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 496) id 2AC12E8A8; Tue, 23 Jun 2020 03:29:25 +0000 (UTC) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by atuin.qyliss.net (Postfix) with ESMTPS id E9A3DE8A6 for ; Tue, 23 Jun 2020 03:29:20 +0000 (UTC) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 829B1159B; Mon, 22 Jun 2020 23:29:18 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 22 Jun 2020 23:29:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h= from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm3; bh=jqri3DdgikpzCSEYY/LbM39RFa RHDljbcF2ev71Wlqo=; b=ezcgxjrWadRVvCPQx6+7AnKF13idMhIGv4rrwI5+sE UaEELYFjDXT/T6O9TnjjhznBnzW5/IJqg8dUKNeSBfH2CQMn3OUTGdT4Xz4GzkjY GtwV+VNx3BuRXOSclBjsIAtnx8AWn4njZq+ZxzwJdbhuUoJwvdJ+1GE3tq4z1z4t M3dk/At8wg7Y5w+s6dbK9QuL836ltInkEsVXIcxGFwfZSgq2vBxIzf5AYIoZyBY1 uZNaOwUENg1WoU6n+rV2YHnULtZzwxkVuLnsz1n9OBglfha2bkgAUiPx8XjtqALL jXg86mWL38qr2DmLXUOfWJkQThyoMuXWl4nOFuruZ0+A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=jqri3D dgikpzCSEYY/LbM39RFaRHDljbcF2ev71Wlqo=; b=J5ucZl3/MuQS/LlIcXyY44 QfnCN3t7FA8GUW7LHb5AJgxlNjkIdSWbimtLMv3qs6ROnwlCeXo6WuzBpWWO2vIb zCys33zvDxyRHKZZ0P9BjQ5jYShiWLnpPJvuqcVheWP9gTGJjP9BCKk8ipb1Df2r +Y6Eazf2esJPmKm909vcVmYd0SLlK+AVUHBjej6yU5rYxIvx0XdPht6oGJslnq/Y Z64cc2tBDfeLYWt0sFLKcbX7AHKcxGz7gmARu7VJdYa+rBlGawZ3RQZuBtNojAv2 ujClw4ZgZ4nSph4GjhmjNNmhtgF2FMIp+whsC2LuBbH0U2JVAYrmeJWX/HpWc5HA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudekfedgjedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfhffkfggtgesghdtreertddttdenucfhrhhomheptehlhihsshgr ucftohhsshcuoehhihesrghlhihsshgrrdhisheqnecuggftrfgrthhtvghrnhepvdeuvd eivdehhfeikedtvddvhefgheffleevueeigffgtdffffeujedujeejkeejnecukfhppeeg iedrkedtrdduvdekrdduhedvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhephhhisegrlhihshhsrgdrihhs X-ME-Proxy: Received: from x220.qyliss.net (p2e508098.dip0.t-ipconnect.de [46.80.128.152]) by mail.messagingengine.com (Postfix) with ESMTPA id 67CFE3067453; Mon, 22 Jun 2020 23:29:17 -0400 (EDT) Received: by x220.qyliss.net (Postfix, from userid 1000) id 9BA6639B; Tue, 23 Jun 2020 02:32:34 +0000 (UTC) From: Alyssa Ross To: Cole Helbling Subject: Re: [PATCH crosvm 1/2] msg_socket: introduce UnixSeqpacketExt In-Reply-To: References: <87a713qrto.fsf@alyssa.is> Date: Tue, 23 Jun 2020 02:32:25 +0000 Message-ID: <87a70u8qbq.fsf@alyssa.is> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Message-ID-Hash: AARZKFCIIXZ43HYRQQGNT6P6MRIQFNJ7 X-Message-ID-Hash: AARZKFCIIXZ43HYRQQGNT6P6MRIQFNJ7 X-MailFrom: hi@alyssa.is 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: --=-=-= Content-Type: text/plain >> 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. In the time since I last posted, I've been leaning towards option 1. But I don't really like callbacks either. I think the main reason for me is that then it's not really obvious what the function _does_. It some cases (if the callback returned false) it wouldn't actually do anything at all, which feels a bit weird. What would a good name for such a function be? It becomes very difficult. On the other hand, making every enum variant a struct of its own feels like a hack around a limitation of Rust, and it's a lot of boilerplate. The size of the change puts me off it. I think I'll probably have to try both out and see what feels best. >> 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. Oh, congratulations! Definitely let yourself adjust to the job as a priority! >> 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 Didn't you respond, like, the next day? :P > P.P.S. Thanks for going into such detail in all your responses (and > apologies for not doing the same)! No worries! It was really useful to have somebody on the other end to go into detail to, because otherwise I wouldn't have thought about this so much and come to the decision I did. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEH9wgcxqlHM/ARR3h+dvtSFmyccAFAl7xabkACgkQ+dvtSFmy ccDHsw/+KFHwT8heAFEIRZvBgKKamiumLyXEJ+SXEpI7nBjnASPj3BOBxeEkYRPS 72XJFeGfOI+X+lFliMS19dUuRNEpiCJF625jIFsoVO/EciANnsyg5rzxKVGX/KqN BAbluAaqkFu9SV5KtaU0hDB5wxRsc3ubgAGg1tpLJ1onQi/F1EMQRjdwU+5Fs6kp qexUC37rsH8qz4aDQ/dEhkqXqu3+O502/+nPkvw5gBQ2iXM0nOo07q6o0HRwQrrE 6+w4n0/wrwxrPOZncgRdVqT/iA6zZHGoJ0rwkOjZUxpL+jnD8x7R4q7FXoBbAJEo KYAR22uR98dLgjOG/Z6Zv6qy5McvqvTG8rzhMPLZWMNNukWOg58ffoU3atOIZOq3 70ttDVytDZcRLpqpyefiolCKTJxpb1aXXrgN6JDbkXzz8N1uNGRM2U79uYz24lkY DnCdCJSbKl7cHWcwNBjm/csfENyD1MtYi4JhPpL9sUDnFLVuPm3+ZJE7AnQssKHB k67NjCrWRppsfAsdfBujIoYGRcDBx62LlH+L9gvupFZpV+FQxOl6s1rCRpES4aVM yzLzjEnfF4AA4HFgNQoPqZxjm7Cr5D6Qkk2rIKHeZNL99J+zmrdR6L1WiW41Q08C db94at0GF6xBNIpOlAwUasrxFu+oMktONOck3wFebLwBfp51NXY= =kvul -----END PGP SIGNATURE----- --=-=-=--