writev_f(int argc, char **argv)

{

	struct timeval t1, t2;

	int Cflag = 0, qflag = 0;

	int c, cnt;

	char *buf;

	int64_t offset;

	int total;

	int nr_iov;

	int pattern = 0xcd;

	QEMUIOVector qiov;



	while ((c = getopt(argc, argv, "CqP:")) != EOF) {

		switch (c) {

		case 'C':

			Cflag = 1;

			break;

		case 'q':

			qflag = 1;

			break;

		case 'P':

			pattern = atoi(optarg);

			break;

		default:

			return command_usage(&writev_cmd);

		}

	}



	if (optind > argc - 2)

		return command_usage(&writev_cmd);



	offset = cvtnum(argv[optind]);

	if (offset < 0) {

		printf("non-numeric length argument -- %s\n", argv[optind]);

		return 0;

	}

	optind++;



	if (offset & 0x1ff) {

		printf("offset %lld is not sector aligned\n",

			(long long)offset);

		return 0;

	}



	nr_iov = argc - optind;

	buf = create_iovec(&qiov, &argv[optind], nr_iov, pattern);



	gettimeofday(&t1, NULL);

	cnt = do_aio_writev(&qiov, offset, &total);

	gettimeofday(&t2, NULL);



	if (cnt < 0) {

		printf("writev failed: %s\n", strerror(-cnt));

		return 0;

	}



	if (qflag)

		return 0;



	/* Finally, report back -- -C gives a parsable format */

	t2 = tsub(t2, t1);

	print_report("wrote", &t2, offset, qiov.size, total, cnt, Cflag);



	qemu_io_free(buf);



	return 0;

}

writev_f(int argc, char **argv)

{

	struct timeval t1, t2;

	int Cflag = 0, qflag = 0;

	int c, cnt;

	char *buf;

	int64_t offset;

	int total;

	int nr_iov;

	int pattern = 0xcd;

	QEMUIOVector qiov;



	while ((c = getopt(argc, argv, "CqP:")) != EOF) {

		switch (c) {

		case 'C':

			Cflag = 1;

			break;

		case 'q':

			qflag = 1;

			break;

		case 'P':

			pattern = atoi(optarg);

			break;

		default:

			return command_usage(&writev_cmd);

		}

	}



	if (optind > argc - 2)

		return command_usage(&writev_cmd);



	offset = cvtnum(argv[optind]);

	if (offset < 0) {

		printf("non-numeric length argument -- %s\n", argv[optind]);

		return 0;

	}

	optind++;



	if (offset & 0x1ff) {

		printf("offset %lld is not sector aligned\n",

			(long long)offset);

		return 0;

	}



	nr_iov = argc - optind;

	buf = create_iovec(&qiov, &argv[optind], nr_iov, pattern);



	gettimeofday(&t1, NULL);

	cnt = do_aio_writev(&qiov, offset, &total);

	gettimeofday(&t2, NULL);



	if (cnt < 0) {

		printf("writev failed: %s\n", strerror(-cnt));

		return 0;

	}



	if (qflag)

		return 0;



	

	t2 = tsub(t2, t1);

	print_report("wrote", &t2, offset, qiov.size, total, cnt, Cflag);



	qemu_io_free(buf);



	return 0;

}

		return 0; 		return 0; 		return 0; 		return 0; 		return 0; 		return 0; 		return 0; 		return 0; 	if (optind > argc - 2) 	if (optind > argc - 2)
FUNC_0(int VAR_0, char **VAR_1)

{

	struct timeval VAR_2, VAR_3;

	int VAR_4 = 0, VAR_5 = 0;

	int VAR_6, VAR_7;

	char *VAR_8;

	int64_t offset;

	int VAR_9;

	int VAR_10;

	int VAR_11 = 0xcd;

	QEMUIOVector qiov;



	while ((VAR_6 = getopt(VAR_0, VAR_1, "CqP:")) != EOF) {

		switch (VAR_6) {

		case 'C':

			VAR_4 = 1;

			break;

		case 'q':

			VAR_5 = 1;

			break;

		case 'P':

			VAR_11 = atoi(optarg);

			break;

		default:

			return command_usage(&writev_cmd);

		}

	}



	if (optind > VAR_0 - 2)

		return command_usage(&writev_cmd);



	offset = cvtnum(VAR_1[optind]);

	if (offset < 0) {

		printf("non-numeric length argument -- %s\n", VAR_1[optind]);

		return 0;

	}

	optind++;



	if (offset & 0x1ff) {

		printf("offset %lld is not sector aligned\n",

			(long long)offset);

		return 0;

	}



	VAR_10 = VAR_0 - optind;

	VAR_8 = create_iovec(&qiov, &VAR_1[optind], VAR_10, VAR_11);



	gettimeofday(&VAR_2, NULL);

	VAR_7 = do_aio_writev(&qiov, offset, &VAR_9);

	gettimeofday(&VAR_3, NULL);



	if (VAR_7 < 0) {

		printf("writev failed: %s\n", strerror(-VAR_7));

		return 0;

	}



	if (VAR_5)

		return 0;



	

	VAR_3 = tsub(VAR_3, VAR_2);

	print_report("wrote", &VAR_3, offset, qiov.size, VAR_9, VAR_7, VAR_4);



	qemu_io_free(VAR_8);



	return 0;

}

FUNC_0(int VAR_0, char **VAR_1)
{ struct timeval VAR_2, VAR_3; int VAR_4 = 0, VAR_5 = 0; int VAR_6, VAR_7; char *VAR_8; int64_t offset; int VAR_9; int VAR_10; int VAR_11 = 0xcd; QEMUIOVector qiov; while ((VAR_6 = getopt(VAR_0, VAR_1, "CqP:")) != EOF) { switch (VAR_6) { case 'C':
VAR_4 = 1; break; case 'q':
VAR_5 = 1; break; case 'P':
VAR_11 = atoi(optarg); break; default:
return command_usage(&writev_cmd); } } if (optind > VAR_0 - 2)
return command_usage(&writev_cmd); offset = cvtnum(VAR_1[optind]); if (offset < 0) { printf("non-numeric length argument -- %s\n", VAR_1[optind]); return 0; } optind++; if (offset & 0x1ff) { printf("offset %lld is not sector aligned\n",
(long long)offset); return 0; } VAR_10 = VAR_0 - optind; VAR_8 = create_iovec(&qiov, &VAR_1[optind], VAR_10, VAR_11); gettimeofday(&VAR_2, NULL); VAR_7 = do_aio_writev(&qiov, offset, &VAR_9); gettimeofday(&VAR_3, NULL); if (VAR_7 < 0) { printf("writev failed: %s\n", strerror(-VAR_7)); return 0; } if (VAR_5)
return 0; VAR_3 = tsub(VAR_3, VAR_2); print_report("wrote", &VAR_3, offset, qiov.size, VAR_9, VAR_7, VAR_4); qemu_io_free(VAR_8); return 0; }