qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Chunyan Liu <cyliu@suse.com>, qemu-devel@nongnu.org
Cc: stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH v23 04/32] change opt->name and opt->str from (const char *) to (char *)
Date: Tue, 25 Mar 2014 13:23:32 -0600	[thread overview]
Message-ID: <5331D7B4.2070101@redhat.com> (raw)
In-Reply-To: <1395396763-26081-5-git-send-email-cyliu@suse.com>

[-- Attachment #1: Type: text/plain, Size: 1522 bytes --]

On 03/21/2014 04:12 AM, Chunyan Liu wrote:

Your subject says "what", but your commit message lacks a "why".
Without a good reason, it's hard to see what this patch is good for.
May I suggest:

qemu_opt_del() already assumes that all QemuOpt instances contain
malloc'd name and value; but it had to cast away const because
opts_start_struct() was doing its own thing and using static storage
instead.  By using the correct type and malloced strings everywhere, the
usage of this struct becomes clearer.

> Signed-off-by: Chunyan Liu <cyliu@suse.com>
> ---
>  include/qemu/option_int.h |  4 ++--
>  qapi/opts-visitor.c       | 10 +++++++---
>  util/qemu-option.c        |  4 ++--
>  3 files changed, 11 insertions(+), 7 deletions(-)
> 
> diff --git a/include/qemu/option_int.h b/include/qemu/option_int.h
> index 8212fa4..db9ed91 100644
> --- a/include/qemu/option_int.h
> +++ b/include/qemu/option_int.h
> @@ -30,8 +30,8 @@
>  #include "qemu/error-report.h"
>  
>  struct QemuOpt {
> -    const char   *name;
> -    const char   *str;
> +    char   *name;
> +    char   *str;

While touching this, is it worth trimming the extra spacing before '*'?
 It's not like you are preserving alignment or anything.  But as that's
cosmetic, and as the code itself is correct, I'm fine if you add this
when you expand your commit message:

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  parent reply	other threads:[~2014-03-25 19:23 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-21 10:12 [Qemu-devel] [PATCH v23 00/32] replace QEMUOptionParameter with QemuOpts Chunyan Liu
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 01/32] move find_desc_by_name ahead for later calling Chunyan Liu
2014-03-21 23:16   ` Eric Blake
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 02/32] add def_value_str to QemuOptDesc Chunyan Liu
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 03/32] qapi: output def_value_str when query command line options Chunyan Liu
2014-03-21 23:27   ` Eric Blake
2014-03-24  3:18     ` Chun Yan Liu
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 04/32] change opt->name and opt->str from (const char *) to (char *) Chunyan Liu
2014-03-25 19:00   ` Leandro Dorileo
2014-03-25 19:23   ` Eric Blake [this message]
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 05/32] move qemu_opt_del ahead for later calling Chunyan Liu
2014-03-25 19:29   ` Eric Blake
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 06/32] add qemu_opt_get_*_del functions for replace work Chunyan Liu
2014-03-25 20:33   ` Eric Blake
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 07/32] add qemu_opts_print_help to replace print_option_help Chunyan Liu
2014-03-25 19:07   ` Leandro Dorileo
2014-03-25 20:43   ` Eric Blake
2014-03-26  2:58     ` Chunyan Liu
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 08/32] add convert functions between QEMUOptionParameter to QemuOpts Chunyan Liu
2014-03-25 21:35   ` Eric Blake
2014-03-26  3:26     ` Chunyan Liu
2014-03-26  6:30     ` Chunyan Liu
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 09/32] add qemu_opts_append to repalce append_option_parameters Chunyan Liu
2014-03-25 19:13   ` Leandro Dorileo
2014-03-25 21:40   ` Eric Blake
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 10/32] check NULL input for qemu_opts_del Chunyan Liu
2014-03-25 21:41   ` Eric Blake
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 11/32] qemu_opts_print: change fprintf stderr to printf Chunyan Liu
2014-03-25 20:10   ` Leandro Dorileo
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 12/32] qcow2.c: remove 'assigned' check in amend Chunyan Liu
2014-03-25 19:25   ` Leandro Dorileo
2014-03-26  7:37     ` Chunyan Liu
2014-03-27  7:27       ` Chunyan Liu
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 13/32] change block layer to support both QemuOpts and QEMUOptionParamter Chunyan Liu
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 14/32] vvfat.c: handle cross_driver's create_options and create_opts Chunyan Liu
2014-03-25 19:17   ` Leandro Dorileo
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 15/32] cow.c: replace QEMUOptionParameter with QemuOpts Chunyan Liu
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 16/32] gluster.c: " Chunyan Liu
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 17/32] iscsi.c: " Chunyan Liu
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 18/32] qcow.c: " Chunyan Liu
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 19/32] qcow2.c: " Chunyan Liu
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 20/32] qed.c: " Chunyan Liu
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 21/32] raw-posix.c: " Chunyan Liu
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 22/32] raw-win32.c: " Chunyan Liu
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 23/32] raw_bsd.c: " Chunyan Liu
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 24/32] rbd.c: " Chunyan Liu
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 25/32] sheepdog.c: " Chunyan Liu
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 26/32] ssh.c: " Chunyan Liu
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 27/32] vdi.c: " Chunyan Liu
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 28/32] vhdx.c: " Chunyan Liu
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 29/32] vmdk.c: " Chunyan Liu
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 30/32] vpc.c: " Chunyan Liu
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 31/32] cleanup QEMUOptionParameter Chunyan Liu
2014-03-25 18:02   ` Leandro Dorileo
2014-03-21 10:12 ` [Qemu-devel] [PATCH v23 32/32] cleanup tmp 'mallocd' member from QemuOptsList Chunyan Liu
2014-03-25 18:09 ` [Qemu-devel] [PATCH v23 00/32] replace QEMUOptionParameter with QemuOpts Leandro Dorileo
2014-03-25 20:22   ` Leandro Dorileo
2014-03-26 15:18   ` Stefan Hajnoczi
2014-03-27  7:20     ` Chunyan Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5331D7B4.2070101@redhat.com \
    --to=eblake@redhat.com \
    --cc=cyliu@suse.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).