commit.c (3b35d4542c8537a9269f6372df531ced6c960084) commit.c (a9262f551eba44d4d0f9e396d7124c059a93e204)
1/*
2 * Live block commit
3 *
4 * Copyright Red Hat, Inc. 2012
5 *
6 * Authors:
7 * Jeff Cody <jcody@redhat.com>
8 * Based on stream.c by Stefan Hajnoczi

--- 513 unchanged lines hidden (view full) ---

522 }
523
524 for (offset = 0; offset < length; offset += n) {
525 ret = bdrv_is_allocated(bs, offset, COMMIT_BUF_SIZE, &n);
526 if (ret < 0) {
527 goto ro_cleanup;
528 }
529 if (ret) {
1/*
2 * Live block commit
3 *
4 * Copyright Red Hat, Inc. 2012
5 *
6 * Authors:
7 * Jeff Cody <jcody@redhat.com>
8 * Based on stream.c by Stefan Hajnoczi

--- 513 unchanged lines hidden (view full) ---

522 }
523
524 for (offset = 0; offset < length; offset += n) {
525 ret = bdrv_is_allocated(bs, offset, COMMIT_BUF_SIZE, &n);
526 if (ret < 0) {
527 goto ro_cleanup;
528 }
529 if (ret) {
530 ret = blk_pread(src, offset, buf, n, 0);
530 ret = blk_pread(src, offset, n, buf, 0);
531 if (ret < 0) {
532 goto ro_cleanup;
533 }
534
531 if (ret < 0) {
532 goto ro_cleanup;
533 }
534
535 ret = blk_pwrite(backing, offset, buf, n, 0);
535 ret = blk_pwrite(backing, offset, n, buf, 0);
536 if (ret < 0) {
537 goto ro_cleanup;
538 }
539 }
540 }
541
542 ret = blk_make_empty(src, NULL);
543 /* Ignore -ENOTSUP */

--- 28 unchanged lines hidden ---
536 if (ret < 0) {
537 goto ro_cleanup;
538 }
539 }
540 }
541
542 ret = blk_make_empty(src, NULL);
543 /* Ignore -ENOTSUP */

--- 28 unchanged lines hidden ---