[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-4.15 v2] xen/dmop: Strip __XEN_TOOLS__ header guard from public API


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Thu, 11 Mar 2021 15:59:39 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • 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=mUG1TdsHe0NYVPn6jvX3nYhLe9Ns/zMy6s34wcH4tI0=; b=Wlmv9cH3DOe/0xsN0T7iHt6Y8DZOnnfdW0hm587TWSgNXzC7HlqTqQsR4ldvyeT512QgHarJlGQO+bJzWjVoaVHMMu89Ya/rOP7Kc2gtx47JsPx53dhwzyUK9ZsnFnyWcX//gJhQ7XURRZqKTNuw+YrM8YV4mztzxShJgrWm0NUwCIOTiS40QH9PO4nqahBUWBN8S7fYbv8edye4Yf5utxRC1Dj+WcScnKyfBW7M7zCTRUS7cvPK1+uc6HaCCU4LQwI6SqfjC6dX0n8eimYs9hs7Thx9WA9UJ+Qx1EQ+RJDh2TCuEWuBlgtJDpSd+2B1Qacy7vND6d3yhAxR0fjBGw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eAtZjd9lFFhTfkcer7mfB1Z9lfQVE+wTiUp17sNhF1a4/3/f6YZabIJNpPDTLHMbktzX7L2JK2XyNeaM4ot6MZVC6/IB6sfJ5cr0RXMJ5C9UvofkVZSAeEeZg+6EjmzdQVYWkeGyjnQQunDkQ+B/sm5Uexa8D4N4G0soOjNKJi83KT/PXmIH040PIoDFJ0MbRZjVaYDenlxxHV8LNNh38Hmxv55sC/GQICXihM9vPMVYExYAsraWCIhd9MSNLJWxzFOta8CD1cnfgCWCje8zJ5FspS0wezbgZyKQA4ykMLt8gMWE7/0pbZFawfwVgKMKkFT7SBZA7da92FPT7k0szw==
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, Wei Liu <wl@xxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Juergen Gross" <jgross@xxxxxxxx>, Paul Durrant <paul@xxxxxxx>
  • Delivery-date: Thu, 11 Mar 2021 15:00:12 +0000
  • Ironport-hdrordr: A9a23:DbNMI6MQ1+kVP8BcTxv155DYdL4zR+YMi2QD/1xtSBBTb8yTn9 2vmvNe7hPvlDMNQhgb9OyoEq+GXH/a6NpJ8ZAcVI3SOTXOlUmJCMVZ7YXkyyD9ACGWzIRg/I ppbqQWMrLNJHdgi8KS2meFOvIB5PXCz6yyn+fZyB5WPGNXQoVt9R1wBAreMmAefml7LKE0Hp ad+cZLzgDIERgqR/+2G2UfWKz7r8DL/aiMXTc9GxUl5AOS5AnYi4LSLh7w5HYjegIK+5gO2y zvkwv15qKs2svLsCP05ivowLl93PfkwttHLsSQhsYSMSWEsHfUWK1RH4eskRpwjOaz6Es7sN SkmWZdA+1Dr0n/U0vwgRzx1xLu2DwjgkWStmOwsD/YjuHSABcZYvAx4b5xQ1/ixGcL+OxY6u Zt2VmUspJGZCmw5BjV1pzzeDxB0navrWFKq591s1VvFbEwRZV2toIl8EZcAP47bVnHwbFiKu VoAc3GjcwmF2+yXjTctmlr9tSmQm4+KBeAWlQDocyYyVFt7QlE83c=
  • Ironport-sdr: M2STuQlVDud+4ryrtlSg+CF/bo3A9d1DBuyxZlbvbwPEql4xVaAFnzYweifdib9ij1+EwD2bGq PI9FMuKBo2RzXTCadUBkUfQENYLGgGhzsgzYcjn6rl+hv6J0J8kYTQZneISxJCT5kH4fZSKDOE 5e0aU96NE5Ei/qTY8tarL83cM2b/feFFMLMIqIYNRf/sQefMGdjbFxdbK/j4GRSBgkG/u+G2ax R6CJuzuUDwB3Warl2gPetNTm48Kpu0ynK1wr6fW0t8QzMSvP5nY2kcGSANl4Ac5oWhG/sMhPUA REg=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, Mar 11, 2021 at 01:43:05PM +0000, Andrew Cooper wrote:
> On 11/03/2021 13:28, Jan Beulich wrote:
> > On 11.03.2021 14:00, Andrew Cooper wrote:
> >> However, having laid things out in this way today, it occurs to me that
> >> we should consider further cleanup as well.
> >>
> >> I do agree that code wanting to use the libxendevicemodel.h API almost
> >> certainly don't want/need the dmop ABI.  (i.e. an individual consumer
> >> will want one, or the other, but almost certainly not both together).
> >>
> >> Should libxendevicemodel.h really be including dm_op.h?

FTR, this is xendevicemodel.h. Just saying because it took me a bit to
find the header. I'm dense today.

> > I was indeed wondering.
> >
> >>   AFAICT, it is
> >> only the ioserverid_t typedef which is API shared between the two
> >> contexts, and we can trivially typedef that locally.
> > Hmm, a local typedef isn't nice - there should be one central point.
> > Granted there's no risk for this to change in anywhere halfway
> > foreseeable future, but still. Also neither C89 nor C99 allow a
> > typedef to be repeated - in those versions we'd then rely on an
> > extension.
> 
> I wonder if we're depending on that extension elsewhere.  As far as the
> stable libraries go, we are dependent on a Linux or BSD environment
> currently.
> 
> Alternatively we can drop the typedef and use uint16_t instead without
> breaking things in practice.  (As long as we make the change in 4.15 and
> we lose the wiggle room afforded us by the entire interface being behind
> __XEN_TOOLS__ previously).
> 
> Thoughts?  I can't think of any ifdefary which would help, and swapping
> to uint16_t would reduce the use of an improperly namespaced identifier.

I don't see much problem in switching to uint16_t, it's likely what
should have been used from the start in order to avoid bits of dm_op.h
leaking into xendevicemodel.h. Or alternatively a new type that maps
to uint16_t if we think that would be more descriptive from a header
PoV: server_t or some such.

At the end of day it should be an opaque handler from the caller PoV,
or is it expected that the ioserverid_t obtained from xendevicemodel
will be used as a parameter to other libraries?

If you end up changing the type to uint16_t it might help to expand
the parameter name to server_id or some such, as an id parameter with
type uint16_t is kind of ambiguous. We already have some comment
blocks to describe the purpose of the parameters, so I don't think
it's a big deal if you also leave then as 'id'.

Thanks, Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.