# HG changeset patch
# User Alastair Tse <atse@xxxxxxxxxxxxx>
# Node ID 4b577c1909a9c988210b759a79633d6560e96dc6
# Parent 5d0efb6f3983bb3659c7d2a5013c8a3a694003ce
# Parent 107f74d363eacb4db0ad388a9042b745ebdd1d3f
Merge
---
tools/blktap/drivers/block-aio.c | 8 ++------
tools/blktap/drivers/block-qcow.c | 9 +--------
tools/blktap/drivers/tapdisk.c | 3 +--
xen/common/domain.c | 4 ++--
4 files changed, 6 insertions(+), 18 deletions(-)
diff -r 5d0efb6f3983 -r 4b577c1909a9 tools/blktap/drivers/block-aio.c
--- a/tools/blktap/drivers/block-aio.c Fri Dec 01 17:31:30 2006 +0000
+++ b/tools/blktap/drivers/block-aio.c Fri Dec 01 17:31:50 2006 +0000
@@ -311,12 +311,8 @@ int tdaio_do_callbacks(struct td_state *
struct pending_aio *pio;
pio = &prv->pending_aio[(long)io->data];
-
- if (ep->res != io->u.c.nbytes) {
- /* TODO: handle this case better. */
- DPRINTF("AIO did less than I asked it to. \n");
- }
- rsp += pio->cb(s, ep->res2, pio->id, pio->private);
+ rsp += pio->cb(s, ep->res == io->u.c.nbytes ? 0 : 1,
+ pio->id, pio->private);
prv->iocb_free[prv->iocb_free_count++] = io;
}
diff -r 5d0efb6f3983 -r 4b577c1909a9 tools/blktap/drivers/block-qcow.c
--- a/tools/blktap/drivers/block-qcow.c Fri Dec 01 17:31:30 2006 +0000
+++ b/tools/blktap/drivers/block-qcow.c Fri Dec 01 17:31:50 2006 +0000
@@ -1145,13 +1145,6 @@ int tdqcow_do_callbacks(struct td_state
pio = &prv->pending_aio[(long)io->data];
- if (ep->res != io->u.c.nbytes) {
- /* TODO: handle this case better. */
- ptr = (int *)&ep->res;
- DPRINTF("AIO did less than I asked it to "
- "[%lu,%lu,%d]\n",
- ep->res, io->u.c.nbytes, *ptr);
- }
aio_unlock(prv, pio->sector);
if (pio->id >= 0) {
if (prv->crypt_method)
@@ -1162,7 +1155,7 @@ int tdqcow_do_callbacks(struct td_state
&prv->aes_decrypt_key);
prv->nr_reqs[pio->qcow_idx]--;
if (prv->nr_reqs[pio->qcow_idx] == 0)
- rsp += pio->cb(s, ep->res2, pio->id,
+ rsp += pio->cb(s, ep->res == io->u.c.nbytes ? 0
: 1, pio->id,
pio->private);
} else if (pio->id == -2) free(pio->buf);
diff -r 5d0efb6f3983 -r 4b577c1909a9 tools/blktap/drivers/tapdisk.c
--- a/tools/blktap/drivers/tapdisk.c Fri Dec 01 17:31:30 2006 +0000
+++ b/tools/blktap/drivers/tapdisk.c Fri Dec 01 17:31:50 2006 +0000
@@ -424,8 +424,7 @@ int send_responses(struct td_state *s, i
}
if (res != 0) {
- DPRINTF("*** request error %d! \n", res);
- return 0;
+ blkif->pending_list[idx].status = BLKIF_RSP_ERROR;
}
blkif->pending_list[idx].count--;
diff -r 5d0efb6f3983 -r 4b577c1909a9 xen/common/domain.c
--- a/xen/common/domain.c Fri Dec 01 17:31:30 2006 +0000
+++ b/xen/common/domain.c Fri Dec 01 17:31:50 2006 +0000
@@ -283,8 +283,8 @@ void domain_shutdown(struct domain *d, u
if ( d->domain_id == 0 )
dom0_shutdown(reason);
- d->shutdown_code = reason;
- set_bit(_DOMF_shutdown, &d->domain_flags);
+ if ( !test_and_set_bit(_DOMF_shutdown, &d->domain_flags) )
+ d->shutdown_code = reason;
for_each_vcpu ( d, v )
vcpu_sleep_nosync(v);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|