aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libaio/harness/cases/aio_setup.h
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2013-07-31 16:15:51 +0100
committerIan Campbell <ian.campbell@citrix.com>2013-08-20 15:34:03 +0100
commit3d4678108a2157db6ae8c290897f67aaed14cdfa (patch)
treee5ce4b22b9fc9f68036937aa931059aee6c79491 /tools/libaio/harness/cases/aio_setup.h
parent03145f0fe42c007834c1ef50d95fe6c4f58a326a (diff)
downloadxen-3d4678108a2157db6ae8c290897f67aaed14cdfa.tar.gz
xen-3d4678108a2157db6ae8c290897f67aaed14cdfa.tar.bz2
xen-3d4678108a2157db6ae8c290897f67aaed14cdfa.zip
tools: remove in tree libaio
We have defaulted to using the system libaio for a while now and I din't think there are any relevant distros which don't have it that running Xen 4.4 would be reasonable on. Also it has caused confusion because it is not ever wanted on ARM, but the build system doesn't express that (could be fixed, but deleting is the right thing to do anyway). Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Matt Wilson <msw@amazon.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libaio/harness/cases/aio_setup.h')
-rw-r--r--tools/libaio/harness/cases/aio_setup.h98
1 files changed, 0 insertions, 98 deletions
diff --git a/tools/libaio/harness/cases/aio_setup.h b/tools/libaio/harness/cases/aio_setup.h
deleted file mode 100644
index 37c96189b2..0000000000
--- a/tools/libaio/harness/cases/aio_setup.h
+++ /dev/null
@@ -1,98 +0,0 @@
-io_context_t io_ctx;
-#define BAD_CTX ((io_context_t)-1)
-
-void aio_setup(int n)
-{
- int res = io_queue_init(n, &io_ctx);
- if (res != 0) {
- printf("io_queue_setup(%d) returned %d (%s)\n",
- n, res, strerror(-res));
- exit(3);
- }
-}
-
-int attempt_io_submit(io_context_t ctx, long nr, struct iocb *ios[], int expect)
-{
- int res;
-
- printf("expect %3d: io_submit(%10p, %3ld, %10p) = ", expect, ctx, nr, ios);
- fflush(stdout);
- res = io_submit(ctx, nr, ios);
- printf("%3d [%s]%s\n", res, (res <= 0) ? strerror(-res) : "",
- (res != expect) ? " -- FAILED" : "");
- if (res != expect)
- return 1;
-
- return 0;
-}
-
-int sync_submit(struct iocb *iocb)
-{
- struct io_event event;
- struct iocb *iocbs[] = { iocb };
- int res;
-
- /* 30 second timeout should be enough */
- struct timespec ts;
- ts.tv_sec = 30;
- ts.tv_nsec = 0;
-
- res = io_submit(io_ctx, 1, iocbs);
- if (res != 1) {
- printf("sync_submit: io_submit res=%d [%s]\n", res, strerror(-res));
- return res;
- }
-
- res = io_getevents(io_ctx, 0, 1, &event, &ts);
- if (res != 1) {
- printf("sync_submit: io_getevents res=%d [%s]\n", res, strerror(-res));
- return res;
- }
- return event.res;
-}
-
-#define SETUP aio_setup(1024)
-
-
-#define READ 'r'
-#define WRITE 'w'
-#define READ_SILENT 'R'
-#define WRITE_SILENT 'W'
-int attempt_rw(int fd, void *buf, int count, long long pos, int rw, int expect)
-{
- struct iocb iocb;
- int res;
- int silent = 0;
-
- switch(rw) {
- case READ_SILENT:
- silent = 1;
- case READ:
- io_prep_pread (&iocb, fd, buf, count, pos);
- break;
- case WRITE_SILENT:
- silent = 1;
- case WRITE:
- io_prep_pwrite(&iocb, fd, buf, count, pos);
- break;
- }
-
- if (!silent) {
- printf("expect %5d: (%c), res = ", expect, rw);
- fflush(stdout);
- }
- res = sync_submit(&iocb);
- if (!silent || res != expect) {
- if (silent)
- printf("expect %5d: (%c), res = ", expect, rw);
- printf("%5d [%s]%s\n", res,
- (res <= 0) ? strerror(-res) : "Success",
- (res != expect) ? " -- FAILED" : "");
- }
-
- if (res != expect)
- return 1;
-
- return 0;
-}
-