replication.c (d038d2645acabf6f52fd61baeaa021c3ebe97714) | replication.c (c86422c5549c0983b4b4525b8f56a1c69dd67aa1) |
---|---|
1/* 2 * Replication Block filter 3 * 4 * Copyright (c) 2016 HUAWEI TECHNOLOGIES CO., LTD. 5 * Copyright (c) 2016 Intel Corporation 6 * Copyright (c) 2016 FUJITSU LIMITED 7 * 8 * Author: --- 165 unchanged lines hidden (view full) --- 174 *nperm |= BLK_PERM_WRITE; 175 } 176 *nshared = BLK_PERM_CONSISTENT_READ 177 | BLK_PERM_WRITE 178 | BLK_PERM_WRITE_UNCHANGED; 179 return; 180} 181 | 1/* 2 * Replication Block filter 3 * 4 * Copyright (c) 2016 HUAWEI TECHNOLOGIES CO., LTD. 5 * Copyright (c) 2016 Intel Corporation 6 * Copyright (c) 2016 FUJITSU LIMITED 7 * 8 * Author: --- 165 unchanged lines hidden (view full) --- 174 *nperm |= BLK_PERM_WRITE; 175 } 176 *nshared = BLK_PERM_CONSISTENT_READ 177 | BLK_PERM_WRITE 178 | BLK_PERM_WRITE_UNCHANGED; 179 return; 180} 181 |
182static int64_t replication_getlength(BlockDriverState *bs) | 182static int64_t coroutine_fn replication_co_getlength(BlockDriverState *bs) |
183{ | 183{ |
184 return bdrv_getlength(bs->file->bs); | 184 return bdrv_co_getlength(bs->file->bs); |
185} 186 187static int replication_get_io_status(BDRVReplicationState *s) 188{ 189 switch (s->stage) { 190 case BLOCK_REPLICATION_NONE: 191 return -EIO; 192 case BLOCK_REPLICATION_RUNNING: --- 560 unchanged lines hidden (view full) --- 753static BlockDriver bdrv_replication = { 754 .format_name = "replication", 755 .instance_size = sizeof(BDRVReplicationState), 756 757 .bdrv_open = replication_open, 758 .bdrv_close = replication_close, 759 .bdrv_child_perm = replication_child_perm, 760 | 185} 186 187static int replication_get_io_status(BDRVReplicationState *s) 188{ 189 switch (s->stage) { 190 case BLOCK_REPLICATION_NONE: 191 return -EIO; 192 case BLOCK_REPLICATION_RUNNING: --- 560 unchanged lines hidden (view full) --- 753static BlockDriver bdrv_replication = { 754 .format_name = "replication", 755 .instance_size = sizeof(BDRVReplicationState), 756 757 .bdrv_open = replication_open, 758 .bdrv_close = replication_close, 759 .bdrv_child_perm = replication_child_perm, 760 |
761 .bdrv_getlength = replication_getlength, | 761 .bdrv_co_getlength = replication_co_getlength, |
762 .bdrv_co_readv = replication_co_readv, 763 .bdrv_co_writev = replication_co_writev, 764 765 .is_filter = true, 766 767 .has_variable_length = true, 768 .strong_runtime_opts = replication_strong_runtime_opts, 769}; 770 771static void bdrv_replication_init(void) 772{ 773 bdrv_register(&bdrv_replication); 774} 775 776block_init(bdrv_replication_init); | 762 .bdrv_co_readv = replication_co_readv, 763 .bdrv_co_writev = replication_co_writev, 764 765 .is_filter = true, 766 767 .has_variable_length = true, 768 .strong_runtime_opts = replication_strong_runtime_opts, 769}; 770 771static void bdrv_replication_init(void) 772{ 773 bdrv_register(&bdrv_replication); 774} 775 776block_init(bdrv_replication_init); |