[libvirt] [PATCH 3/4] conf: Refactor the iothreadid initialization

Peter Krempa pkrempa at redhat.com
Tue Oct 13 16:14:16 UTC 2015


On Tue, Oct 13, 2015 at 11:47:09 -0400, John Ferlan wrote:
> Create a separate local API that will fill in the iothreadid array
> entries that were not defined by <iothread id='#'> entries in the XML.
> 
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
>  src/conf/domain_conf.c | 47 +++++++++++++++++++++++++++++++----------------
>  1 file changed, 31 insertions(+), 16 deletions(-)
> 
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 65e0d8e..217179d 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -2329,6 +2329,35 @@ virDomainIOThreadIDDefArrayFree(virDomainIOThreadIDDefPtr *def,
>  }
>  
>  
> +static int
> +virDomainIOThreadIDDefArrayInit(virDomainDefPtr def)
> +{
> +    unsigned int iothread_id = 1;
> +    int retval = -1;
> +
> +    /* Same value (either 0 or some number), then we have none to fill in or
> +     * the iothreadid array was filled from the XML

The previous comment removed later was a bit easier to read.

> +     */
> +    if (def->iothreads == def->niothreadids)
> +        return 0;

ACK,

Peter
-------------- 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/20151013/74c4e1da/attachment-0001.sig>


More information about the libvir-list mailing list