On 07/18/2018 03:57 AM, [email protected] wrote:
> From: Bing Niu <[email protected]>
>
> Refactor virResctrlAllocFormat so that it is easy to support other
> resource allocation technologies.
>
> Signed-off-by: Bing Niu <[email protected]>
> ---
> src/util/virresctrl.c | 43 ++++++++++++++++++++++++++++---------------
> 1 file changed, 28 insertions(+), 15 deletions(-)
>
> diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c
> index 98e7296..1515de2 100644
> --- a/src/util/virresctrl.c
> +++ b/src/util/virresctrl.c
> @@ -848,17 +848,13 @@ virResctrlAllocGetID(virResctrlAllocPtr alloc)
> }
>
>
> -char *
> -virResctrlAllocFormat(virResctrlAllocPtr alloc)
> +static int
> +virResctrlAllocFormatCache(virResctrlAllocPtr alloc, virBufferPtr buf)
One argument per line. I'll adjust.
> {
> - virBuffer buf = VIR_BUFFER_INITIALIZER;
> unsigned int level = 0;
> unsigned int type = 0;
> unsigned int cache = 0;
>
[...]
>
> - virBufferCheckError(&buf);
> + if (virBufferCheckError(buf) < 0)
> + return -1;
> + else
> + return 0;
Just return virBufferCheckError(buf); directly
I'll adjust before pushing.
Reviewed-by: John Ferlan <[email protected]>
John
--
libvir-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libvir-list