本文整理汇总了C++中qemu_aio_wait函数的典型用法代码示例。如果您正苦于以下问题:C++ qemu_aio_wait函数的具体用法?C++ qemu_aio_wait怎么用?C++ qemu_aio_wait使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了qemu_aio_wait函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: iscsi_ioctl
static int iscsi_ioctl(BlockDriverState *bs, unsigned long int req, void *buf)
{
IscsiLun *iscsilun = bs->opaque;
int status;
switch (req) {
case SG_GET_VERSION_NUM:
*(int *)buf = 30000;
break;
case SG_GET_SCSI_ID:
((struct sg_scsi_id *)buf)->scsi_type = iscsilun->type;
break;
case SG_IO:
status = -EINPROGRESS;
iscsi_aio_ioctl(bs, req, buf, ioctl_cb, &status);
while (status == -EINPROGRESS) {
qemu_aio_wait();
}
return 0;
default:
return -1;
}
return 0;
}
示例2: do_co_write_zeroes
static int do_co_write_zeroes(int64_t offset, int count, int *total)
{
Coroutine *co;
CoWriteZeroes data = {
.offset = offset,
.count = count,
.total = total,
.done = false,
};
co = qemu_coroutine_create(co_write_zeroes_entry);
qemu_coroutine_enter(co, &data);
while (!data.done) {
qemu_aio_wait();
}
if (data.ret < 0) {
return data.ret;
} else {
return 1;
}
}
static int do_write_compressed(char *buf, int64_t offset, int count, int *total)
{
int ret;
ret = bdrv_write_compressed(bs, offset >> 9, (uint8_t *)buf, count >> 9);
if (ret < 0) {
return ret;
}
*total = count;
return 1;
}
示例3: do_co_write_zeroes
static int do_co_write_zeroes(int64_t offset, int count, int *total)
{
Coroutine *co;
CoWriteZeroes data = {
.offset = offset,
.count = count,
.total = total,
.done = false,
};
co = qemu_coroutine_create(co_write_zeroes_entry);
qemu_coroutine_enter(co, &data);
while (!data.done) {
qemu_aio_wait();
}
if (data.ret < 0) {
return data.ret;
} else {
return 1;
}
}
static int do_load_vmstate(char *buf, int64_t offset, int count, int *total)
{
*total = bdrv_load_vmstate(bs, (uint8_t *)buf, offset, count);
if (*total < 0) {
return *total;
}
return 1;
}
示例4: wait_break_f
static int wait_break_f(int argc, char **argv)
{
while (!bdrv_debug_is_suspended(bs, argv[1])) {
qemu_aio_wait();
}
return 0;
}
示例5: qemu_gluster_aio_cancel
static void qemu_gluster_aio_cancel(BlockDriverAIOCB *blockacb)
{
GlusterAIOCB *acb = (GlusterAIOCB *)blockacb;
bool finished = false;
acb->finished = &finished;
while (!finished) {
qemu_aio_wait();
}
}
示例6: qed_read_l2_table_sync
int qed_read_l2_table_sync(BDRVQEDState *s, QEDRequest *request, uint64_t offset)
{
int ret = -EINPROGRESS;
qed_read_l2_table(s, request, offset, qed_sync_cb, &ret);
while (ret == -EINPROGRESS) {
qemu_aio_wait();
}
return ret;
}
示例7: blkverify_aio_cancel
static void blkverify_aio_cancel(BlockDriverAIOCB *blockacb)
{
BlkverifyAIOCB *acb = (BlkverifyAIOCB *)blockacb;
bool finished = false;
/* Wait until request completes, invokes its callback, and frees itself */
acb->finished = &finished;
while (!finished) {
qemu_aio_wait();
}
}
示例8: qed_aio_cancel
static void qed_aio_cancel(BlockDriverAIOCB *blockacb)
{
QEDAIOCB *acb = (QEDAIOCB *)blockacb;
bool finished = false;
/* Wait for the request to finish */
acb->finished = &finished;
while (!finished) {
qemu_aio_wait();
}
}
示例9: qemu_rbd_aio_cancel
/*
* Cancel aio. Since we don't reference acb in a non qemu threads,
* it is safe to access it here.
*/
static void qemu_rbd_aio_cancel(BlockDriverAIOCB *blockacb)
{
RBDAIOCB *acb = (RBDAIOCB *) blockacb;
acb->cancelled = 1;
while (acb->status == -EINPROGRESS) {
qemu_aio_wait();
}
qemu_aio_release(acb);
}
示例10: qed_read_l1_table_sync
int qed_read_l1_table_sync(BDRVQEDState *s)
{
int ret = -EINPROGRESS;
qed_read_table(s, s->header.l1_table_offset,
s->l1_table, qed_sync_cb, &ret);
while (ret == -EINPROGRESS) {
qemu_aio_wait();
}
return ret;
}
示例11: qed_write_l2_table_sync
int qed_write_l2_table_sync(BDRVQEDState *s, QEDRequest *request,
unsigned int index, unsigned int n, bool flush)
{
int ret = -EINPROGRESS;
qed_write_l2_table(s, request, index, n, flush, qed_sync_cb, &ret);
while (ret == -EINPROGRESS) {
qemu_aio_wait();
}
return ret;
}
示例12: qed_write_l1_table_sync
int qed_write_l1_table_sync(BDRVQEDState *s, unsigned int index,
unsigned int n)
{
int ret = -EINPROGRESS;
qed_write_l1_table(s, index, n, qed_sync_cb, &ret);
while (ret == -EINPROGRESS) {
qemu_aio_wait();
}
return ret;
}
示例13: do_aio_writev
static int do_aio_writev(QEMUIOVector *qiov, int64_t offset, int *total)
{
int async_ret = NOT_DONE;
bdrv_aio_writev(bs, offset >> 9, qiov, qiov->size >> 9,
aio_rw_done, &async_ret);
while (async_ret == NOT_DONE) {
qemu_aio_wait();
}
*total = qiov->size;
return async_ret < 0 ? async_ret : 1;
}
示例14: do_aio_multiwrite
static int do_aio_multiwrite(BlockRequest* reqs, int num_reqs, int *total)
{
int i, ret;
struct multiwrite_async_ret async_ret = {
.num_done = 0,
.error = 0,
};
*total = 0;
for (i = 0; i < num_reqs; i++) {
reqs[i].cb = multiwrite_cb;
reqs[i].opaque = &async_ret;
*total += reqs[i].qiov->size;
}
ret = bdrv_aio_multiwrite(bs, reqs, num_reqs);
if (ret < 0) {
return ret;
}
while (async_ret.num_done < num_reqs) {
qemu_aio_wait();
}
return async_ret.error < 0 ? async_ret.error : 1;
}
static void
read_help(void)
{
printf(
"\n"
" reads a range of bytes from the given offset\n"
"\n"
" Example:\n"
" 'read -v 512 1k' - dumps 1 kilobyte read from 512 bytes into the file\n"
"\n"
" Reads a segment of the currently open file, optionally dumping it to the\n"
" standard output stream (with -v option) for subsequent inspection.\n"
" -b, -- read from the VM state rather than the virtual disk\n"
" -C, -- report statistics in a machine parsable format\n"
" -l, -- length for pattern verification (only with -P)\n"
" -p, -- use bdrv_pread to read the file\n"
" -P, -- use a pattern to verify read data\n"
" -q, -- quite mode, do not show I/O statistics\n"
" -s, -- start offset for pattern verification (only with -P)\n"
" -v, -- dump buffer to standard output\n"
"\n");
}
示例15: do_aio_writev
static int do_aio_writev(QEMUIOVector *qiov, int64_t offset, int *total)
{
BlockDriverAIOCB *acb;
int async_ret = NOT_DONE;
acb = bdrv_aio_writev(bs, offset >> 9, qiov, qiov->size >> 9,
aio_rw_done, &async_ret);
if (!acb)
return -EIO;
while (async_ret == NOT_DONE)
qemu_aio_wait();
*total = qiov->size;
return async_ret < 0 ? async_ret : 1;
}