From: Eric Blake <eblake@redhat.com>
To: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>,
"snabb-devel@googlegroups.com" <snabb-devel@googlegroups.com>
Cc: Antonios Motakis <a.motakis@virtualopensystems.com>,
Luke Gorrie <luke@snabb.co>,
VirtualOpenSystems Technical Team <tech@virtualopensystems.com>,
qemu-devel <qemu-devel@nongnu.org>, mst <mst@redhat.com>
Subject: Re: [Qemu-devel] [snabb-devel] Re: [PATCH v10 15/18] Add the vhost-user netdev backend to the command line
Date: Mon, 09 Jun 2014 16:22:40 -0600 [thread overview]
Message-ID: <539633B0.1070908@redhat.com> (raw)
In-Reply-To: <CADDJ2=M_ZSG_f5GBmq=0tVqa=LR3rof-Yftu-sX1Oqm6unhESQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2514 bytes --]
On 06/09/2014 03:19 PM, Nikolay Nikolaev wrote:
>>> +static CharDriverState *net_vhost_parse_chardev(
>>> + const NetdevVhostUserOptions *opts)
>>
>> Unusual indentation, but I see your dilemma of fitting 80 columns.
>>
> What woudl be the right approach here, is leaving it 84 colums acceptable:
checkpatch.pl is for guidance; it is okay to have a patch that doesn't
pass. At any rate, I won't reject a patch for long lines, or for unusual
style, where it is obvious that there is no way to fit things into 80
columns while still complying with all other style issues.
>>> + error_report("vhost-user requires frontend driver
>> virtio-net-*");
>>
>> How many of these error_report() should be using Error **errp logistics
>> instead?
>>
>> I don't see this 'errp' logic applied here. These are static functions
> called in the init function to check for compatible command line parameters.
> This init fucntion is part of 'net_client_init_fun[]" which does not
> provide 'Error **errp' argument. The way I see it, there is no way to
> propagate the 'errp' up. Or am I getting this wrong?
It was more of a 'food for thought' question - we may eventually want to
enhance the code base to be able to propagate errp up; but since that is
a more invasive patch, and your series isn't making the situation worse,
it does not necessarily mean you have to do that additional work. On
the other hand, if the conversion is worth doing, then getting it done
sooner makes it easier to take advantage of the improved error handling
for other new code in the same area.
>>> +
>>> + /* verify net frontend */
>>> + if (qemu_opts_foreach(qemu_find_opts("device"), net_vhost_check_net,
>>> + (void *)name, true) == -1) {
>>
>> This is C; why do you need a cast to (void*)?
>>
> Because of the constness in 'const char *name'. I am casting to 'char *
> now', is it better?
Okay, I see. Sometimes, I like to put in a comment /* cast away const
*/ to make it obvious why I'm doing things like that. It also serves as
a spur to investigate a couple of things: 1) should the callback
signature should have allowed a const in the first place, rather than
making callers have to cast away const, 2) if the callback can modify
the pointer but I'm casting away const, am I going to cause data
corruption and/or a crash
--
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-06-09 22:22 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20140527120050.15172.94908.stgit@3820>
2014-06-04 19:30 ` [Qemu-devel] [PATCH v10 00/18] Vhost and vhost-net support for userspace based backends Michael S. Tsirkin
2014-06-04 20:03 ` [Qemu-devel] [snabb-devel] " Nikolay Nikolaev
[not found] ` <20140527120330.15172.91211.stgit@3820>
2014-06-05 14:00 ` [Qemu-devel] [PATCH v10 01/18] Add kvm_eventfds_enabled function Paolo Bonzini
[not found] ` <20140527120638.15172.80806.stgit@3820>
2014-06-05 14:37 ` [Qemu-devel] [PATCH v10 15/18] Add the vhost-user netdev backend to the command line Luiz Capitulino
2014-06-09 13:28 ` [Qemu-devel] [snabb-devel] " Nikolay Nikolaev
2014-06-09 13:31 ` Michael S. Tsirkin
2014-06-09 13:43 ` Nikolay Nikolaev
2014-06-05 16:08 ` [Qemu-devel] " Eric Blake
2014-06-09 21:19 ` [Qemu-devel] [snabb-devel] " Nikolay Nikolaev
2014-06-09 22:22 ` Eric Blake [this message]
[not found] ` <20140527120651.15172.72895.stgit@3820>
2014-06-05 16:17 ` [Qemu-devel] [PATCH v10 16/18] Add vhost-user protocol documentation Eric Blake
2014-06-08 15:05 ` Michael S. Tsirkin
2014-06-08 15:12 ` [Qemu-devel] [PATCH v10 00/18] Vhost and vhost-net support for userspace based backends Michael S. Tsirkin
2014-06-09 10:14 ` [Qemu-devel] [snabb-devel] " Nikolay Nikolaev
[not found] ` <20140527120718.15172.9772.stgit@3820>
2014-07-09 14:24 ` [Qemu-devel] [PATCH v10 18/18] Add qtest for vhost-user Kevin Wolf
2014-07-09 15:09 ` [Qemu-devel] [snabb-devel] " Nikolay Nikolaev
2014-07-11 18:35 ` [Qemu-devel] " Michael S. Tsirkin
2014-07-11 18:35 ` [Qemu-devel] [snabb-devel] " Nikolay Nikolaev
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=539633B0.1070908@redhat.com \
--to=eblake@redhat.com \
--cc=a.motakis@virtualopensystems.com \
--cc=luke@snabb.co \
--cc=mst@redhat.com \
--cc=n.nikolaev@virtualopensystems.com \
--cc=qemu-devel@nongnu.org \
--cc=snabb-devel@googlegroups.com \
--cc=tech@virtualopensystems.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).