On Wed, Apr 10, 2019 at 4:45 PM Yoni Bettan <ybet...@redhat.com> wrote: > On 4/9/19 4:17 PM, Stefan Hajnoczi wrote: > > On Mon, Apr 01, 2019 at 02:18:43PM +0300, Yoni Bettan wrote: > > There are multiple problems with the code, but the larger issue is that > > this example device is just helping people shoot themselves in the foot > > more easily. > > > If you can point me to those problem I will be glad so I can update the > code and understand those problems you are talking about.
Please see Eduardo's reply. I didn't review much since he already pointed out many things. One thing he didn't mention: + elem = virtqueue_pop(vq, sizeof(VirtQueueElement)); The return value can be NULL. Spurious notifications could happen so the code shouldn't crash when this returns NULL. I apologize for the critical replies. What you're doing is valuable. I think explaining the VIRTIO device model and the order in which things are done will lead to higher quality devices so I'm making a lot of noise about it :). Stefan