Re: [Qemu-devel] [PATCH v8 2/6] virtio-pmem: Add virtio pmem driver

2019-05-14 Thread Pankaj Gupta
> >> > >> I think you should do the same here, vdev->priv is allocated in > >> virtio_pmem_probe. > >> > >> But maybe I am missing something important here :) > > > > Because virtio_balloon use "kzalloc" for allocation and needs to be freed. > > But virtio pmem uses "devm_kzalloc" which takes ca

Re: [Qemu-devel] [PATCH v8 2/6] virtio-pmem: Add virtio pmem driver

2019-05-14 Thread David Hildenbrand
>> >> I think you should do the same here, vdev->priv is allocated in >> virtio_pmem_probe. >> >> But maybe I am missing something important here :) > > Because virtio_balloon use "kzalloc" for allocation and needs to be freed. > But virtio pmem uses "devm_kzalloc" which takes care of automatical

Re: [Qemu-devel] [PATCH v8 2/6] virtio-pmem: Add virtio pmem driver

2019-05-14 Thread Pankaj Gupta
> > >> > >>> + } > >>> + > >>> + /* When host has read buffer, this completes via host_ack */ > >> > >> "A host repsonse results in "host_ack" getting called" ... ? > >> > >>> + wait_event(req->host_acked, req->done); > >>> + err = req->ret; > >>> +ret: > >>> + kfree(req); > >>> + return err; >

Re: [Qemu-devel] [PATCH v8 2/6] virtio-pmem: Add virtio pmem driver

2019-05-14 Thread David Hildenbrand
>> >>> + } >>> + >>> + /* When host has read buffer, this completes via host_ack */ >> >> "A host repsonse results in "host_ack" getting called" ... ? >> >>> + wait_event(req->host_acked, req->done); >>> + err = req->ret; >>> +ret: >>> + kfree(req); >>> + return err; >>> +}; >>> + >>> +

Re: [Qemu-devel] [PATCH v8 2/6] virtio-pmem: Add virtio pmem driver

2019-05-14 Thread Pankaj Gupta
Hi David, Thank you for the review. > On 10.05.19 17:51, Pankaj Gupta wrote: > > This patch adds virtio-pmem driver for KVM guest. > > > > Guest reads the persistent memory range information from > > Qemu over VIRTIO and registers it on nvdimm_bus. It also > > creates a nd_region object with t

Re: [Qemu-devel] [PATCH v8 2/6] virtio-pmem: Add virtio pmem driver

2019-05-14 Thread David Hildenbrand
On 10.05.19 17:51, Pankaj Gupta wrote: > This patch adds virtio-pmem driver for KVM guest. > > Guest reads the persistent memory range information from > Qemu over VIRTIO and registers it on nvdimm_bus. It also > creates a nd_region object with the persistent memory > range information so that exi

Re: [Qemu-devel] [PATCH v8 2/6] virtio-pmem: Add virtio pmem driver

2019-05-12 Thread Pankaj Gupta
> > Guest reads the persistent memory range information from > > Qemu over VIRTIO and registers it on nvdimm_bus. It also > > creates a nd_region object with the persistent memory > > range information so that existing 'nvdimm/pmem' driver > > can reserve this into system memory map. This way > >

Re: [Qemu-devel] [PATCH v8 2/6] virtio-pmem: Add virtio pmem driver

2019-05-12 Thread Michael S. Tsirkin
On Fri, May 10, 2019 at 09:21:58PM +0530, Pankaj Gupta wrote: > This patch adds virtio-pmem driver for KVM guest. > > Guest reads the persistent memory range information from > Qemu over VIRTIO and registers it on nvdimm_bus. It also > creates a nd_region object with the persistent memory > range

[Qemu-devel] [PATCH v8 2/6] virtio-pmem: Add virtio pmem driver

2019-05-10 Thread Pankaj Gupta
This patch adds virtio-pmem driver for KVM guest. Guest reads the persistent memory range information from Qemu over VIRTIO and registers it on nvdimm_bus. It also creates a nd_region object with the persistent memory range information so that existing 'nvdimm/pmem' driver can reserve this into sy