qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-1.5 1/2] virtio-net: add virtio_net_set_netc


From: KONRAD Frédéric
Subject: Re: [Qemu-devel] [PATCH for-1.5 1/2] virtio-net: add virtio_net_set_netclient_name.
Date: Wed, 15 May 2013 15:28:28 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4

On 15/05/2013 15:16, Stefan Hajnoczi wrote:
On Wed, May 15, 2013 at 02:12:49PM +0200, address@hidden 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

[Prev in Thread] Current Thread [Next in Thread]