On Mon, Jun 4, 2012 at 11:48 PM, Cyrill Gorcunov <gorcunov@xxxxxxxxxx> wrote: > On Mon, Jun 04, 2012 at 11:40:53PM +0800, Asias He wrote: >> >> +static void *virtio_blk_thread(void *dev) >> +{ >> + struct blk_dev *bdev = dev; >> + u64 data; >> + >> + while (1) { >> + read(bdev->io_efd, &data, sizeof(u64)); >> + virtio_blk_do_io(bdev->kvm, &bdev->vqs[0], bdev); >> + } >> + >> + pthread_exit(NULL); >> + return NULL; >> +} > > I must admit I don't understand this code ;) The data get read into > stack variable forever? The data we read itself is not interesting at all. virtio_blk_thread() sleeps on the eventfd bdev->io_efd until notify_vq() writes something to wake it up. -- Asias He -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html