On Thu, May 16, 2013 at 03:19:54PM +0300, Michael S. Tsirkin wrote: > On Thu, May 16, 2013 at 07:07:25PM +0800, Amos Kong wrote: > > We want to implement mac programming over macvtap through Libvirt. > > The previous patch adds QMP event to notify management of mac-table > > change. This patch adds a monitor command to query rx mode information > > of mac-tables. > > > > (qemu) info mac-table vnet0 > > vnet0: > > \ promisc: on > > \ allmulti: off > > \ alluni: off > > \ nomulti: off > > \ nouni: off > > \ nobcast: off > > \ multi_overflow: off > > \ uni_overflow: off > > \ multicast: > > 01:00:5e:00:00:01 > > 33:33:00:00:00:01 > > 33:33:ff:12:34:56 > > > > Signed-off-by: Amos Kong <ak...@redhat.com> Hi Michael,
> It's an interesting example. > > There are no unicast addresses at all? Currently we save the main MAC in n->mac (not in n->mactable). I only output the content of n->mactable. And main MAC doesn't exist in guest's virtio_net_dev->uc, so it's not outputted. The main MAC can also be got by 'info network', but not coverted to QMP. I will add main MAC in query result and add event for its change. ---- I just started a guest by : qemu .. -device virtio-net-pci,netdev=ndev1,id=id1 -netdev tap,id=ndev1 \ -device e1000,netdev=ndev2,id=id2 -netdev tap,id=ndev2 The default mac address was used. virtio-nic: 52:54:00:12:34:56 e1000 nic: 52:54:00:12:34:57 52:54:00:12:34:56 doesn't exist in guest's virtio_net_dev->uc. ---- Another example: I tried to add a new vlan for virtio-nic in guest # vconfig add eth1 3 up then changed mac of eth1 # ifconfig eth1 hw ether 12:34:00:00:00:00 then I can see a mac address in unicast part of mac-table (qemu) info mac-table id1: ... \ unicast: 33:33:ff:12:34:56 \ multicast: 00:00:00:00:00:00 01:80:c2:00:00:21 01:00:5e:00:00:01 33:33:00:00:00:01 33:33:ff:00:00:00 > I'm guessing you are missing the main MAC. -- Amos.