diff mbox

[2/4] block/rbd: code movement

Message ID 6f1d60bdbbb4e82991c699d4aa6666c4317a1c5d.1488180142.git.jcody@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jeff Cody Feb. 27, 2017, 7:30 a.m. UTC
Signed-off-by: Jeff Cody <jcody@redhat.com>
---
 block/rbd.c | 64 +++++++++++++++++++++++++++++++++++++++++++------------------
 1 file changed, 45 insertions(+), 19 deletions(-)

Comments

Daniel P. Berrangé Feb. 27, 2017, 9:28 a.m. UTC | #1
Describing this as "code movement" when the added & removed chunks are not
identical is a bit misleading.

Can you expand the commit message to explain why the extra options are
being added

On Mon, Feb 27, 2017 at 02:30:39AM -0500, Jeff Cody wrote:
> Signed-off-by: Jeff Cody <jcody@redhat.com>
> ---
>  block/rbd.c | 64 +++++++++++++++++++++++++++++++++++++++++++------------------
>  1 file changed, 45 insertions(+), 19 deletions(-)
> 
> diff --git a/block/rbd.c b/block/rbd.c
> index 3f1a9de..c8d4eb1 100644
> --- a/block/rbd.c
> +++ b/block/rbd.c
> @@ -357,6 +357,51 @@ static void qemu_rbd_memset(RADOSCB *rcb, int64_t offs)
>      }
>  }
>  
> +static QemuOptsList runtime_opts = {
> +    .name = "rbd",
> +    .head = QTAILQ_HEAD_INITIALIZER(runtime_opts.head),
> +    .desc = {
> +        {
> +            .name = "filename",
> +            .type = QEMU_OPT_STRING,
> +            .help = "Specification of the rbd image",
> +        },
> +        {
> +            .name = "password-secret",
> +            .type = QEMU_OPT_STRING,
> +            .help = "ID of secret providing the password",
> +        },
> +        {
> +            .name = "conf",
> +            .type = QEMU_OPT_STRING,
> +        },
> +        {
> +            .name = "pool",
> +            .type = QEMU_OPT_STRING,
> +        },
> +        {
> +            .name = "image",
> +            .type = QEMU_OPT_STRING,
> +        },
> +        {
> +            .name = "snapshot",
> +            .type = QEMU_OPT_STRING,
> +        },
> +        {
> +            /* you might be tempted to call this 'id' to match
> +             * the ceph documentation, but then it'll get gobbled
> +             * up in the block layer before it gets to the image driver */
> +            .name = "rbd-id",
> +            .type = QEMU_OPT_STRING,
> +        },
> +        {
> +            .name = "keyvalue-pairs",
> +            .type = QEMU_OPT_STRING,
> +        },
> +        { /* end of list */ }
> +    },
> +};
> +
>  static int qemu_rbd_create(const char *filename, QemuOpts *opts, Error **errp)
>  {
>      Error *local_err = NULL;
> @@ -500,25 +545,6 @@ static void qemu_rbd_complete_aio(RADOSCB *rcb)
>      qemu_aio_unref(acb);
>  }
>  
> -/* TODO Convert to fine grained options */
> -static QemuOptsList runtime_opts = {
> -    .name = "rbd",
> -    .head = QTAILQ_HEAD_INITIALIZER(runtime_opts.head),
> -    .desc = {
> -        {
> -            .name = "filename",
> -            .type = QEMU_OPT_STRING,
> -            .help = "Specification of the rbd image",
> -        },
> -        {
> -            .name = "password-secret",
> -            .type = QEMU_OPT_STRING,
> -            .help = "ID of secret providing the password",
> -        },
> -        { /* end of list */ }
> -    },
> -};
> -
>  static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags,
>                           Error **errp)
>  {
> -- 
> 2.9.3
> 

Regards,
Daniel
Jeff Cody Feb. 27, 2017, 1:14 p.m. UTC | #2
On Mon, Feb 27, 2017 at 09:28:56AM +0000, Daniel P. Berrange wrote:
> 
> Describing this as "code movement" when the added & removed chunks are not
> identical is a bit misleading.
> 
> Can you expand the commit message to explain why the extra options are
> being added

Ah, sorry - yes.  The lack of a commit message was a mistake when squashing
patches.

> 
> On Mon, Feb 27, 2017 at 02:30:39AM -0500, Jeff Cody wrote:
> > Signed-off-by: Jeff Cody <jcody@redhat.com>
> > ---
> >  block/rbd.c | 64 +++++++++++++++++++++++++++++++++++++++++++------------------
> >  1 file changed, 45 insertions(+), 19 deletions(-)
> > 
> > diff --git a/block/rbd.c b/block/rbd.c
> > index 3f1a9de..c8d4eb1 100644
> > --- a/block/rbd.c
> > +++ b/block/rbd.c
> > @@ -357,6 +357,51 @@ static void qemu_rbd_memset(RADOSCB *rcb, int64_t offs)
> >      }
> >  }
> >  
> > +static QemuOptsList runtime_opts = {
> > +    .name = "rbd",
> > +    .head = QTAILQ_HEAD_INITIALIZER(runtime_opts.head),
> > +    .desc = {
> > +        {
> > +            .name = "filename",
> > +            .type = QEMU_OPT_STRING,
> > +            .help = "Specification of the rbd image",
> > +        },
> > +        {
> > +            .name = "password-secret",
> > +            .type = QEMU_OPT_STRING,
> > +            .help = "ID of secret providing the password",
> > +        },
> > +        {
> > +            .name = "conf",
> > +            .type = QEMU_OPT_STRING,
> > +        },
> > +        {
> > +            .name = "pool",
> > +            .type = QEMU_OPT_STRING,
> > +        },
> > +        {
> > +            .name = "image",
> > +            .type = QEMU_OPT_STRING,
> > +        },
> > +        {
> > +            .name = "snapshot",
> > +            .type = QEMU_OPT_STRING,
> > +        },
> > +        {
> > +            /* you might be tempted to call this 'id' to match
> > +             * the ceph documentation, but then it'll get gobbled
> > +             * up in the block layer before it gets to the image driver */
> > +            .name = "rbd-id",
> > +            .type = QEMU_OPT_STRING,
> > +        },
> > +        {
> > +            .name = "keyvalue-pairs",
> > +            .type = QEMU_OPT_STRING,
> > +        },
> > +        { /* end of list */ }
> > +    },
> > +};
> > +
> >  static int qemu_rbd_create(const char *filename, QemuOpts *opts, Error **errp)
> >  {
> >      Error *local_err = NULL;
> > @@ -500,25 +545,6 @@ static void qemu_rbd_complete_aio(RADOSCB *rcb)
> >      qemu_aio_unref(acb);
> >  }
> >  
> > -/* TODO Convert to fine grained options */
> > -static QemuOptsList runtime_opts = {
> > -    .name = "rbd",
> > -    .head = QTAILQ_HEAD_INITIALIZER(runtime_opts.head),
> > -    .desc = {
> > -        {
> > -            .name = "filename",
> > -            .type = QEMU_OPT_STRING,
> > -            .help = "Specification of the rbd image",
> > -        },
> > -        {
> > -            .name = "password-secret",
> > -            .type = QEMU_OPT_STRING,
> > -            .help = "ID of secret providing the password",
> > -        },
> > -        { /* end of list */ }
> > -    },
> > -};
> > -
> >  static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags,
> >                           Error **errp)
> >  {
> > -- 
> > 2.9.3
> > 
> 
> Regards,
> Daniel
> -- 
> |: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
> |: http://libvirt.org              -o-             http://virt-manager.org :|
> |: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|
diff mbox

Patch

diff --git a/block/rbd.c b/block/rbd.c
index 3f1a9de..c8d4eb1 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -357,6 +357,51 @@  static void qemu_rbd_memset(RADOSCB *rcb, int64_t offs)
     }
 }
 
