> -----Original Message-----
> From: Stefano Garzarella [mailto:sgarz...@redhat.com]
> Sent: Monday, March 28, 2022 11:00 PM
> To: Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
> <longpe...@huawei.com>
> Cc: Stefan Hajnoczi <stefa...@redhat.com>; Michael Tsirkin <m...@redhat.com>;
> Cornelia Huck <coh...@redhat.com>; Paolo Bonzini <pbonz...@redhat.com>;
> Gonglei (Arei) <arei.gong...@huawei.com>; Yechuan <yech...@huawei.com>;
> Huangzhichao <huangzhic...@huawei.com>; qemu devel list 
> <qemu-devel@nongnu.org>
> Subject: Re: [PATCH v3 05/10] vdpa-dev: implement the realize interface
> 
> On Sat, Mar 19, 2022 at 03:20:07PM +0800, Longpeng(Mike) wrote:
> >From: Longpeng <longpe...@huawei.com>
> >

[snap]

> > static void vhost_vdpa_device_unrealize(DeviceState *dev)
> >@@ -66,6 +197,7 @@ static void vhost_vdpa_device_set_status(VirtIODevice 
> >*vdev,
> uint8_t status)
> > static Property vhost_vdpa_device_properties[] = {
> >     DEFINE_PROP_STRING("vdpa-dev", VhostVdpaDevice, vdpa_dev),
> >     DEFINE_PROP_INT32("vdpa-dev-fd", VhostVdpaDevice, vdpa_dev_fd, -1),
> 
> Other vhost devices use the `vhostfd` property, maybe we should use the
> same name.
> 
> If we go for this change, then maybe we also need to change `vdpa-dev`
> to `vhostpath` or something like that
> 

Make sense.

I prefer to use 'vhostdev' for the file path, just like the usage in Netdev:
  -netdev type=vhost-vdpa,vhostdev=/dev/vhost-vdpa-0,id=vhostvdpa1

> Thanks,
> Stefano
> 
> >+    DEFINE_PROP_UINT16("queue-size", VhostVdpaDevice, queue_size, 0),
> >     DEFINE_PROP_END_OF_LIST(),
> > };
> >
> >diff --git a/include/hw/virtio/vdpa-dev.h b/include/hw/virtio/vdpa-dev.h
> >index 476bda0873..cf11abd0f7 100644
> >--- a/include/hw/virtio/vdpa-dev.h
> >+++ b/include/hw/virtio/vdpa-dev.h
> >@@ -28,6 +28,16 @@ struct VhostVdpaDevice {
> >     char *vdpa_dev;
> >     int vdpa_dev_fd;
> >     int32_t bootindex;
> >+    uint32_t vdev_id;
> >+    uint32_t num_queues;
> >+    struct vhost_dev dev;
> >+    struct vhost_vdpa vdpa;
> >+    VirtQueue **virtqs;
> >+    uint8_t *config;
> >+    int config_size;
> >+    uint16_t queue_size;
> >+    bool started;
> >+    int (*post_init)(VhostVdpaDevice *v, Error **errp);
> > };
> >
> > #endif
> >--
> >2.23.0
> >


Reply via email to