Revision 72da4208 hw/virtio-net.c
b/hw/virtio-net.c | ||
---|---|---|
560 | 560 |
return 0; |
561 | 561 |
} |
562 | 562 |
|
563 |
void virtio_net_init(PCIBus *bus, NICInfo *nd, int devfn)
|
|
563 |
PCIDevice *virtio_net_init(PCIBus *bus, NICInfo *nd, int devfn)
|
|
564 | 564 |
{ |
565 | 565 |
VirtIONet *n; |
566 | 566 |
static int virtio_net_id; |
... | ... | |
574 | 574 |
sizeof(struct virtio_net_config), |
575 | 575 |
sizeof(VirtIONet)); |
576 | 576 |
if (!n) |
577 |
return; |
|
577 |
return NULL;
|
|
578 | 578 |
|
579 | 579 |
n->vdev.get_config = virtio_net_get_config; |
580 | 580 |
n->vdev.set_config = virtio_net_set_config; |
... | ... | |
599 | 599 |
|
600 | 600 |
n->mac_table.macs = qemu_mallocz(MAC_TABLE_ENTRIES * ETH_ALEN); |
601 | 601 |
if (!n->mac_table.macs) |
602 |
return; |
|
602 |
return NULL;
|
|
603 | 603 |
|
604 | 604 |
n->vlans = qemu_mallocz(MAX_VLAN >> 3); |
605 | 605 |
if (!n->vlans) |
606 |
return; |
|
606 |
return NULL;
|
|
607 | 607 |
|
608 | 608 |
register_savevm("virtio-net", virtio_net_id++, VIRTIO_NET_VM_VERSION, |
609 | 609 |
virtio_net_save, virtio_net_load, n); |
610 |
return (PCIDevice *)n; |
|
610 | 611 |
} |
Also available in: Unified diff