+static QemuOptsList runtime_opts = {
+    .name = "rbd",
+    .head = QTAILQ_HEAD_INITIALIZER(runtime_opts.head),
+    .desc = {
+        {
+            .name = "filename",
+            .type = QEMU_OPT_STRING,
+            .help = "Specification of the rbd image",
+        },
+        {
+            .name = "password-secret",
+            .type = QEMU_OPT_STRING,
+            .help = "ID of secret providing the password",
+        },
+        {
+            .name = "conf",
+            .type = QEMU_OPT_STRING,
+        },
+        {
+            .name = "pool",
+            .type = QEMU_OPT_STRING,
+        },
+        {
+            .name = "image",
+            .type = QEMU_OPT_STRING,
+        },
+        {
+            .name = "snapshot",
+            .type = QEMU_OPT_STRING,
+        },
+        {
+            /* you might be tempted to call this 'id' to match
+             * the ceph documentation, but then it'll get gobbled
+             * up in the block layer before it gets to the image driver */
+            .name = "rbd-id",
+            .type = QEMU_OPT_STRING,
+        },
+        {
+            .name = "keyvalue-pairs",
+            .type = QEMU_OPT_STRING,
+        },
+        { /* end of list */ }
+    },
+};
+
 static int qemu_rbd_create(const char *filename, QemuOpts *opts, Error **errp)
 {
     Error *local_err = NULL;
@@ -500,25 +545,6 @@  static void qemu_rbd_complete_aio(RADOSCB *rcb)
     qemu_aio_unref(acb);
 }
 
-/* TODO Convert to fine grained options */
-static QemuOptsList runtime_opts = {
-    .name = "rbd",
-    .head = QTAILQ_HEAD_INITIALIZER(runtime_opts.head),
-    .desc = {
-        {
-            .name = "filename",
-            .type = QEMU_OPT_STRING,
-            .help = "Specification of the rbd image",
-        },
-        {
-            .name = "password-secret",
-            .type = QEMU_OPT_STRING,
-            .help = "ID of secret providing the password",
-        },
-        { /* end of list */ }
-    },
-};
-
 static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags,
                          Error **errp)
 {