qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH v2 10/36] test-qemu-opts: Test qemu_opts_to_qdic


From: Eric Blake
Subject: Re: [Qemu-block] [PATCH v2 10/36] test-qemu-opts: Test qemu_opts_to_qdict_filtered()
Date: Wed, 21 Feb 2018 14:57:34 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 02/21/2018 07:53 AM, Kevin Wolf wrote:
Signed-off-by: Kevin Wolf <address@hidden>
---
  tests/test-qemu-opts.c | 125 +++++++++++++++++++++++++++++++++++++++++++++++++
  1 file changed, 125 insertions(+)

diff --git a/tests/test-qemu-opts.c b/tests/test-qemu-opts.c
index 6c3183390b..2c422abcd4 100644
--- a/tests/test-qemu-opts.c
+++ b/tests/test-qemu-opts.c
@@ -10,6 +10,7 @@
  #include "qemu/osdep.h"
  #include "qemu/cutils.h"
  #include "qemu/option.h"
+#include "qemu/option_int.h"
  #include "qapi/error.h"
  #include "qapi/qmp/qdict.h"
  #include "qapi/qmp/qstring.h"
@@ -868,6 +869,127 @@ static void test_opts_append(void)
      qemu_opts_free(merged);
  }
+static void test_opts_to_qdict_basic(void)
+{
+    QemuOpts *opts;
+    QDict *dict;
+
+    opts = qemu_opts_parse(&opts_list_01, "str1=foo,str2=,str3=bar,number1=42",
+                           false, &error_abort);

Worth any additional craziness in regards to our QemuOpts parsing, like str1=foo,,bar,str2... for an option containing commas, or str2=,str1=foo, for supplying options in a different order than the list? But what you have is a good addition even if you don't tweak it.

Reviewed-by: Eric Blake <address@hidden>

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



reply via email to

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