Re: [PATCH 03/12] qemu: Separate formatting from saving into caps cache

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

 



On Thu, May 05, 2016 at 18:42:05 +0200, Jiri Denemark wrote:
> We will need to use the formatter directly for testing QEMU capabilities
> code.
> 
> Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
> ---
>  src/qemu/qemu_capabilities.c | 32 ++++++++++++++++++++++----------
>  1 file changed, 22 insertions(+), 10 deletions(-)
> 
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index c2ba69d..862aed0 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c

[...]

> @@ -3094,10 +3095,21 @@ virQEMUCapsSaveCache(virQEMUCapsPtr qemuCaps, const char *filename)
>      virBufferAdjustIndent(&buf, -2);
>      virBufferAddLit(&buf, "</qemuCaps>\n");
>  
> -    if (virBufferCheckError(&buf) < 0)
> -        goto cleanup;
> +    if (virBufferCheckError(&buf) == 0)
> +        ret = virBufferContentAndReset(&buf);
>  
> -    xml = virBufferContentAndReset(&buf);
> +    return ret;
> +}
> +

Two newlines to separate functions.

> +static int
> +virQEMUCapsSaveCache(virQEMUCapsPtr qemuCaps, const char *filename)
> +{
> +    char *xml = NULL;
> +    int ret = -1;
> +
> +    xml = virQEMUCapsFormatCache(qemuCaps,
> +                                 virGetSelfLastChanged(),
> +                                 LIBVIR_VERSION_NUMBER);
>  
>      if (virFileWriteStr(filename, xml, 0600) < 0) {
>          virReportSystemError(errno,

ACK

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]