qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 for-4.0 2/7] vhost-user: Support providing sh


From: Yongji Xie
Subject: Re: [Qemu-devel] [PATCH v2 for-4.0 2/7] vhost-user: Support providing shared memory to backend
Date: Tue, 18 Dec 2018 23:10:58 +0800

On Tue, 18 Dec 2018 at 22:57, Michael S. Tsirkin <address@hidden> wrote:
>
> On Tue, Dec 18, 2018 at 10:47:32PM +0800, Yongji Xie wrote:
> > On Tue, 18 Dec 2018 at 22:25, Michael S. Tsirkin <address@hidden> wrote:
> > >
> > > On Tue, Dec 18, 2018 at 05:59:57PM +0800, address@hidden wrote:
> > > > From: Xie Yongji <address@hidden>
> > > >
> > > > This patch introduces two new messages VHOST_USER_GET_SHM_SIZE
> > > > and VHOST_USER_SET_SHM_FD to support providing shared
> > > > memory to backend.
> > > >
> > > > Firstly, qemu uses VHOST_USER_GET_SHM_SIZE to get the
> > > > required size of shared memory from backend. Then, qemu
> > > > allocates memory and sends them back to backend through
> > > > VHOST_USER_SET_SHM_FD.
> > > >
> > > > Note that the shared memory should be used to record
> > > > inflight I/O by backend. Qemu will clear it when vm reset.
> > >
> > > An interesting design choice. Why not let the backend clear it
> > > on start?
> > >
> >
> > The backend might restart when it has some inflight I/Os. In this case,
> > it should not clear the memory on start, right?
> >
> > Thanks,
> > Yongji
>
> I see. So this allows backend to detect a non-initialized buffer
> by checking e.g. a version is 0? Clever.
>

If the version is a variable in the buffer, yes, we can detect whether
the buffer is initialized or not by checking it.

Thanks,
Yongji



reply via email to

[Prev in Thread] Current Thread [Next in Thread]