qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v5 1/2] slirp: Add "query-usernet" QMP command


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v5 1/2] slirp: Add "query-usernet" QMP command
Date: Thu, 3 May 2018 09:53:18 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

On 05/03/2018 04:12 AM, Daniel P. Berrangé wrote:
On Thu, May 03, 2018 at 09:25:45AM +0800, Fam Zheng wrote:
HMP "info usernet" has been available but it isn't ideal for programmed
use cases. This closes the gap in QMP by adding a counterpart
"query-usernet" command. It is basically translated from
the HMP slirp_connection_info() loop, which now calls the QMP
implementation and prints the data, just like other HMP info_* commands.

The TCPS_* macros are now defined as a QAPI enum.

Signed-off-by: Fam Zheng <address@hidden>


+##
+{ 'enum': 'TCPS',

I'd suggest avoiding the abbreviation, IOW use  TCPState as
the name. Yes that will require changnig the constants in
the SLIRP code, but that's worthwhile to get this QAPI
naming clearer IMHO.

I wonder if we should have a common prefix too eg UsernetTCPState
as this is a global QAPI namespace after all .

You could also use

{ 'enum': 'UsernetTCPState', 'prefix': 'TCPS', ...

for minimizing code churn (if 'prefix' is present, that overrides what the generator would use for enum values); although I'm not sure if that is any better (we haven't used 'prefix' much, and Markus wasn't the biggest fan of it in the first place, as it is more of a hack).

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



reply via email to

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