mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
qdev/net: common nic property bits
Add a new type for properties common to all nics. Add helper functions and macros to deal with it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
851bec091d
commit
ed16ab5afa
2 changed files with 23 additions and 0 deletions
|
@ -383,6 +383,15 @@ void qdev_get_macaddr(DeviceState *dev, uint8_t *macaddr)
|
|||
memcpy(macaddr, dev->nd->macaddr, 6);
|
||||
}
|
||||
|
||||
void qdev_set_nic_properties(DeviceState *dev, NICInfo *nd)
|
||||
{
|
||||
qdev_prop_set_macaddr(dev, "mac", nd->macaddr);
|
||||
if (nd->vlan)
|
||||
qdev_prop_set_vlan(dev, "vlan", nd->vlan);
|
||||
if (nd->netdev)
|
||||
qdev_prop_set_netdev(dev, "netdev", nd->netdev);
|
||||
}
|
||||
|
||||
static int next_block_unit[IF_COUNT];
|
||||
|
||||
/* Get a block device. This should only be used for single-drive devices
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue