mirror: Require GRAPH_RDLOCK for accessing a node's parent list
[qemu/kevin.git] / migration / channel-block.h
blob31673824e6971398b73f55cfb36a521ca0d91791
1 /*
2 * QEMU I/O channels block driver
4 * Copyright (c) 2022 Red Hat, Inc.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
21 #ifndef QIO_CHANNEL_BLOCK_H
22 #define QIO_CHANNEL_BLOCK_H
24 #include "io/channel.h"
25 #include "qom/object.h"
27 #define TYPE_QIO_CHANNEL_BLOCK "qio-channel-block"
28 OBJECT_DECLARE_SIMPLE_TYPE(QIOChannelBlock, QIO_CHANNEL_BLOCK)
31 /**
32 * QIOChannelBlock:
34 * The QIOChannelBlock object provides a channel implementation
35 * that is able to perform I/O on the BlockDriverState objects
36 * to the VMState region.
39 struct QIOChannelBlock {
40 QIOChannel parent;
41 BlockDriverState *bs;
42 off_t offset;
46 /**
47 * qio_channel_block_new:
48 * @bs: the block driver state
50 * Create a new IO channel object that can perform
51 * I/O on a BlockDriverState object to the VMState
52 * region
54 * Returns: the new channel object
56 QIOChannelBlock *
57 qio_channel_block_new(BlockDriverState *bs);
59 #endif /* QIO_CHANNEL_BLOCK_H */