> >> Two port members, one is 'str', the other is 'uint16'. Ugly. > > > > This is because port can be a service name. Using a union was > > deemed > > overkill. > > Two ways to reduce the ugliness: > > 1. Make @to a string, too. Yes, users don't normally want to specify > the upper bound as service name, but if a user wanted to, it would > work just fine. > > 2. Use a number of ports instead of an upper port bound: replace @to > by @port+@nports.
Both considered, but they make it an absolute pain to deal with the current QemuOpts code that expects a @to and expects it to be an integer. > >>> + '*ipv4': 'bool', > >>> + '*ipv6': 'bool' } } > >>> + > >>> +## > >>> +# @UnixSocketAddress > >>> +# > >>> +# Captures the destination address of a Unix socket > >> > >> What's a "destination address of a Unix socket"? > > "Socket address in the local namespace" Ok. > >>> + 'unix': 'UnixSocketAddress', > >>> + 'fd': 'String' } } > > 'String'? Do you mean 'str'? 'String' is a boxed 'str'. It gives more freedom to extend the API later in a backwards-compatible way. Paolo