QEMUOptionParameter *create_options;
- /* Returns number of errors in image, -errno for internal errors */
- int (*bdrv_check)(BlockDriverState* bs);
+ /*
+ * Returns 0 for completed check, -errno for internal errors.
+ * The check results are stored in result.
+ */
+ int (*bdrv_check)(BlockDriverState* bs, BdrvCheckResult *result);
void (*bdrv_debug_event)(BlockDriverState *bs, BlkDebugEvent event);
BlockDriver *drv; /* NULL means no media */
void *opaque;
+ DeviceState *peer;
+
char filename[1024];
char backing_file[1024]; /* if non zero, the image is a diff of
this file image */
int is_windows_drive(const char *filename);
#endif
-struct DriveInfo;
-
typedef struct BlockConf {
- struct DriveInfo *dinfo;
+ BlockDriverState *bs;
uint16_t physical_block_size;
uint16_t logical_block_size;
uint16_t min_io_size;
{
unsigned int exp = 0, size;
- for (size = conf->physical_block_size; size > 512; size >>= 1) {
+ for (size = conf->physical_block_size;
+ size > conf->logical_block_size;
+ size >>= 1) {
exp++;
}
}
#define DEFINE_BLOCK_PROPERTIES(_state, _conf) \
- DEFINE_PROP_DRIVE("drive", _state, _conf.dinfo), \
+ DEFINE_PROP_DRIVE("drive", _state, _conf.bs), \
DEFINE_PROP_UINT16("logical_block_size", _state, \
_conf.logical_block_size, 512), \
DEFINE_PROP_UINT16("physical_block_size", _state, \