Revision b97564f4
b/block/sheepdog.c | ||
---|---|---|
541 | 541 |
return ret; |
542 | 542 |
} |
543 | 543 |
|
544 |
static coroutine_fn int do_co_req(int sockfd, SheepdogReq *hdr, void *data, |
|
545 |
unsigned int *wlen, unsigned int *rlen); |
|
546 |
|
|
544 | 547 |
static int do_req(int sockfd, SheepdogReq *hdr, void *data, |
545 | 548 |
unsigned int *wlen, unsigned int *rlen) |
546 | 549 |
{ |
547 | 550 |
int ret; |
548 | 551 |
|
552 |
if (qemu_in_coroutine()) { |
|
553 |
return do_co_req(sockfd, hdr, data, wlen, rlen); |
|
554 |
} |
|
555 |
|
|
549 | 556 |
socket_set_block(sockfd); |
550 | 557 |
ret = send_req(sockfd, hdr, data, wlen); |
551 | 558 |
if (ret < 0) { |
... | ... | |
1642 | 1649 |
int ret; |
1643 | 1650 |
|
1644 | 1651 |
if (bs->growable && sector_num + nb_sectors > bs->total_sectors) { |
1645 |
/* TODO: shouldn't block here */ |
|
1646 | 1652 |
ret = sd_truncate(bs, (sector_num + nb_sectors) * SECTOR_SIZE); |
1647 | 1653 |
if (ret < 0) { |
1648 | 1654 |
return ret; |
... | ... | |
1710 | 1716 |
hdr.opcode = SD_OP_FLUSH_VDI; |
1711 | 1717 |
hdr.oid = vid_to_vdi_oid(inode->vdi_id); |
1712 | 1718 |
|
1713 |
ret = do_co_req(s->flush_fd, (SheepdogReq *)&hdr, NULL, &wlen, &rlen);
|
|
1719 |
ret = do_req(s->flush_fd, (SheepdogReq *)&hdr, NULL, &wlen, &rlen); |
|
1714 | 1720 |
if (ret) { |
1715 | 1721 |
error_report("failed to send a request to the sheep"); |
1716 | 1722 |
return ret; |
Also available in: Unified diff