~pmdj/ubuntu/trusty/qemu/2.9+applesmc+fadtv3

« back to all changes in this revision

Viewing changes to block/replication.c

  • Committer: Phil Dennis-Jordan
  • Date: 2017-07-21 08:03:43 UTC
  • mfrom: (1.1.1)
  • Revision ID: phil@philjordan.eu-20170721080343-2yr2vdj7713czahv
New upstream release 2.9.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
86
86
    const char *mode;
87
87
    const char *top_id;
88
88
 
 
89
    bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file,
 
90
                               false, errp);
 
91
    if (!bs->file) {
 
92
        return -EINVAL;
 
93
    }
 
94
 
89
95
    ret = -EINVAL;
90
96
    opts = qemu_opts_create(&replication_runtime_opts, NULL, 0, &error_abort);
91
97
    qemu_opts_absorb_qdict(opts, options, &local_err);
149
155
    replication_remove(s->rs);
150
156
}
151
157
 
 
158
static void replication_child_perm(BlockDriverState *bs, BdrvChild *c,
 
159
                                   const BdrvChildRole *role,
 
160
                                   uint64_t perm, uint64_t shared,
 
161
                                   uint64_t *nperm, uint64_t *nshared)
 
162
{
 
163
    *nperm = *nshared = BLK_PERM_CONSISTENT_READ \
 
164
                        | BLK_PERM_WRITE \
 
165
                        | BLK_PERM_WRITE_UNCHANGED;
 
166
 
 
167
    return;
 
168
}
 
169
 
152
170
static int64_t replication_getlength(BlockDriverState *bs)
153
171
{
154
172
    return bdrv_getlength(bs->file->bs);
638
656
        s->replication_state = BLOCK_REPLICATION_FAILOVER;
639
657
        commit_active_start(NULL, s->active_disk->bs, s->secondary_disk->bs,
640
658
                            BLOCK_JOB_INTERNAL, 0, BLOCKDEV_ON_ERROR_REPORT,
641
 
                            replication_done, bs, errp, true);
 
659
                            NULL, replication_done, bs, errp, true);
642
660
        break;
643
661
    default:
644
662
        aio_context_release(aio_context);
654
672
 
655
673
    .bdrv_open                  = replication_open,
656
674
    .bdrv_close                 = replication_close,
 
675
    .bdrv_child_perm            = replication_child_perm,
657
676
 
658
677
    .bdrv_getlength             = replication_getlength,
659
678
    .bdrv_co_readv              = replication_co_readv,