Files
xemu/include/system/blockdev.h
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

65 lines
1.8 KiB
C
Raw Normal View History

/*
* QEMU host block devices
*
* Copyright (c) 2003-2008 Fabrice Bellard
*
* This work is licensed under the terms of the GNU GPL, version 2 or
* later. See the COPYING file in the top-level directory.
*/
#ifndef BLOCKDEV_H
#define BLOCKDEV_H
2012-12-17 18:19:44 +01:00
#include "block/block.h"
2012-12-17 18:20:00 +01:00
#include "qemu/queue.h"
typedef enum {
IF_DEFAULT = -1, /* for use with drive_add() only */
/*
* IF_NONE must be zero, because we want MachineClass member
* block_default_type to default-initialize to IF_NONE
*/
IF_NONE = 0,
IF_IDE, IF_SCSI, IF_FLOPPY, IF_PFLASH, IF_MTD, IF_SD, IF_VIRTIO, IF_XEN,
IF_COUNT
} BlockInterfaceType;
2010-08-24 15:22:24 +00:00
struct DriveInfo {
BlockInterfaceType type;
int bus;
int unit;
2010-06-25 08:09:10 +02:00
int auto_del; /* see blockdev_mark_auto_del() */
2014-10-01 14:19:24 -04:00
bool is_default; /* Added by default_drive() ? */
int media_cd;
QemuOpts *opts;
QTAILQ_ENTRY(DriveInfo) next;
2010-08-24 15:22:24 +00:00
};
2022-03-03 10:16:05 -05:00
/*
* Global state (GS) API. These functions run under the BQL.
*
* See include/block/block-global-state.h for more information about
* the GS API.
*/
void blockdev_mark_auto_del(BlockBackend *blk);
void blockdev_auto_del(BlockBackend *blk);
2014-10-07 13:59:06 +02:00
DriveInfo *blk_legacy_dinfo(BlockBackend *blk);
DriveInfo *blk_set_legacy_dinfo(BlockBackend *blk, DriveInfo *dinfo);
BlockBackend *blk_by_legacy_dinfo(DriveInfo *dinfo);
void override_max_devs(BlockInterfaceType type, int max_devs);
DriveInfo *drive_get(BlockInterfaceType type, int bus, int unit);
2017-02-15 11:05:46 +01:00
void drive_check_orphaned(void);
2011-01-28 11:21:44 +01:00
DriveInfo *drive_get_by_index(BlockInterfaceType type, int index);
int drive_get_max_bus(BlockInterfaceType type);
QemuOpts *drive_add(BlockInterfaceType type, int index, const char *file,
const char *optstr);
2018-10-17 10:26:57 +02:00
DriveInfo *drive_new(QemuOpts *arg, BlockInterfaceType block_default_type,
Error **errp);
#endif