ivshmem: use a single eventfd callback, get rid of CharDriver
commit9940c3236f318949c92099163281d5d23a9fcf4f
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Mon, 21 Dec 2015 11:10:13 +0000 (21 12:10 +0100)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 2 Feb 2016 12:28:58 +0000 (2 13:28 +0100)
treef03dbfbe9a298310d3b328099b798c9987746603
parentfd47bfe5ad423b4b09dc0244bda3b1346fa189ba
ivshmem: use a single eventfd callback, get rid of CharDriver

Simplify the interrupt handling by having a single callback on irq&msi
cases. Remove usage of CharDriver, replace it with
qemu_set_fd_handler(). Use event_notifier_test_and_clear() to read the
eventfd.

Before this patch, ivshmem writes the first byte received to
s->intrstatus. But ivshmem_device_spec.txt says "The status register is
set to 1 when an interrupt occurs." Fortunately, the byte usually comes
from another ivshmem device, and those always write 1.

After this commit, follows the specification, set to 1 when an interrupt
occurs.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
hw/misc/ivshmem.c