Patchwork [RFC,13/24] qed: add bdrv_qed_get_conversion_options()

login
register
mail settings
Submitter Devin Nakamura
Date July 29, 2011, 4:49 a.m.
Message ID <1311914994-20482-14-git-send-email-devin122@gmail.com>
Download mbox | patch
Permalink /patch/107342/
State New
Headers show

Comments

Devin Nakamura - July 29, 2011, 4:49 a.m.
Signed-off-by: Devin Nakamura <devin122@gmail.com>
---
 block/qed.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

Patch

diff --git a/block/qed.c b/block/qed.c
index 556512b..26e43e2 100644
--- a/block/qed.c
+++ b/block/qed.c
@@ -1594,6 +1594,18 @@  static int bdrv_qed_copy_header(BlockDriverState *bs)
     return 0;
 }
 
+static int bdrv_qed_get_conversion_options(BlockDriverState *bs,
+                                           BlockConversionOptions *options)
+{
+    BDRVQEDState* s = bs->opaque;
+
+    options->encryption_type = 0;
+    options->cluster_size = s->header.cluster_size;
+    options->allocation_size = options->cluster_size;
+    options->image_size = s->header.image_size;
+    return 0;
+}
+
 static QEMUOptionParameter qed_create_options[] = {
     {
         .name = BLOCK_OPT_SIZE,
@@ -1644,6 +1656,7 @@  static BlockDriver bdrv_qed = {
     .bdrv_get_mapping            = bdrv_qed_get_mapping,
     .bdrv_map                    = bdrv_qed_map,
     .bdrv_copy_header            = bdrv_qed_copy_header,
+    .bdrv_get_conversion_options = bdrv_qed_get_conversion_options,
 };
 
 static void bdrv_qed_init(void)