qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 3/4] qcow2: Add overlap-check.template option


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH 3/4] qcow2: Add overlap-check.template option
Date: Wed, 20 Aug 2014 21:30:51 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0

On 20.08.2014 21:22, Eric Blake wrote:
On 08/20/2014 11:59 AM, Max Reitz wrote:
Being able to set the overlap-check option to a string and then refine
it via the overlap-check.* options is a nice idea for the command line
but does not work so well for non-flattened dicts. In that case, one can
only specify either but not both, so add a field to overlap-check.*
which does the same as directly specifying overlap-check but can be used
in conjunction with the other fields in non-flattened dicts.

Signed-off-by: Max Reitz <address@hidden>
---
  block/qcow2.c | 24 ++++++++++++++++++++++--
  block/qcow2.h |  1 +
  2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/block/qcow2.c b/block/qcow2.c
index c64d611..c6099b5 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -403,6 +403,12 @@ static QemuOptsList qcow2_runtime_opts = {
                      "templates (none, constant, cached, all)",
          },
          {
+            .name = QCOW2_OPT_OVERLAP_TEMPLATE,
+            .type = QEMU_OPT_STRING,
+            .help = "Selects which overlap checks to perform from a range of "
+                    "templates (none, constant, cached, all)",
+        },
+        {
Okay, I see where this is headed.  The QMP will allow either
'overlap-check':'all' (resolve all defaults according to a template
name), or 'overlap-check':{'template':'all','inactive-l1':'none'} (that
is, a struct, where the struct also sets a default but also provides
per-item overrides).

Yes, it's my fault for not thinking about how well the second case would work for non-flattened dicts when I originally introduced these options.

Max

It took me a couple of reads of this in tandem
with 4/4, but it looks correct.



reply via email to

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