qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] using -net dump with tap networking


From: Paolo Bonzini
Subject: Re: [Qemu-devel] using -net dump with tap networking
Date: Thu, 14 Feb 2013 00:12:03 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

Il 13/02/2013 19:02, Laszlo Ersek ha scritto:
>> > I am running qemu as:
>> >
>> > qemu/ppc64-softmmu/qemu-system-ppc64 -m 1024 -M pseries -trace
>> > events=trace_events -netdev user,id=virtnet,hostfwd=tcp::5000-:22
>> > -device virtio-net-pci,netdev=virtnet -nographic -vga none -enable-kvm
>> > -kernel vml36_64k -initrd 1.cpio
>> >
>> > Now I want to enable network dump. With the old "-net" syntax I could do
>> > that with "-net dump" but I cannot with the new syntax, tried many
>> > variants, none works. What would the correct syntax be for the case above?
> Ugh, I'm a bit confused, but if I say something stupid that should still
> help "ignite" the discussion.
> 
> So, in general there are two ways to specify this:
> 
> (1) -net dump,id=dump0,vlan=VLAN_ID,len=SIZE_LIMIT,file=PATHNAME
> 
> (2) -netdev dump,id=dump0,len=SIZE_LIMIT,file=PATHNAME
> 
> I believe the first option (legacy) should work.

Yes.  -net dump is meant to be used with vlans: you typically use a
3-port VLAN (actually a hub, not just in code but also as a mental
model) with a tap device, a NIC and the dumper.

> Hence I think you're back to (1), the legacy format. Assuming qemu
> doesn't barf on that option immediately, I believe you *also* have to
> add your "-netdev user" to the same hub as the dumper is on.
> 
> In total you have to create both netdevs (a, b) and assign both to a
> common hub/vlan (c, d). Again, unfortunately the dump netdev only works
> with the legacy format, but that already includes the assignment to the
> hub (a, c). So you have to take care of creating the other netdev
> (-netdev user, b), and assign it through its vlan qdev property to the
> same hub (d), so that data can flow from it to the dump netdev.
> 
> Hm... Looks like you can't do that directly on "-netdev user" (it seems
> to have no such property).

Right, just use "-net user"/"-net tap" and it will create both a hub
port and a backend.

> "virtio-net-pci" does have it however. At
> least in a quick "info qtree" check:
> 
> bus: main-system-bus
>   type System
>   dev: i440FX-pcihost, id ""
>     bus: pci.0
>       type PCI
>       dev: virtio-net-pci, id "net0"
>         dev-prop: vlan = <null>
> 
> Also confirmed by "qemu-system-x86_64 -device virtio-net-pci,help".

It may well be broken.  In this case, again just use "-net nic".

I learnt yesterday that the legacy syntax disables checksum and
fragmentation offloading.  The reason is that peer_test_vnet_hdr only
work if the NIC is connected directly to the TAP device, with no hubs in
between.  Anyway you probably don't care about that if you want to get
dumps; in fact having correct checksums in the dumps will probably help.

Paolo



reply via email to

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