I found some test code in tools/virtio and drivers/vhost/test.c I guess this is what I wanted.
-Earlence On Tue, May 28, 2013 at 5:59 PM, Earlence Fernandes <earlencefe...@gmail.com > wrote: > Yes. using vring is the best plan. > > My need is as follows: in the host kernel, I have a module that kicks off > a kthread which basically services requests from other places in the > kernel. This kthread should in turn make requests to the guest virtio > driver. The guest virtio driver will service the request and hypercall back > to the host indicating completion of the request. > > To understand how to implement this I started looking at the > virtio_balloon driver (since it uses the stats_vq to wait for host > requests). This is the guest side of the connection. However, I'm clueless > as to how to setup the host side of the communication. I saw some code in > lguest.c (the launcher), but that seems to be all userspace helpers. can > somebody help me understand how to write the host-side of the communication > in a kernel module? > > -Earlence > > > On Mon, May 27, 2013 at 9:34 PM, Rusty Russell <ru...@rustcorp.com.au>wrote: > >> Earlence Fernandes <earlencefe...@gmail.com> writes: >> >> > Yep. I was grepping thru the sources. >> > >> > I think the best way would be to create a virtio device coupled with a >> > hypercall to return data (which is typically one value). >> > >> > Of course, I was thinking, what if I simply did a write() to lguest_fd >> and >> > pull that in the read loop in the guest... >> >> That's going to be less efficient than just using a virtio ring >> with a writable part in the descriptor for the reply (this is what >> virtio-blk does for a write, for example). >> >> Cheers, >> Rusty. >> > >
_______________________________________________ Lguest mailing list Lguest@lists.ozlabs.org https://lists.ozlabs.org/listinfo/lguest