Re: [RFC PATCH 16/27] virtio: Expose virtqueue_alloc_element

2020-12-10 Thread Stefan Hajnoczi
On Wed, Dec 09, 2020 at 07:46:49PM +0100, Eugenio Perez Martin wrote: > On Tue, Dec 8, 2020 at 9:26 AM Stefan Hajnoczi wrote: > > > > On Fri, Nov 20, 2020 at 07:50:54PM +0100, Eugenio Pérez wrote: > > > Specify VirtQueueElement * as return type makes no harm at this moment. > > > > The reason for

Re: [RFC PATCH 16/27] virtio: Expose virtqueue_alloc_element

2020-12-09 Thread Eugenio Perez Martin
On Tue, Dec 8, 2020 at 9:26 AM Stefan Hajnoczi wrote: > > On Fri, Nov 20, 2020 at 07:50:54PM +0100, Eugenio Pérez wrote: > > Specify VirtQueueElement * as return type makes no harm at this moment. > > The reason for the void * return type is that C implicitly converts void > pointers to pointers o

Re: [RFC PATCH 16/27] virtio: Expose virtqueue_alloc_element

2020-12-08 Thread Stefan Hajnoczi
On Fri, Nov 20, 2020 at 07:50:54PM +0100, Eugenio Pérez wrote: > Specify VirtQueueElement * as return type makes no harm at this moment. The reason for the void * return type is that C implicitly converts void pointers to pointers of any type. The function takes a size_t sz argument so it can allo

[RFC PATCH 16/27] virtio: Expose virtqueue_alloc_element

2020-11-20 Thread Eugenio Pérez
Specify VirtQueueElement * as return type makes no harm at this moment. Signed-off-by: Eugenio Pérez --- include/hw/virtio/virtio.h | 2 ++ hw/virtio/virtio.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h in