static bool check_ready(VirtIOMaruInput *input)
{
+ if (!input) {
+ // device is not realized yet.
+ return false;
+ }
+
if (unlikely(!virtio_queue_ready(input->vq))) {
LOG_INFO("virtqueue is not ready, dropping event.\n");
return false;
static void virtio_keyboard_device_reset(VirtIODevice *vdev)
{
- VirtIOKeyboard *vkbd = (VirtIOKeyboard *)vdev;
+ VirtIOKeyboard *kbd = (VirtIOKeyboard *)vdev;
LOG_INFO("%s\n", __func__);
- vkbd->extension_key = 0;
+ kbd->extension_key = 0;
input_common_reset(vdev);
}