Re: [PATCH 7/8] test: Refactor testDomainSetVcpusFlags

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

 



On Tue, Jun 16, 2015 at 07:43:19PM +0200, Peter Krempa wrote:
> Remove the bogous flag check and refactor the code by using

s/bogous/bogus

> virDomainObjGetDefs instead of virDomainObjGetPersistentDef.
> ---
>  src/test/test_driver.c | 68 +++++++++++++++++---------------------------------
>  1 file changed, 23 insertions(+), 45 deletions(-)
> 
> diff --git a/src/test/test_driver.c b/src/test/test_driver.c
> index 59e2031..cfec122 100644
> --- a/src/test/test_driver.c
> +++ b/src/test/test_driver.c

> 
> -    if (nrCpus > maxvcpus) {
> +    if ((def &&
> +         def->maxvcpus < nrCpus) ||
> +        (persistentDef &&
> +         !(flags & VIR_DOMAIN_VCPU_MAXIMUM) &&
> +         persistentDef->maxvcpus < nrCpus)) {
>          virReportError(VIR_ERR_INVALID_ARG,
>                         _("requested cpu amount exceeds maximum (%d > %d)"),
>                         nrCpus, maxvcpus);

The comparison uses {persistentD,d}ef->maxvcpus, but the error message
shows maxvcpus.

>          goto cleanup;
>      }
> 
> -    if (!(persistentDef = virDomainObjGetPersistentDef(privconn->caps,
> -                                                       privconn->xmlopt,
> -                                                       privdom)))
> +    if (def &&
> +        testDomainUpdateVCPUs(privconn, privdom, nrCpus, 0) < 0)
>          goto cleanup;
> 

ACK with those fixes.

Jan

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]