Message ID | 20200831082737.10983-5-jasowang@redhat.com |
---|---|
State | New |
Headers | show |
Series | refine vhost-vdpa initialization | expand |
On 31/08/2020 10:27, Jason Wang wrote: > We use "vhost-vdpa" as nic info string which is not useful, let's add > the vhostdev path. > > before: > info network > v0: index=0,type=vhost-vdpa,vhost-vdpa > > after: > info network > v0: index=0,type=vhost-vdpa,vhostdev=/dev/vhost-vdpa-0 > > Signed-off-by: Jason Wang <jasowang@redhat.com> > --- > net/vhost-vdpa.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c > index c4568b885e..397d4d3082 100644 > --- a/net/vhost-vdpa.c > +++ b/net/vhost-vdpa.c > @@ -181,7 +181,7 @@ static int net_vhost_vdpa_init(NetClientState *peer, const char *device, > int ret = 0; > assert(name); > nc = qemu_new_net_client(&net_vhost_vdpa_info, peer, device, name); > - snprintf(nc->info_str, sizeof(nc->info_str), TYPE_VHOST_VDPA); > + snprintf(nc->info_str, sizeof(nc->info_str), "vhostdev=%s", vhostdev); > nc->queue_index = 0; > s = DO_UPCAST(VhostVDPAState, nc, nc); > vdpa_device_fd = qemu_open(vhostdev, O_RDWR); > Reviewed-by: Laurent Vivier <lvivier@redhat.com>
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index c4568b885e..397d4d3082 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -181,7 +181,7 @@ static int net_vhost_vdpa_init(NetClientState *peer, const char *device, int ret = 0; assert(name); nc = qemu_new_net_client(&net_vhost_vdpa_info, peer, device, name); - snprintf(nc->info_str, sizeof(nc->info_str), TYPE_VHOST_VDPA); + snprintf(nc->info_str, sizeof(nc->info_str), "vhostdev=%s", vhostdev); nc->queue_index = 0; s = DO_UPCAST(VhostVDPAState, nc, nc); vdpa_device_fd = qemu_open(vhostdev, O_RDWR);
We use "vhost-vdpa" as nic info string which is not useful, let's add the vhostdev path. before: info network v0: index=0,type=vhost-vdpa,vhost-vdpa after: info network v0: index=0,type=vhost-vdpa,vhostdev=/dev/vhost-vdpa-0 Signed-off-by: Jason Wang <jasowang@redhat.com> --- net/vhost-vdpa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)