summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2009-10-28 11:51:32 +0000
committerMark McLoughlin <markmc@redhat.com>2009-10-28 11:52:42 +0000
commit4c3bad2f638cebe70864952a054ebeed6327daee (patch)
treee3bfa75a5f567befc3a7b7ba96d03bcfe98398c4 /posix-aio-compat.c
parentMerge commit '8febfa26846e75d38848255028dfe2d06e5ba941' into upstream-merge (diff)
parentnet: make tap_receive() re-use tap_receive_iov() code (diff)
downloadqemu-kvm-4c3bad2f638cebe70864952a054ebeed6327daee.tar.gz
qemu-kvm-4c3bad2f638cebe70864952a054ebeed6327daee.tar.bz2
qemu-kvm-4c3bad2f638cebe70864952a054ebeed6327daee.zip
Merge commit '38c75be3139a117b02350dbda9d48d47aa57fa3d' into upstream-merge
* commit '38c75be3139a117b02350dbda9d48d47aa57fa3d': net: make tap_receive() re-use tap_receive_iov() code net: import linux tap ioctl definitions net: remove unused includes of if_tun.h and if_tap.h Revert "qcow2: Bring synchronous read/write back to life" linux-aio: Honour AsyncContext posix-aio-compat: Honour AsyncContext block: Use new AsyncContext for bdrv_read/write emulation Introduce contexts for asynchronous callbacks Split out bottom halves Conflicts: net.c Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Diffstat (limited to 'posix-aio-compat.c')
-rw-r--r--posix-aio-compat.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/posix-aio-compat.c b/posix-aio-compat.c
index 90ed32ced..d7dbab3e4 100644
--- a/posix-aio-compat.c
+++ b/posix-aio-compat.c
@@ -49,6 +49,8 @@ struct qemu_paiocb {
ssize_t ret;
int active;
struct qemu_paiocb *next;
+
+ int async_context_id;
};
typedef struct PosixAioState {
@@ -420,6 +422,7 @@ static int posix_aio_process_queue(void *opaque)
struct qemu_paiocb *acb, **pacb;
int ret;
int result = 0;
+ int async_context_id = get_async_context_id();
for(;;) {
pacb = &s->first_aio;
@@ -427,6 +430,13 @@ static int posix_aio_process_queue(void *opaque)
acb = *pacb;
if (!acb)
return result;
+
+ /* we're only interested in requests in the right context */
+ if (acb->async_context_id != async_context_id) {
+ pacb = &acb->next;
+ continue;
+ }
+
ret = qemu_paio_error(acb);
if (ret == ECANCELED) {
/* remove the request */
@@ -559,6 +569,8 @@ BlockDriverAIOCB *paio_submit(BlockDriverState *bs, void *aio_ctx, int fd,
acb->aio_type = type;
acb->aio_fildes = fd;
acb->ev_signo = SIGUSR2;
+ acb->async_context_id = get_async_context_id();
+
if (qiov) {
acb->aio_iov = qiov->iov;
acb->aio_niov = qiov->niov;