Revision 83f64091 vl.h
b/vl.h | ||
---|---|---|
481 | 481 |
void cpu_save(QEMUFile *f, void *opaque); |
482 | 482 |
int cpu_load(QEMUFile *f, void *opaque, int version_id); |
483 | 483 |
|
484 |
/* bottom halves */ |
|
485 |
typedef struct QEMUBH QEMUBH; |
|
486 |
typedef void QEMUBHFunc(void *opaque); |
|
487 |
|
|
488 |
QEMUBH *qemu_bh_new(QEMUBHFunc *cb, void *opaque); |
|
489 |
void qemu_bh_schedule(QEMUBH *bh); |
|
490 |
void qemu_bh_cancel(QEMUBH *bh); |
|
491 |
void qemu_bh_delete(QEMUBH *bh); |
|
492 |
void qemu_bh_poll(void); |
|
493 |
|
|
484 | 494 |
/* block.c */ |
485 | 495 |
typedef struct BlockDriverState BlockDriverState; |
486 | 496 |
typedef struct BlockDriver BlockDriver; |
... | ... | |
495 | 505 |
extern BlockDriver bdrv_vpc; |
496 | 506 |
extern BlockDriver bdrv_vvfat; |
497 | 507 |
|
508 |
#define BDRV_O_RDONLY 0x0000 |
|
509 |
#define BDRV_O_RDWR 0x0002 |
|
510 |
#define BDRV_O_ACCESS 0x0003 |
|
511 |
#define BDRV_O_CREAT 0x0004 /* create an empty file */ |
|
512 |
#define BDRV_O_SNAPSHOT 0x0008 /* open the file read only and save writes in a snapshot */ |
|
513 |
#define BDRV_O_FILE 0x0010 /* open as a raw file (do not try to |
|
514 |
use a disk image format on top of |
|
515 |
it (default for |
|
516 |
bdrv_file_open()) */ |
|
517 |
|
|
498 | 518 |
void bdrv_init(void); |
499 | 519 |
BlockDriver *bdrv_find_format(const char *format_name); |
500 | 520 |
int bdrv_create(BlockDriver *drv, |
... | ... | |
502 | 522 |
const char *backing_file, int flags); |
503 | 523 |
BlockDriverState *bdrv_new(const char *device_name); |
504 | 524 |
void bdrv_delete(BlockDriverState *bs); |
505 |
int bdrv_open(BlockDriverState *bs, const char *filename, int snapshot); |
|
506 |
int bdrv_open2(BlockDriverState *bs, const char *filename, int snapshot, |
|
525 |
int bdrv_file_open(BlockDriverState **pbs, const char *filename, int flags); |
|
526 |
int bdrv_open(BlockDriverState *bs, const char *filename, int flags); |
|
527 |
int bdrv_open2(BlockDriverState *bs, const char *filename, int flags, |
|
507 | 528 |
BlockDriver *drv); |
508 | 529 |
void bdrv_close(BlockDriverState *bs); |
509 | 530 |
int bdrv_read(BlockDriverState *bs, int64_t sector_num, |
510 | 531 |
uint8_t *buf, int nb_sectors); |
511 | 532 |
int bdrv_write(BlockDriverState *bs, int64_t sector_num, |
512 | 533 |
const uint8_t *buf, int nb_sectors); |
534 |
int bdrv_pread(BlockDriverState *bs, int64_t offset, |
|
535 |
void *buf, int count); |
|
536 |
int bdrv_pwrite(BlockDriverState *bs, int64_t offset, |
|
537 |
const void *buf, int count); |
|
538 |
int bdrv_truncate(BlockDriverState *bs, int64_t offset); |
|
539 |
int64_t bdrv_getlength(BlockDriverState *bs); |
|
513 | 540 |
void bdrv_get_geometry(BlockDriverState *bs, int64_t *nb_sectors_ptr); |
514 | 541 |
int bdrv_commit(BlockDriverState *bs); |
515 | 542 |
void bdrv_set_boot_sector(BlockDriverState *bs, const uint8_t *data, int size); |
543 |
/* async block I/O */ |
|
544 |
typedef struct BlockDriverAIOCB BlockDriverAIOCB; |
|
545 |
typedef void BlockDriverCompletionFunc(void *opaque, int ret); |
|
546 |
|
|
547 |
BlockDriverAIOCB *bdrv_aio_new(BlockDriverState *bs); |
|
548 |
int bdrv_aio_read(BlockDriverAIOCB *acb, int64_t sector_num, |
|
549 |
uint8_t *buf, int nb_sectors, |
|
550 |
BlockDriverCompletionFunc *cb, void *opaque); |
|
551 |
int bdrv_aio_write(BlockDriverAIOCB *acb, int64_t sector_num, |
|
552 |
const uint8_t *buf, int nb_sectors, |
|
553 |
BlockDriverCompletionFunc *cb, void *opaque); |
|
554 |
void bdrv_aio_cancel(BlockDriverAIOCB *acb); |
|
555 |
void bdrv_aio_delete(BlockDriverAIOCB *acb); |
|
556 |
|
|
557 |
void qemu_aio_init(void); |
|
558 |
void qemu_aio_poll(void); |
|
559 |
void qemu_aio_wait_start(void); |
|
560 |
void qemu_aio_wait(void); |
|
561 |
void qemu_aio_wait_end(void); |
|
562 |
|
|
516 | 563 |
/* Ensure contents are flushed to disk. */ |
517 | 564 |
void bdrv_flush(BlockDriverState *bs); |
518 | 565 |
|
... | ... | |
551 | 598 |
int qcow_get_cluster_size(BlockDriverState *bs); |
552 | 599 |
int qcow_compress_cluster(BlockDriverState *bs, int64_t sector_num, |
553 | 600 |
const uint8_t *buf); |
601 |
void bdrv_get_backing_filename(BlockDriverState *bs, |
|
602 |
char *filename, int filename_size); |
|
603 |
|
|
604 |
int path_is_absolute(const char *path); |
|
605 |
void path_combine(char *dest, int dest_size, |
|
606 |
const char *base_path, |
|
607 |
const char *filename); |
|
554 | 608 |
|
555 | 609 |
#ifndef QEMU_TOOL |
556 | 610 |
|
Also available in: Unified diff