[libvirt] [PATCH] qemu: Fix qemuMonitorCreateObjectProps

Ján Tomko jtomko at redhat.com
Mon Jun 18 12:35:46 UTC 2018


The commit message is one long sentence and a bit hard to read.

On Mon, Jun 18, 2018 at 07:56:35AM -0400, John Ferlan wrote:
>Commit id f0a23c0c3 introduced qemuMonitorCreateObjectProps
>to manage wrapping the object name and alias; however, calling

Listing the commit that broke it can be in a separate paragraph.

>virJSONValueObjectCreateVArgs and checking a unary ! return
>status meant when the CreateVAArgs function returned zero, then
>rather than generating a @propsret, the jump to cleanup would

Rather than explaing the semantics of C operators, it would be helpful
to mention that virJSONValueObjectCreateVArgs returns -1 on failure
and 0 when we did not need to add any arguments.


>result in an unexpected failure and cause virsh to issue the
>"error: An error occurred, but the cause is unknown" error
>message for something like "virsh iothreadadd $DOM 10" (assuming
>that IOThread 10 didn't already exist).

Putting the example error message and virsh commands on separate lines
would make the commit message easier to read.

>
>Signed-off-by: John Ferlan <jferlan at redhat.com>
>---
> src/qemu/qemu_monitor.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
>index b29672d4f1..d6771c1d52 100644
>--- a/src/qemu/qemu_monitor.c
>+++ b/src/qemu/qemu_monitor.c
>@@ -3051,7 +3051,7 @@ qemuMonitorCreateObjectProps(virJSONValuePtr *propsret,
>
>     va_start(args, alias);
>
>-    if (!(virJSONValueObjectCreateVArgs(&props, args)))
>+    if (virJSONValueObjectCreateVArgs(&props, args) < 0)

Looks like qemuDomainHotplugAddIOThread is the only user of qemuMonitorCreateObjectProps
passing NULL for args. Can it be tested by our test suite?

With more newlines in the commit message:

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: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180618/7af0c668/attachment-0001.sig>


More information about the libvir-list mailing list