質問

I've been trying to get into QEMU development in order to virtualize a not supported hardware.

I want to develop a new QEMU i2c device (qemu x86), that would get/send data to an application running on the guest. Thing is : I need these data onto the host, as a daemon will send/get the same kind of data to the guest.

My questions are : is it easy to get the data from this device ? Are there any examples already in QEMU that can fit my needs ?

PS : my i2c device is only a "bridge" between the host and the guest. I need the application to use i2c (can't change that).

役に立ちましたか?

解決

Typically, the qemu device will use the "chardev" abstraction to get data from a socket on the host. For example, something like -chardev socket,path=/tmp/foo.sock,server,nowait,id=foo -device myi2c,chardev=foo will connect your i2c device to a socket on the host.

There are many examples of devices that use chardevs in QEMU's hw/char directory. A simple example is digic-uart.c.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top