Add socket character device
[qemu/aliguori.git] / backends / block_file.h
blob78a6c4fc1e2ffd3290940bb03f305692bf7480db
1 #ifndef BLOCK_FILE_H
2 #define BLOCK_FILE_H
4 #include "block_dev.h"
6 typedef struct BlockFile {
7 BlockDev parent;
9 char *filename;
10 int fd;
12 int open_flags;
14 #ifdef CONFIG_LINUX_AIO
15 int use_aio;
16 void *aio_ctx;
17 #endif
18 uint8_t *aligned_buf;
19 unsigned aligned_buf_size;
20 #ifdef CONFIG_XFS
21 bool is_xfs : 1;
22 #endif
23 } BlockFile;
25 #define TYPE_BLOCK_FILE "block-file"
26 #define BLOCK_FILE(obj) TYPE_CHECK(BlockFile, obj, TYPE_BLOCK_FILE)
28 void block_file_initialize(BlockFile *obj, const char *id);
30 void block_file_finalize(BlockFile *obj);
32 const char *block_file_get_filename(BlockFile *obj);
33 void block_file_set_filename(BlockFile *obj, const char *value);
35 #endif