qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v6 04/14] block/amend: separate amend and create options for


From: Eric Blake
Subject: Re: [PATCH v6 04/14] block/amend: separate amend and create options for qemu-img
Date: Thu, 14 May 2020 11:10:02 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

On 5/14/20 7:28 AM, Max Reitz wrote:
On 10.05.20 15:40, Maxim Levitsky wrote:
Some options are only useful for creation
(or hard to be amended, like cluster size for qcow2), while some other
options are only useful for amend, like upcoming keyslot management
options for luks


+#define QCOW_COMMON_OPTIONS \
+    {                                                               \

+        .help = "Width of a reference count entry in bits",         \
+        .def_value_str = "16"                                       \
+    }                                                               \

I think the last line should have a comma in it (otherwise the final
backslash doesn’t make much sense, because whenever we’d add a new
option, we would need to modify the line anyway to insert a comma).

Except that...


Speaking of adding option, this requires a rebase due to the
compression_type option added (not trivial in the strict sense, but
still straightforward to handle).

+
  static QemuOptsList qcow2_create_opts = {
      .name = "qcow2-create-opts",
      .head = QTAILQ_HEAD_INITIALIZER(qcow2_create_opts.head),
      .desc = {


[...]

+        QCOW_COMMON_OPTIONS,
+        { /* end of list */ }

...the intended usage is to use the macro name followed by a comma, so including a trailing comma in the macro itself would lead to a syntax error. I think the better fix is to eliminate the trailing \ on the final line, and have '}' without a trailing comma in the macro.

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]