@samitouri / QOSamiQemu / commits / 3c0c7bfeba

qemu-io: propagate errors through Error API instead of printf

Convert the qemu-io command infrastructure to use QEMU's Error API (Error **errp) for error propagation instead of printing directly to stdout/stderr via printf/fprintf. The cfunc_t typedef, all ~35 command functions, the dispatcher chain (command/init_check_command/qemuio_command), and helper functions (parse_pattern, create_iovec, qemu_io_alloc_from_file) all gain an Error **errp parameter. Async completion callbacks (aio_read_done, aio_write_done, aio_discard_done) use error_report() since they have no Error path back to the caller. Update tests: - error_report_err() prepends qemu-io: prefix - copy-before-write: check the HMP return value, rather than stdio - other tests: update to check JSON {"return": "Error: error text"} Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20260828-qemu-no-hmp-v5-21-9227de146347@redhat.com>

Marc-André Lureau committed Aug 28, 2026 at 16:04 UTC 3c0c7bfeba92c4de83410629b6a5378c4189d9d6
35 files changed +552 -523
block/monitor/block-hmp-cmds.c
+1 -1
@@ -598,7 +598,7 @@ void hmp_qemu_io(Monitor *mon, const QDict *qdict)
598 * extended, possibly resulting in a read-only guest device keeping write
599 * permissions. Ugly, but it appears to be the lesser evil.
600 */
601 - qemuio_command(blk, command);
601 + qemuio_command(blk, command, &err);
602
603 fail:
604 blk_unref(local_blk);
include/qemu-io.h
+2 -2
@@ -25,7 +25,7 @@
25 * Operate on @blk using @argc/@argv as the command's arguments, and
26 * return 0 on success or negative errno on failure.
27 */
28 -typedef int (*cfunc_t)(BlockBackend *blk, int argc, char **argv);
28 +typedef int (*cfunc_t)(BlockBackend *blk, int argc, char **argv, Error **errp);
29
30 typedef void (*helpfunc_t)(void);
31
@@ -45,7 +45,7 @@ typedef struct cmdinfo {
45
46 extern bool qemuio_misalign;
47
48 -int qemuio_command(BlockBackend *blk, const char *cmd);
48 +int qemuio_command(BlockBackend *blk, const char *cmd, Error **errp);
49
50 void qemuio_add_command(const cmdinfo_t *ci);
51 void qemuio_command_usage(const cmdinfo_t *ci);
qemu-io-cmds.c
+213 -201
@@ -55,40 +55,43 @@ void qemuio_command_usage(const cmdinfo_t *ci)
55 printf("%s %s -- %s\n", ci->name, ci->args, ci->oneline);
56 }
57
58 -static int init_check_command(BlockBackend *blk, const cmdinfo_t *ct)
58 +static int init_check_command(BlockBackend *blk, const cmdinfo_t *ct,
59 + Error **errp)
60 {
61 if (ct->flags & CMD_FLAG_GLOBAL) {
62 return 1;
63 }
64 if (!(ct->flags & CMD_NOFILE_OK) && !blk) {
64 - fprintf(stderr, "no file open, try 'help open'\n");
65 + error_setg(errp, "no file open, try 'help open'");
66 return 0;
67 }
68 return 1;
69 }
70
71 static int command(BlockBackend *blk, const cmdinfo_t *ct, int argc,
71 - char **argv)
72 + char **argv, Error **errp)
73 {
74 char *cmd = argv[0];
75
75 - if (!init_check_command(blk, ct)) {
76 + if (!init_check_command(blk, ct, errp)) {
77 return -EINVAL;
78 }
79
80 if (argc - 1 < ct->argmin || (ct->argmax != -1 && argc - 1 > ct->argmax)) {
81 if (ct->argmax == -1) {
81 - fprintf(stderr,
82 - "bad argument count %d to %s, expected at least %d arguments\n",
83 - argc-1, cmd, ct->argmin);
82 + error_setg(errp,
83 + "bad argument count %d to %s,"
84 + " expected at least %d arguments",
85 + argc - 1, cmd, ct->argmin);
86 } else if (ct->argmin == ct->argmax) {
85 - fprintf(stderr,
86 - "bad argument count %d to %s, expected %d arguments\n",
87 - argc-1, cmd, ct->argmin);
87 + error_setg(errp,
88 + "bad argument count %d to %s, expected %d arguments",
89 + argc - 1, cmd, ct->argmin);
90 } else {
89 - fprintf(stderr,
90 - "bad argument count %d to %s, expected between %d and %d arguments\n",
91 - argc-1, cmd, ct->argmin, ct->argmax);
91 + error_setg(errp,
92 + "bad argument count %d to %s,"
93 + " expected between %d and %d arguments",
94 + argc - 1, cmd, ct->argmin, ct->argmax);
95 }
96 return -EINVAL;
97 }
@@ -112,21 +115,19 @@ static int command(BlockBackend *blk, const cmdinfo_t *ct, int argc,
115
116 if (ct->perm & ~orig_perm) {
117 uint64_t new_perm;
115 - Error *local_err = NULL;
118 int ret;
119
120 new_perm = orig_perm | ct->perm;
121
120 - ret = blk_set_perm(blk, new_perm, orig_shared_perm, &local_err);
122 + ret = blk_set_perm(blk, new_perm, orig_shared_perm, errp);
123 if (ret < 0) {
122 - error_report_err(local_err);
124 return ret;
125 }
126 }
127 }
128
129 qemu_reset_optind();
129 - return ct->cfunc(blk, argc, argv);
130 + return ct->cfunc(blk, argc, argv, errp);
131 }
132
133 static const cmdinfo_t *find_command(const char *cmd)
@@ -192,18 +193,18 @@ static int64_t cvtnum(const char *s)
193 return value;
194 }
195
195 -static void print_cvtnum_err(int64_t rc, const char *arg)
196 +static void set_cvtnum_err(int64_t rc, const char *arg, Error **errp)
197 {
198 switch (rc) {
199 case -EINVAL:
199 - printf("Parsing error: non-numeric argument,"
200 - " or extraneous/unrecognized suffix -- %s\n", arg);
200 + error_setg(errp, "Parsing error: non-numeric argument,"
201 + " or extraneous/unrecognized suffix -- %s", arg);
202 break;
203 case -ERANGE:
203 - printf("Parsing error: argument too large -- %s\n", arg);
204 + error_setg(errp, "Parsing error: argument too large -- %s", arg);
205 break;
206 default:
206 - printf("Parsing error: %s\n", arg);
207 + error_setg(errp, "Parsing error: %s", arg);
208 }
209 }
210
@@ -316,14 +317,14 @@ static void timestr(struct timespec *tv, char *ts, size_t size, int format)
317 * Because the pattern is used as an argument to memset it must evaluate
318 * to an unsigned integer that fits into a single byte.
319 */
319 -static int parse_pattern(const char *arg)
320 +static int parse_pattern(const char *arg, Error **errp)
321 {
322 char *endptr = NULL;
323 long pattern;
324
325 pattern = strtol(arg, &endptr, 0);
326 if (pattern < 0 || pattern > UCHAR_MAX || *endptr != '\0') {
326 - printf("%s is not a valid pattern byte\n", arg);
327 + error_setg(errp, "%s is not a valid pattern byte", arg);
328 return -1;
329 }
330
@@ -386,7 +387,8 @@ static void qemu_io_free(BlockBackend *blk, void *p, size_t len,
387 * NULL on error
388 */
389 static void *qemu_io_alloc_from_file(BlockBackend *blk, size_t len,
389 - const char *file_name, bool register_buf)
390 + const char *file_name, bool register_buf,
391 + Error **errp)
392 {
393 size_t alloc_len = len + (qemuio_misalign ? MISALIGN_OFFSET : 0);
394 char *alloc_buf, *buf, *end;
@@ -394,7 +396,7 @@ static void *qemu_io_alloc_from_file(BlockBackend *blk, size_t len,
396 int pattern_len;
397
398 if (!f) {
397 - perror(file_name);
399 + error_setg_errno(errp, errno, "%s", file_name);
400 return NULL;
401 }
402
@@ -407,12 +409,12 @@ static void *qemu_io_alloc_from_file(BlockBackend *blk, size_t len,
409 pattern_len = fread(buf, 1, len, f);
410
411 if (ferror(f)) {
410 - perror(file_name);
412 + error_setg_errno(errp, errno, "%s", file_name);
413 goto error;
414 }
415
416 if (pattern_len == 0) {
415 - fprintf(stderr, "%s: file is empty\n", file_name);
417 + error_setg(errp, "%s: file is empty", file_name);
418 goto error;
419 }
420
@@ -494,7 +496,7 @@ static void print_report(const char *op, struct timespec *t, int64_t offset,
496 */
497 static void *
498 create_iovec(BlockBackend *blk, QEMUIOVector *qiov, char **argv, int nr_iov,
497 - int pattern, bool register_buf)
499 + int pattern, bool register_buf, Error **errp)
500 {
501 size_t *sizes = g_new0(size_t, nr_iov);
502 size_t count = 0;
@@ -508,19 +510,20 @@ create_iovec(BlockBackend *blk, QEMUIOVector *qiov, char **argv, int nr_iov,
510
511 len = cvtnum(arg);
512 if (len < 0) {
511 - print_cvtnum_err(len, arg);
513 + set_cvtnum_err(len, arg, errp);
514 goto fail;
515 }
516
517 if (len > BDRV_REQUEST_MAX_BYTES) {
516 - printf("Argument '%s' exceeds maximum size %" PRIu64 "\n", arg,
517 - (uint64_t)BDRV_REQUEST_MAX_BYTES);
518 + error_setg(errp, "Argument '%s' exceeds maximum size %" PRIu64,
519 + arg, (uint64_t)BDRV_REQUEST_MAX_BYTES);
520 goto fail;
521 }
522
523 if (count > BDRV_REQUEST_MAX_BYTES - len) {
522 - printf("The total number of bytes exceed the maximum size %" PRIu64
523 - "\n", (uint64_t)BDRV_REQUEST_MAX_BYTES);
524 + error_setg(errp,
525 + "The total number of bytes exceed the maximum size %"
526 + PRIu64, (uint64_t)BDRV_REQUEST_MAX_BYTES);
527 goto fail;
528 }
529
@@ -692,7 +695,7 @@ static void read_help(void)
695 "\n");
696 }
697
695 -static int read_f(BlockBackend *blk, int argc, char **argv);
698 +static int read_f(BlockBackend *blk, int argc, char **argv, Error **errp);
699
700 static const cmdinfo_t read_cmd = {
701 .name = "read",
@@ -705,7 +708,7 @@ static const cmdinfo_t read_cmd = {
708 .help = read_help,
709 };
710
708 -static int read_f(BlockBackend *blk, int argc, char **argv)
711 +static int read_f(BlockBackend *blk, int argc, char **argv, Error **errp)
712 {
713 struct timespec t1, t2;
714 bool Cflag = false, qflag = false, vflag = false;
@@ -732,7 +735,7 @@ static int read_f(BlockBackend *blk, int argc, char **argv)
735 lflag = true;
736 pattern_count = cvtnum(optarg);
737 if (pattern_count < 0) {
735 - print_cvtnum_err(pattern_count, optarg);
738 + set_cvtnum_err(pattern_count, optarg, errp);
739 return pattern_count;
740 }
741 break;
@@ -741,7 +744,7 @@ static int read_f(BlockBackend *blk, int argc, char **argv)
744 break;
745 case 'P':
746 Pflag = true;
744 - pattern = parse_pattern(optarg);
747 + pattern = parse_pattern(optarg, errp);
748 if (pattern < 0) {
749 return -EINVAL;
750 }
@@ -756,7 +759,7 @@ static int read_f(BlockBackend *blk, int argc, char **argv)
759 sflag = true;
760 pattern_offset = cvtnum(optarg);
761 if (pattern_offset < 0) {
759 - print_cvtnum_err(pattern_offset, optarg);
762 + set_cvtnum_err(pattern_offset, optarg, errp);
763 return pattern_offset;
764 }
765 break;
@@ -776,18 +779,18 @@ static int read_f(BlockBackend *blk, int argc, char **argv)
779
780 offset = cvtnum(argv[optind]);
781 if (offset < 0) {
779 - print_cvtnum_err(offset, argv[optind]);
782 + set_cvtnum_err(offset, argv[optind], errp);
783 return offset;
784 }
785
786 optind++;
787 count = cvtnum(argv[optind]);
788 if (count < 0) {
786 - print_cvtnum_err(count, argv[optind]);
789 + set_cvtnum_err(count, argv[optind], errp);
790 return count;
791 } else if (count > BDRV_REQUEST_MAX_BYTES) {
789 - printf("length cannot exceed %" PRIu64 ", given %s\n",
790 - (uint64_t)BDRV_REQUEST_MAX_BYTES, argv[optind]);
792 + error_setg(errp, "length cannot exceed %" PRIu64 ", given %s",
793 + (uint64_t)BDRV_REQUEST_MAX_BYTES, argv[optind]);
794 return -EINVAL;
795 }
796
@@ -801,24 +804,26 @@ static int read_f(BlockBackend *blk, int argc, char **argv)
804 }
805
806 if ((pattern_count < 0) || (pattern_count + pattern_offset > count)) {
804 - printf("pattern verification range exceeds end of read data\n");
807 + error_setg(errp, "pattern verification range exceeds end of read data");
808 return -EINVAL;
809 }
810
811 if (bflag) {
812 if (!QEMU_IS_ALIGNED(offset, BDRV_SECTOR_SIZE)) {
810 - printf("%" PRId64 " is not a sector-aligned value for 'offset'\n",
811 - offset);
813 + error_setg(errp,
814 + "%" PRId64 " is not a sector-aligned value for 'offset'",
815 + offset);
816 return -EINVAL;
817 }
818 if (!QEMU_IS_ALIGNED(count, BDRV_SECTOR_SIZE)) {
815 - printf("%"PRId64" is not a sector-aligned value for 'count'\n",
816 - count);
819 + error_setg(errp,
820 + "%" PRId64 " is not a sector-aligned value for 'count'",
821 + count);
822 return -EINVAL;
823 }
824 if (flags & BDRV_REQ_REGISTERED_BUF) {
820 - printf("I/O buffer registration is not supported when reading "
821 - "from vmstate\n");
825 + error_setg(errp, "I/O buffer registration is not supported when"
826 + " reading from vmstate");
827 return -EINVAL;
828 }
829 }
@@ -834,7 +839,7 @@ static int read_f(BlockBackend *blk, int argc, char **argv)
839 clock_gettime(CLOCK_MONOTONIC, &t2);
840
841 if (ret < 0) {
837 - printf("read failed: %s\n", strerror(-ret));
842 + error_setg(errp, "read failed: %s", strerror(-ret));
843 goto out;
844 }
845 cnt = ret;
@@ -845,9 +850,9 @@ static int read_f(BlockBackend *blk, int argc, char **argv)
850 void *cmp_buf = g_malloc(pattern_count);
851 memset(cmp_buf, pattern, pattern_count);
852 if (memcmp(buf + pattern_offset, cmp_buf, pattern_count)) {
848 - printf("Pattern verification failed at offset %"
849 - PRId64 ", %"PRId64" bytes\n",
850 - offset + pattern_offset, pattern_count);
853 + error_setg(errp, "Pattern verification failed at offset %"
854 + PRId64 ", %" PRId64 " bytes",
855 + offset + pattern_offset, pattern_count);
856 ret = -EINVAL;
857 }
858 g_free(cmp_buf);
@@ -890,7 +895,7 @@ static void readv_help(void)
895 "\n");
896 }
897
893 -static int readv_f(BlockBackend *blk, int argc, char **argv);
898 +static int readv_f(BlockBackend *blk, int argc, char **argv, Error **errp);
899
900 static const cmdinfo_t readv_cmd = {
901 .name = "readv",
@@ -902,7 +907,7 @@ static const cmdinfo_t readv_cmd = {
907 .help = readv_help,
908 };
909
905 -static int readv_f(BlockBackend *blk, int argc, char **argv)
910 +static int readv_f(BlockBackend *blk, int argc, char **argv, Error **errp)
911 {
912 struct timespec t1, t2;
913 bool Cflag = false, qflag = false, vflag = false;
@@ -924,7 +929,7 @@ static int readv_f(BlockBackend *blk, int argc, char **argv)
929 break;
930 case 'P':
931 Pflag = true;
927 - pattern = parse_pattern(optarg);
932 + pattern = parse_pattern(optarg, errp);
933 if (pattern < 0) {
934 return -EINVAL;
935 }
@@ -952,14 +957,14 @@ static int readv_f(BlockBackend *blk, int argc, char **argv)
957
958 offset = cvtnum(argv[optind]);
959 if (offset < 0) {
955 - print_cvtnum_err(offset, argv[optind]);
960 + set_cvtnum_err(offset, argv[optind], errp);
961 return offset;
962 }
963 optind++;
964
965 nr_iov = argc - optind;
966 buf = create_iovec(blk, &qiov, &argv[optind], nr_iov, 0xab,
962 - flags & BDRV_REQ_REGISTERED_BUF);
967 + flags & BDRV_REQ_REGISTERED_BUF, errp);
968 if (buf == NULL) {
969 return -EINVAL;
970 }
@@ -969,7 +974,7 @@ static int readv_f(BlockBackend *blk, int argc, char **argv)
974 clock_gettime(CLOCK_MONOTONIC, &t2);
975
976 if (ret < 0) {
972 - printf("readv failed: %s\n", strerror(-ret));
977 + error_setg(errp, "readv failed: %s", strerror(-ret));
978 goto out;
979 }
980 cnt = ret;
@@ -980,8 +985,8 @@ static int readv_f(BlockBackend *blk, int argc, char **argv)
985 void *cmp_buf = g_malloc(qiov.size);
986 memset(cmp_buf, pattern, qiov.size);
987 if (memcmp(buf, cmp_buf, qiov.size)) {
983 - printf("Pattern verification failed at offset %"
984 - PRId64 ", %zu bytes\n", offset, qiov.size);
988 + error_setg(errp, "Pattern verification failed at offset %"
989 + PRId64 ", %zu bytes", offset, qiov.size);
990 ret = -EINVAL;
991 }
992 g_free(cmp_buf);
@@ -1031,7 +1036,7 @@ static void write_help(void)
1036 "\n");
1037 }
1038
1034 -static int write_f(BlockBackend *blk, int argc, char **argv);
1039 +static int write_f(BlockBackend *blk, int argc, char **argv, Error **errp);
1040
1041 static const cmdinfo_t write_cmd = {
1042 .name = "write",
@@ -1045,7 +1050,7 @@ static const cmdinfo_t write_cmd = {
1050 .help = write_help,
1051 };
1052
1048 -static int write_f(BlockBackend *blk, int argc, char **argv)
1053 +static int write_f(BlockBackend *blk, int argc, char **argv, Error **errp)
1054 {
1055 struct timespec t1, t2;
1056 bool Cflag = false, qflag = false, bflag = false;
@@ -1082,7 +1087,7 @@ static int write_f(BlockBackend *blk, int argc, char **argv)
1087 break;
1088 case 'P':
1089 Pflag = true;
1085 - pattern = parse_pattern(optarg);
1090 + pattern = parse_pattern(optarg, errp);
1091 if (pattern < 0) {
1092 return -EINVAL;
1093 }
@@ -1115,72 +1120,78 @@ static int write_f(BlockBackend *blk, int argc, char **argv)
1120 }
1121
1122 if (bflag && zflag) {
1118 - printf("-b and -z cannot be specified at the same time\n");
1123 + error_setg(errp, "-b and -z cannot be specified at the same time");
1124 return -EINVAL;
1125 }
1126
1127 if ((flags & BDRV_REQ_FUA) && (bflag || cflag)) {
1123 - printf("-f and -b or -c cannot be specified at the same time\n");
1128 + error_setg(errp,
1129 + "-f and -b or -c cannot be specified at the same time");
1130 return -EINVAL;
1131 }
1132
1133 if ((flags & BDRV_REQ_NO_FALLBACK) && !zflag) {
1128 - printf("-n requires -z to be specified\n");
1134 + error_setg(errp, "-n requires -z to be specified");
1135 return -EINVAL;
1136 }
1137
1138 if ((flags & BDRV_REQ_MAY_UNMAP) && !zflag) {
1133 - printf("-u requires -z to be specified\n");
1139 + error_setg(errp, "-u requires -z to be specified");
1140 return -EINVAL;
1141 }
1142
1143 if (zflag + Pflag + sflag > 1) {
1138 - printf("Only one of -z, -P, and -s "
1139 - "can be specified at the same time\n");
1144 + error_setg(errp, "Only one of -z, -P, and -s "
1145 + "can be specified at the same time");
1146 return -EINVAL;
1147 }
1148
1149 offset = cvtnum(argv[optind]);
1150 if (offset < 0) {
1145 - print_cvtnum_err(offset, argv[optind]);
1151 + set_cvtnum_err(offset, argv[optind], errp);
1152 return offset;
1153 }
1154
1155 optind++;
1156 count = cvtnum(argv[optind]);
1157 if (count < 0) {
1152 - print_cvtnum_err(count, argv[optind]);
1158 + set_cvtnum_err(count, argv[optind], errp);
1159 return count;
1160 } else if (count > BDRV_REQUEST_MAX_BYTES &&
1161 !(flags & BDRV_REQ_NO_FALLBACK)) {
1156 - printf("length cannot exceed %" PRIu64 " without -n, given %s\n",
1157 - (uint64_t)BDRV_REQUEST_MAX_BYTES, argv[optind]);
1162 + error_setg(errp,
1163 + "length cannot exceed %" PRIu64 " without -n, given %s",
1164 + (uint64_t)BDRV_REQUEST_MAX_BYTES, argv[optind]);
1165 return -EINVAL;
1166 }
1167
1168 if (bflag || cflag) {
1169 if (!QEMU_IS_ALIGNED(offset, BDRV_SECTOR_SIZE)) {
1163 - printf("%" PRId64 " is not a sector-aligned value for 'offset'\n",
1164 - offset);
1170 + error_setg(errp,
1171 + "%" PRId64 " is not a sector-aligned value for 'offset'",
1172 + offset);
1173 return -EINVAL;
1174 }
1175
1176 if (!QEMU_IS_ALIGNED(count, BDRV_SECTOR_SIZE)) {
1169 - printf("%"PRId64" is not a sector-aligned value for 'count'\n",
1170 - count);
1177 + error_setg(errp,
1178 + "%" PRId64 " is not a sector-aligned value for 'count'",
1179 + count);
1180 return -EINVAL;
1181 }
1182 }
1183
1184 if (zflag) {
1185 if (flags & BDRV_REQ_REGISTERED_BUF) {
1177 - printf("cannot combine zero write with registered I/O buffer\n");
1186 + error_setg(errp,
1187 + "cannot combine zero write with registered I/O buffer");
1188 return -EINVAL;
1189 }
1190 } else {
1191 if (sflag) {
1192 buf = qemu_io_alloc_from_file(blk, count, file_name,
1183 - flags & BDRV_REQ_REGISTERED_BUF);
1193 + flags & BDRV_REQ_REGISTERED_BUF,
1194 + errp);
1195 if (!buf) {
1196 return -EINVAL;
1197 }
@@ -1203,7 +1214,7 @@ static int write_f(BlockBackend *blk, int argc, char **argv)
1214 clock_gettime(CLOCK_MONOTONIC, &t2);
1215
1216 if (ret < 0) {
1206 - printf("write failed: %s\n", strerror(-ret));
1217 + error_setg(errp, "write failed: %s", strerror(-ret));
1218 goto out;
1219 }
1220 cnt = ret;
@@ -1245,7 +1256,7 @@ writev_help(void)
1256 "\n");
1257 }
1258
1248 -static int writev_f(BlockBackend *blk, int argc, char **argv);
1259 +static int writev_f(BlockBackend *blk, int argc, char **argv, Error **errp);
1260
1261 static const cmdinfo_t writev_cmd = {
1262 .name = "writev",
@@ -1258,7 +1269,7 @@ static const cmdinfo_t writev_cmd = {
1269 .help = writev_help,
1270 };
1271
1261 -static int writev_f(BlockBackend *blk, int argc, char **argv)
1272 +static int writev_f(BlockBackend *blk, int argc, char **argv, Error **errp)
1273 {
1274 struct timespec t1, t2;
1275 bool Cflag = false, qflag = false;
@@ -1287,7 +1298,7 @@ static int writev_f(BlockBackend *blk, int argc, char **argv)
1298 flags |= BDRV_REQ_REGISTERED_BUF;
1299 break;
1300 case 'P':
1290 - pattern = parse_pattern(optarg);
1301 + pattern = parse_pattern(optarg, errp);
1302 if (pattern < 0) {
1303 return -EINVAL;
1304 }
@@ -1305,14 +1316,14 @@ static int writev_f(BlockBackend *blk, int argc, char **argv)
1316
1317 offset = cvtnum(argv[optind]);
1318 if (offset < 0) {
1308 - print_cvtnum_err(offset, argv[optind]);
1319 + set_cvtnum_err(offset, argv[optind], errp);
1320 return offset;
1321 }
1322 optind++;
1323
1324 nr_iov = argc - optind;
1325 buf = create_iovec(blk, &qiov, &argv[optind], nr_iov, pattern,
1315 - flags & BDRV_REQ_REGISTERED_BUF);
1326 + flags & BDRV_REQ_REGISTERED_BUF, errp);
1327 if (buf == NULL) {
1328 return -EINVAL;
1329 }
@@ -1322,7 +1333,7 @@ static int writev_f(BlockBackend *blk, int argc, char **argv)
1333 clock_gettime(CLOCK_MONOTONIC, &t2);
1334
1335 if (ret < 0) {
1325 - printf("writev failed: %s\n", strerror(-ret));
1336 + error_setg(errp, "writev failed: %s", strerror(-ret));
1337 goto out;
1338 }
1339 cnt = ret;
@@ -1367,7 +1378,7 @@ static void aio_write_done(void *opaque, int ret)
1378
1379
1380 if (ret < 0) {
1370 - printf("aio_write failed: %s\n", strerror(-ret));
1381 + error_report("aio_write failed: %s", strerror(-ret));
1382 block_acct_failed(blk_get_stats(ctx->blk), &ctx->acct);
1383 goto out;
1384 }
@@ -1399,7 +1410,7 @@ static void aio_read_done(void *opaque, int ret)
1410 clock_gettime(CLOCK_MONOTONIC, &t2);
1411
1412 if (ret < 0) {
1402 - printf("readv failed: %s\n", strerror(-ret));
1413 + error_report("readv failed: %s", strerror(-ret));
1414 block_acct_failed(blk_get_stats(ctx->blk), &ctx->acct);
1415 goto out;
1416 }
@@ -1409,8 +1420,8 @@ static void aio_read_done(void *opaque, int ret)
1420
1421 memset(cmp_buf, ctx->pattern, ctx->qiov.size);
1422 if (memcmp(ctx->buf, cmp_buf, ctx->qiov.size)) {
1412 - printf("Pattern verification failed at offset %"
1413 - PRId64 ", %zu bytes\n", ctx->offset, ctx->qiov.size);
1423 + error_report("Pattern verification failed at offset %"
1424 + PRId64 ", %zu bytes", ctx->offset, ctx->qiov.size);
1425 }
1426 g_free(cmp_buf);
1427 }
@@ -1461,7 +1472,7 @@ static void aio_read_help(void)
1472 "\n");
1473 }
1474
1464 -static int aio_read_f(BlockBackend *blk, int argc, char **argv);
1475 +static int aio_read_f(BlockBackend *blk, int argc, char **argv, Error **errp);
1476
1477 static const cmdinfo_t aio_read_cmd = {
1478 .name = "aio_read",
@@ -1473,7 +1484,7 @@ static const cmdinfo_t aio_read_cmd = {
1484 .help = aio_read_help,
1485 };
1486
1476 -static int aio_read_f(BlockBackend *blk, int argc, char **argv)
1487 +static int aio_read_f(BlockBackend *blk, int argc, char **argv, Error **errp)
1488 {
1489 int nr_iov, c;
1490 struct aio_ctx *ctx = g_new0(struct aio_ctx, 1);
@@ -1486,7 +1497,7 @@ static int aio_read_f(BlockBackend *blk, int argc, char **argv)
1497 break;
1498 case 'P':
1499 ctx->Pflag = true;
1489 - ctx->pattern = parse_pattern(optarg);
1500 + ctx->pattern = parse_pattern(optarg, errp);
1501 if (ctx->pattern < 0) {
1502 g_free(ctx);
1503 return -EINVAL;
@@ -1522,7 +1533,7 @@ static int aio_read_f(BlockBackend *blk, int argc, char **argv)
1533 ctx->offset = cvtnum(argv[optind]);
1534 if (ctx->offset < 0) {
1535 int ret = ctx->offset;
1525 - print_cvtnum_err(ret, argv[optind]);
1536 + set_cvtnum_err(ret, argv[optind], errp);
1537 g_free(ctx);
1538 return ret;
1539 }
@@ -1530,7 +1541,7 @@ static int aio_read_f(BlockBackend *blk, int argc, char **argv)
1541
1542 nr_iov = argc - optind;
1543 ctx->buf = create_iovec(blk, &ctx->qiov, &argv[optind], nr_iov, 0xab,
1533 - ctx->flags & BDRV_REQ_REGISTERED_BUF);
1544 + ctx->flags & BDRV_REQ_REGISTERED_BUF, errp);
1545 if (ctx->buf == NULL) {
1546 block_acct_invalid(blk_get_stats(blk), BLOCK_ACCT_READ);
1547 g_free(ctx);
@@ -1573,7 +1584,7 @@ static void aio_write_help(void)
1584 "\n");
1585 }
1586
1576 -static int aio_write_f(BlockBackend *blk, int argc, char **argv);
1587 +static int aio_write_f(BlockBackend *blk, int argc, char **argv, Error **errp);
1588
1589 static const cmdinfo_t aio_write_cmd = {
1590 .name = "aio_write",
@@ -1586,7 +1597,7 @@ static const cmdinfo_t aio_write_cmd = {
1597 .help = aio_write_help,
1598 };
1599
1589 -static int aio_write_f(BlockBackend *blk, int argc, char **argv)
1600 +static int aio_write_f(BlockBackend *blk, int argc, char **argv, Error **errp)
1601 {
1602 int nr_iov, c;
1603 int pattern = 0xcd;
@@ -1611,7 +1622,7 @@ static int aio_write_f(BlockBackend *blk, int argc, char **argv)
1622 ctx->flags |= BDRV_REQ_MAY_UNMAP;
1623 break;
1624 case 'P':
1614 - pattern = parse_pattern(optarg);
1625 + pattern = parse_pattern(optarg, errp);
1626 if (pattern < 0) {
1627 g_free(ctx);
1628 return -EINVAL;
@@ -1639,25 +1650,26 @@ static int aio_write_f(BlockBackend *blk, int argc, char **argv)
1650 }
1651
1652 if (ctx->zflag && optind != argc - 2) {
1642 - printf("-z supports only a single length parameter\n");
1653 + error_setg(errp, "-z supports only a single length parameter");
1654 g_free(ctx);
1655 return -EINVAL;
1656 }
1657
1658 if ((ctx->flags & BDRV_REQ_MAY_UNMAP) && !ctx->zflag) {
1648 - printf("-u requires -z to be specified\n");
1659 + error_setg(errp, "-u requires -z to be specified");
1660 g_free(ctx);
1661 return -EINVAL;
1662 }
1663
1664 if (ctx->zflag && ctx->Pflag) {
1654 - printf("-z and -P cannot be specified at the same time\n");
1665 + error_setg(errp, "-z and -P cannot be specified at the same time");
1666 g_free(ctx);
1667 return -EINVAL;
1668 }
1669
1670 if (ctx->zflag && (ctx->flags & BDRV_REQ_REGISTERED_BUF)) {
1660 - printf("cannot combine zero write with registered I/O buffer\n");
1671 + error_setg(errp,
1672 + "cannot combine zero write with registered I/O buffer");
1673 g_free(ctx);
1674 return -EINVAL;
1675 }
@@ -1665,7 +1677,7 @@ static int aio_write_f(BlockBackend *blk, int argc, char **argv)
1677 ctx->offset = cvtnum(argv[optind]);
1678 if (ctx->offset < 0) {
1679 int ret = ctx->offset;
1668 - print_cvtnum_err(ret, argv[optind]);
1680 + set_cvtnum_err(ret, argv[optind], errp);
1681 g_free(ctx);
1682 return ret;
1683 }
@@ -1674,7 +1686,7 @@ static int aio_write_f(BlockBackend *blk, int argc, char **argv)
1686 if (ctx->zflag) {
1687 int64_t count = cvtnum(argv[optind]);
1688 if (count < 0) {
1677 - print_cvtnum_err(count, argv[optind]);
1689 + set_cvtnum_err(count, argv[optind], errp);
1690 g_free(ctx);
1691 return count;
1692 }
@@ -1685,7 +1697,8 @@ static int aio_write_f(BlockBackend *blk, int argc, char **argv)
1697 } else {
1698 nr_iov = argc - optind;
1699 ctx->buf = create_iovec(blk, &ctx->qiov, &argv[optind], nr_iov,
1688 - pattern, ctx->flags & BDRV_REQ_REGISTERED_BUF);
1700 + pattern,
1701 + ctx->flags & BDRV_REQ_REGISTERED_BUF, errp);
1702 if (ctx->buf == NULL) {
1703 block_acct_invalid(blk_get_stats(blk), BLOCK_ACCT_WRITE);
1704 g_free(ctx);
@@ -1703,7 +1716,7 @@ static int aio_write_f(BlockBackend *blk, int argc, char **argv)
1716 return 0;
1717 }
1718
1706 -static int aio_flush_f(BlockBackend *blk, int argc, char **argv)
1719 +static int aio_flush_f(BlockBackend *blk, int argc, char **argv, Error **errp)
1720 {
1721 BlockAcctCookie cookie;
1722 block_acct_start(blk_get_stats(blk), &cookie, 0, BLOCK_ACCT_FLUSH);
@@ -1718,7 +1731,7 @@ static const cmdinfo_t aio_flush_cmd = {
1731 .oneline = "completes all outstanding aio requests"
1732 };
1733
1721 -static int flush_f(BlockBackend *blk, int argc, char **argv)
1734 +static int flush_f(BlockBackend *blk, int argc, char **argv, Error **errp)
1735 {
1736 return blk_flush(blk);
1737 }
@@ -1735,7 +1748,7 @@ static inline int64_t tosector(int64_t bytes)
1748 return bytes >> BDRV_SECTOR_BITS;
1749 }
1750
1738 -static int zone_report_f(BlockBackend *blk, int argc, char **argv)
1751 +static int zone_report_f(BlockBackend *blk, int argc, char **argv, Error **errp)
1752 {
1753 int ret;
1754 int64_t offset;
@@ -1745,17 +1758,17 @@ static int zone_report_f(BlockBackend *blk, int argc, char **argv)
1758 ++optind;
1759 offset = cvtnum(argv[optind]);
1760 if (offset < 0) {
1748 - print_cvtnum_err(offset, argv[optind]);
1761 + set_cvtnum_err(offset, argv[optind], errp);
1762 return offset;
1763 }
1764 ++optind;
1765 val = cvtnum(argv[optind]);
1766 if (val < 0) {
1754 - print_cvtnum_err(val, argv[optind]);
1767 + set_cvtnum_err(val, argv[optind], errp);
1768 return val;
1769 }
1770 if (val > UINT_MAX) {
1758 - printf("Number of zones must be less than 2^32\n");
1771 + error_setg(errp, "Number of zones must be less than 2^32");
1772 return -ERANGE;
1773 }
1774 nr_zones = val;
@@ -1764,7 +1777,7 @@ static int zone_report_f(BlockBackend *blk, int argc, char **argv)
1777 zones = g_new(BlockZoneDescriptor, nr_zones);
1778 ret = blk_zone_report(blk, offset, &nr_zones, zones);
1779 if (ret < 0) {
1767 - printf("zone report failed: %s\n", strerror(-ret));
1780 + error_setg(errp, "zone report failed: %s", strerror(-ret));
1781 } else {
1782 for (int i = 0; i < nr_zones; ++i) {
1783 printf("start: 0x%" PRIx64 ", len 0x%" PRIx64 ", "
@@ -1788,25 +1801,25 @@ static const cmdinfo_t zone_report_cmd = {
1801 .oneline = "report zone information",
1802 };
1803
1791 -static int zone_open_f(BlockBackend *blk, int argc, char **argv)
1804 +static int zone_open_f(BlockBackend *blk, int argc, char **argv, Error **errp)
1805 {
1806 int ret;
1807 int64_t offset, len;
1808 ++optind;
1809 offset = cvtnum(argv[optind]);
1810 if (offset < 0) {
1798 - print_cvtnum_err(offset, argv[optind]);
1811 + set_cvtnum_err(offset, argv[optind], errp);
1812 return offset;
1813 }
1814 ++optind;
1815 len = cvtnum(argv[optind]);
1816 if (len < 0) {
1804 - print_cvtnum_err(len, argv[optind]);
1817 + set_cvtnum_err(len, argv[optind], errp);
1818 return len;
1819 }
1820 ret = blk_zone_mgmt(blk, BLK_ZO_OPEN, offset, len);
1821 if (ret < 0) {
1809 - printf("zone open failed: %s\n", strerror(-ret));
1822 + error_setg(errp, "zone open failed: %s", strerror(-ret));
1823 }
1824 return ret;
1825 }
@@ -1821,25 +1834,25 @@ static const cmdinfo_t zone_open_cmd = {
1834 .oneline = "explicit open a range of zones in zone block device",
1835 };
1836
1824 -static int zone_close_f(BlockBackend *blk, int argc, char **argv)
1837 +static int zone_close_f(BlockBackend *blk, int argc, char **argv, Error **errp)
1838 {
1839 int ret;
1840 int64_t offset, len;
1841 ++optind;
1842 offset = cvtnum(argv[optind]);
1843 if (offset < 0) {
1831 - print_cvtnum_err(offset, argv[optind]);
1844 + set_cvtnum_err(offset, argv[optind], errp);
1845 return offset;
1846 }
1847 ++optind;
1848 len = cvtnum(argv[optind]);
1849 if (len < 0) {
1837 - print_cvtnum_err(len, argv[optind]);
1850 + set_cvtnum_err(len, argv[optind], errp);
1851 return len;
1852 }
1853 ret = blk_zone_mgmt(blk, BLK_ZO_CLOSE, offset, len);
1854 if (ret < 0) {
1842 - printf("zone close failed: %s\n", strerror(-ret));
1855 + error_setg(errp, "zone close failed: %s", strerror(-ret));
1856 }
1857 return ret;
1858 }
@@ -1854,25 +1867,25 @@ static const cmdinfo_t zone_close_cmd = {
1867 .oneline = "close a range of zones in zone block device",
1868 };
1869
1857 -static int zone_finish_f(BlockBackend *blk, int argc, char **argv)
1870 +static int zone_finish_f(BlockBackend *blk, int argc, char **argv, Error **errp)
1871 {
1872 int ret;
1873 int64_t offset, len;
1874 ++optind;
1875 offset = cvtnum(argv[optind]);
1876 if (offset < 0) {
1864 - print_cvtnum_err(offset, argv[optind]);
1877 + set_cvtnum_err(offset, argv[optind], errp);
1878 return offset;
1879 }
1880 ++optind;
1881 len = cvtnum(argv[optind]);
1882 if (len < 0) {
1870 - print_cvtnum_err(len, argv[optind]);
1883 + set_cvtnum_err(len, argv[optind], errp);
1884 return len;
1885 }
1886 ret = blk_zone_mgmt(blk, BLK_ZO_FINISH, offset, len);
1887 if (ret < 0) {
1875 - printf("zone finish failed: %s\n", strerror(-ret));
1888 + error_setg(errp, "zone finish failed: %s", strerror(-ret));
1889 }
1890 return ret;
1891 }
@@ -1887,25 +1900,25 @@ static const cmdinfo_t zone_finish_cmd = {
1900 .oneline = "finish a range of zones in zone block device",
1901 };
1902
1890 -static int zone_reset_f(BlockBackend *blk, int argc, char **argv)
1903 +static int zone_reset_f(BlockBackend *blk, int argc, char **argv, Error **errp)
1904 {
1905 int ret;
1906 int64_t offset, len;
1907 ++optind;
1908 offset = cvtnum(argv[optind]);
1909 if (offset < 0) {
1897 - print_cvtnum_err(offset, argv[optind]);
1910 + set_cvtnum_err(offset, argv[optind], errp);
1911 return offset;
1912 }
1913 ++optind;
1914 len = cvtnum(argv[optind]);
1915 if (len < 0) {
1903 - print_cvtnum_err(len, argv[optind]);
1916 + set_cvtnum_err(len, argv[optind], errp);
1917 return len;
1918 }
1919 ret = blk_zone_mgmt(blk, BLK_ZO_RESET, offset, len);
1920 if (ret < 0) {
1908 - printf("zone reset failed: %s\n", strerror(-ret));
1921 + error_setg(errp, "zone reset failed: %s", strerror(-ret));
1922 }
1923 return ret;
1924 }
@@ -1934,7 +1947,7 @@ static int do_aio_zone_append(BlockBackend *blk, QEMUIOVector *qiov,
1947 return async_ret < 0 ? async_ret : 1;
1948 }
1949
1937 -static int zone_append_f(BlockBackend *blk, int argc, char **argv)
1950 +static int zone_append_f(BlockBackend *blk, int argc, char **argv, Error **errp)
1951 {
1952 int ret;
1953 bool pflag = false;
@@ -1956,19 +1969,19 @@ static int zone_append_f(BlockBackend *blk, int argc, char **argv)
1969
1970 offset = cvtnum(argv[optind]);
1971 if (offset < 0) {
1959 - print_cvtnum_err(offset, argv[optind]);
1972 + set_cvtnum_err(offset, argv[optind], errp);
1973 return offset;
1974 }
1975 optind++;
1976 nr_iov = argc - optind;
1977 buf = create_iovec(blk, &qiov, &argv[optind], nr_iov, pattern,
1965 - flags & BDRV_REQ_REGISTERED_BUF);
1978 + flags & BDRV_REQ_REGISTERED_BUF, errp);
1979 if (buf == NULL) {
1980 return -EINVAL;
1981 }
1982 ret = do_aio_zone_append(blk, &qiov, &offset, flags, &total);
1983 if (ret < 0) {
1971 - printf("zone append failed: %s\n", strerror(-ret));
1984 + error_setg(errp, "zone append failed: %s", strerror(-ret));
1985 goto out;
1986 }
1987
@@ -1994,7 +2007,7 @@ static const cmdinfo_t zone_append_cmd = {
2007 .oneline = "append write a number of bytes at a specified offset",
2008 };
2009
1997 -static int truncate_f(BlockBackend *blk, int argc, char **argv);
2010 +static int truncate_f(BlockBackend *blk, int argc, char **argv, Error **errp);
2011 static const cmdinfo_t truncate_cmd = {
2012 .name = "truncate",
2013 .altname = "t",
@@ -2006,9 +2019,8 @@ static const cmdinfo_t truncate_cmd = {
2019 .oneline = "truncates the current file at the given offset",
2020 };
2021
2009 -static int truncate_f(BlockBackend *blk, int argc, char **argv)
2022 +static int truncate_f(BlockBackend *blk, int argc, char **argv, Error **errp)
2023 {
2011 - Error *local_err = NULL;
2024 int64_t offset;
2025 int c, ret;
2026 PreallocMode prealloc = PREALLOC_MODE_OFF;
@@ -2019,7 +2031,7 @@ static int truncate_f(BlockBackend *blk, int argc, char **argv)
2031 prealloc = qapi_enum_parse(&PreallocMode_lookup, optarg,
2032 PREALLOC_MODE__MAX, NULL);
2033 if (prealloc == PREALLOC_MODE__MAX) {
2022 - error_report("Invalid preallocation mode '%s'", optarg);
2034 + error_setg(errp, "Invalid preallocation mode '%s'", optarg);
2035 return -EINVAL;
2036 }
2037 break;
@@ -2031,7 +2043,7 @@ static int truncate_f(BlockBackend *blk, int argc, char **argv)
2043
2044 offset = cvtnum(argv[optind]);
2045 if (offset < 0) {
2034 - print_cvtnum_err(offset, argv[1]);
2046 + set_cvtnum_err(offset, argv[1], errp);
2047 return offset;
2048 }
2049
@@ -2040,23 +2052,22 @@ static int truncate_f(BlockBackend *blk, int argc, char **argv)
2052 * exact=true. It is better to err on the "emit more errors" side
2053 * than to be overly permissive.
2054 */
2043 - ret = blk_truncate(blk, offset, false, prealloc, 0, &local_err);
2055 + ret = blk_truncate(blk, offset, false, prealloc, 0, errp);
2056 if (ret < 0) {
2045 - error_report_err(local_err);
2057 return ret;
2058 }
2059
2060 return 0;
2061 }
2062
2052 -static int length_f(BlockBackend *blk, int argc, char **argv)
2063 +static int length_f(BlockBackend *blk, int argc, char **argv, Error **errp)
2064 {
2065 int64_t size;
2066 char s1[64];
2067
2068 size = blk_getlength(blk);
2069 if (size < 0) {
2059 - printf("getlength: %s\n", strerror(-size));
2070 + error_setg(errp, "getlength: %s", strerror(-size));
2071 return size;
2072 }
2073
@@ -2074,12 +2085,12 @@ static const cmdinfo_t length_cmd = {
2085 };
2086
2087
2077 -static int info_f(BlockBackend *blk, int argc, char **argv)
2088 +static int info_f(BlockBackend *blk, int argc, char **argv, Error **errp)
2089 {
2090 + ERRP_GUARD();
2091 BlockDriverState *bs = blk_bs(blk);
2092 BlockDriverInfo bdi;
2093 ImageInfoSpecific *spec_info;
2082 - Error *local_err = NULL;
2094 char s1[64], s2[64];
2095 int ret;
2096
@@ -2104,9 +2115,8 @@ static int info_f(BlockBackend *blk, int argc, char **argv)
2115 printf("cluster size: %s\n", s1);
2116 printf("vm state offset: %s\n", s2);
2117
2107 - spec_info = bdrv_get_specific_info(bs, &local_err);
2108 - if (local_err) {
2109 - error_report_err(local_err);
2118 + spec_info = bdrv_get_specific_info(bs, errp);
2119 + if (*errp) {
2120 return -EIO;
2121 }
2122 if (spec_info) {
@@ -2143,7 +2153,7 @@ static void discard_help(void)
2153 "\n");
2154 }
2155
2146 -static int discard_f(BlockBackend *blk, int argc, char **argv);
2156 +static int discard_f(BlockBackend *blk, int argc, char **argv, Error **errp);
2157
2158 static const cmdinfo_t discard_cmd = {
2159 .name = "discard",
@@ -2157,7 +2167,7 @@ static const cmdinfo_t discard_cmd = {
2167 .help = discard_help,
2168 };
2169
2160 -static int discard_f(BlockBackend *blk, int argc, char **argv)
2170 +static int discard_f(BlockBackend *blk, int argc, char **argv, Error **errp)
2171 {
2172 struct timespec t1, t2;
2173 bool Cflag = false, qflag = false;
@@ -2185,18 +2195,18 @@ static int discard_f(BlockBackend *blk, int argc, char **argv)
2195
2196 offset = cvtnum(argv[optind]);
2197 if (offset < 0) {
2188 - print_cvtnum_err(offset, argv[optind]);
2198 + set_cvtnum_err(offset, argv[optind], errp);
2199 return offset;
2200 }
2201
2202 optind++;
2203 bytes = cvtnum(argv[optind]);
2204 if (bytes < 0) {
2195 - print_cvtnum_err(bytes, argv[optind]);
2205 + set_cvtnum_err(bytes, argv[optind], errp);
2206 return bytes;
2207 } else if (bytes > BDRV_REQUEST_MAX_BYTES) {
2198 - printf("length cannot exceed %"PRIu64", given %s\n",
2199 - (uint64_t)BDRV_REQUEST_MAX_BYTES, argv[optind]);
2208 + error_setg(errp, "length cannot exceed %" PRIu64 ", given %s",
2209 + (uint64_t)BDRV_REQUEST_MAX_BYTES, argv[optind]);
2210 return -EINVAL;
2211 }
2212
@@ -2205,7 +2215,7 @@ static int discard_f(BlockBackend *blk, int argc, char **argv)
2215 clock_gettime(CLOCK_MONOTONIC, &t2);
2216
2217 if (ret < 0) {
2208 - printf("discard failed: %s\n", strerror(-ret));
2218 + error_setg(errp, "discard failed: %s", strerror(-ret));
2219 return ret;
2220 }
2221
@@ -2238,7 +2248,8 @@ static void aio_discard_help(void)
2248 "\n");
2249 }
2250
2241 -static int aio_discard_f(BlockBackend *blk, int argc, char **argv);
2251 +static int aio_discard_f(BlockBackend *blk, int argc, char **argv,
2252 + Error **errp);
2253
2254 static const cmdinfo_t aio_discard_cmd = {
2255 .name = "aio_discard",
@@ -2259,7 +2270,7 @@ static void aio_discard_done(void *opaque, int ret)
2270 clock_gettime(CLOCK_MONOTONIC, &t2);
2271
2272 if (ret < 0) {
2262 - printf("aio_discard failed: %s\n", strerror(-ret));
2273 + error_report("aio_discard failed: %s", strerror(-ret));
2274 block_acct_failed(blk_get_stats(ctx->blk), &ctx->acct);
2275 goto out;
2276 }
@@ -2278,7 +2289,7 @@ out:
2289 g_free(ctx);
2290 }
2291
2281 -static int aio_discard_f(BlockBackend *blk, int argc, char **argv)
2292 +static int aio_discard_f(BlockBackend *blk, int argc, char **argv, Error **errp)
2293 {
2294 int c, ret;
2295 int64_t count;
@@ -2310,7 +2321,7 @@ static int aio_discard_f(BlockBackend *blk, int argc, char **argv)
2321 ctx->offset = cvtnum(argv[optind]);
2322 if (ctx->offset < 0) {
2323 ret = ctx->offset;
2313 - print_cvtnum_err(ret, argv[optind]);
2324 + set_cvtnum_err(ret, argv[optind], errp);
2325 g_free(ctx);
2326 return ret;
2327 }
@@ -2318,7 +2329,7 @@ static int aio_discard_f(BlockBackend *blk, int argc, char **argv)
2329
2330 count = cvtnum(argv[optind]);
2331 if (count < 0) {
2321 - print_cvtnum_err(count, argv[optind]);
2332 + set_cvtnum_err(count, argv[optind], errp);
2333 g_free(ctx);
2334 return count;
2335 }
@@ -2332,7 +2343,7 @@ static int aio_discard_f(BlockBackend *blk, int argc, char **argv)
2343 return 0;
2344 }
2345
2335 -static int alloc_f(BlockBackend *blk, int argc, char **argv)
2346 +static int alloc_f(BlockBackend *blk, int argc, char **argv, Error **errp)
2347 {
2348 BlockDriverState *bs = blk_bs(blk);
2349 int64_t offset, start, remaining, count;
@@ -2342,14 +2353,14 @@ static int alloc_f(BlockBackend *blk, int argc, char **argv)
2353
2354 start = offset = cvtnum(argv[1]);
2355 if (offset < 0) {
2345 - print_cvtnum_err(offset, argv[1]);
2356 + set_cvtnum_err(offset, argv[1], errp);
2357 return offset;
2358 }
2359
2360 if (argc == 3) {
2361 count = cvtnum(argv[2]);
2362 if (count < 0) {
2352 - print_cvtnum_err(count, argv[2]);
2363 + set_cvtnum_err(count, argv[2], errp);
2364 return count;
2365 }
2366 } else {
@@ -2361,7 +2372,7 @@ static int alloc_f(BlockBackend *blk, int argc, char **argv)
2372 while (remaining) {
2373 ret = bdrv_is_allocated(bs, offset, remaining, &num);
2374 if (ret < 0) {
2364 - printf("is_allocated failed: %s\n", strerror(-ret));
2375 + error_setg(errp, "is_allocated failed: %s", strerror(-ret));
2376 return ret;
2377 }
2378 offset += num;
@@ -2422,7 +2433,7 @@ static int map_is_allocated(BlockDriverState *bs, int64_t offset,
2433 return firstret;
2434 }
2435
2425 -static int map_f(BlockBackend *blk, int argc, char **argv)
2436 +static int map_f(BlockBackend *blk, int argc, char **argv, Error **errp)
2437 {
2438 int64_t offset, bytes;
2439 char s1[64], s2[64];
@@ -2433,17 +2444,18 @@ static int map_f(BlockBackend *blk, int argc, char **argv)
2444 offset = 0;
2445 bytes = blk_getlength(blk);
2446 if (bytes < 0) {
2436 - error_report("Failed to query image length: %s", strerror(-bytes));
2447 + error_setg(errp, "Failed to query image length: %s", strerror(-bytes));
2448 return bytes;
2449 }
2450
2451 while (bytes) {
2452 ret = map_is_allocated(blk_bs(blk), offset, bytes, &num);
2453 if (ret < 0) {
2443 - error_report("Failed to get allocation status: %s", strerror(-ret));
2454 + error_setg(errp, "Failed to get allocation status: %s",
2455 + strerror(-ret));
2456 return ret;
2457 } else if (!num) {
2446 - error_report("Unexpected end of image");
2458 + error_setg(errp, "Unexpected end of image");
2459 return -EIO;
2460 }
2461
@@ -2485,7 +2497,7 @@ static void reopen_help(void)
2497 "\n");
2498 }
2499
2488 -static int reopen_f(BlockBackend *blk, int argc, char **argv);
2500 +static int reopen_f(BlockBackend *blk, int argc, char **argv, Error **errp);
2501
2502 static QemuOptsList reopen_opts = {
2503 .name = "reopen",
@@ -2507,7 +2519,7 @@ static const cmdinfo_t reopen_cmd = {
2519 .help = reopen_help,
2520 };
2521
2510 -static int reopen_f(BlockBackend *blk, int argc, char **argv)
2522 +static int reopen_f(BlockBackend *blk, int argc, char **argv, Error **errp)
2523 {
2524 BlockDriverState *bs = blk_bs(blk);
2525 QemuOpts *qopts;
@@ -2517,13 +2529,12 @@ static int reopen_f(BlockBackend *blk, int argc, char **argv)
2529 bool writethrough = !blk_enable_write_cache(blk);
2530 bool has_rw_option = false;
2531 bool has_cache_option = false;
2520 - Error *local_err = NULL;
2532
2533 while ((c = getopt(argc, argv, "c:o:rw")) != -1) {
2534 switch (c) {
2535 case 'c':
2536 if (bdrv_parse_cache_mode(optarg, &flags, &writethrough) < 0) {
2526 - error_report("Invalid cache option: %s", optarg);
2537 + error_setg(errp, "Invalid cache option: %s", optarg);
2538 return -EINVAL;
2539 }
2540 has_cache_option = true;
@@ -2536,7 +2547,7 @@ static int reopen_f(BlockBackend *blk, int argc, char **argv)
2547 break;
2548 case 'r':
2549 if (has_rw_option) {
2539 - error_report("Only one -r/-w option may be given");
2550 + error_setg(errp, "Only one -r/-w option may be given");
2551 return -EINVAL;
2552 }
2553 flags &= ~BDRV_O_RDWR;
@@ -2544,7 +2555,7 @@ static int reopen_f(BlockBackend *blk, int argc, char **argv)
2555 break;
2556 case 'w':
2557 if (has_rw_option) {
2547 - error_report("Only one -r/-w option may be given");
2558 + error_setg(errp, "Only one -r/-w option may be given");
2559 return -EINVAL;
2560 }
2561 flags |= BDRV_O_RDWR;
@@ -2566,7 +2577,7 @@ static int reopen_f(BlockBackend *blk, int argc, char **argv)
2577 if (!writethrough != blk_enable_write_cache(blk) &&
2578 blk_get_attached_dev(blk))
2579 {
2569 - error_report("Cannot change cache.writeback: Device attached");
2580 + error_setg(errp, "Cannot change cache.writeback: Device attached");
2581 qemu_opts_reset(&reopen_opts);
2582 return -EBUSY;
2583 }
@@ -2589,7 +2600,8 @@ static int reopen_f(BlockBackend *blk, int argc, char **argv)
2600
2601 if (qdict_haskey(opts, BDRV_OPT_READ_ONLY)) {
2602 if (has_rw_option) {
2592 - error_report("Cannot set both -r/-w and '" BDRV_OPT_READ_ONLY "'");
2603 + error_setg(errp,
2604 + "Cannot set both -r/-w and '" BDRV_OPT_READ_ONLY "'");
2605 qobject_unref(opts);
2606 return -EINVAL;
2607 }
@@ -2600,7 +2612,7 @@ static int reopen_f(BlockBackend *blk, int argc, char **argv)
2612 if (qdict_haskey(opts, BDRV_OPT_CACHE_DIRECT) ||
2613 qdict_haskey(opts, BDRV_OPT_CACHE_NO_FLUSH)) {
2614 if (has_cache_option) {
2603 - error_report("Cannot set both -c and the cache options");
2615 + error_setg(errp, "Cannot set both -c and the cache options");
2616 qobject_unref(opts);
2617 return -EINVAL;
2618 }
@@ -2609,10 +2621,7 @@ static int reopen_f(BlockBackend *blk, int argc, char **argv)
2621 qdict_put_bool(opts, BDRV_OPT_CACHE_NO_FLUSH, flags & BDRV_O_NO_FLUSH);
2622 }
2623
2612 - bdrv_reopen(bs, opts, true, &local_err);
2613 -
2614 - if (local_err) {
2615 - error_report_err(local_err);
2624 + if (bdrv_reopen(bs, opts, true, errp) < 0) {
2625 return -EINVAL;
2626 }
2627
@@ -2620,26 +2629,28 @@ static int reopen_f(BlockBackend *blk, int argc, char **argv)
2629 return 0;
2630 }
2631
2623 -static int break_f(BlockBackend *blk, int argc, char **argv)
2632 +static int break_f(BlockBackend *blk, int argc, char **argv, Error **errp)
2633 {
2634 int ret;
2635
2636 ret = bdrv_debug_breakpoint(blk_bs(blk), argv[1], argv[2]);
2637 if (ret < 0) {
2629 - printf("Could not set breakpoint: %s\n", strerror(-ret));
2638 + error_setg(errp, "Could not set breakpoint: %s", strerror(-ret));
2639 return ret;
2640 }
2641
2642 return 0;
2643 }
2644
2636 -static int remove_break_f(BlockBackend *blk, int argc, char **argv)
2645 +static int remove_break_f(BlockBackend *blk, int argc, char **argv,
2646 + Error **errp)
2647 {
2648 int ret;
2649
2650 ret = bdrv_debug_remove_breakpoint(blk_bs(blk), argv[1]);
2651 if (ret < 0) {
2642 - printf("Could not remove breakpoint %s: %s\n", argv[1], strerror(-ret));
2652 + error_setg(errp, "Could not remove breakpoint %s: %s",
2653 + argv[1], strerror(-ret));
2654 return ret;
2655 }
2656
@@ -2665,13 +2676,13 @@ static const cmdinfo_t remove_break_cmd = {
2676 .oneline = "remove a breakpoint by tag",
2677 };
2678
2668 -static int resume_f(BlockBackend *blk, int argc, char **argv)
2679 +static int resume_f(BlockBackend *blk, int argc, char **argv, Error **errp)
2680 {
2681 int ret;
2682
2683 ret = bdrv_debug_resume(blk_bs(blk), argv[1]);
2684 if (ret < 0) {
2674 - printf("Could not resume request: %s\n", strerror(-ret));
2685 + error_setg(errp, "Could not resume request: %s", strerror(-ret));
2686 return ret;
2687 }
2688
@@ -2687,7 +2698,7 @@ static const cmdinfo_t resume_cmd = {
2698 .oneline = "resumes the request tagged as tag",
2699 };
2700
2690 -static int wait_break_f(BlockBackend *blk, int argc, char **argv)
2701 +static int wait_break_f(BlockBackend *blk, int argc, char **argv, Error **errp)
2702 {
2703 while (!bdrv_debug_is_suspended(blk_bs(blk), argv[1])) {
2704 aio_poll(blk_get_aio_context(blk), true);
@@ -2704,7 +2715,7 @@ static const cmdinfo_t wait_break_cmd = {
2715 .oneline = "waits for the suspension of a request",
2716 };
2717
2707 -static int abort_f(BlockBackend *blk, int argc, char **argv)
2718 +static int abort_f(BlockBackend *blk, int argc, char **argv, Error **errp)
2719 {
2720 abort();
2721 }
@@ -2730,7 +2741,7 @@ static void sigraise_help(void)
2741 "\n", SIGTERM);
2742 }
2743
2733 -static int sigraise_f(BlockBackend *blk, int argc, char **argv);
2744 +static int sigraise_f(BlockBackend *blk, int argc, char **argv, Error **errp);
2745
2746 static const cmdinfo_t sigraise_cmd = {
2747 .name = "sigraise",
@@ -2743,15 +2754,16 @@ static const cmdinfo_t sigraise_cmd = {
2754 .help = sigraise_help,
2755 };
2756
2746 -static int sigraise_f(BlockBackend *blk, int argc, char **argv)
2757 +static int sigraise_f(BlockBackend *blk, int argc, char **argv, Error **errp)
2758 {
2759 int64_t sig = cvtnum(argv[1]);
2760 if (sig < 0) {
2750 - print_cvtnum_err(sig, argv[1]);
2761 + set_cvtnum_err(sig, argv[1], errp);
2762 return sig;
2763 } else if (sig > NSIG) {
2753 - printf("signal argument '%s' is too large to be a valid signal\n",
2754 - argv[1]);
2764 + error_setg(errp,
2765 + "signal argument '%s' is too large to be a valid signal",
2766 + argv[1]);
2767 return -EINVAL;
2768 }
2769
@@ -2772,7 +2784,7 @@ static void sleep_cb(void *opaque)
2784 *expired = true;
2785 }
2786
2775 -static int sleep_f(BlockBackend *blk, int argc, char **argv)
2787 +static int sleep_f(BlockBackend *blk, int argc, char **argv, Error **errp)
2788 {
2789 char *endptr;
2790 long ms;
@@ -2781,7 +2793,7 @@ static int sleep_f(BlockBackend *blk, int argc, char **argv)
2793
2794 ms = strtol(argv[1], &endptr, 0);
2795 if (ms < 0 || *endptr != '\0') {
2784 - printf("%s is not a valid number\n", argv[1]);
2796 + error_setg(errp, "%s is not a valid number", argv[1]);
2797 return -EINVAL;
2798 }
2799
@@ -2833,7 +2845,7 @@ static void help_all(void)
2845 printf("\nUse 'help commandname' for extended help.\n");
2846 }
2847
2836 -static int help_f(BlockBackend *blk, int argc, char **argv)
2848 +static int help_f(BlockBackend *blk, int argc, char **argv, Error **errp)
2849 {
2850 const cmdinfo_t *ct;
2851
@@ -2844,7 +2856,7 @@ static int help_f(BlockBackend *blk, int argc, char **argv)
2856
2857 ct = find_command(argv[1]);
2858 if (ct == NULL) {
2847 - printf("command %s not found\n", argv[1]);
2859 + error_setg(errp, "command %s not found", argv[1]);
2860 return -EINVAL;
2861 }
2862
@@ -2867,7 +2879,7 @@ static const cmdinfo_t help_cmd = {
2879 * Called with aio context of blk acquired. Or with qemu_get_aio_context()
2880 * context acquired if blk is NULL.
2881 */
2870 -int qemuio_command(BlockBackend *blk, const char *cmd)
2882 +int qemuio_command(BlockBackend *blk, const char *cmd, Error **errp)
2883 {
2884 char *input;
2885 const cmdinfo_t *ct;
@@ -2880,9 +2892,9 @@ int qemuio_command(BlockBackend *blk, const char *cmd)
2892 if (c) {
2893 ct = find_command(v[0]);
2894 if (ct) {
2883 - ret = command(blk, ct, c, v);
2895 + ret = command(blk, ct, c, v, errp);
2896 } else {
2885 - fprintf(stderr, "command \"%s\" not found\n", v[0]);
2897 + error_setg(errp, "command \"%s\" not found", v[0]);
2898 ret = -EINVAL;
2899 }
2900 }
qemu-io.c
+12 -5
@@ -68,7 +68,7 @@ static int get_eof_char(void)
68 #endif
69 }
70
71 -static int close_f(BlockBackend *blk, int argc, char **argv)
71 +static int close_f(BlockBackend *blk, int argc, char **argv, Error **errp)
72 {
73 blk_unref(qemuio_blk);
74 qemuio_blk = NULL;
@@ -140,7 +140,7 @@ static void open_help(void)
140 "\n");
141 }
142
143 -static int open_f(BlockBackend *blk, int argc, char **argv);
143 +static int open_f(BlockBackend *blk, int argc, char **argv, Error **errp);
144
145 static const cmdinfo_t open_cmd = {
146 .name = "open",
@@ -164,7 +164,7 @@ static QemuOptsList empty_opts = {
164 },
165 };
166
167 -static int open_f(BlockBackend *blk, int argc, char **argv)
167 +static int open_f(BlockBackend *blk, int argc, char **argv, Error **errp)
168 {
169 int flags = BDRV_O_UNMAP;
170 int readonly = 0;
@@ -268,7 +268,7 @@ static int open_f(BlockBackend *blk, int argc, char **argv)
268 return 0;
269 }
270
271 -static int quit_f(BlockBackend *blk, int argc, char **argv)
271 +static int quit_f(BlockBackend *blk, int argc, char **argv, Error **errp)
272 {
273 quit_qemu_io = true;
274 return 0;
@@ -414,7 +414,14 @@ static void prep_fetchline(void *opaque)
414
415 static int do_qemuio_command(const char *cmd)
416 {
417 - return qemuio_command(qemuio_blk, cmd);
417 + Error *local_err = NULL;
418 + int ret;
419 +
420 + ret = qemuio_command(qemuio_blk, cmd, &local_err);
421 + if (local_err) {
422 + error_report_err(local_err);
423 + }
424 + return ret;
425 }
426
427 static int command_loop(void)
tests/qemu-iotests/004.out
+10 -10
@@ -6,36 +6,36 @@ wrote 1048576/1048576 bytes at offset 133169152
6 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
7
8 write into image boundary
9 -write failed: Input/output error
9 +qemu-io: write failed: Input/output error
10
11 write at image boundary
12 -write failed: Input/output error
12 +qemu-io: write failed: Input/output error
13
14 write past image boundary
15 -write failed: Input/output error
15 +qemu-io: write failed: Input/output error
16
17 pwrite past image boundary
18 -write failed: Input/output error
18 +qemu-io: write failed: Input/output error
19
20 writev past image boundary
21 -writev failed: Input/output error
21 +qemu-io: writev failed: Input/output error
22
23 read before image boundary
24 read 1048576/1048576 bytes at offset 133169152
25 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
26
27 read into image boundary
28 -read failed: Input/output error
28 +qemu-io: read failed: Input/output error
29
30 read at image boundary
31 -read failed: Input/output error
31 +qemu-io: read failed: Input/output error
32
33 read past image boundary
34 -read failed: Input/output error
34 +qemu-io: read failed: Input/output error
35
36 pread past image boundary
37 -read failed: Input/output error
37 +qemu-io: read failed: Input/output error
38
39 readv past image boundary
40 -readv failed: Input/output error
40 +qemu-io: readv failed: Input/output error
41 *** done
tests/qemu-iotests/021.out
+30 -30
@@ -2,92 +2,92 @@ QA output created by 021
2 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
3
4 == testing writev -P -1 ==
5 --1 is not a valid pattern byte
5 +qemu-io: -1 is not a valid pattern byte
6
7 == testing read -P -1 ==
8 --1 is not a valid pattern byte
8 +qemu-io: -1 is not a valid pattern byte
9
10 == testing write -P -1 ==
11 --1 is not a valid pattern byte
11 +qemu-io: -1 is not a valid pattern byte
12
13 == testing readv -P -1 ==
14 --1 is not a valid pattern byte
14 +qemu-io: -1 is not a valid pattern byte
15
16 == testing aio_read -P -1 ==
17 --1 is not a valid pattern byte
17 +qemu-io: -1 is not a valid pattern byte
18
19 == testing aio_write -P -1 ==
20 --1 is not a valid pattern byte
20 +qemu-io: -1 is not a valid pattern byte
21
22 == testing writev -P 300 ==
23 -300 is not a valid pattern byte
23 +qemu-io: 300 is not a valid pattern byte
24
25 == testing read -P 300 ==
26 -300 is not a valid pattern byte
26 +qemu-io: 300 is not a valid pattern byte
27
28 == testing write -P 300 ==
29 -300 is not a valid pattern byte
29 +qemu-io: 300 is not a valid pattern byte
30
31 == testing readv -P 300 ==
32 -300 is not a valid pattern byte
32 +qemu-io: 300 is not a valid pattern byte
33
34 == testing aio_read -P 300 ==
35 -300 is not a valid pattern byte
35 +qemu-io: 300 is not a valid pattern byte
36
37 == testing aio_write -P 300 ==
38 -300 is not a valid pattern byte
38 +qemu-io: 300 is not a valid pattern byte
39
40 == testing writev -P 12m ==
41 -12m is not a valid pattern byte
41 +qemu-io: 12m is not a valid pattern byte
42
43 == testing read -P 12m ==
44 -12m is not a valid pattern byte
44 +qemu-io: 12m is not a valid pattern byte
45
46 == testing write -P 12m ==
47 -12m is not a valid pattern byte
47 +qemu-io: 12m is not a valid pattern byte
48
49 == testing readv -P 12m ==
50 -12m is not a valid pattern byte
50 +qemu-io: 12m is not a valid pattern byte
51
52 == testing aio_read -P 12m ==
53 -12m is not a valid pattern byte
53 +qemu-io: 12m is not a valid pattern byte
54
55 == testing aio_write -P 12m ==
56 -12m is not a valid pattern byte
56 +qemu-io: 12m is not a valid pattern byte
57
58 == testing writev -P 4k ==
59 -4k is not a valid pattern byte
59 +qemu-io: 4k is not a valid pattern byte
60
61 == testing read -P 4k ==
62 -4k is not a valid pattern byte
62 +qemu-io: 4k is not a valid pattern byte
63
64 == testing write -P 4k ==
65 -4k is not a valid pattern byte
65 +qemu-io: 4k is not a valid pattern byte
66
67 == testing readv -P 4k ==
68 -4k is not a valid pattern byte
68 +qemu-io: 4k is not a valid pattern byte
69
70 == testing aio_read -P 4k ==
71 -4k is not a valid pattern byte
71 +qemu-io: 4k is not a valid pattern byte
72
73 == testing aio_write -P 4k ==
74 -4k is not a valid pattern byte
74 +qemu-io: 4k is not a valid pattern byte
75
76 == testing writev -P route66 ==
77 -route66 is not a valid pattern byte
77 +qemu-io: route66 is not a valid pattern byte
78
79 == testing read -P route66 ==
80 -route66 is not a valid pattern byte
80 +qemu-io: route66 is not a valid pattern byte
81
82 == testing write -P route66 ==
83 -route66 is not a valid pattern byte
83 +qemu-io: route66 is not a valid pattern byte
84
85 == testing readv -P route66 ==
86 -route66 is not a valid pattern byte
86 +qemu-io: route66 is not a valid pattern byte
87
88 == testing aio_read -P route66 ==
89 -route66 is not a valid pattern byte
89 +qemu-io: route66 is not a valid pattern byte
90
91 == testing aio_write -P route66 ==
92 -route66 is not a valid pattern byte
92 +qemu-io: route66 is not a valid pattern byte
93 *** done
tests/qemu-iotests/026.out
+114 -114
@@ -4,442 +4,442 @@ Errors while writing 128 kB
4 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
5
6 Event: l1_update; errno: 5; imm: off; once: on; write
7 -write failed: Input/output error
7 +qemu-io: write failed: Input/output error
8 No errors were found on the image.
9 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
10
11 Event: l1_update; errno: 5; imm: off; once: on; write -b
12 -write failed: Input/output error
12 +qemu-io: write failed: Input/output error
13 No errors were found on the image.
14 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
15
16 Event: l1_update; errno: 5; imm: off; once: off; write
17 +qemu-io: write failed: Input/output error
18 qemu-io: Failed to flush the L2 table cache: Input/output error
19 qemu-io: Failed to flush the refcount block cache: Input/output error
19 -write failed: Input/output error
20 No errors were found on the image.
21 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
22
23 Event: l1_update; errno: 5; imm: off; once: off; write -b
24 +qemu-io: write failed: Input/output error
25 qemu-io: Failed to flush the L2 table cache: Input/output error
26 qemu-io: Failed to flush the refcount block cache: Input/output error
26 -write failed: Input/output error
27 No errors were found on the image.
28 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
29
30 Event: l1_update; errno: 28; imm: off; once: on; write
31 -write failed: No space left on device
31 +qemu-io: write failed: No space left on device
32 No errors were found on the image.
33 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
34
35 Event: l1_update; errno: 28; imm: off; once: on; write -b
36 -write failed: No space left on device
36 +qemu-io: write failed: No space left on device
37 No errors were found on the image.
38 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
39
40 Event: l1_update; errno: 28; imm: off; once: off; write
41 +qemu-io: write failed: No space left on device
42 qemu-io: Failed to flush the L2 table cache: No space left on device
43 qemu-io: Failed to flush the refcount block cache: No space left on device
43 -write failed: No space left on device
44 No errors were found on the image.
45 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
46
47 Event: l1_update; errno: 28; imm: off; once: off; write -b
48 +qemu-io: write failed: No space left on device
49 qemu-io: Failed to flush the L2 table cache: No space left on device
50 qemu-io: Failed to flush the refcount block cache: No space left on device
50 -write failed: No space left on device
51 No errors were found on the image.
52 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
53
54 Event: l2_load; errno: 5; imm: off; once: on; write
55 wrote 131072/131072 bytes at offset 0
56 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
57 -write failed: Input/output error
58 -read failed: Input/output error
57 +qemu-io: write failed: Input/output error
58 +qemu-io: read failed: Input/output error
59 No errors were found on the image.
60 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
61
62 Event: l2_load; errno: 5; imm: off; once: on; write -b
63 wrote 131072/131072 bytes at offset 0
64 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
65 -write failed: Input/output error
66 -read failed: Input/output error
65 +qemu-io: write failed: Input/output error
66 +qemu-io: read failed: Input/output error
67 No errors were found on the image.
68 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
69
70 Event: l2_load; errno: 5; imm: off; once: off; write
71 wrote 131072/131072 bytes at offset 0
72 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
73 -write failed: Input/output error
74 -read failed: Input/output error
73 +qemu-io: write failed: Input/output error
74 +qemu-io: read failed: Input/output error
75 No errors were found on the image.
76 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
77
78 Event: l2_load; errno: 5; imm: off; once: off; write -b
79 wrote 131072/131072 bytes at offset 0
80 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
81 -write failed: Input/output error
82 -read failed: Input/output error
81 +qemu-io: write failed: Input/output error
82 +qemu-io: read failed: Input/output error
83 No errors were found on the image.
84 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
85
86 Event: l2_load; errno: 28; imm: off; once: on; write
87 wrote 131072/131072 bytes at offset 0
88 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
89 -write failed: No space left on device
90 -read failed: No space left on device
89 +qemu-io: write failed: No space left on device
90 +qemu-io: read failed: No space left on device
91 No errors were found on the image.
92 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
93
94 Event: l2_load; errno: 28; imm: off; once: on; write -b
95 wrote 131072/131072 bytes at offset 0
96 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
97 -write failed: No space left on device
98 -read failed: No space left on device
97 +qemu-io: write failed: No space left on device
98 +qemu-io: read failed: No space left on device
99 No errors were found on the image.
100 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
101
102 Event: l2_load; errno: 28; imm: off; once: off; write
103 wrote 131072/131072 bytes at offset 0
104 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
105 -write failed: No space left on device
106 -read failed: No space left on device
105 +qemu-io: write failed: No space left on device
106 +qemu-io: read failed: No space left on device
107 No errors were found on the image.
108 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
109
110 Event: l2_load; errno: 28; imm: off; once: off; write -b
111 wrote 131072/131072 bytes at offset 0
112 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
113 -write failed: No space left on device
114 -read failed: No space left on device
113 +qemu-io: write failed: No space left on device
114 +qemu-io: read failed: No space left on device
115 No errors were found on the image.
116 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
117
118 Event: l2_update; errno: 5; imm: off; once: on; write
119 -write failed: Input/output error
119 +qemu-io: write failed: Input/output error
120 No errors were found on the image.
121 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
122
123 Event: l2_update; errno: 5; imm: off; once: on; write -b
124 -write failed: Input/output error
124 +qemu-io: write failed: Input/output error
125 No errors were found on the image.
126 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
127
128 Event: l2_update; errno: 5; imm: off; once: off; write
129 +qemu-io: write failed: Input/output error
130 qemu-io: Failed to flush the L2 table cache: Input/output error
131 qemu-io: Failed to flush the refcount block cache: Input/output error
131 -write failed: Input/output error
132 No errors were found on the image.
133 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
134
135 Event: l2_update; errno: 5; imm: off; once: off; write -b
136 +qemu-io: write failed: Input/output error
137 qemu-io: Failed to flush the L2 table cache: Input/output error
138 qemu-io: Failed to flush the refcount block cache: Input/output error
138 -write failed: Input/output error
139 No errors were found on the image.
140 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
141
142 Event: l2_update; errno: 28; imm: off; once: on; write
143 -write failed: No space left on device
143 +qemu-io: write failed: No space left on device
144 No errors were found on the image.
145 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
146
147 Event: l2_update; errno: 28; imm: off; once: on; write -b
148 -write failed: No space left on device
148 +qemu-io: write failed: No space left on device
149 No errors were found on the image.
150 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
151
152 Event: l2_update; errno: 28; imm: off; once: off; write
153 +qemu-io: write failed: No space left on device
154 qemu-io: Failed to flush the L2 table cache: No space left on device
155 qemu-io: Failed to flush the refcount block cache: No space left on device
155 -write failed: No space left on device
156 No errors were found on the image.
157 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
158
159 Event: l2_update; errno: 28; imm: off; once: off; write -b
160 +qemu-io: write failed: No space left on device
161 qemu-io: Failed to flush the L2 table cache: No space left on device
162 qemu-io: Failed to flush the refcount block cache: No space left on device
162 -write failed: No space left on device
163 No errors were found on the image.
164 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
165
166 Event: l2_alloc_write; errno: 5; imm: off; once: on; write
167 -write failed: Input/output error
167 +qemu-io: write failed: Input/output error
168 No errors were found on the image.
169 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
170
171 Event: l2_alloc_write; errno: 5; imm: off; once: on; write -b
172 -write failed: Input/output error
172 +qemu-io: write failed: Input/output error
173 No errors were found on the image.
174 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
175
176 Event: l2_alloc_write; errno: 5; imm: off; once: off; write
177 +qemu-io: write failed: Input/output error
178 qemu-io: Failed to flush the L2 table cache: Input/output error
179 qemu-io: Failed to flush the refcount block cache: Input/output error
179 -write failed: Input/output error
180 No errors were found on the image.
181 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
182
183 Event: l2_alloc_write; errno: 5; imm: off; once: off; write -b
184 +qemu-io: write failed: Input/output error
185 qemu-io: Failed to flush the L2 table cache: Input/output error
186 qemu-io: Failed to flush the refcount block cache: Input/output error
186 -write failed: Input/output error
187 No errors were found on the image.
188 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
189
190 Event: l2_alloc_write; errno: 28; imm: off; once: on; write
191 -write failed: No space left on device
191 +qemu-io: write failed: No space left on device
192 No errors were found on the image.
193 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
194
195 Event: l2_alloc_write; errno: 28; imm: off; once: on; write -b
196 -write failed: No space left on device
196 +qemu-io: write failed: No space left on device
197 No errors were found on the image.
198 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
199
200 Event: l2_alloc_write; errno: 28; imm: off; once: off; write
201 +qemu-io: write failed: No space left on device
202 qemu-io: Failed to flush the L2 table cache: No space left on device
203 qemu-io: Failed to flush the refcount block cache: No space left on device
203 -write failed: No space left on device
204 No errors were found on the image.
205 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
206
207 Event: l2_alloc_write; errno: 28; imm: off; once: off; write -b
208 +qemu-io: write failed: No space left on device
209 qemu-io: Failed to flush the L2 table cache: No space left on device
210 qemu-io: Failed to flush the refcount block cache: No space left on device
210 -write failed: No space left on device
211 No errors were found on the image.
212 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
213
214 Event: write_aio; errno: 5; imm: off; once: on; write
215 -write failed: Input/output error
215 +qemu-io: write failed: Input/output error
216 No errors were found on the image.
217 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
218
219 Event: write_aio; errno: 5; imm: off; once: on; write -b
220 -write failed: Input/output error
220 +qemu-io: write failed: Input/output error
221 No errors were found on the image.
222 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
223
224 Event: write_aio; errno: 5; imm: off; once: off; write
225 +qemu-io: write failed: Input/output error
226 qemu-io: Failed to flush the L2 table cache: Input/output error
227 qemu-io: Failed to flush the refcount block cache: Input/output error
227 -write failed: Input/output error
228 No errors were found on the image.
229 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
230
231 Event: write_aio; errno: 5; imm: off; once: off; write -b
232 +qemu-io: write failed: Input/output error
233 qemu-io: Failed to flush the L2 table cache: Input/output error
234 qemu-io: Failed to flush the refcount block cache: Input/output error
234 -write failed: Input/output error
235 No errors were found on the image.
236 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
237
238 Event: write_aio; errno: 28; imm: off; once: on; write
239 -write failed: No space left on device
239 +qemu-io: write failed: No space left on device
240 No errors were found on the image.
241 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
242
243 Event: write_aio; errno: 28; imm: off; once: on; write -b
244 -write failed: No space left on device
244 +qemu-io: write failed: No space left on device
245 No errors were found on the image.
246 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
247
248 Event: write_aio; errno: 28; imm: off; once: off; write
249 +qemu-io: write failed: No space left on device
250 qemu-io: Failed to flush the L2 table cache: No space left on device
251 qemu-io: Failed to flush the refcount block cache: No space left on device
251 -write failed: No space left on device
252 No errors were found on the image.
253 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
254
255 Event: write_aio; errno: 28; imm: off; once: off; write -b
256 +qemu-io: write failed: No space left on device
257 qemu-io: Failed to flush the L2 table cache: No space left on device
258 qemu-io: Failed to flush the refcount block cache: No space left on device
258 -write failed: No space left on device
259 No errors were found on the image.
260 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
261
262 Event: refblock_load; errno: 5; imm: off; once: on; write
263 -write failed: Input/output error
263 +qemu-io: write failed: Input/output error
264 No errors were found on the image.
265 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
266
267 Event: refblock_load; errno: 5; imm: off; once: on; write -b
268 -write failed: Input/output error
268 +qemu-io: write failed: Input/output error
269 No errors were found on the image.
270 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
271
272 Event: refblock_load; errno: 5; imm: off; once: off; write
273 +qemu-io: write failed: Input/output error
274 qemu-io: Failed to flush the L2 table cache: Input/output error
275 qemu-io: Failed to flush the refcount block cache: Input/output error
275 -write failed: Input/output error
276 No errors were found on the image.
277 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
278
279 Event: refblock_load; errno: 5; imm: off; once: off; write -b
280 +qemu-io: write failed: Input/output error
281 qemu-io: Failed to flush the L2 table cache: Input/output error
282 qemu-io: Failed to flush the refcount block cache: Input/output error
282 -write failed: Input/output error
283 No errors were found on the image.
284 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
285
286 Event: refblock_load; errno: 28; imm: off; once: on; write
287 -write failed: No space left on device
287 +qemu-io: write failed: No space left on device
288 No errors were found on the image.
289 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
290
291 Event: refblock_load; errno: 28; imm: off; once: on; write -b
292 -write failed: No space left on device
292 +qemu-io: write failed: No space left on device
293 No errors were found on the image.
294 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
295
296 Event: refblock_load; errno: 28; imm: off; once: off; write
297 +qemu-io: write failed: No space left on device
298 qemu-io: Failed to flush the L2 table cache: No space left on device
299 qemu-io: Failed to flush the refcount block cache: No space left on device
299 -write failed: No space left on device
300 No errors were found on the image.
301 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
302
303 Event: refblock_load; errno: 28; imm: off; once: off; write -b
304 +qemu-io: write failed: No space left on device
305 qemu-io: Failed to flush the L2 table cache: No space left on device
306 qemu-io: Failed to flush the refcount block cache: No space left on device
306 -write failed: No space left on device
307 No errors were found on the image.
308 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
309
310 Event: refblock_update_part; errno: 5; imm: off; once: on; write
311 -write failed: Input/output error
311 +qemu-io: write failed: Input/output error
312 No errors were found on the image.
313 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
314
315 Event: refblock_update_part; errno: 5; imm: off; once: on; write -b
316 -write failed: Input/output error
316 +qemu-io: write failed: Input/output error
317 No errors were found on the image.
318 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
319
320 Event: refblock_update_part; errno: 5; imm: off; once: off; write
321 +qemu-io: write failed: Input/output error
322 qemu-io: Failed to flush the L2 table cache: Input/output error
323 qemu-io: Failed to flush the refcount block cache: Input/output error
323 -write failed: Input/output error
324 No errors were found on the image.
325 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
326
327 Event: refblock_update_part; errno: 5; imm: off; once: off; write -b
328 +qemu-io: write failed: Input/output error
329 qemu-io: Failed to flush the L2 table cache: Input/output error
330 qemu-io: Failed to flush the refcount block cache: Input/output error
330 -write failed: Input/output error
331 No errors were found on the image.
332 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
333
334 Event: refblock_update_part; errno: 28; imm: off; once: on; write
335 -write failed: No space left on device
335 +qemu-io: write failed: No space left on device
336 No errors were found on the image.
337 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
338
339 Event: refblock_update_part; errno: 28; imm: off; once: on; write -b
340 -write failed: No space left on device
340 +qemu-io: write failed: No space left on device
341 No errors were found on the image.
342 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
343
344 Event: refblock_update_part; errno: 28; imm: off; once: off; write
345 +qemu-io: write failed: No space left on device
346 qemu-io: Failed to flush the L2 table cache: No space left on device
347 qemu-io: Failed to flush the refcount block cache: No space left on device
347 -write failed: No space left on device
348 No errors were found on the image.
349 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
350
351 Event: refblock_update_part; errno: 28; imm: off; once: off; write -b
352 +qemu-io: write failed: No space left on device
353 qemu-io: Failed to flush the L2 table cache: No space left on device
354 qemu-io: Failed to flush the refcount block cache: No space left on device
354 -write failed: No space left on device
355 No errors were found on the image.
356 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
357
358 Event: refblock_alloc; errno: 5; imm: off; once: on; write
359 -write failed: Input/output error
359 +qemu-io: write failed: Input/output error
360 No errors were found on the image.
361 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
362
363 Event: refblock_alloc; errno: 5; imm: off; once: on; write -b
364 -write failed: Input/output error
364 +qemu-io: write failed: Input/output error
365 No errors were found on the image.
366 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
367
368 Event: refblock_alloc; errno: 5; imm: off; once: off; write
369 +qemu-io: write failed: Input/output error
370 qemu-io: Failed to flush the L2 table cache: Input/output error
371 qemu-io: Failed to flush the refcount block cache: Input/output error
371 -write failed: Input/output error
372 No errors were found on the image.
373 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
374
375 Event: refblock_alloc; errno: 5; imm: off; once: off; write -b
376 +qemu-io: write failed: Input/output error
377 qemu-io: Failed to flush the L2 table cache: Input/output error
378 qemu-io: Failed to flush the refcount block cache: Input/output error
378 -write failed: Input/output error
379 No errors were found on the image.
380 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
381
382 Event: refblock_alloc; errno: 28; imm: off; once: on; write
383 -write failed: No space left on device
383 +qemu-io: write failed: No space left on device
384 No errors were found on the image.
385 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
386
387 Event: refblock_alloc; errno: 28; imm: off; once: on; write -b
388 -write failed: No space left on device
388 +qemu-io: write failed: No space left on device
389 No errors were found on the image.
390 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
391
392 Event: refblock_alloc; errno: 28; imm: off; once: off; write
393 +qemu-io: write failed: No space left on device
394 qemu-io: Failed to flush the L2 table cache: No space left on device
395 qemu-io: Failed to flush the refcount block cache: No space left on device
395 -write failed: No space left on device
396 No errors were found on the image.
397 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
398
399 Event: refblock_alloc; errno: 28; imm: off; once: off; write -b
400 +qemu-io: write failed: No space left on device
401 qemu-io: Failed to flush the L2 table cache: No space left on device
402 qemu-io: Failed to flush the refcount block cache: No space left on device
402 -write failed: No space left on device
403 No errors were found on the image.
404 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
405
406 Event: cluster_alloc; errno: 5; imm: off; once: on; write
407 -write failed: Input/output error
407 +qemu-io: write failed: Input/output error
408 No errors were found on the image.
409 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
410
411 Event: cluster_alloc; errno: 5; imm: off; once: on; write -b
412 -write failed: Input/output error
412 +qemu-io: write failed: Input/output error
413 No errors were found on the image.
414 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
415
416 Event: cluster_alloc; errno: 5; imm: off; once: off; write
417 -write failed: Input/output error
417 +qemu-io: write failed: Input/output error
418 No errors were found on the image.
419 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
420
421 Event: cluster_alloc; errno: 5; imm: off; once: off; write -b
422 -write failed: Input/output error
422 +qemu-io: write failed: Input/output error
423 No errors were found on the image.
424 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
425
426 Event: cluster_alloc; errno: 28; imm: off; once: on; write
427 -write failed: No space left on device
427 +qemu-io: write failed: No space left on device
428 No errors were found on the image.
429 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
430
431 Event: cluster_alloc; errno: 28; imm: off; once: on; write -b
432 -write failed: No space left on device
432 +qemu-io: write failed: No space left on device
433 No errors were found on the image.
434 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
435
436 Event: cluster_alloc; errno: 28; imm: off; once: off; write
437 -write failed: No space left on device
437 +qemu-io: write failed: No space left on device
438 No errors were found on the image.
439 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
440
441 Event: cluster_alloc; errno: 28; imm: off; once: off; write -b
442 -write failed: No space left on device
442 +qemu-io: write failed: No space left on device
443 No errors were found on the image.
444
445 === Refcount table growth tests ===
@@ -447,122 +447,122 @@ No errors were found on the image.
447 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
448
449 Event: refblock_alloc_hookup; errno: 28; imm: off; once: on; write
450 -write failed: No space left on device
450 +qemu-io: write failed: No space left on device
451 No errors were found on the image.
452 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
453
454 Event: refblock_alloc_hookup; errno: 28; imm: off; once: on; write -b
455 -write failed: No space left on device
455 +qemu-io: write failed: No space left on device
456 No errors were found on the image.
457 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
458
459 Event: refblock_alloc_hookup; errno: 28; imm: off; once: off; write
460 +qemu-io: write failed: No space left on device
461 qemu-io: Failed to flush the L2 table cache: No space left on device
462 qemu-io: Failed to flush the refcount block cache: No space left on device
462 -write failed: No space left on device
463 No errors were found on the image.
464 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
465
466 Event: refblock_alloc_hookup; errno: 28; imm: off; once: off; write -b
467 +qemu-io: write failed: No space left on device
468 qemu-io: Failed to flush the L2 table cache: No space left on device
469 qemu-io: Failed to flush the refcount block cache: No space left on device
469 -write failed: No space left on device
470 No errors were found on the image.
471 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
472
473 Event: refblock_alloc_write; errno: 28; imm: off; once: on; write
474 -write failed: No space left on device
474 +qemu-io: write failed: No space left on device
475 No errors were found on the image.
476 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
477
478 Event: refblock_alloc_write; errno: 28; imm: off; once: on; write -b
479 -write failed: No space left on device
479 +qemu-io: write failed: No space left on device
480 No errors were found on the image.
481 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
482
483 Event: refblock_alloc_write; errno: 28; imm: off; once: off; write
484 +qemu-io: write failed: No space left on device
485 qemu-io: Failed to flush the L2 table cache: No space left on device
486 qemu-io: Failed to flush the refcount block cache: No space left on device
486 -write failed: No space left on device
487 No errors were found on the image.
488 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
489
490 Event: refblock_alloc_write; errno: 28; imm: off; once: off; write -b
491 +qemu-io: write failed: No space left on device
492 qemu-io: Failed to flush the L2 table cache: No space left on device
493 qemu-io: Failed to flush the refcount block cache: No space left on device
493 -write failed: No space left on device
494 No errors were found on the image.
495 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
496
497 Event: refblock_alloc_write_blocks; errno: 28; imm: off; once: on; write
498 -write failed: No space left on device
498 +qemu-io: write failed: No space left on device
499 No errors were found on the image.
500 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
501
502 Event: refblock_alloc_write_blocks; errno: 28; imm: off; once: on; write -b
503 -write failed: No space left on device
503 +qemu-io: write failed: No space left on device
504 No errors were found on the image.
505 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
506
507 Event: refblock_alloc_write_blocks; errno: 28; imm: off; once: off; write
508 +qemu-io: write failed: No space left on device
509 qemu-io: Failed to flush the L2 table cache: No space left on device
510 qemu-io: Failed to flush the refcount block cache: No space left on device
510 -write failed: No space left on device
511 No errors were found on the image.
512 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
513
514 Event: refblock_alloc_write_blocks; errno: 28; imm: off; once: off; write -b
515 +qemu-io: write failed: No space left on device
516 qemu-io: Failed to flush the L2 table cache: No space left on device
517 qemu-io: Failed to flush the refcount block cache: No space left on device
517 -write failed: No space left on device
518 No errors were found on the image.
519 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
520
521 Event: refblock_alloc_write_table; errno: 28; imm: off; once: on; write
522 -write failed: No space left on device
522 +qemu-io: write failed: No space left on device
523 No errors were found on the image.
524 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
525
526 Event: refblock_alloc_write_table; errno: 28; imm: off; once: on; write -b
527 -write failed: No space left on device
527 +qemu-io: write failed: No space left on device
528 No errors were found on the image.
529 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
530
531 Event: refblock_alloc_write_table; errno: 28; imm: off; once: off; write
532 +qemu-io: write failed: No space left on device
533 qemu-io: Failed to flush the L2 table cache: No space left on device
534 qemu-io: Failed to flush the refcount block cache: No space left on device
534 -write failed: No space left on device
535 No errors were found on the image.
536 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
537
538 Event: refblock_alloc_write_table; errno: 28; imm: off; once: off; write -b
539 +qemu-io: write failed: No space left on device
540 qemu-io: Failed to flush the L2 table cache: No space left on device
541 qemu-io: Failed to flush the refcount block cache: No space left on device
541 -write failed: No space left on device
542 No errors were found on the image.
543 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
544
545 Event: refblock_alloc_switch_table; errno: 28; imm: off; once: on; write
546 -write failed: No space left on device
546 +qemu-io: write failed: No space left on device
547 No errors were found on the image.
548 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
549
550 Event: refblock_alloc_switch_table; errno: 28; imm: off; once: on; write -b
551 -write failed: No space left on device
551 +qemu-io: write failed: No space left on device
552 No errors were found on the image.
553 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
554
555 Event: refblock_alloc_switch_table; errno: 28; imm: off; once: off; write
556 +qemu-io: write failed: No space left on device
557 qemu-io: Failed to flush the L2 table cache: No space left on device
558 qemu-io: Failed to flush the refcount block cache: No space left on device
558 -write failed: No space left on device
559 No errors were found on the image.
560 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
561
562 Event: refblock_alloc_switch_table; errno: 28; imm: off; once: off; write -b
563 +qemu-io: write failed: No space left on device
564 qemu-io: Failed to flush the L2 table cache: No space left on device
565 qemu-io: Failed to flush the refcount block cache: No space left on device
565 -write failed: No space left on device
566 No errors were found on the image.
567
568 === L1 growth tests ===
@@ -570,76 +570,76 @@ No errors were found on the image.
570 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
571
572 Event: l1_grow_alloc_table; errno: 5; imm: off; once: on
573 -write failed: Input/output error
573 +qemu-io: write failed: Input/output error
574 No errors were found on the image.
575 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
576
577 Event: l1_grow_alloc_table; errno: 5; imm: off; once: off
578 -write failed: Input/output error
578 +qemu-io: write failed: Input/output error
579 No errors were found on the image.
580 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
581
582 Event: l1_grow_alloc_table; errno: 28; imm: off; once: on
583 -write failed: No space left on device
583 +qemu-io: write failed: No space left on device
584 No errors were found on the image.
585 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
586
587 Event: l1_grow_alloc_table; errno: 28; imm: off; once: off
588 -write failed: No space left on device
588 +qemu-io: write failed: No space left on device
589 No errors were found on the image.
590 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
591
592 Event: l1_grow_write_table; errno: 5; imm: off; once: on
593 -write failed: Input/output error
593 +qemu-io: write failed: Input/output error
594 No errors were found on the image.
595 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
596
597 Event: l1_grow_write_table; errno: 5; imm: off; once: off
598 +qemu-io: write failed: Input/output error
599 qemu-io: Failed to flush the L2 table cache: Input/output error
600 qemu-io: Failed to flush the refcount block cache: Input/output error
600 -write failed: Input/output error
601 No errors were found on the image.
602 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
603
604 Event: l1_grow_write_table; errno: 28; imm: off; once: on
605 -write failed: No space left on device
605 +qemu-io: write failed: No space left on device
606 No errors were found on the image.
607 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
608
609 Event: l1_grow_write_table; errno: 28; imm: off; once: off
610 +qemu-io: write failed: No space left on device
611 qemu-io: Failed to flush the L2 table cache: No space left on device
612 qemu-io: Failed to flush the refcount block cache: No space left on device
612 -write failed: No space left on device
613 No errors were found on the image.
614 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
615
616 Event: l1_grow_activate_table; errno: 5; imm: off; once: on
617 -write failed: Input/output error
617 +qemu-io: write failed: Input/output error
618 No errors were found on the image.
619 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
620
621 Event: l1_grow_activate_table; errno: 5; imm: off; once: off
622 +qemu-io: write failed: Input/output error
623 qemu-io: Failed to flush the L2 table cache: Input/output error
624 qemu-io: Failed to flush the refcount block cache: Input/output error
624 -write failed: Input/output error
625 No errors were found on the image.
626 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
627
628 Event: l1_grow_activate_table; errno: 28; imm: off; once: on
629 -write failed: No space left on device
629 +qemu-io: write failed: No space left on device
630 No errors were found on the image.
631 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
632
633 Event: l1_grow_activate_table; errno: 28; imm: off; once: off
634 +qemu-io: write failed: No space left on device
635 qemu-io: Failed to flush the L2 table cache: No space left on device
636 qemu-io: Failed to flush the refcount block cache: No space left on device
636 -write failed: No space left on device
637 No errors were found on the image.
638
639 === Avoid cluster leaks after temporary failure ===
640
641 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
642 -write failed: Input/output error
642 +qemu-io: write failed: Input/output error
643 wrote 1048576/1048576 bytes at offset 0
644 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
645 No errors were found on the image.
@@ -651,6 +651,6 @@ wrote 1024/1024 bytes at offset 0
651 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
652 wrote 1024/1024 bytes at offset 0
653 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
654 -write failed: Input/output error
654 +qemu-io: write failed: Input/output error
655 No errors were found on the image.
656 *** done
tests/qemu-iotests/060.out
+21 -23
@@ -9,7 +9,7 @@ ERROR cluster 3 refcount=1 reference=3
9 Data may be corrupted, or further writes to the image may corrupt it.
10 incompatible_features []
11 qcow2: Marking image as corrupt: Preventing invalid write on metadata (overlaps with active L1 table); further corruption events will be suppressed
12 -write failed: Input/output error
12 +qemu-io: write failed: Input/output error
13 incompatible_features [1]
14 image: TEST_DIR/t.IMGFMT
15 file format: IMGFMT
@@ -23,7 +23,7 @@ Format specific information:
23 corrupt: true
24 extended l2: false
25 qemu-io: can't open device TEST_DIR/t.IMGFMT: IMGFMT: Image is corrupt; cannot be opened read/write
26 -no file open, try 'help open'
26 +qemu-io: no file open, try 'help open'
27 read 512/512 bytes at offset 0
28 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
29
@@ -37,7 +37,7 @@ ERROR cluster 2 refcount=1 reference=2
37 Data may be corrupted, or further writes to the image may corrupt it.
38 incompatible_features []
39 qcow2: Marking image as corrupt: Preventing invalid write on metadata (overlaps with refcount block); further corruption events will be suppressed
40 -write failed: Input/output error
40 +qemu-io: write failed: Input/output error
41 incompatible_features [1]
42 ERROR refcount block 0 refcount=2
43 ERROR cluster 2 refcount=1 reference=2
@@ -73,7 +73,7 @@ Data may be corrupted, or further writes to the image may corrupt it.
73 This means waste of disk space, but no harm to data.
74 incompatible_features []
75 qcow2: Marking image as corrupt: Preventing invalid write on metadata (overlaps with inactive L2 table); further corruption events will be suppressed
76 -write failed: Input/output error
76 +qemu-io: write failed: Input/output error
77 incompatible_features [1]
78 ERROR cluster 4 refcount=1 reference=2
79 Leaked cluster 9 refcount=1 reference=0
@@ -108,10 +108,10 @@ wrote 65536/65536 bytes at offset 0
108 wrote 65536/65536 bytes at offset 536870912
109 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
110 qcow2: Marking image as corrupt: Preventing invalid write on metadata (overlaps with active L2 table); further corruption events will be suppressed
111 +qemu-io: write failed: Input/output error
112 +qemu-io: aio_write failed: No medium found
113 blkdebug: Suspended request '0'
112 -write failed: Input/output error
114 blkdebug: Resuming request '0'
114 -aio_write failed: No medium found
115
116 === Testing unallocated image header ===
117
@@ -119,7 +119,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
119 wrote 65536/65536 bytes at offset 0
120 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
121 qcow2: Marking image as corrupt: Preventing invalid write on metadata (overlaps with qcow2_header); further corruption events will be suppressed
122 -write failed: Input/output error
122 +qemu-io: write failed: Input/output error
123
124 === Testing unaligned L1 entry ===
125
@@ -127,7 +127,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
127 wrote 65536/65536 bytes at offset 0
128 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
129 qcow2: Marking image as corrupt: L2 table offset 0x42a00 unaligned (L1 index: 0); further corruption events will be suppressed
130 -read failed: Input/output error
130 +qemu-io: read failed: Input/output error
131 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
132 wrote 65536/65536 bytes at offset 0
133 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -140,7 +140,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
140 wrote 65536/65536 bytes at offset 0
141 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
142 qcow2: Marking image as corrupt: Cluster allocation offset 0x52a00 unaligned (L2 offset: 0x40000, L2 index: 0); further corruption events will be suppressed
143 -read failed: Input/output error
143 +qemu-io: read failed: Input/output error
144
145 === Testing unaligned pre-allocated zero cluster ===
146
@@ -154,7 +154,7 @@ qemu-img: Failed to turn zero into data clusters: Input/output error
154
155 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
156 qcow2: Marking image as corrupt: Refblock offset 0x22a00 unaligned (reftable index: 0); further corruption events will be suppressed
157 -write failed: Input/output error
157 +qemu-io: write failed: Input/output error
158
159 === Testing non-fatal corruption on freeing ===
160
@@ -171,8 +171,8 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
171 wrote 65536/65536 bytes at offset 0
172 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
173 qcow2: Image is corrupt: Cluster allocation offset 0x52a00 unaligned (L2 offset: 0x40000, L2 index: 0); further non-fatal corruption events will be suppressed
174 -read failed: Input/output error
175 -read failed: Input/output error
174 +qemu-io: read failed: Input/output error
175 +qemu-io: read failed: Input/output error
176
177 === Testing non-fatal and then fatal corruption report ===
178
@@ -181,15 +181,15 @@ wrote 131072/131072 bytes at offset 0
181 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
182 qcow2: Image is corrupt: Cannot free unaligned cluster 0x52a00; further non-fatal corruption events will be suppressed
183 qcow2: Marking image as corrupt: Cluster allocation offset 0x62a00 unaligned (L2 offset: 0x40000, L2 index: 0x1); further corruption events will be suppressed
184 +qemu-io: read failed: Input/output error
185 discard 65536/65536 bytes at offset 0
186 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
186 -read failed: Input/output error
187
188 === Testing empty refcount table ===
189
190 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
191 qcow2: Marking image as corrupt: Preventing invalid write on metadata (overlaps with refcount table); further corruption events will be suppressed
192 -write failed: Input/output error
192 +qemu-io: write failed: Input/output error
193 ERROR cluster 0 refcount=0 reference=1
194 ERROR cluster 1 refcount=0 reference=1
195 ERROR cluster 3 refcount=0 reference=1
@@ -209,7 +209,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
209 wrote 65536/65536 bytes at offset 0
210 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
211 qcow2: Marking image as corrupt: Preventing invalid allocation of refcount block at offset 0; further corruption events will be suppressed
212 -write failed: Input/output error
212 +qemu-io: write failed: Input/output error
213 ERROR cluster 0 refcount=0 reference=1
214 ERROR cluster 1 refcount=0 reference=1
215 ERROR cluster 3 refcount=0 reference=1
@@ -229,7 +229,7 @@ No errors were found on the image.
229
230 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
231 qcow2: Marking image as corrupt: Preventing invalid allocation of L2 table at offset 0; further corruption events will be suppressed
232 -write failed: Input/output error
232 +qemu-io: write failed: Input/output error
233 ERROR cluster 0 refcount=0 reference=1
234 ERROR cluster 1 refcount=0 reference=1
235 ERROR cluster 2 refcount=0 reference=1
@@ -251,7 +251,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
251 wrote 65536/65536 bytes at offset 65536
252 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
253 qcow2: Marking image as corrupt: Preventing invalid allocation of compressed cluster at offset 0; further corruption events will be suppressed
254 -write failed: Input/output error
254 +qemu-io: write failed: Input/output error
255 ERROR cluster 0 refcount=0 reference=1
256 ERROR cluster 1 refcount=0 reference=1
257 ERROR cluster 2 refcount=0 reference=1
@@ -286,7 +286,7 @@ No errors were found on the image.
286
287 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
288 qcow2: Marking image as corrupt: Preventing invalid allocation of L2 table at offset 0; further corruption events will be suppressed
289 -write failed: Input/output error
289 +qemu-io: write failed: Input/output error
290
291 === Testing dirty corrupt image ===
292
@@ -319,7 +319,7 @@ wrote 65536/65536 bytes at offset 0
319 discard 65536/65536 bytes at offset 0
320 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
321 qcow2: Marking image as corrupt: Preallocated zero cluster offset 0x2a00 unaligned (guest offset: 0); further corruption events will be suppressed
322 -write failed: Input/output error
322 +qemu-io: write failed: Input/output error
323 --- Repairing ---
324 Repairing offset=2a00: Preallocated cluster is not properly aligned; L2 entry corrupted.
325 The following inconsistencies were found and repaired:
@@ -337,7 +337,7 @@ wrote 131072/131072 bytes at offset 0
337 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
338 qcow2: Marking image as corrupt: Refblock offset 0x2a00 unaligned (reftable index: 0); further corruption events will be suppressed
339 qcow2_free_clusters failed: Input/output error
340 -discard failed: No medium found
340 +qemu-io: discard failed: No medium found
341 --- Repairing ---
342 ERROR refcount block 0 is not cluster aligned; refcount table entry corrupted
343 qcow2: Marking image as corrupt: Refblock offset 0x2a00 unaligned (reftable index: 0); further corruption events will be suppressed
@@ -419,8 +419,7 @@ qcow2: Marking image as corrupt: Preventing invalid write on metadata (overlaps
419 QMP_VERSION
420 {"return": {}}
421 {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_IMAGE_CORRUPTED", "data": {"device": "none0", "msg": "Preventing invalid write on metadata (overlaps with refcount table)", "offset": 65536, "node-name": "drive", "fatal": true, "size": 65536}}
422 -write failed: Input/output error
423 -{"return": ""}
422 +{"return": "Error: write failed: Input/output error\r\n"}
423 {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}}
424 {"return": {}}
425
@@ -431,7 +430,6 @@ QMP_VERSION
430 {"return": {}}
431 qcow2: Image is corrupt: L2 table offset 0x2a2a2a00 unaligned (L1 index: 0); further non-fatal corruption events will be suppressed
432 {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_IMAGE_CORRUPTED", "data": {"device": "", "msg": "L2 table offset 0x2a2a2a00 unaligned (L1 index: 0)", "node-name": "drive", "fatal": false}}
434 -{"return": ""}
433 {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}}
434 {"return": {}}
435
tests/qemu-iotests/071.out
+4 -6
@@ -30,11 +30,11 @@ blkverify: read offset=0 bytes=512 contents mismatch at offset 0
30
31 === Testing blkdebug through filename ===
32
33 -read failed: Input/output error
33 +qemu-io: read failed: Input/output error
34
35 === Testing blkdebug through file blockref ===
36
37 -read failed: Input/output error
37 +qemu-io: read failed: Input/output error
38
39 === Testing blkdebug on existing block device ===
40
@@ -43,8 +43,7 @@ QMP_VERSION
43 {"return": {}}
44 {"return": {}}
45 {"return": {}}
46 -read failed: Input/output error
47 -{"return": ""}
46 +{"return": "Error: read failed: Input/output error\r\n"}
47 {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}}
48 {"return": {}}
49
@@ -82,8 +81,7 @@ read 512/512 bytes at offset 0
81 wrote 512/512 bytes at offset 0
82 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
83 {"return": ""}
85 -read failed: Input/output error
86 -{"return": ""}
84 +{"return": "Error: read failed: Input/output error\r\n"}
85 {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}}
86 QEMU_PROG: Failed to flush the L2 table cache: Input/output error
87 QEMU_PROG: Failed to flush the refcount block cache: Input/output error
tests/qemu-iotests/072.out
+1 -1
@@ -15,7 +15,7 @@ read 512/512 bytes at offset 512
15 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
16 read 512/512 bytes at offset 1024
17 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
18 -Pattern verification failed at offset 0, 512 bytes
18 +qemu-io: Pattern verification failed at offset 0, 512 bytes
19 read 512/512 bytes at offset 0
20 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
21 *** done
tests/qemu-iotests/080.out
+2 -2
@@ -66,8 +66,8 @@ wrote 512/512 bytes at offset 0
66 qemu-img: Failed to load snapshot: Snapshot L1 table offset invalid
67 qemu-img: Snapshot L1 table offset invalid
68 qemu-img: Failed to turn zero into data clusters: Invalid argument
69 +qemu-io: write failed: Invalid argument
70 qemu-io: Failed to flush the refcount block cache: Invalid argument
70 -write failed: Invalid argument
71 qemu-img: Snapshot L1 table offset invalid
72 qemu-img: Could not apply snapshot 'test': Failed to load snapshot: Invalid argument
73 qemu-img: Could not delete snapshot 'test': Snapshot L1 table offset invalid
@@ -89,8 +89,8 @@ wrote 512/512 bytes at offset 0
89 qemu-img: Failed to load snapshot: Snapshot L1 table too large
90 qemu-img: Snapshot L1 table too large
91 qemu-img: Failed to turn zero into data clusters: File too large
92 +qemu-io: write failed: File too large
93 qemu-io: Failed to flush the refcount block cache: File too large
93 -write failed: File too large
94 qemu-img: Snapshot L1 table too large
95 qemu-img: Could not apply snapshot 'test': Failed to load snapshot: File too large
96 qemu-img: Could not delete snapshot 'test': Snapshot L1 table too large
tests/qemu-iotests/081.out
+1 -1
@@ -81,7 +81,7 @@ wrote 10485760/10485760 bytes at offset 0
81 10 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
82
83 == checking that quorum is broken ==
84 -read failed: Input/output error
84 +qemu-io: read failed: Input/output error
85
86 == checking the blkverify mode with broken content ==
87 quorum: offset=0 bytes=10485760 contents mismatch at offset 0
tests/qemu-iotests/083.out
+18 -18
@@ -41,7 +41,7 @@ qemu-io: can't open device nbd+tcp://127.0.0.1:PORT/foo
41
42 === Check disconnect after neg2 ===
43
44 -read failed: Input/output error
44 +qemu-io: read failed: Input/output error
45
46 === Check disconnect 8 neg2 ===
47
@@ -53,31 +53,31 @@ qemu-io: can't open device nbd+tcp://127.0.0.1:PORT/foo
53
54 === Check disconnect before request ===
55
56 -read failed: Input/output error
56 +qemu-io: read failed: Input/output error
57
58 === Check disconnect after request ===
59
60 -read failed: Input/output error
60 +qemu-io: read failed: Input/output error
61
62 === Check disconnect before reply ===
63
64 -read failed: Input/output error
64 +qemu-io: read failed: Input/output error
65
66 === Check disconnect after reply ===
67
68 -read failed: Input/output error
68 +qemu-io: read failed: Input/output error
69
70 === Check disconnect 4 reply ===
71
72 -read failed: Input/output error
72 +qemu-io: read failed: Input/output error
73
74 === Check disconnect 8 reply ===
75
76 -read failed: Input/output error
76 +qemu-io: read failed: Input/output error
77
78 === Check disconnect before data ===
79
80 -read failed: Input/output error
80 +qemu-io: read failed: Input/output error
81
82 === Check disconnect after data ===
83
@@ -106,7 +106,7 @@ qemu-io: can't open device nbd+tcp://127.0.0.1:PORT/
106
107 === Check disconnect after neg-classic ===
108
109 -read failed: Input/output error
109 +qemu-io: read failed: Input/output error
110
111 === Check disconnect before neg1 ===
112
@@ -150,7 +150,7 @@ qemu-io: can't open device nbd+unix:///foo?socket=SOCK_DIR/nbd.sock
150
151 === Check disconnect after neg2 ===
152
153 -read failed: Input/output error
153 +qemu-io: read failed: Input/output error
154
155 === Check disconnect 8 neg2 ===
156
@@ -162,31 +162,31 @@ qemu-io: can't open device nbd+unix:///foo?socket=SOCK_DIR/nbd.sock
162
163 === Check disconnect before request ===
164
165 -read failed: Input/output error
165 +qemu-io: read failed: Input/output error
166
167 === Check disconnect after request ===
168
169 -read failed: Input/output error
169 +qemu-io: read failed: Input/output error
170
171 === Check disconnect before reply ===
172
173 -read failed: Input/output error
173 +qemu-io: read failed: Input/output error
174
175 === Check disconnect after reply ===
176
177 -read failed: Input/output error
177 +qemu-io: read failed: Input/output error
178
179 === Check disconnect 4 reply ===
180
181 -read failed: Input/output error
181 +qemu-io: read failed: Input/output error
182
183 === Check disconnect 8 reply ===
184
185 -read failed: Input/output error
185 +qemu-io: read failed: Input/output error
186
187 === Check disconnect before data ===
188
189 -read failed: Input/output error
189 +qemu-io: read failed: Input/output error
190
191 === Check disconnect after data ===
192
@@ -215,6 +215,6 @@ qemu-io: can't open device nbd+unix:///?socket=SOCK_DIR/nbd.sock
215
216 === Check disconnect after neg-classic ===
217
218 -read failed: Input/output error
218 +qemu-io: read failed: Input/output error
219
220 *** done
tests/qemu-iotests/089.out
+2 -2
@@ -16,7 +16,7 @@ read 512/512 bytes at offset 512
16 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
17 read 512/512 bytes at offset 1024
18 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
19 -Pattern verification failed at offset 0, 512 bytes
19 +qemu-io: Pattern verification failed at offset 0, 512 bytes
20 read 512/512 bytes at offset 0
21 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
22
@@ -33,7 +33,7 @@ read 512/512 bytes at offset 0
33 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
34 wrote 512/512 bytes at offset 229376
35 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
36 -read failed: Input/output error
36 +qemu-io: read failed: Input/output error
37
38 === Testing qemu-img info output ===
39
tests/qemu-iotests/114.out
+1 -1
@@ -11,7 +11,7 @@ cluster_size: 65536
11 backing file: TEST_DIR/t.IMGFMT.base
12 backing file format: foo
13 qemu-io: can't open device TEST_DIR/t.qcow2: Could not open backing file: Unknown driver 'foo'
14 -no file open, try 'help open'
14 +qemu-io: no file open, try 'help open'
15 read 4096/4096 bytes at offset 0
16 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
17 qemu-img: Could not change the backing file to 'TEST_DIR/t.qcow2.base': backing format must be specified
tests/qemu-iotests/134.out
+1 -1
@@ -24,7 +24,7 @@ read 134217728/134217728 bytes at offset 0
24 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
25
26 == verify pattern failure with wrong password ==
27 -Pattern verification failed at offset 0, 134217728 bytes
27 +qemu-io: Pattern verification failed at offset 0, 134217728 bytes
28 read 134217728/134217728 bytes at offset 0
29 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
30 *** done
tests/qemu-iotests/137.out
+1 -1
@@ -40,5 +40,5 @@ OK: Dirty bit not set
40 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
41 qemu-io: Parameter 'lazy-refcounts' expects 'on' or 'off'
42 qcow2: Marking image as corrupt: Preventing invalid allocation of L2 table at offset 0; further corruption events will be suppressed
43 -write failed: Input/output error
43 +qemu-io: write failed: Input/output error
44 *** done
tests/qemu-iotests/153.out
+6 -6
@@ -33,12 +33,12 @@ Is another process using the image [TEST_DIR/t.qcow2]?
33 _qemu_io_wrapper -c open TEST_DIR/t.qcow2 -c read 0 512
34 qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get "write" lock
35 Is another process using the image [TEST_DIR/t.qcow2]?
36 -no file open, try 'help open'
36 +qemu-io: no file open, try 'help open'
37
38 _qemu_io_wrapper -c open -r TEST_DIR/t.qcow2 -c read 0 512
39 qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get shared "write" lock
40 Is another process using the image [TEST_DIR/t.qcow2]?
41 -no file open, try 'help open'
41 +qemu-io: no file open, try 'help open'
42
43 _qemu_img_wrapper info TEST_DIR/t.qcow2
44 qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get shared "write" lock
@@ -107,7 +107,7 @@ _qemu_io_wrapper -U -r -c read 0 512 TEST_DIR/t.qcow2
107
108 _qemu_io_wrapper -c open -U TEST_DIR/t.qcow2 -c read 0 512
109 qemu-io: can't open device TEST_DIR/t.qcow2: force-share=on can only be used with read-only images
110 -no file open, try 'help open'
110 +qemu-io: no file open, try 'help open'
111
112 _qemu_io_wrapper -c open -r -U TEST_DIR/t.qcow2 -c read 0 512
113
@@ -176,7 +176,7 @@ _qemu_io_wrapper -r -c read 0 512 TEST_DIR/t.qcow2
176 _qemu_io_wrapper -c open TEST_DIR/t.qcow2 -c read 0 512
177 qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get "write" lock
178 Is another process using the image [TEST_DIR/t.qcow2]?
179 -no file open, try 'help open'
179 +qemu-io: no file open, try 'help open'
180
181 _qemu_io_wrapper -c open -r TEST_DIR/t.qcow2 -c read 0 512
182
@@ -231,7 +231,7 @@ _qemu_io_wrapper -U -r -c read 0 512 TEST_DIR/t.qcow2
231
232 _qemu_io_wrapper -c open -U TEST_DIR/t.qcow2 -c read 0 512
233 qemu-io: can't open device TEST_DIR/t.qcow2: force-share=on can only be used with read-only images
234 -no file open, try 'help open'
234 +qemu-io: no file open, try 'help open'
235
236 _qemu_io_wrapper -c open -r -U TEST_DIR/t.qcow2 -c read 0 512
237
@@ -336,7 +336,7 @@ _qemu_io_wrapper -U -r -c read 0 512 TEST_DIR/t.qcow2
336
337 _qemu_io_wrapper -c open -U TEST_DIR/t.qcow2 -c read 0 512
338 qemu-io: can't open device TEST_DIR/t.qcow2: force-share=on can only be used with read-only images
339 -no file open, try 'help open'
339 +qemu-io: no file open, try 'help open'
340
341 _qemu_io_wrapper -c open -r -U TEST_DIR/t.qcow2 -c read 0 512
342
tests/qemu-iotests/171
+1 -1
@@ -188,7 +188,7 @@ img_offset=512
188 img_size=512
189 _make_test_img $size
190 (
191 -$QEMU_IO "$(img_json)" <<EOT
191 +$QEMU_IO "$(img_json)" 2>&1 <<EOT
192 write -P 0x0a 0 512
193 write -P 0x0a 511 1
194 write -P 0x0a 512 1
tests/qemu-iotests/171.out
+34 -34
@@ -21,32 +21,32 @@ wrote 1/1 bytes at offset 3583
21 1 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
22
23 write across image boundary
24 -write failed: Input/output error
24 +qemu-io: write failed: Input/output error
25
26 write at image boundary
27 -write failed: Input/output error
27 +qemu-io: write failed: Input/output error
28
29 write after image boundary
30 -write failed: Input/output error
30 +qemu-io: write failed: Input/output error
31
32 writev before/after image boundary
33 -writev failed: Input/output error
33 +qemu-io: writev failed: Input/output error
34
35 read before image boundary
36 read 1/1 bytes at offset 3583
37 1 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
38
39 read across image boundary
40 -read failed: Input/output error
40 +qemu-io: read failed: Input/output error
41
42 read at image boundary
43 -read failed: Input/output error
43 +qemu-io: read failed: Input/output error
44
45 read after image boundary
46 -read failed: Input/output error
46 +qemu-io: read failed: Input/output error
47
48 readv before/after image boundary
49 -readv failed: Input/output error
49 +qemu-io: readv failed: Input/output error
50
51 fill image with pattern
52 wrote 4096/4096 bytes at offset 0
@@ -60,7 +60,7 @@ read 4/4 bytes at offset 510
60 4 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
61
62 write zeroes across image boundary
63 -write failed: Input/output error
63 +qemu-io: write failed: Input/output error
64
65 write zeroes at image boundary and check
66 wrote 2/2 bytes at offset 3582
@@ -68,7 +68,7 @@ wrote 2/2 bytes at offset 3582
68 00000ffe: 00 00 ..
69 read 2/2 bytes at offset 4094
70 2 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
71 -read failed: Input/output error
71 +qemu-io: read failed: Input/output error
72
73 fill image with pattern
74 wrote 4096/4096 bytes at offset 0
@@ -82,7 +82,7 @@ read 4/4 bytes at offset 510
82 4 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
83
84 discard across image boundary
85 -discard failed: Input/output error
85 +qemu-io: discard failed: Input/output error
86
87 discard at image boundary and check
88 discard 2/2 bytes at offset 3582
@@ -90,7 +90,7 @@ discard 2/2 bytes at offset 3582
90 00000ffe: 00 00 ..
91 read 2/2 bytes at offset 4094
92 2 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
93 -read failed: Input/output error
93 +qemu-io: read failed: Input/output error
94
95 == test 'offset' and 'size' options ==
96 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4096
@@ -113,32 +113,32 @@ wrote 1/1 bytes at offset 2047
113 1 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
114
115 write across image boundary
116 -write failed: Input/output error
116 +qemu-io: write failed: Input/output error
117
118 write at image boundary
119 -write failed: Input/output error
119 +qemu-io: write failed: Input/output error
120
121 write after image boundary
122 -write failed: Input/output error
122 +qemu-io: write failed: Input/output error
123
124 writev before/after image boundary
125 -writev failed: Input/output error
125 +qemu-io: writev failed: Input/output error
126
127 read before image boundary
128 read 1/1 bytes at offset 2047
129 1 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
130
131 read across image boundary
132 -read failed: Input/output error
132 +qemu-io: read failed: Input/output error
133
134 read at image boundary
135 -read failed: Input/output error
135 +qemu-io: read failed: Input/output error
136
137 read after image boundary
138 -read failed: Input/output error
138 +qemu-io: read failed: Input/output error
139
140 readv before/after image boundary
141 -readv failed: Input/output error
141 +qemu-io: readv failed: Input/output error
142
143 fill image with pattern
144 wrote 4096/4096 bytes at offset 0
@@ -152,7 +152,7 @@ read 4/4 bytes at offset 510
152 4 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
153
154 write zeroes across image boundary
155 -write failed: Input/output error
155 +qemu-io: write failed: Input/output error
156
157 write zeroes at image boundary and check
158 wrote 2/2 bytes at offset 2046
@@ -176,7 +176,7 @@ read 4/4 bytes at offset 510
176 4 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
177
178 discard across image boundary
179 -discard failed: Input/output error
179 +qemu-io: discard failed: Input/output error
180
181 discard at image boundary and check
182 discard 2/2 bytes at offset 2046
@@ -209,32 +209,32 @@ wrote 1/1 bytes at offset 2047
209 1 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
210
211 write across image boundary
212 -write failed: Input/output error
212 +qemu-io: write failed: Input/output error
213
214 write at image boundary
215 -write failed: Input/output error
215 +qemu-io: write failed: Input/output error
216
217 write after image boundary
218 -write failed: Input/output error
218 +qemu-io: write failed: Input/output error
219
220 writev before/after image boundary
221 -writev failed: Input/output error
221 +qemu-io: writev failed: Input/output error
222
223 read before image boundary
224 read 1/1 bytes at offset 2047
225 1 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
226
227 read across image boundary
228 -read failed: Input/output error
228 +qemu-io: read failed: Input/output error
229
230 read at image boundary
231 -read failed: Input/output error
231 +qemu-io: read failed: Input/output error
232
233 read after image boundary
234 -read failed: Input/output error
234 +qemu-io: read failed: Input/output error
235
236 readv before/after image boundary
237 -readv failed: Input/output error
237 +qemu-io: readv failed: Input/output error
238
239 fill image with pattern
240 wrote 4096/4096 bytes at offset 0
@@ -248,7 +248,7 @@ read 4/4 bytes at offset 8
248 4 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
249
250 write zeroes across image boundary
251 -write failed: Input/output error
251 +qemu-io: write failed: Input/output error
252
253 write zeroes at image boundary and check
254 wrote 2/2 bytes at offset 2046
@@ -272,7 +272,7 @@ read 4/4 bytes at offset 8
272 4 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
273
274 discard across image boundary
275 -discard failed: Input/output error
275 +qemu-io: discard failed: Input/output error
276
277 discard at image boundary and check
278 discard 2/2 bytes at offset 2046
@@ -290,12 +290,12 @@ wrote 512/512 bytes at offset 0
290 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
291 wrote 1/1 bytes at offset 511
292 1 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
293 -write failed: Input/output error
293 +qemu-io: write failed: Input/output error
294 wrote 1024/1024 bytes at offset 0
295 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
296 wrote 1/1 bytes at offset 1023
297 1 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
298 -write failed: Input/output error
298 +qemu-io: write failed: Input/output error
299 checking boundaries
300 000001fe: 00 00 0a 0a ....
301 read 4/4 bytes at offset 510
tests/qemu-iotests/205
+1 -1
@@ -75,7 +75,7 @@ class TestNbdServerRemove(iotests.QMPTestCase):
75
76 def assertReadFailed(self, qemu_io_output):
77 self.assertEqual(filter_qemu_io(qemu_io_output).strip(),
78 - 'read failed: Input/output error')
78 + 'qemu-io: read failed: Input/output error')
79
80 def assertConnectFailed(self, qemu_io_output):
81 self.assertEqual(filter_qemu_io(qemu_io_output).strip(),
tests/qemu-iotests/214.out
+1 -1
@@ -7,7 +7,7 @@ wrote 2097152/2097152 bytes at offset 0
7 2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
8 wrote 2097152/2097152 bytes at offset 2097152
9 2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
10 -read failed: Input/output error
10 +qemu-io: read failed: Input/output error
11 No errors were found on the image.
12 read 4194304/4194304 bytes at offset 0
13 4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
tests/qemu-iotests/220.out
+1 -1
@@ -38,7 +38,7 @@ wrote 2097152/2097152 bytes at offset 37748736
38 No errors were found on the image.
39 image size 39845888
40 == Trying to write compressed cluster ==
41 -write failed: File too large
41 +qemu-io: write failed: File too large
42 image size 562949957615616
43 == Writing normal cluster ==
44 wrote 2097152/2097152 bytes at offset 0
tests/qemu-iotests/225.out
+2 -2
@@ -14,11 +14,11 @@ read 512/512 bytes at offset 0
14
15 QEMU X.Y.Z monitor - type 'help' for more information
16 (qemu) qemu-io overlay "read 0 512"
17 -read failed: Invalid argument
17 +Error: read failed: Invalid argument
18
19 === Testing non-VMDK backing image ===
20
21 QEMU X.Y.Z monitor - type 'help' for more information
22 (qemu) qemu-io overlay "read 0 512"
23 -read failed: Invalid argument
23 +Error: read failed: Invalid argument
24 *** done
tests/qemu-iotests/244.out
+6 -6
@@ -10,22 +10,22 @@ read 65536/65536 bytes at offset 0
10 read 65536/65536 bytes at offset 0
11 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
12 qemu-io: can't open device TEST_DIR/t.qcow2: Could not open 'inexistent': No such file or directory
13 -no file open, try 'help open'
13 +qemu-io: no file open, try 'help open'
14
15 Data file required, but without data file name in the image:
16 qemu-io: can't open device TEST_DIR/t.qcow2: 'data-file' is required for this image
17 -no file open, try 'help open'
17 +qemu-io: no file open, try 'help open'
18 read 65536/65536 bytes at offset 0
19 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
20 qemu-io: can't open device TEST_DIR/t.qcow2: Could not open 'inexistent': No such file or directory
21 -no file open, try 'help open'
21 +qemu-io: no file open, try 'help open'
22
23 Setting data-file for an image with internal data:
24 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
25 qemu-io: can't open device TEST_DIR/t.qcow2: 'data-file' can only be set for images with an external data file
26 -no file open, try 'help open'
26 +qemu-io: no file open, try 'help open'
27 qemu-io: can't open device TEST_DIR/t.qcow2: Could not open 'inexistent': No such file or directory
28 -no file open, try 'help open'
28 +qemu-io: no file open, try 'help open'
29
30 === Conflicting features ===
31
@@ -37,7 +37,7 @@ qemu-img: error while writing at byte 0: Operation not supported
37
38 Convert uncompressed, then write compressed data manually:
39 Images are identical.
40 -write failed: Operation not supported
40 +qemu-io: write failed: Operation not supported
41 No errors were found on the image.
42
43 Take an internal snapshot:
tests/qemu-iotests/249.out
+3 -3
@@ -9,7 +9,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.
9
10 { 'execute': 'human-monitor-command',
11 'arguments': {'command-line': 'qemu-io none0 "aio_write 0 2k"'}}
12 -{"return": "Block node is read-onlyrn"}
12 +{"return": "Error: Block node is read-onlyrn"}
13
14 === Run block-commit on base using an invalid filter node name
15
@@ -24,7 +24,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.
24
25 { 'execute': 'human-monitor-command',
26 'arguments': {'command-line': 'qemu-io none0 "aio_write 0 2k"'}}
27 -{"return": "Block node is read-onlyrn"}
27 +{"return": "Error: Block node is read-onlyrn"}
28
29 === Run block-commit on base using the default filter node name
30
@@ -43,5 +43,5 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.
43
44 { 'execute': 'human-monitor-command',
45 'arguments': {'command-line': 'qemu-io none0 "aio_write 0 2k"'}}
46 -{"return": "Block node is read-onlyrn"}
46 +{"return": "Error: Block node is read-onlyrn"}
47 *** done
tests/qemu-iotests/271.out
+7 -7
@@ -456,7 +456,7 @@ L2 entry #0: 0x8000000000050001 0000000000000001
456 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
457 L2 entry #1: 0x8000000000060000 00000001ffffffff
458 qcow2: Marking image as corrupt: Invalid cluster entry found (L2 offset: 0x40000, L2 index: 0x1); further corruption events will be suppressed
459 -read failed: Input/output error
459 +qemu-io: read failed: Input/output error
460
461 ### Corrupted L2 entries - read test (unallocated) ###
462
@@ -471,14 +471,14 @@ L2 entry #0: 0x0000000000000001 0000000000000000
471 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
472 L2 entry #0: 0x0000000000000000 0000000000000001
473 qcow2: Marking image as corrupt: Invalid cluster entry found (L2 offset: 0x40000, L2 index: 0); further corruption events will be suppressed
474 -read failed: Input/output error
474 +qemu-io: read failed: Input/output error
475
476 # Both 'subcluster is zero' and 'subcluster is allocated' bits set
477
478 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
479 L2 entry #1: 0x0000000000000000 0000000100000001
480 qcow2: Marking image as corrupt: Invalid cluster entry found (L2 offset: 0x40000, L2 index: 0x1); further corruption events will be suppressed
481 -read failed: Input/output error
481 +qemu-io: read failed: Input/output error
482
483 ### Compressed cluster with subcluster bitmap != 0 - read test ###
484
@@ -501,7 +501,7 @@ L2 entry #0: 0x8000000000050001 0000000000000001
501 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
502 L2 entry #1: 0x8000000000060000 00000001ffffffff
503 qcow2: Marking image as corrupt: Invalid cluster entry found (L2 offset: 0x40000, L2 index: 0x1); further corruption events will be suppressed
504 -write failed: Input/output error
504 +qemu-io: write failed: Input/output error
505
506 ### Corrupted L2 entries - write test (unallocated) ###
507
@@ -516,14 +516,14 @@ L2 entry #0: 0x8000000000060000 0000000000000001
516 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
517 L2 entry #0: 0x0000000000000000 0000000000000001
518 qcow2: Marking image as corrupt: Invalid cluster entry found (L2 offset: 0x40000, L2 index: 0); further corruption events will be suppressed
519 -write failed: Input/output error
519 +qemu-io: write failed: Input/output error
520
521 # Both 'subcluster is zero' and 'subcluster is allocated' bits set
522
523 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
524 L2 entry #1: 0x0000000000000000 0000000100000001
525 qcow2: Marking image as corrupt: Invalid cluster entry found (L2 offset: 0x40000, L2 index: 0x1); further corruption events will be suppressed
526 -write failed: Input/output error
526 +qemu-io: write failed: Input/output error
527
528 ### Compressed cluster with subcluster bitmap != 0 - write test ###
529
@@ -555,7 +555,7 @@ Double checking the fixed image now...
555 1 errors were found on the image.
556 Data may be corrupted, or further writes to the image may corrupt it.
557 qcow2: Marking image as corrupt: Cluster allocation offset 0x50200 unaligned (L2 offset: 0x40000, L2 index: 0); further corruption events will be suppressed
558 -read failed: Input/output error
558 +qemu-io: read failed: Input/output error
559 # Corrupted L2 entry, no allocated subclusters #
560 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=131072 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=raw
561 Repairing offset=50200: Preallocated cluster is not properly aligned; L2 entry corrupted.
tests/qemu-iotests/289.out
+1 -1
@@ -3,6 +3,6 @@ QA output created by 289
3 === Avoid freeing external data clusters on failure ===
4
5 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=65536 data_file=TEST_DIR/t.IMGFMT.data_file
6 -write failed: Input/output error
6 +qemu-io: write failed: Input/output error
7 No errors were found on the image.
8 *** done
tests/qemu-iotests/305.out
+1 -1
@@ -12,5 +12,5 @@ discard 1024/1024 bytes at offset 125952
12 ### Corrupt the offset of the second refcount block
13 ### Try to allocate the discarded clusters again
14 qcow2: Marking image as corrupt: Refblock offset 0x20600 unaligned (reftable index: 0x1); further corruption events will be suppressed
15 -write failed: Input/output error
15 +qemu-io: write failed: Input/output error
16 *** done
tests/qemu-iotests/307.out
+1 -1
@@ -127,7 +127,7 @@ exports available: 1
127 {"error": {"class": "GenericError", "desc": "export 'export1' still in use"}}
128 {"execute": "block-export-del", "arguments": {"id": "export1", "mode": "hard"}}
129 {"return": {}}
130 -read failed: Input/output error
130 +qemu-io: read failed: Input/output error
131
132 {"execute": "query-block-exports", "arguments": {}}
133 {"return": []}
tests/qemu-iotests/tests/backup-discard-source
+2 -2
@@ -87,11 +87,11 @@ class TestBackup(iotests.QMPTestCase):
87
88 def tearDown(self):
89 # That should fail, because region is discarded
90 - self.vm.hmp_qemu_io('access', 'read 0 1M')
90 + result = self.vm.hmp_qemu_io('access', 'read 0 1M')
91
92 self.vm.shutdown()
93
94 - self.assertTrue('read failed: Permission denied' in self.vm.get_log())
94 + self.assertIn('read failed: Permission denied', result['return'])
95
96 # Final check that temp image is empty
97 mapping = qemu_img_map(temp_img)
tests/qemu-iotests/tests/copy-before-write
+40 -26
@@ -87,17 +87,17 @@ class TestCbwError(iotests.QMPTestCase):
87
88 result = self.vm.qmp('human-monitor-command',
89 command_line='qemu-io cbw "write 0 1M"')
90 - self.assert_qmp(result, 'return', '')
90 + write_res = result['return']
91
92 result = self.vm.qmp('human-monitor-command',
93 command_line='qemu-io access "read 0 1M"')
94 - self.assert_qmp(result, 'return', '')
94 + read_res = result['return']
95
96 self.vm.shutdown()
97 log = self.vm.get_log()
98 log = iotests.filter_qtest(log)
99 log = iotests.filter_qemu_io(log)
100 - return log
100 + return log, write_res, read_res
101
102 def do_cbw_error_via_blockdev_backup(self, on_cbw_error=None):
103 self.vm.cmd('blockdev-add', {
@@ -150,28 +150,29 @@ class TestCbwError(iotests.QMPTestCase):
150
151 result = self.vm.qmp('human-monitor-command',
152 command_line='qemu-io cbw "write 0 1M"')
153 - self.assert_qmp(result, 'return', '')
153 + write_res = result['return']
154
155 result = self.vm.qmp('human-monitor-command',
156 command_line='qemu-io access "read 0 1M"')
157 - self.assert_qmp(result, 'return', '')
157 + read_res = result['return']
158
159 self.vm.shutdown()
160 log = self.vm.get_log()
161 log = iotests.filter_qemu_io(log)
162 - return log
162 + return log, write_res, read_res
163
164 def test_break_snapshot_on_cbw_error(self):
165 """break-snapshot behavior:
166 Guest write succeed, but further snapshot-read fails, as snapshot is
167 broken.
168 """
169 - log = self.do_cbw_error('break-snapshot')
169 + log, write_res, read_res = self.do_cbw_error('break-snapshot')
170 + self.assertEqual(write_res, '')
171 + self.assertIn('read failed: Permission denied', read_res)
172
173 self.assertEqual(log, """\
174 wrote 1048576/1048576 bytes at offset 0
175 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
174 -read failed: Permission denied
176 """)
177
178 def test_break_guest_write_on_cbw_error(self):
@@ -179,10 +180,11 @@ read failed: Permission denied
180 Guest write fails, but snapshot-access continues working and further
181 snapshot-read succeeds.
182 """
182 - log = self.do_cbw_error('break-guest-write')
183 + log, write_res, read_res = self.do_cbw_error('break-guest-write')
184 + self.assertIn('write failed: Input/output error', write_res)
185 + self.assertEqual(read_res, '')
186
187 self.assertEqual(log, """\
185 -write failed: Input/output error
188 read 1048576/1048576 bytes at offset 0
189 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
190 """)
@@ -191,20 +193,24 @@ read 1048576/1048576 bytes at offset 0
193 """Ensure CBW filter accepts break-snapshot policy
194 specified in blockdev-backup QMP command.
195 """
194 - log = self.do_cbw_error_via_blockdev_backup('break-snapshot')
196 + log, write_res, read_res = \
197 + self.do_cbw_error_via_blockdev_backup('break-snapshot')
198 + self.assertEqual(write_res, '')
199 + self.assertIn('read failed: Permission denied', read_res)
200 self.assertEqual(log, """\
201 wrote 1048576/1048576 bytes at offset 0
202 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
198 -read failed: Permission denied
203 """)
204
205 def test_break_guest_write_policy_forwarding(self):
206 """Ensure CBW filter accepts break-guest-write policy
207 specified in blockdev-backup QMP command.
208 """
205 - log = self.do_cbw_error_via_blockdev_backup('break-guest-write')
209 + log, write_res, read_res = \
210 + self.do_cbw_error_via_blockdev_backup('break-guest-write')
211 + self.assertIn('write failed: Input/output error', write_res)
212 + self.assertEqual(read_res, '')
213 self.assertEqual(log, """\
207 -write failed: Input/output error
214 read 1048576/1048576 bytes at offset 0
215 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
216 """)
@@ -213,9 +219,11 @@ read 1048576/1048576 bytes at offset 0
219 """Ensure break-guest-write policy is used by default when
220 on-cbw-error is not explicitly specified.
221 """
216 - log = self.do_cbw_error_via_blockdev_backup()
222 + log, write_res, read_res = \
223 + self.do_cbw_error_via_blockdev_backup()
224 + self.assertIn('write failed: Input/output error', write_res)
225 + self.assertEqual(read_res, '')
226 self.assertEqual(log, """\
218 -write failed: Input/output error
227 read 1048576/1048576 bytes at offset 0
228 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
229 """)
@@ -260,47 +268,53 @@ read 1048576/1048576 bytes at offset 0
268
269 result = self.vm.qmp('human-monitor-command',
270 command_line='qemu-io cbw "write 0 512K"')
263 - self.assert_qmp(result, 'return', '')
271 + write1_res = result['return']
272
273 # We need second write to trigger throttling
274 result = self.vm.qmp('human-monitor-command',
275 command_line='qemu-io cbw "write 512K 512K"')
268 - self.assert_qmp(result, 'return', '')
276 + write2_res = result['return']
277
278 result = self.vm.qmp('human-monitor-command',
279 command_line='qemu-io access "read 0 1M"')
272 - self.assert_qmp(result, 'return', '')
280 + read_res = result['return']
281
282 self.vm.shutdown()
283 log = self.vm.get_log()
284 log = re.sub(r'^\[I \d+\.\d+\] OPENED\n', '', log)
285 log = re.sub(r'\[I \+\d+\.\d+\] CLOSED\n?$', '', log)
286 log = iotests.filter_qemu_io(log)
279 - return log
287 + return log, write1_res, write2_res, read_res
288
289 def test_timeout_break_guest(self):
282 - log = self.do_cbw_timeout('break-guest-write')
290 + log, write1_res, write2_res, read_res = \
291 + self.do_cbw_timeout('break-guest-write')
292 + self.assertEqual(write1_res, '')
293 # macOS and FreeBSD tend to represent ETIMEDOUT as
294 # "Operation timed out", when Linux prefer
295 # "Connection timed out"
286 - log = log.replace('Operation timed out',
287 - 'Connection timed out')
296 + write2_res = write2_res.replace('Operation timed out',
297 + 'Connection timed out')
298 + self.assertIn('write failed: Connection timed out', write2_res)
299 + self.assertEqual(read_res, '')
300 self.assertEqual(log, """\
301 wrote 524288/524288 bytes at offset 0
302 512 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
291 -write failed: Connection timed out
303 read 1048576/1048576 bytes at offset 0
304 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
305 """)
306
307 def test_timeout_break_snapshot(self):
297 - log = self.do_cbw_timeout('break-snapshot')
308 + log, write1_res, write2_res, read_res = \
309 + self.do_cbw_timeout('break-snapshot')
310 + self.assertEqual(write1_res, '')
311 + self.assertEqual(write2_res, '')
312 + self.assertIn('read failed: Permission denied', read_res)
313 self.assertEqual(log, """\
314 wrote 524288/524288 bytes at offset 0
315 512 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
316 wrote 524288/524288 bytes at offset 524288
317 512 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
303 -read failed: Permission denied
318 """)
319
320
tests/qemu-iotests/tests/file-io-error.out
+1 -1
@@ -21,7 +21,7 @@ QA output created by file-io-error
21 }}
22 {"return": {}}
23
24 -write failed: Input/output error
24 +qemu-io: write failed: Input/output error
25
26 {'execute': 'block-export-del',
27 'arguments': {'id': 'exp0'}}
tests/qemu-iotests/tests/image-fleecing.out
+6 -6
@@ -238,13 +238,13 @@ read -P0xd5 1M 64k
238 read -P0xdc 32M 64k
239 read -P0xcd 0x3ff0000 64k
240 read -P0 0x00f8000 32k
241 -read failed: Invalid argument
241 +qemu-io: read failed: Invalid argument
242
243 read -P0 0x2010000 32k
244 -read failed: Invalid argument
244 +qemu-io: read failed: Invalid argument
245
246 read -P0 0x3fe0000 64k
247 -read failed: Invalid argument
247 +qemu-io: read failed: Invalid argument
248
249
250 --- Testing COW ---
@@ -265,13 +265,13 @@ read -P0xd5 1M 64k
265 read -P0xdc 32M 64k
266 read -P0xcd 0x3ff0000 64k
267 read -P0 0x00f8000 32k
268 -read failed: Invalid argument
268 +qemu-io: read failed: Invalid argument
269
270 read -P0 0x2010000 32k
271 -read failed: Invalid argument
271 +qemu-io: read failed: Invalid argument
272
273 read -P0 0x3fe0000 64k
274 -read failed: Invalid argument
274 +qemu-io: read failed: Invalid argument
275
276
277 --- Cleanup ---
tests/qemu-iotests/tests/inactive-node-nbd.out
+4 -4
@@ -215,13 +215,13 @@ target-fmt active: True
215 read 65536/65536 bytes at offset 0
216 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
217
218 -write failed: Operation not permitted
218 +qemu-io: write failed: Operation not permitted
219
220 -write failed: Operation not permitted
220 +qemu-io: write failed: Operation not permitted
221
222 -write failed: Operation not permitted
222 +qemu-io: write failed: Operation not permitted
223
224 -discard failed: Operation not permitted
224 +qemu-io: discard failed: Operation not permitted
225
226
227 qemu-io: Failed to get allocation status: Operation not permitted