~jderose/ubuntu/raring/qemu/vde-again

« back to all changes in this revision

Viewing changes to block.h

  • Committer: Bazaar Package Importer
  • Author(s): Aurelien Jarno, Aurelien Jarno
  • Date: 2009-03-22 10:13:17 UTC
  • mfrom: (1.2.1 upstream) (6.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090322101317-iigjtnu5qil35dtb
Tags: 0.10.1-1
[ Aurelien Jarno ]
* New upstream stable release:
  - patches/80_stable-branch.patch: remove.
* debian/control: 
  - Remove depends on proll.
  - Move depends on device-tree-compiler to build-depends.
  - Bump Standards-Version to 3.8.1 (no changes).
* patches/82_qemu-img_decimal.patch: new patch from upstream to make
  qemu-img accept sizes with decimal values (closes: bug#501400).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#ifndef BLOCK_H
2
2
#define BLOCK_H
3
3
 
 
4
#include "qemu-aio.h"
 
5
#include "qemu-common.h"
 
6
 
4
7
/* block.c */
5
8
typedef struct BlockDriver BlockDriver;
6
9
 
16
19
extern BlockDriver bdrv_vvfat;
17
20
extern BlockDriver bdrv_qcow2;
18
21
extern BlockDriver bdrv_parallels;
 
22
extern BlockDriver bdrv_nbd;
19
23
 
20
24
typedef struct BlockDriverInfo {
21
25
    /* in bytes, 0 if irrelevant */
44
48
                                     use a disk image format on top of
45
49
                                     it (default for
46
50
                                     bdrv_file_open()) */
47
 
#define BDRV_O_DIRECT      0x0020
48
 
 
49
 
#ifndef QEMU_IMG
 
51
#define BDRV_O_NOCACHE     0x0020 /* do not use the host page cache */
 
52
#define BDRV_O_CACHE_WB    0x0040 /* use write-back caching */
 
53
#define BDRV_O_CACHE_DEF   0x0080 /* use default caching */
 
54
 
 
55
#define BDRV_O_CACHE_MASK  (BDRV_O_NOCACHE | BDRV_O_CACHE_WB | BDRV_O_CACHE_DEF)
 
56
 
50
57
void bdrv_info(void);
51
58
void bdrv_info_stats(void);
52
 
#endif
53
59
 
54
60
void bdrv_init(void);
55
61
BlockDriver *bdrv_find_format(const char *format_name);
74
80
int bdrv_truncate(BlockDriverState *bs, int64_t offset);
75
81
int64_t bdrv_getlength(BlockDriverState *bs);
76
82
void bdrv_get_geometry(BlockDriverState *bs, uint64_t *nb_sectors_ptr);
 
83
void bdrv_guess_geometry(BlockDriverState *bs, int *pcyls, int *pheads, int *psecs);
77
84
int bdrv_commit(BlockDriverState *bs);
78
 
void bdrv_set_boot_sector(BlockDriverState *bs, const uint8_t *data, int size);
79
85
/* async block I/O */
80
86
typedef struct BlockDriverAIOCB BlockDriverAIOCB;
81
87
typedef void BlockDriverCompletionFunc(void *opaque, int ret);
82
88
 
 
89
BlockDriverAIOCB *bdrv_aio_readv(BlockDriverState *bs, int64_t sector_num,
 
90
                                 QEMUIOVector *iov, int nb_sectors,
 
91
                                 BlockDriverCompletionFunc *cb, void *opaque);
 
92
BlockDriverAIOCB *bdrv_aio_writev(BlockDriverState *bs, int64_t sector_num,
 
93
                                  QEMUIOVector *iov, int nb_sectors,
 
94
                                  BlockDriverCompletionFunc *cb, void *opaque);
 
95
 
83
96
BlockDriverAIOCB *bdrv_aio_read(BlockDriverState *bs, int64_t sector_num,
84
97
                                uint8_t *buf, int nb_sectors,
85
98
                                BlockDriverCompletionFunc *cb, void *opaque);
88
101
                                 BlockDriverCompletionFunc *cb, void *opaque);
89
102
void bdrv_aio_cancel(BlockDriverAIOCB *acb);
90
103
 
91
 
void qemu_aio_init(void);
92
 
void qemu_aio_poll(void);
93
 
void qemu_aio_flush(void);
94
 
void qemu_aio_wait_start(void);
95
 
void qemu_aio_wait(void);
96
 
void qemu_aio_wait_end(void);
97
 
 
98
 
int qemu_key_check(BlockDriverState *bs, const char *name);
99
 
 
100
104
/* Ensure contents are flushed to disk.  */
101
105
void bdrv_flush(BlockDriverState *bs);
 
106
void bdrv_flush_all(void);
 
107
 
 
108
int bdrv_is_allocated(BlockDriverState *bs, int64_t sector_num, int nb_sectors,
 
109
        int *pnum);
102
110
 
103
111
#define BDRV_TYPE_HD     0
104
112
#define BDRV_TYPE_CDROM  1
129
137
                        void (*change_cb)(void *opaque), void *opaque);
130
138
void bdrv_get_format(BlockDriverState *bs, char *buf, int buf_size);
131
139
BlockDriverState *bdrv_find(const char *name);
132
 
void bdrv_iterate(void (*it)(void *opaque, const char *name), void *opaque);
 
140
void bdrv_iterate(void (*it)(void *opaque, BlockDriverState *bs),
 
141
                  void *opaque);
133
142
int bdrv_is_encrypted(BlockDriverState *bs);
 
143
int bdrv_key_required(BlockDriverState *bs);
134
144
int bdrv_set_key(BlockDriverState *bs, const char *key);
 
145
int bdrv_query_missing_keys(void);
135
146
void bdrv_iterate_format(void (*it)(void *opaque, const char *name),
136
147
                         void *opaque);
137
148
const char *bdrv_get_device_name(BlockDriverState *bs);
139
150
                          const uint8_t *buf, int nb_sectors);
140
151
int bdrv_get_info(BlockDriverState *bs, BlockDriverInfo *bdi);
141
152
 
 
153
const char *bdrv_get_encrypted_filename(BlockDriverState *bs);
142
154
void bdrv_get_backing_filename(BlockDriverState *bs,
143
155
                               char *filename, int filename_size);
144
156
int bdrv_snapshot_create(BlockDriverState *bs,