|
@@ -126,6 +126,8 @@ struct BlockDriver {
|
|
|
|
|
|
int (*bdrv_open)(BlockDriverState *bs, QDict *options, int flags,
|
|
int (*bdrv_open)(BlockDriverState *bs, QDict *options, int flags,
|
|
Error **errp);
|
|
Error **errp);
|
|
|
|
+
|
|
|
|
+ /* Protocol drivers should implement this instead of bdrv_open */
|
|
int (*bdrv_file_open)(BlockDriverState *bs, QDict *options, int flags,
|
|
int (*bdrv_file_open)(BlockDriverState *bs, QDict *options, int flags,
|
|
Error **errp);
|
|
Error **errp);
|
|
void (*bdrv_close)(BlockDriverState *bs);
|
|
void (*bdrv_close)(BlockDriverState *bs);
|
|
@@ -251,6 +253,12 @@ struct BlockDriver {
|
|
*/
|
|
*/
|
|
int coroutine_fn (*bdrv_co_flush_to_os)(BlockDriverState *bs);
|
|
int coroutine_fn (*bdrv_co_flush_to_os)(BlockDriverState *bs);
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * Drivers setting this field must be able to work with just a plain
|
|
|
|
+ * filename with '<protocol_name>:' as a prefix, and no other options.
|
|
|
|
+ * Options may be extracted from the filename by implementing
|
|
|
|
+ * bdrv_parse_filename.
|
|
|
|
+ */
|
|
const char *protocol_name;
|
|
const char *protocol_name;
|
|
int (*bdrv_truncate)(BlockDriverState *bs, int64_t offset,
|
|
int (*bdrv_truncate)(BlockDriverState *bs, int64_t offset,
|
|
PreallocMode prealloc, Error **errp);
|
|
PreallocMode prealloc, Error **errp);
|