Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to use the in-qemu API for virtio serial device
    primarykey
    data
    text
    <p>I want to exchange "complex" data (hierarchical structs) between the guest and the host in a KVM+Qemu setup. </p> <p>My idea was to use the virtio serial driver to do so. A guest application would use the normal I/O functions such as open(2), close(2), read(2) and write(2) to send the "buffer" (=the struct I want to send) to the virtio serial back-end. The back-end driver would run inside Qemu and receive the pointer to the struct through the in-qemu host API described here: <a href="http://www.linux-kvm.org/page/Virtio-serial_API" rel="nofollow">http://www.linux-kvm.org/page/Virtio-serial_API</a></p> <p>My question now may be relatively trivial, but I was looking around all over Google and couldn't find anything: How do I "hook into qemu" such that I can use the virtio serial host API?</p> <p>I understand that I have to provide an init function like <code>void my_init(void) { virtio_serial_port_qdev_register(&amp;myinfo); }</code> and register it with qemu using <code>device_init(&amp;my_init)</code>. However, I do not understand how I link my module with qemu? Do I have to add my source files to the qemu code base and makefiles and recompile qemu? Or can I compile it separately and use some magic qemu command line option to load it? Or something completely different?</p> <p>(Note: I know that I could optionally serialize my data, send it to a socket on the host, and de-serialize it there, but I wanted to avoid the serialization overhead. If there is a way to use a shared memory region instead of a socket with an out-of-the-box virtIO serial device, this could be an option, too).</p> <p>Thank you all for your help! Christoph</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload