qemu_mutex_unlock(&vt->mutex);
/* Get a queue buffer which is written by guest side. */
- do {
- elem = virtqueue_pop(vt->vq, sizeof(VirtQueueElement));
- } while (elem);
+ elem = virtqueue_pop(vt->vq, sizeof(VirtQueueElement));
qemu_mutex_lock(&vt->mutex);
while (!QTAILQ_EMPTY(&events_queue)) {
/* copy event into virtio buffer */
len = iov_from_buf(elem->in_sg, elem->in_num, push_len,
&(event_entry->tablet), sizeof(EmulTabletEvent));
- if(len != sizeof(EmulTabletEvent)) {
+ if (len != sizeof(EmulTabletEvent)) {
LOG_WARNING("len != sizeof(EmulTabletEvent).\n");
LOG_WARNING("len: %zu, sizeof(EmulTabletEvent): %zu\n",
- len, sizeof(EmulTabletEvent));
+ len, sizeof(EmulTabletEvent));
}
push_len += sizeof(EmulTabletEvent);