]> git.proxmox.com Git - mirror_qemu.git/commit - net.c
Fix automatically assigned network names for netdev
authorMarkus Armbruster <armbru@redhat.com>
Thu, 16 Jun 2011 16:45:36 +0000 (18:45 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 19 Jul 2011 12:11:22 +0000 (15:11 +0300)
commit53e51d85ef1fdd295c8f09792b8e7490c148f4b3
tree291fbed615365901ad90ab5f2bd691539056f313
parentc8eac1cfa1e9104a658b4614ada758861b8d823a
Fix automatically assigned network names for netdev

If a network client doesn't have a name, we make one up, with
assign_name().  assign_name() creates a name MODEL.NUM, where MODEL is
the client's model, and NUM is the number of MODELs that already
exist.

Bug: it misses clients that are not on a VLAN, i.e. netdevs and the
NICs using them:

    $ qemu-system-x86_64 -nodefaults -vnc :0 -S -monitor stdio -netdev user,id=hostnet0 -net nic,netdev=hostnet0 -netdev user,id=hostnet1 -net nic,netdev=hostnet1
    QEMU 0.14.50 monitor - type 'help' for more information
    (qemu) info network
    Devices not on any VLAN:
      hostnet0: net=10.0.2.0, restricted=n peer=e1000.0
      hostnet1: net=10.0.2.0, restricted=n peer=e1000.0
      e1000.0: model=e1000,macaddr=52:54:00:12:34:56 peer=hostnet0
      e1000.0: model=e1000,macaddr=52:54:00:12:34:57 peer=hostnet1

Fix that.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
net.c