lkml.org 
[lkml]   [2018]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Qemu-devel] [RFC v2] qemu: Add virtio pmem device


> > +static void virtio_pmem_flush(VirtIODevice *vdev, VirtQueue *vq)
> > +{
> > + VirtQueueElement *elem;
> > + VirtIOPMEM *pmem = VIRTIO_PMEM(vdev);
> > + HostMemoryBackend *backend = MEMORY_BACKEND(pmem->memdev);
> > + int fd = memory_region_get_fd(&backend->mr);
> > +
> > + elem = virtqueue_pop(vq, sizeof(VirtQueueElement));
> > + if (!elem) {
> > + return;
> > + }
> > + /* flush raw backing image */
> > + fsync(fd);
>
> fsync(2) is a blocking syscall. This can hang QEMU for an unbounded
> amount of time.

o.k. Main thread will block, agree.

>
> Please do the fsync from a thread pool. See block/file-posix.c's
> aio_worker() for an example.

Sure!

>
> > +static void virtio_pmem_get_config(VirtIODevice *vdev, uint8_t *config)
> > +{
> > + VirtIOPMEM *pmem = VIRTIO_PMEM(vdev);
> > + struct virtio_pmem_config *pmemcfg = (struct virtio_pmem_config *)
> > config;
> > +
> > + pmemcfg->start = pmem->start;
> > + pmemcfg->size = pmem->size;
>
> Endianness. Please use virtio_st*_p() instead.

sure.

>
> > +#define VIRTIO_PMEM_PLUG 0
>
> What is this?

will remove

Thanks,
Pankaj

\
 
 \ /
  Last update: 2018-04-26 18:44    [W:0.102 / U:3.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site