Revision 384acbf4 posix-aio-compat.c

b/posix-aio-compat.c
49 49
    ssize_t ret;
50 50
    int active;
51 51
    struct qemu_paiocb *next;
52

  
53
    int async_context_id;
54 52
};
55 53

  
56 54
typedef struct PosixAioState {
......
420 418
    struct qemu_paiocb *acb, **pacb;
421 419
    int ret;
422 420
    int result = 0;
423
    int async_context_id = get_async_context_id();
424 421

  
425 422
    for(;;) {
426 423
        pacb = &s->first_aio;
......
429 426
            if (!acb)
430 427
                return result;
431 428

  
432
            /* we're only interested in requests in the right context */
433
            if (acb->async_context_id != async_context_id) {
434
                pacb = &acb->next;
435
                continue;
436
            }
437

  
438 429
            ret = qemu_paio_error(acb);
439 430
            if (ret == ECANCELED) {
440 431
                /* remove the request */
......
575 566
    acb->aio_type = type;
576 567
    acb->aio_fildes = fd;
577 568
    acb->ev_signo = SIGUSR2;
578
    acb->async_context_id = get_async_context_id();
579 569

  
580 570
    if (qiov) {
581 571
        acb->aio_iov = qiov->iov;
......
604 594
    acb->aio_type = QEMU_AIO_IOCTL;
605 595
    acb->aio_fildes = fd;
606 596
    acb->ev_signo = SIGUSR2;
607
    acb->async_context_id = get_async_context_id();
608 597
    acb->aio_offset = 0;
609 598
    acb->aio_ioctl_buf = buf;
610 599
    acb->aio_ioctl_cmd = req;

Also available in: Unified diff