Revision 83f64091 block_int.h
b/block_int.h | ||
---|---|---|
28 | 28 |
const char *format_name; |
29 | 29 |
int instance_size; |
30 | 30 |
int (*bdrv_probe)(const uint8_t *buf, int buf_size, const char *filename); |
31 |
int (*bdrv_open)(BlockDriverState *bs, const char *filename); |
|
31 |
int (*bdrv_open)(BlockDriverState *bs, const char *filename, int flags);
|
|
32 | 32 |
int (*bdrv_read)(BlockDriverState *bs, int64_t sector_num, |
33 | 33 |
uint8_t *buf, int nb_sectors); |
34 | 34 |
int (*bdrv_write)(BlockDriverState *bs, int64_t sector_num, |
... | ... | |
41 | 41 |
int nb_sectors, int *pnum); |
42 | 42 |
int (*bdrv_set_key)(BlockDriverState *bs, const char *key); |
43 | 43 |
int (*bdrv_make_empty)(BlockDriverState *bs); |
44 |
/* aio */ |
|
45 |
int (*bdrv_aio_new)(BlockDriverAIOCB *acb); |
|
46 |
int (*bdrv_aio_read)(BlockDriverAIOCB *acb, int64_t sector_num, |
|
47 |
uint8_t *buf, int nb_sectors); |
|
48 |
int (*bdrv_aio_write)(BlockDriverAIOCB *acb, int64_t sector_num, |
|
49 |
const uint8_t *buf, int nb_sectors); |
|
50 |
void (*bdrv_aio_cancel)(BlockDriverAIOCB *acb); |
|
51 |
void (*bdrv_aio_delete)(BlockDriverAIOCB *acb); |
|
52 |
|
|
53 |
const char *protocol_name; |
|
54 |
int (*bdrv_pread)(BlockDriverState *bs, int64_t offset, |
|
55 |
uint8_t *buf, int count); |
|
56 |
int (*bdrv_pwrite)(BlockDriverState *bs, int64_t offset, |
|
57 |
const uint8_t *buf, int count); |
|
58 |
int (*bdrv_truncate)(BlockDriverState *bs, int64_t offset); |
|
59 |
int64_t (*bdrv_getlength)(BlockDriverState *bs); |
|
60 |
|
|
44 | 61 |
struct BlockDriver *next; |
45 | 62 |
}; |
46 | 63 |
|
47 | 64 |
struct BlockDriverState { |
48 |
int64_t total_sectors; |
|
65 |
int64_t total_sectors; /* XXX: will be suppressed */
|
|
49 | 66 |
int read_only; /* if true, the media is read only */ |
50 | 67 |
int inserted; /* if true, the media is present */ |
51 | 68 |
int removable; /* if true, the media can be removed */ |
... | ... | |
67 | 84 |
int is_temporary; |
68 | 85 |
|
69 | 86 |
BlockDriverState *backing_hd; |
87 |
/* sync read/write emulation */ |
|
88 |
|
|
89 |
BlockDriverAIOCB *sync_aiocb; |
|
70 | 90 |
|
71 | 91 |
/* NOTE: the following infos are only hints for real hardware |
72 | 92 |
drivers. They are not used by the block driver */ |
... | ... | |
76 | 96 |
BlockDriverState *next; |
77 | 97 |
}; |
78 | 98 |
|
99 |
struct BlockDriverAIOCB { |
|
100 |
BlockDriverState *bs; |
|
101 |
BlockDriverCompletionFunc *cb; |
|
102 |
void *cb_opaque; |
|
103 |
|
|
104 |
void *opaque; /* driver opaque */ |
|
105 |
}; |
|
106 |
|
|
79 | 107 |
void get_tmp_filename(char *filename, int size); |
80 | 108 |
|
81 | 109 |
#endif /* BLOCK_INT_H */ |
Also available in: Unified diff