From: Eric Blake <eblake@redhat.com>
To: "Anton Ivanov (antivano)" <antivano@cisco.com>,
"Qemu-devel@nongnu.org" <Qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Contribution - L2TPv3 transport
Date: Fri, 28 Feb 2014 06:40:27 -0700 [thread overview]
Message-ID: <531091CB.9050908@redhat.com> (raw)
In-Reply-To: <5310489A.4060501@cisco.com>
[-- Attachment #1: Type: text/plain, Size: 3807 bytes --]
On 02/28/2014 01:28 AM, Anton Ivanov (antivano) wrote:
> Hi all,
>
> On behalf of Cisco Systems I am authorized to contribute a new transport
> to the network subsystem in qemu.
>
>
> Patch attached.
Your patch is huge - it might be better to break it into smaller logical
chunks to make it easier to review. See this page for more hints:
http://wiki.qemu.org/Contribute/SubmitAPatch
Your patch is lacking a diffstat, and was sent as an attachment rather
than inline. This makes it harder to review.
I'm going to focus my review on just the qapi interface for now.
> +++ b/net/l2tpv3.c
> @@ -0,0 +1,630 @@
> +/*
> + * QEMU System Emulator
> + *
> + * Copyright (c) 2003-2008 Fabrice Bellard
> + * Copyright (c) 2012 Cisco Systems
It's now 2014.
> +++ b/qapi-schema.json
> @@ -2941,6 +2941,45 @@
> '*udp': 'str' } }
>
> ##
> +# @NetdevL2TPv3Options
> +#
> +# Connect the VLAN to Ethernet over L2TPv3 Static tunnel
> +#
> +# @fd: #optional file descriptor of an already opened socket
Other commands name this parameter 'fdname' (see 'add_client'); it takes
an fd named via the 'getfd' command. However, this style is old, and
new code should instead prefer file names rather than fd names. That
is, we want the newer style of using 'add-fd', then referring to the
file by name (/dev/fdset/nnn), and not the older style of 'getfd'; using
a file name also gives you the flexibility of using actual Unix socket
files stored in the file system.
> +#
> +# @src: source address
> +#
> +# @dst: #optional destination address
> +#
> +# @mode: bitmask mode for the tunnel (see l2tpv3.h for actual definition)
Ewww. This is is gross. This API should be self-documented here,
without making the end-reader chase down a source file. And passing raw
numbers for bit ids is not user-friendly. Better would be making this
parameter be an enum (if you can describe all modes via a single name,
as in 'mode':'cookie') or a series of bool arguments (perhaps optional
with sane defaults, as in 'udp':true,'cookie':false).
> +#
> +# @txcookie:#optional 32 or 64 bit tx cookie for the tunnel (set mode for actual type selection)
> +#
> +# @rxcookie:#optional 32 or 64 bit rx cookie for the tunnel (set mode for actual type selection)
> +#
> +# @txsession: tx 32 bit session
> +#
> +# @rxsession: rx 32 bit session
> +#
> +#
> +# Since 1.0
s/1.0/2.0/
> +##
> +##
> +{ 'type': 'NetdevL2TPv3Options',
> + 'data': {
> + '*fd': 'str',
> + '*src': 'str',
You didn't list 'src' as optional above.
Trailing whitespace - run your submission through checkpatch.pl.
> + '*dst': 'str',
> + '*mode': 'str',
As mentioned above, 'mode' should not be a string.
> + '*txcookie': 'str',
> + '*rxcookie': 'str',
> + '*txsession': 'str',
> + '*rxsession': 'str'
These should probably be 'int', not 'str'. If you have to hand-parse a
string into a numeric value, you encoded the QMP wrong.
> +
> +} }
> +
> +##
> +##
> # @NetdevVdeOptions
> #
> # Connect the VLAN to a vde switch running on the host.
> @@ -3021,6 +3060,7 @@
> 'nic': 'NetLegacyNicOptions',
> 'user': 'NetdevUserOptions',
> 'tap': 'NetdevTapOptions',
> + 'l2tpv3': 'NetdevL2TPv3Options',
Please add documentation that the l2tpv3 arm of this union was added in
2.0 (yes, I know we haven't been very good at documenting when unions
were extended, but it can't hurt to do a better job going forward).
> 'socket': 'NetdevSocketOptions',
> 'vde': 'NetdevVdeOptions',
> 'dump': 'NetdevDumpOptions',
>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2014-02-28 13:40 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-28 8:28 [Qemu-devel] Contribution - L2TPv3 transport Anton Ivanov (antivano)
2014-02-28 10:02 ` Paolo Bonzini
2014-02-28 11:17 ` Anton Ivanov (antivano)
2014-02-28 11:36 ` Paolo Bonzini
2014-02-28 12:59 ` Anton Ivanov (antivano)
2014-02-28 13:55 ` Anton Ivanov (antivano)
2014-03-04 15:19 ` Anton Ivanov (antivano)
2014-03-04 15:22 ` Anton Ivanov (antivano)
2014-03-04 15:53 ` Eric Blake
2014-03-04 16:05 ` Anton Ivanov (antivano)
2014-03-05 8:49 ` Anton Ivanov (antivano)
2014-03-05 11:38 ` Peter Maydell
2014-03-04 15:41 ` Eric Blake
2014-03-04 15:58 ` Anton Ivanov (antivano)
2014-03-04 16:04 ` Paolo Bonzini
2014-03-04 16:33 ` Eric Blake
2014-03-04 16:48 ` Anton Ivanov (antivano)
2014-03-04 16:55 ` Paolo Bonzini
2014-03-04 17:28 ` Anton Ivanov (antivano)
2014-03-04 17:30 ` Paolo Bonzini
2014-02-28 13:40 ` Eric Blake [this message]
2014-02-28 13:52 ` Anton Ivanov (antivano)
2014-02-28 13:57 ` Eric Blake
2014-02-28 14:03 ` Anton Ivanov (antivano)
2014-02-28 14:00 ` Paolo Bonzini
2014-02-28 15:06 ` Eric Blake
2014-02-28 15:20 ` Paolo Bonzini
2014-03-03 13:27 ` Stefan Hajnoczi
2014-03-03 14:01 ` Anton Ivanov (antivano)
2014-03-04 9:36 ` Stefan Hajnoczi
2014-03-04 9:47 ` Anton Ivanov (antivano)
2014-03-05 8:59 ` Stefan Hajnoczi
2014-03-05 9:13 ` Vincenzo Maffione
2014-03-03 14:53 ` Stefan Hajnoczi
2014-03-04 11:32 ` Anton Ivanov (antivano)
2014-03-05 9:07 ` Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=531091CB.9050908@redhat.com \
--to=eblake@redhat.com \
--cc=Qemu-devel@nongnu.org \
--cc=antivano@cisco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).