[Lguest] Communication between host and guest

Earlence Fernandes earlenceferns at gmail.com
Sun Jun 2 12:18:32 EST 2013


So the rings are always designed to be in userspace?
Or can I simply allocate them in kernel space?

What is the point of the "kernel-space" functions then?

-Earlence


On Sat, Jun 1, 2013 at 8:57 AM, Rusty Russell <rusty at rustcorp.com.au> wrote:

> Earlence Fernandes <earlenceferns at gmail.com> writes:
> > So I've spent some time studying the sources to the balloon driver and
> the
> > "vringh" implementation.
> > My understanding is that I will write a driver similar to the balloon in
> > terms of communication. That is, my driver
> > will initialize a virtqueue for incoming requests. It will initialize the
> > vq's using scatterlist init functions (as in the balloon driver).
> >
> > Then my "device" in the host kernel will use the same functions as vringh
> > (or use vringh functions themselves?) to send
> > and receive data from the driver in the guest.
> >
> > I don't understand how the vringh functions will get pointers to the
> > descriptors initialized in the guest?
> > Coz, for example, I guess I will have to use
> > int vringh_init_kern(struct vringh *vrh, u32 features,
> >      unsigned int num, bool weak_barriers,
> >      struct vring_desc *desc,
> >      struct vring_avail *avail,
> >      struct vring_used *used);
> >
> > as an init function in my host "device". I think that these pointers are
> to
> > guest virtqueues, so how ill this function be called correctly?
>
> (You'll actually use the vringh_*_user functions, BTW).
>
> You will have to add an ioctl for the Launcher to tell your code where
> the virtio queue rings are.
>
> Cheers,
> Rusty.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/lguest/attachments/20130601/f20b7b33/attachment.html>


More information about the Lguest mailing list