]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: Drop useless check when parsing cpu scheduler info
authorPeter Krempa <pkrempa@redhat.com>
Mon, 19 Oct 2015 12:36:14 +0000 (14:36 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 24 Nov 2015 12:42:55 +0000 (13:42 +0100)
The checked predicate is a deduction from the following checks:

1) maximum cpu id is checked for every parsed <vcpusched> element
2) the resulting bitmaps are checked for overlaps
3) there has to be at least one cpu per <vcpusched>

From the above checks we can indeed deduce that if we have one
<vcpusched> element per CPU we will have at most 'maxvcpus' of them.

Drop the explicit check since it's redundant.

src/conf/domain_conf.c

index 0ac7dbf249bd7e5092d47083ef91ac3cc4f4103d..616bf80acd16b3c336f8f92a945b4300d98a8c25 100644 (file)
@@ -15224,12 +15224,6 @@ virDomainDefParseXML(xmlDocPtr xml,
         goto error;
     }
     if (n) {
-        if (n > def->maxvcpus) {
-            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                           _("too many vcpusched nodes in cputune"));
-            goto error;
-        }
-
         if (VIR_ALLOC_N(def->cputune.vcpusched, n) < 0)
             goto error;
         def->cputune.nvcpusched = n;