X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=blockdev.h;h=5f27b643be7b9f550a355e9d89863f1b65d203e9;hb=ad1db3b341d3d55e6d722ad868bd48ed4425c9fb;hp=84e462ab3fb915daff13da625b9fa96cefeca937;hpb=9363ee31ab53fc0fd39fbe5936d9c00a2f4e54a4;p=mirror_qemu.git diff --git a/blockdev.h b/blockdev.h index 84e462ab3f..5f27b643be 100644 --- a/blockdev.h +++ b/blockdev.h @@ -11,13 +11,12 @@ #define BLOCKDEV_H #include "block.h" +#include "error.h" #include "qemu-queue.h" void blockdev_mark_auto_del(BlockDriverState *bs); void blockdev_auto_del(BlockDriverState *bs); -#define BLOCK_SERIAL_STRLEN 20 - typedef enum { IF_DEFAULT = -1, /* for use with drive_add() only */ IF_NONE, @@ -33,16 +32,20 @@ struct DriveInfo { int bus; int unit; int auto_del; /* see blockdev_mark_auto_del() */ + int media_cd; + int cyls, heads, secs, trans; QemuOpts *opts; - char serial[BLOCK_SERIAL_STRLEN + 1]; + const char *serial; QTAILQ_ENTRY(DriveInfo) next; + int refcount; }; DriveInfo *drive_get(BlockInterfaceType type, int bus, int unit); DriveInfo *drive_get_by_index(BlockInterfaceType type, int index); int drive_get_max_bus(BlockInterfaceType type); DriveInfo *drive_get_next(BlockInterfaceType type); -void drive_uninit(DriveInfo *dinfo); +void drive_get_ref(DriveInfo *dinfo); +void drive_put_ref(DriveInfo *dinfo); DriveInfo *drive_get_by_blockdev(BlockDriverState *bs); QemuOpts *drive_def(const char *optstr); @@ -54,13 +57,8 @@ DriveInfo *drive_init(QemuOpts *arg, int default_to_scsi); DriveInfo *add_init_drive(const char *opts); +void qmp_change_blockdev(const char *device, const char *filename, + bool has_format, const char *format, Error **errp); void do_commit(Monitor *mon, const QDict *qdict); -int do_eject(Monitor *mon, const QDict *qdict, QObject **ret_data); -int do_block_set_passwd(Monitor *mon, const QDict *qdict, QObject **ret_data); -int do_change_block(Monitor *mon, const char *device, - const char *filename, const char *fmt); int do_drive_del(Monitor *mon, const QDict *qdict, QObject **ret_data); -int do_snapshot_blkdev(Monitor *mon, const QDict *qdict, QObject **ret_data); -int do_block_resize(Monitor *mon, const QDict *qdict, QObject **ret_data); - #endif