summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBenoƮt Canet <benoit@irqsave.net>2013-09-24 17:07:04 +0200
committerKevin Wolf <kwolf@redhat.com>2013-09-25 16:21:28 +0200
commit030be32184034261da14693b69e9582f6fe4af9d (patch)
treef4e1df2addee8730fa499e883690224d01d72113 /include
parent2fe2e2907163f6d86b6bbced776ec8f9319ca83f (diff)
downloadqemu-030be32184034261da14693b69e9582f6fe4af9d.tar.gz
qemu-030be32184034261da14693b69e9582f6fe4af9d.tar.bz2
qemu-030be32184034261da14693b69e9582f6fe4af9d.zip
block: introduce BlockDriver.bdrv_needs_filename to enable some drivers.
Some drivers will have driver specifics options but no filename. This new bool allow the block layer to treat them correctly. The .bdrv_needs_filename is set in drivers not having .bdrv_parse_filename and not having .bdrv_open. The first exception to this rule will be the quorum driver. Signed-off-by: Benoit Canet <benoit@irqsave.net> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/block/block_int.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 3eeb6fe2a4..211087aa91 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -73,6 +73,12 @@ struct BlockDriver {
/* Any driver implementing this callback is expected to be able to handle
* NULL file names in its .bdrv_open() implementation */
void (*bdrv_parse_filename)(const char *filename, QDict *options, Error **errp);
+ /* Drivers not implementing bdrv_parse_filename nor bdrv_open should have
+ * this field set to true, except ones that are defined only by their
+ * child's bs.
+ * An example of the last type will be the quorum block driver.
+ */
+ bool bdrv_needs_filename;
/* For handling image reopen for split or non-split files */
int (*bdrv_reopen_prepare)(BDRVReopenState *reopen_state,