qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 20/25] qapi: add socket address types


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 20/25] qapi: add socket address types
Date: Fri, 19 Oct 2012 04:39:29 -0400 (EDT)

> >> 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 @address@hidden

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]