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