summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2009-09-14 07:07:28 -0300
committerMarcelo Tosatti <mtosatti@redhat.com>2009-09-14 07:07:28 -0300
commit8ee4a93637fd50121edbe2d50ae965da2fcfa949 (patch)
treee4fa00ce41d91206f26a4406364e7b9cef831495 /posix-aio-compat.c
parentMerge commit '9453c5bc2634fdbdd05450034c21a58806d366a4' into upstream-merge (diff)
parentram: remove support for loading v1 (diff)
downloadqemu-kvm-8ee4a93637fd50121edbe2d50ae965da2fcfa949.tar.gz
qemu-kvm-8ee4a93637fd50121edbe2d50ae965da2fcfa949.tar.bz2
qemu-kvm-8ee4a93637fd50121edbe2d50ae965da2fcfa949.zip
Merge commit '1a621c8dc9e4dcc9d385bdd2c24c5b5dbfd0ebe4' into upstream-merge
* commit '1a621c8dc9e4dcc9d385bdd2c24c5b5dbfd0ebe4': (51 commits) ram: remove support for loading v1 move mux focus field from CharDriverState to MuxDriver monitor: fix muxing qdev: add parser for chardev properties Allow -serial chardev:<name> convert udp chardev to QemuOpts. convert mux chardev to QemuOpts. convert vc chardev to QemuOpts. convert tty + parport chardevs to QemuOpts. convert windows console chardev to QemuOpts. convert braille chardev to QemuOpts. convert msmouse chardev to QemuOpts. convert stdio chardev to QemuOpts. convert pty chardev to QemuOpts. convert unix+tcp chardevs to QemuOpts. sockets: add inet_listen_opts sockets: add inet_connect_opts sockets: add unix_*_opts for windows. sockets: add unix_listen_opts sockets: add unix_connect_opts ... Conflicts: vl.c Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'posix-aio-compat.c')
-rw-r--r--posix-aio-compat.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/posix-aio-compat.c b/posix-aio-compat.c
index fd9e71645..9320b3d79 100644
--- a/posix-aio-compat.c
+++ b/posix-aio-compat.c
@@ -135,6 +135,16 @@ static size_t handle_aiocb_ioctl(struct qemu_paiocb *aiocb)
return aiocb->aio_nbytes;
}
+static size_t handle_aiocb_flush(struct qemu_paiocb *aiocb)
+{
+ int ret;
+
+ ret = fdatasync(aiocb->aio_fildes);
+ if (ret == -1)
+ return -errno;
+ return 0;
+}
+
#ifdef CONFIG_PREADV
static ssize_t
@@ -331,6 +341,9 @@ static void *aio_thread(void *unused)
case QEMU_AIO_WRITE:
ret = handle_aiocb_rw(aiocb);
break;
+ case QEMU_AIO_FLUSH:
+ ret = handle_aiocb_flush(aiocb);
+ break;
case QEMU_AIO_IOCTL:
ret = handle_aiocb_ioctl(aiocb);
break;
@@ -531,8 +544,10 @@ BlockDriverAIOCB *paio_submit(BlockDriverState *bs, void *aio_ctx, int fd,
acb->aio_type = type;
acb->aio_fildes = fd;
acb->ev_signo = SIGUSR2;
- acb->aio_iov = qiov->iov;
- acb->aio_niov = qiov->niov;
+ if (qiov) {
+ acb->aio_iov = qiov->iov;
+ acb->aio_niov = qiov->niov;
+ }
acb->aio_nbytes = nb_sectors * 512;
acb->aio_offset = sector_num * 512;