Home | History | Annotate | Download | only in qemu

Lines Matching refs:offset

79 dump_buffer(const void *buffer, int64_t offset, int len)
87 printf("%08" PRIx64 ": ", offset + i);
102 print_report(const char *op, struct timeval *t, int64_t offset,
111 printf("%s %d/%d bytes at offset %" PRId64 "\n",
112 op, total, count, offset);
176 static int do_read(char *buf, int64_t offset, int count, int *total)
180 ret = bdrv_read(bs, offset >> 9, (uint8_t *)buf, count >> 9);
187 static int do_write(char *buf, int64_t offset, int count, int *total)
191 ret = bdrv_write(bs, offset >> 9, (uint8_t *)buf, count >> 9);
198 static int do_pread(char *buf, int64_t offset, int count, int *total)
200 *total = bdrv_pread(bs, offset, (uint8_t *)buf, count);
206 static int do_pwrite(char *buf, int64_t offset, int count, int *total)
208 *total = bdrv_pwrite(bs, offset, (uint8_t *)buf, count);
214 static int do_load_vmstate(char *buf, int64_t offset, int count, int *total)
216 *total = bdrv_load_vmstate(bs, (uint8_t *)buf, offset, count);
222 static int do_save_vmstate(char *buf, int64_t offset, int count, int *total)
224 *total = bdrv_save_vmstate(bs, (uint8_t *)buf, offset, count);
236 static int do_aio_readv(QEMUIOVector *qiov, int64_t offset, int *total)
241 acb = bdrv_aio_readv(bs, offset >> 9, qiov, qiov->size >> 9,
253 static int do_aio_writev(QEMUIOVector *qiov, int64_t offset, int *total)
258 acb = bdrv_aio_writev(bs, offset >> 9, qiov, qiov->size >> 9,
317 " reads a range of bytes from the given offset\n"
330 " -s, -- start offset for pattern verification (only with -P)\n"
344 .oneline = "reads a number of bytes at a specified offset",
356 int64_t offset;
414 offset = cvtnum(argv[optind]);
415 if (offset < 0) {
441 if (offset & 0x1ff) {
442 printf("offset %" PRId64 " is not sector aligned\n",
443 offset);
457 cnt = do_pread(buf, offset, count, &total);
459 cnt = do_load_vmstate(buf, offset, count, &total);
461 cnt = do_read(buf, offset, count, &total);
473 printf("Pattern verification failed at offset %"
475 offset + pattern_offset, pattern_count);
484 dump_buffer(buf, offset, count);
488 print_report("read", &t2, offset, count, total, cnt, Cflag);
501 " reads a range of bytes from the given offset into multiple buffers\n"
524 .oneline = "reads a number of bytes at a specified offset",
535 int64_t offset;
569 offset = cvtnum(argv[optind]);
570 if (offset < 0) {
576 if (offset & 0x1ff) {
577 printf("offset %" PRId64 " is not sector aligned\n",
578 offset);
586 cnt = do_aio_readv(&qiov, offset, &total);
598 printf("Pattern verification failed at offset %"
600 offset, qiov.size);
609 dump_buffer(buf, offset, qiov.size);
613 print_report("read", &t2, offset, qiov.size, total, cnt, Cflag);
625 " writes a range of bytes from the given offset\n"
649 .oneline = "writes a number of bytes at a specified offset",
660 int64_t offset;
698 offset = cvtnum(argv[optind]);
699 if (offset < 0) {
712 if (offset & 0x1ff) {
713 printf("offset %" PRId64 " is not sector aligned\n",
714 offset);
729 cnt = do_pwrite(buf, offset, count, &total);
731 cnt = do_save_vmstate(buf, offset, count, &total);
733 cnt = do_write(buf, offset, count, &total);
746 print_report("wrote", &t2, offset, count, total, cnt, Cflag);
759 offset source from multiple buffers\n"
780 .oneline = "writes a number of bytes at a specified offset",
791 int64_t offset;
819 offset = cvtnum(argv[optind]);
820 if (offset < 0) {
826 if (offset & 0x1ff) {
827 printf("offset %" PRId64 " is not sector aligned\n",
828 offset);
836 cnt = do_aio_writev(&qiov, offset, &total);
849 print_report("wrote", &t2, offset, qiov.size, total, cnt, Cflag);
860 " writes a range of bytes from the given offset source from multiple buffers,\n"
895 int64_t offset, first_offset = 0;
940 /* Read the offset of the request */
941 offset = cvtnum(argv[optind]);
942 if (offset < 0) {
943 printf("non-numeric offset argument -- %s\n", argv[optind]);
948 if (offset & 0x1ff) {
949 printf("offset %lld is not sector aligned\n",
950 (long long)offset);
955 first_offset = offset;
970 reqs[i].sector = offset >> 9;
975 offset += reqs[i].qiov->size;
1007 int64_t offset;
1037 print_report("wrote", &t2, ctx->offset, ctx->qiov.size,
1062 printf("Pattern verification failed at offset %"
1064 ctx->offset, ctx->qiov.size);
1074 dump_buffer(ctx->buf, ctx->offset, ctx->qiov.size);
1079 print_report("read", &t2, ctx->offset, ctx->qiov.size,
1091 " asynchronously reads a range of bytes from the given offset\n"
1156 ctx->offset = cvtnum(argv[optind]);
1157 if (ctx->offset < 0) {
1164 if (ctx->offset & 0x1ff) {
1165 printf("offset %" PRId64 " is not sector aligned\n",
1166 ctx->offset);
1175 acb = bdrv_aio_readv(bs, ctx->offset >> 9, &ctx->qiov,
1191 " asynchronously writes a range of bytes from the given offset source \n"
1251 ctx->offset = cvtnum(argv[optind]);
1252 if (ctx->offset < 0) {
1259 if (ctx->offset & 0x1ff) {
1260 printf("offset %" PRId64 " is not sector aligned\n",
1261 ctx->offset);
1270 acb = bdrv_aio_writev(bs, ctx->offset >> 9, &ctx->qiov,
1311 int64_t offset;
1314 offset = cvtnum(argv[1]);
1315 if (offset < 0) {
1320 ret = bdrv_truncate(bs, offset);
1336 .oneline = "truncates the current file at the given offset",
1385 printf("vm state offset: %s\n", s2);
1404 " discards a range of bytes from the given offset\n"
1424 .oneline = "discards a number of bytes at a specified offset",
1434 int64_t offset;
1454 offset = cvtnum(argv[optind]);
1455 if (offset < 0) {
1468 ret = bdrv_discard(bs, offset >> BDRV_SECTOR_BITS, count >> BDRV_SECTOR_BITS);
1479 print_report("discard", &t2, offset, count, count, 1, Cflag);
1489 int64_t offset;
1495 offset = cvtnum(argv[1]);
1496 if (offset & 0x1ff) {
1497 printf("offset %" PRId64 " is not sector aligned\n",
1498 offset);
1510 ret = bdrv_is_allocated(bs, offset >> 9, nb_sectors, &num);
1517 cvtstr(offset, s1, sizeof(s1));
1520 printf("sector allocated at offset %s\n", s1);
1522 printf("%d/%d sectors allocated at offset %s\n",
1540 int64_t offset;
1547 offset = 0;
1552 ret = bdrv_is_allocated(bs, offset, num_checked, &num);
1554 cvtstr(offset << 9ULL, s1, sizeof(s1));
1555 printf("[% 24" PRId64 "] % 8d/% 8d sectors %s at offset %s (%d)\n",
1556 offset << 9ULL, num, num_checked, retstr, s1, ret);
1558 offset += num;
1560 } while(offset < bs->total_sectors);
1737 { "offset", 1, NULL, 'o' },