<div dir="ltr">So the rings are always designed to be in userspace?<div>Or can I simply allocate them in kernel space?</div><div><br></div><div>What is the point of the "kernel-space" functions then?</div><div><br>

</div><div>-Earlence</div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Sat, Jun 1, 2013 at 8:57 AM, Rusty Russell <span dir="ltr"><<a href="mailto:rusty@rustcorp.com.au" target="_blank">rusty@rustcorp.com.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


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