From: Thomas Huth <thuth@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>,
qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 4/5] net/dump: Add dump option for netdev devices
Date: Fri, 10 Jul 2015 20:27:24 +0200 [thread overview]
Message-ID: <20150710202724.61198530@thh440s> (raw)
In-Reply-To: <87k2uhbhua.fsf@blackfin.pond.sub.org>
On Fri, 03 Jul 2015 13:28:45 +0200
Markus Armbruster <armbru@redhat.com> wrote:
> Thomas Huth <thuth@redhat.com> writes:
>
> > So far it is not possible to dump network traffic with the "-netdev"
> > option yet - this is only possible with the "-net" option and an
> > internal "hub".
> > This patch now fixes this ugliness by adding a proper, generic
> > dumpfile parameter to the "-netdev" option.
> >
> > Signed-off-by: Thomas Huth <thuth@redhat.com>
> > ---
> > include/net/net.h | 1 +
> > net/net.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
> > qapi-schema.json | 12 ++++++++++--
> > 3 files changed, 59 insertions(+), 2 deletions(-)
> >
> > diff --git a/include/net/net.h b/include/net/net.h
> > index b265047..62abc98 100644
> > --- a/include/net/net.h
> > +++ b/include/net/net.h
...
> > @@ -877,6 +889,36 @@ static int net_init_nic(const NetClientOptions *opts, const char *name,
> > return idx;
> > }
> >
> > +static int netdev_init_dumpfile(const Netdev *netdev, const char *name,
> > + Error **errp)
> > +{
> > + NetClientState *nc;
> > + int dumplen = 65536;
> > + int rc;
> > +
> > + if (netdev->opts->kind == NET_CLIENT_OPTIONS_KIND_TAP
> > + && netdev->opts->tap->has_vhost && netdev->opts->tap->vhost) {
> > + error_setg(errp, "dumping does not work with vhost enabled");
> > + return -1;
> > + }
> > +
> > + if (netdev->has_dumplen) {
> > + dumplen = netdev->dumplen;
>
> I keep reading "dumpling" for some reason... %-)
Were you hungry while reading the patch? :-)
> > + }
> > +
> > + nc = qemu_find_netdev(name);
> > + if (!nc) {
> > + error_setg(errp, "failed to lookup netdev for dump");
> > + return -1;
>
> Can this happen?
>
> Hmm, see below.
...
> net_client_init_fun() creates a netdev with this name. Since it doesn't
> return it, we have to look it up with qemu_find_netdev(). So the answer
> to "can this happen?" appears to be no. assert(!rc)?
I agree, an assert() should be enough here!
Thomas
next prev parent reply other threads:[~2015-07-10 18:27 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-24 15:56 [Qemu-devel] [PATCH 0/5] Network traffic dumping for -netdev, second try Thomas Huth
2015-06-24 15:56 ` [Qemu-devel] [PATCH 1/5] net/dump: Add support for receive_iov function Thomas Huth
2015-06-26 6:38 ` Jason Wang
2015-06-26 7:06 ` Thomas Huth
2015-07-03 11:06 ` Markus Armbruster
2015-07-10 18:09 ` Thomas Huth
2015-06-24 15:56 ` [Qemu-devel] [PATCH 2/5] net/dump: Move DumpState into NetClientState Thomas Huth
2015-06-24 15:56 ` [Qemu-devel] [PATCH 3/5] net/dump: Rework net-dump init functions Thomas Huth
2015-07-03 11:19 ` Markus Armbruster
2015-06-24 15:56 ` [Qemu-devel] [PATCH 4/5] net/dump: Add dump option for netdev devices Thomas Huth
2015-06-26 6:50 ` Jason Wang
2015-06-26 9:44 ` Stefan Hajnoczi
2015-06-29 9:57 ` Thomas Huth
2015-06-30 15:12 ` Stefan Hajnoczi
2015-06-30 10:37 ` Thomas Huth
2015-07-01 8:36 ` Stefan Hajnoczi
2015-07-03 11:28 ` Markus Armbruster
2015-07-10 18:27 ` Thomas Huth [this message]
2015-06-24 15:56 ` [Qemu-devel] [PATCH 5/5] qemu options: Add information about dumpfile to help text Thomas Huth
2015-07-03 11:30 ` Markus Armbruster
2015-06-26 9:41 ` [Qemu-devel] [PATCH 0/5] Network traffic dumping for -netdev, second try Stefan Hajnoczi
2015-07-03 11:30 ` Markus Armbruster
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=20150710202724.61198530@thh440s \
--to=thuth@redhat.com \
--cc=armbru@redhat.com \
--cc=jasowang@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.