On Wed, May 15, 2013 at 02:12:49PM +0200, fred.kon...@greensocs.com wrote: > @@ -1315,8 +1338,17 @@ static int virtio_net_device_init(VirtIODevice *vdev) > memcpy(&n->mac[0], &n->nic_conf.macaddr, sizeof(n->mac)); > n->status = VIRTIO_NET_S_LINK_UP; > > - n->nic = qemu_new_nic(&net_virtio_info, &n->nic_conf, > - object_get_typename(OBJECT(qdev)), qdev->id, n); > + if (n->netclient_type) { > + /* > + * Happen when virtio_net_set_netclient_name has been called. > + */ > + n->nic = qemu_new_nic(&net_virtio_info, &n->nic_conf, > + n->netclient_type, n->netclient_name, n); > + } else { > + n->nic = qemu_new_nic(&net_virtio_info, &n->nic_conf, > + object_get_typename(OBJECT(qdev)), qdev->id, > n); > + }
Does the 'else' case ever happen? In the next patch you update all callers to invoke virtio_net_set_netclient_name().