[PATCH 3/3] qemu: Use virJSONValueObjectGetStringArray() more

Ján Tomko jtomko at redhat.com
Tue Dec 1 15:47:00 UTC 2020


On a Tuesday in 2020, Michal Privoznik wrote:
>In a few commit back (v6.10.0-5-gb3dad96972) a new helper for
>obtaining string arrays from a virJSONObject was introduced:
>virJSONValueObjectGetStringArray(). I've identified three places
>where it can be used instead of open coding it:
>qemuAgentSSHGetAuthorizedKeys(),
>qemuMonitorJSONGetStringListProperty() and
>qemuMonitorJSONGetCPUDefinitions().
>
>Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>---
> src/qemu/qemu_agent.c        | 30 +++----------------
> src/qemu/qemu_monitor_json.c | 56 +++++-------------------------------
> 2 files changed, 11 insertions(+), 75 deletions(-)
>
>@@ -6788,9 +6764,6 @@ qemuMonitorJSONGetStringListProperty(qemuMonitorPtr mon,
>     g_autoptr(virJSONValue) cmd = NULL;
>     g_autoptr(virJSONValue) reply = NULL;
>     VIR_AUTOSTRINGLIST list = NULL;

list is now unused:
../src/qemu/qemu_monitor_json.c:6766:24: error: unused variable 'list' [-Werror,-Wunused-variable]
     VIR_AUTOSTRINGLIST list = NULL;
                        ^
1 error generated.

>-    virJSONValuePtr data;
>-    size_t n;
>-    size_t i;
>
>     *strList = NULL;
>

with that fixed:

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20201201/476ddd5c/attachment-0001.sig>


More information about the libvir-list mailing list