Revision dcd1d224 block-migration.c
b/block-migration.c | ||
---|---|---|
263 | 263 |
|
264 | 264 |
error: |
265 | 265 |
monitor_printf(mon, "Error reading sector %" PRId64 "\n", cur_sector); |
266 |
qemu_file_set_error(f); |
|
266 |
qemu_file_set_error(f, -EIO);
|
|
267 | 267 |
g_free(blk->buf); |
268 | 268 |
g_free(blk); |
269 | 269 |
return 0; |
... | ... | |
383 | 383 |
int64_t total_sectors = bmds->total_sectors; |
384 | 384 |
int64_t sector; |
385 | 385 |
int nr_sectors; |
386 |
int ret = -EIO; |
|
386 | 387 |
|
387 | 388 |
for (sector = bmds->cur_dirty; sector < bmds->total_sectors;) { |
388 | 389 |
if (bmds_aio_inflight(bmds, sector)) { |
... | ... | |
418 | 419 |
block_mig_state.submitted++; |
419 | 420 |
bmds_set_aio_inflight(bmds, sector, nr_sectors, 1); |
420 | 421 |
} else { |
421 |
if (bdrv_read(bmds->bs, sector, blk->buf,
|
|
422 |
nr_sectors) < 0) {
|
|
422 |
ret = bdrv_read(bmds->bs, sector, blk->buf, nr_sectors);
|
|
423 |
if (ret < 0) {
|
|
423 | 424 |
goto error; |
424 | 425 |
} |
425 | 426 |
blk_send(f, blk); |
... | ... | |
439 | 440 |
|
440 | 441 |
error: |
441 | 442 |
monitor_printf(mon, "Error reading sector %" PRId64 "\n", sector); |
442 |
qemu_file_set_error(f); |
|
443 |
qemu_file_set_error(f, ret);
|
|
443 | 444 |
g_free(blk->buf); |
444 | 445 |
g_free(blk); |
445 | 446 |
return 0; |
... | ... | |
473 | 474 |
break; |
474 | 475 |
} |
475 | 476 |
if (blk->ret < 0) { |
476 |
qemu_file_set_error(f); |
|
477 |
qemu_file_set_error(f, blk->ret);
|
|
477 | 478 |
break; |
478 | 479 |
} |
479 | 480 |
blk_send(f, blk); |
Also available in: Unified diff