Patchwork [1/2] block: New bdrv_get_flags()

login
register
mail settings
Submitter Markus Armbruster
Date June 5, 2012, 2:49 p.m.
Message ID <1338907765-22078-2-git-send-email-armbru@redhat.com>
Download mbox | patch
Permalink /patch/163091/
State New
Headers show

Comments

Markus Armbruster - June 5, 2012, 2:49 p.m.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 block.c |    5 +++++
 block.h |    1 +
 2 files changed, 6 insertions(+), 0 deletions(-)

Patch

diff --git a/block.c b/block.c
index 7547051..9a50843 100644
--- a/block.c
+++ b/block.c
@@ -2466,6 +2466,11 @@  const char *bdrv_get_device_name(BlockDriverState *bs)
     return bs->device_name;
 }
 
+int bdrv_get_flags(BlockDriverState *bs)
+{
+    return bs->open_flags;
+}
+
 void bdrv_flush_all(void)
 {
     BlockDriverState *bs;
diff --git a/block.h b/block.h
index 7408acc..d42dfb3 100644
--- a/block.h
+++ b/block.h
@@ -296,6 +296,7 @@  int bdrv_query_missing_keys(void);
 void bdrv_iterate_format(void (*it)(void *opaque, const char *name),
                          void *opaque);
 const char *bdrv_get_device_name(BlockDriverState *bs);
+int bdrv_get_flags(BlockDriverState *bs);
 int bdrv_write_compressed(BlockDriverState *bs, int64_t sector_num,
                           const uint8_t *buf, int nb_sectors);
 int bdrv_get_info(BlockDriverState *bs, BlockDriverInfo *bdi);