On 15/05/2013 15:16, Stefan Hajnoczi wrote:
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().


Yes, we made virtio-bus hot-plugguable for virtio-mmio, which won't work like pci, s390 or CCW.
So virtio_net_set_netclient_name will not be called in that case.

Maybe worth to remove it and push it with virtio-mmio series? Peter?

Thanks,
Fred

Reply via email to