xref: /qemu/block/copy-before-write.h (revision 377cc15b)
1d003e0aeSVladimir Sementsov-Ogievskiy /*
2d003e0aeSVladimir Sementsov-Ogievskiy  * copy-before-write filter driver
3d003e0aeSVladimir Sementsov-Ogievskiy  *
4d003e0aeSVladimir Sementsov-Ogievskiy  * The driver performs Copy-Before-Write (CBW) operation: it is injected above
5d003e0aeSVladimir Sementsov-Ogievskiy  * some node, and before each write it copies _old_ data to the target node.
6d003e0aeSVladimir Sementsov-Ogievskiy  *
7d003e0aeSVladimir Sementsov-Ogievskiy  * Copyright (c) 2018-2021 Virtuozzo International GmbH.
8d003e0aeSVladimir Sementsov-Ogievskiy  *
9d003e0aeSVladimir Sementsov-Ogievskiy  * Author:
10d003e0aeSVladimir Sementsov-Ogievskiy  *  Sementsov-Ogievskiy Vladimir <vsementsov@virtuozzo.com>
11d003e0aeSVladimir Sementsov-Ogievskiy  *
12d003e0aeSVladimir Sementsov-Ogievskiy  * This program is free software; you can redistribute it and/or modify
13d003e0aeSVladimir Sementsov-Ogievskiy  * it under the terms of the GNU General Public License as published by
14d003e0aeSVladimir Sementsov-Ogievskiy  * the Free Software Foundation; either version 2 of the License, or
15d003e0aeSVladimir Sementsov-Ogievskiy  * (at your option) any later version.
16d003e0aeSVladimir Sementsov-Ogievskiy  *
17d003e0aeSVladimir Sementsov-Ogievskiy  * This program is distributed in the hope that it will be useful,
18d003e0aeSVladimir Sementsov-Ogievskiy  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19d003e0aeSVladimir Sementsov-Ogievskiy  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20d003e0aeSVladimir Sementsov-Ogievskiy  * GNU General Public License for more details.
21d003e0aeSVladimir Sementsov-Ogievskiy  *
22d003e0aeSVladimir Sementsov-Ogievskiy  * You should have received a copy of the GNU General Public License
23d003e0aeSVladimir Sementsov-Ogievskiy  * along with this program. If not, see <http://www.gnu.org/licenses/>.
24d003e0aeSVladimir Sementsov-Ogievskiy  */
25d003e0aeSVladimir Sementsov-Ogievskiy 
26d003e0aeSVladimir Sementsov-Ogievskiy #ifndef COPY_BEFORE_WRITE_H
27d003e0aeSVladimir Sementsov-Ogievskiy #define COPY_BEFORE_WRITE_H
28d003e0aeSVladimir Sementsov-Ogievskiy 
29d003e0aeSVladimir Sementsov-Ogievskiy #include "block/block_int.h"
30d003e0aeSVladimir Sementsov-Ogievskiy #include "block/block-copy.h"
31d003e0aeSVladimir Sementsov-Ogievskiy 
32*377cc15bSEmanuele Giuseppe Esposito /*
33*377cc15bSEmanuele Giuseppe Esposito  * Global state (GS) API. These functions run under the BQL.
34*377cc15bSEmanuele Giuseppe Esposito  *
35*377cc15bSEmanuele Giuseppe Esposito  * See include/block/block-global-state.h for more information about
36*377cc15bSEmanuele Giuseppe Esposito  * the GS API.
37*377cc15bSEmanuele Giuseppe Esposito  */
38*377cc15bSEmanuele Giuseppe Esposito 
39d003e0aeSVladimir Sementsov-Ogievskiy BlockDriverState *bdrv_cbw_append(BlockDriverState *source,
40d003e0aeSVladimir Sementsov-Ogievskiy                                   BlockDriverState *target,
41d003e0aeSVladimir Sementsov-Ogievskiy                                   const char *filter_node_name,
42d003e0aeSVladimir Sementsov-Ogievskiy                                   BlockCopyState **bcs,
43d003e0aeSVladimir Sementsov-Ogievskiy                                   Error **errp);
44d003e0aeSVladimir Sementsov-Ogievskiy void bdrv_cbw_drop(BlockDriverState *bs);
45d003e0aeSVladimir Sementsov-Ogievskiy 
46d003e0aeSVladimir Sementsov-Ogievskiy #endif /* COPY_BEFORE_WRITE_H */
47