[libvirt] [PATCH 22/34] qemu: monitor: Remove weird return values from qemuMonitorSetCPU
Peter Krempa
pkrempa at redhat.com
Thu Nov 26 11:43:06 UTC 2015
On Mon, Nov 23, 2015 at 15:07:32 -0500, John Ferlan wrote:
> On 11/20/2015 10:22 AM, Peter Krempa wrote:
> > Let the function report errors internally and change it to return
> > standard return codes.
> > ---
> > src/qemu/qemu_driver.c | 22 ++++------------------
> > src/qemu/qemu_monitor_json.c | 4 ----
> > src/qemu/qemu_monitor_text.c | 22 +++++++++++-----------
> > 3 files changed, 15 insertions(+), 33 deletions(-)
> >
[...]
> > diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
> > index 86b8c7b..50d6f62 100644
> > --- a/src/qemu/qemu_monitor_json.c
> > +++ b/src/qemu/qemu_monitor_json.c
>
> Need to adjust comments here... Probably could move the comments to
> qemuMonitorSetCPU just so it doesn't cause chase into second level to
> know what function returns.
Oh, indeed I missed the comment. I've removed it and used the one from
the text monitor in the monitor dispatcher file.
>
> > @@ -2188,10 +2188,6 @@ int qemuMonitorJSONSetCPU(qemuMonitorPtr mon,
> > else
> > ret = qemuMonitorJSONCheckError(cmd, reply);
> >
> > - /* this function has non-standard return values, so adapt it */
> > - if (ret == 0)
> > - ret = 1;
> > -
> > cleanup:
> > virJSONValueFree(cmd);
> > virJSONValueFree(reply);
> > diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
> > index f44da20..fd38d01 100644
> > --- a/src/qemu/qemu_monitor_text.c
> > +++ b/src/qemu/qemu_monitor_text.c
> > @@ -1137,8 +1137,7 @@ qemuMonitorTextSetBalloon(qemuMonitorPtr mon,
> >
> >
> > /*
> > - * Returns: 0 if CPU hotplug not supported, +1 if CPU hotplug worked
> > - * or -1 on failure
> > + * Returns: 0 if CPU modification was successful or -1 on failure
> > */
>
> Could copy/move the comment to qemuMonitorSetCPU
Done. Thanks for the suggestion.
>
> ACK - as long as JSON function comments modified.
>
> John
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20151126/70d543b5/attachment-0001.sig>
More information about the libvir-list
mailing list