Revision f2e5dca4 block/sheepdog.c
b/block/sheepdog.c | ||
---|---|---|
531 | 531 |
unsigned int *rlen = srco->rlen; |
532 | 532 |
|
533 | 533 |
co = qemu_coroutine_self(); |
534 |
qemu_aio_set_fd_handler(sockfd, NULL, restart_co_req, NULL, co);
|
|
534 |
qemu_aio_set_fd_handler(sockfd, NULL, restart_co_req, co); |
|
535 | 535 |
|
536 | 536 |
ret = send_co_req(sockfd, hdr, data, wlen); |
537 | 537 |
if (ret < 0) { |
538 | 538 |
goto out; |
539 | 539 |
} |
540 | 540 |
|
541 |
qemu_aio_set_fd_handler(sockfd, restart_co_req, NULL, NULL, co);
|
|
541 |
qemu_aio_set_fd_handler(sockfd, restart_co_req, NULL, co); |
|
542 | 542 |
|
543 | 543 |
ret = qemu_co_recv(sockfd, hdr, sizeof(*hdr)); |
544 | 544 |
if (ret < sizeof(*hdr)) { |
... | ... | |
563 | 563 |
out: |
564 | 564 |
/* there is at most one request for this sockfd, so it is safe to |
565 | 565 |
* set each handler to NULL. */ |
566 |
qemu_aio_set_fd_handler(sockfd, NULL, NULL, NULL, NULL);
|
|
566 |
qemu_aio_set_fd_handler(sockfd, NULL, NULL, NULL); |
|
567 | 567 |
|
568 | 568 |
srco->ret = ret; |
569 | 569 |
srco->finished = true; |
... | ... | |
804 | 804 |
return fd; |
805 | 805 |
} |
806 | 806 |
|
807 |
qemu_aio_set_fd_handler(fd, co_read_response, NULL, NULL, s);
|
|
807 |
qemu_aio_set_fd_handler(fd, co_read_response, NULL, s); |
|
808 | 808 |
return fd; |
809 | 809 |
} |
810 | 810 |
|
... | ... | |
1054 | 1054 |
|
1055 | 1055 |
qemu_co_mutex_lock(&s->lock); |
1056 | 1056 |
s->co_send = qemu_coroutine_self(); |
1057 |
qemu_aio_set_fd_handler(s->fd, co_read_response, co_write_request, |
|
1058 |
NULL, s); |
|
1057 |
qemu_aio_set_fd_handler(s->fd, co_read_response, co_write_request, s); |
|
1059 | 1058 |
socket_set_cork(s->fd, 1); |
1060 | 1059 |
|
1061 | 1060 |
/* send a header */ |
... | ... | |
1076 | 1075 |
} |
1077 | 1076 |
|
1078 | 1077 |
socket_set_cork(s->fd, 0); |
1079 |
qemu_aio_set_fd_handler(s->fd, co_read_response, NULL, |
|
1080 |
NULL, s); |
|
1078 |
qemu_aio_set_fd_handler(s->fd, co_read_response, NULL, s); |
|
1081 | 1079 |
qemu_co_mutex_unlock(&s->lock); |
1082 | 1080 |
|
1083 | 1081 |
return 0; |
... | ... | |
1335 | 1333 |
g_free(buf); |
1336 | 1334 |
return 0; |
1337 | 1335 |
out: |
1338 |
qemu_aio_set_fd_handler(s->fd, NULL, NULL, NULL, NULL);
|
|
1336 |
qemu_aio_set_fd_handler(s->fd, NULL, NULL, NULL); |
|
1339 | 1337 |
if (s->fd >= 0) { |
1340 | 1338 |
closesocket(s->fd); |
1341 | 1339 |
} |
... | ... | |
1563 | 1561 |
error_report("%s, %s", sd_strerror(rsp->result), s->name); |
1564 | 1562 |
} |
1565 | 1563 |
|
1566 |
qemu_aio_set_fd_handler(s->fd, NULL, NULL, NULL, NULL);
|
|
1564 |
qemu_aio_set_fd_handler(s->fd, NULL, NULL, NULL); |
|
1567 | 1565 |
closesocket(s->fd); |
1568 | 1566 |
g_free(s->host_spec); |
1569 | 1567 |
} |
Also available in: Unified diff