qdev: Catch attempt to attach more than one device to a netdev
authorMarkus Armbruster <armbru@redhat.com>
Fri, 26 Feb 2010 14:50:51 +0000 (15:50 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Tue, 9 Mar 2010 14:47:20 +0000 (08:47 -0600)
commit78a9d73d4d1d4ff6b75d85f11cf14fbe50f0e867
treed0de32edc07951138978e8425d09084d3930838d
parentc6e755c30f022566035e0949755fa840b8fb40ef
qdev: Catch attempt to attach more than one device to a netdev

Guest device and host netdev are peers, i.e. it's a 1:1 relation.
However, we fail to enforce that:

    $ qemu -nodefaults --nographic -netdev user,id=net0 -device e1000,netdev=net0 -device virtio-net-pci,netdev=net0 -monitor stdio
    QEMU 0.12.50 monitor - type 'help' for more information
    (qemu) info network
    Devices not on any VLAN:
      net0: net=10.0.2.0, restricted=n peer=virtio-net-pci.0
      e1000.0: model=e1000,macaddr=52:54:00:12:34:56 peer=net0
      virtio-net-pci.0: model=virtio-net-pci,macaddr=52:54:00:12:34:57 peer=net0

It's all downhill from there.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/qdev-properties.c
net.c