[Lguest] Communication between host and guest

Rusty Russell rusty at rustcorp.com.au
Sat Jun 1 22:57:19 EST 2013


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.


More information about the Lguest mailing list