]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Remove iothread 'poll-' value validation
authorPeter Krempa <pkrempa@redhat.com>
Wed, 19 Apr 2023 10:37:01 +0000 (12:37 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 2 May 2023 12:32:47 +0000 (14:32 +0200)
QEMU accepts even values bigger than INT_MAX. The reasoning for these
checks was that the QAPI definition declares them as 'int', but in QAPI
terms that's any number as it's JSON.

Remove the validation as well as the comment misinterpreting the QAPI
definiton.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_driver.c
src/qemu/qemu_monitor_json.c

index 16a7f7acd306f591b60a1aa4606ed6d73485a492..c23b30542be0087aec24da9f13f69e162b4dc25b 100644 (file)
@@ -5234,27 +5234,6 @@ qemuDomainIOThreadParseParams(virTypedParameterPtr params,
     if (rc == 1)
         iothread->set_thread_pool_max = true;
 
-    if (iothread->set_poll_max_ns && iothread->poll_max_ns > INT_MAX) {
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("poll-max-ns (%1$llu) must be less than or equal to %2$d"),
-                       iothread->poll_max_ns, INT_MAX);
-        return -1;
-    }
-
-    if (iothread->set_poll_grow && iothread->poll_grow > INT_MAX) {
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("poll-grow (%1$u) must be less than or equal to %2$d"),
-                         iothread->poll_grow, INT_MAX);
-        return -1;
-    }
-
-    if (iothread->set_poll_shrink && iothread->poll_shrink > INT_MAX) {
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("poll-shrink (%1$u) must be less than or equal to %2$d"),
-                       iothread->poll_shrink, INT_MAX);
-        return -1;
-    }
-
     if (iothread->set_thread_pool_min && iothread->thread_pool_min < -1) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
                        _("thread_pool_min (%1$d) must be equal to or greater than -1"),
index b2c0b20a11eae8f8396a5cb789ee7c7b3c59bc8d..3454e85e43b9a6062ddd916f5084de1ffcfb4a17 100644 (file)
@@ -7128,13 +7128,6 @@ qemuMonitorJSONGetIOThreads(qemuMonitor *mon,
             goto cleanup;
         }
 
-        /* Fetch poll values (since QEMU 2.9 ) if available. QEMU
-         * stores these values as int64_t's; however, the qapi type
-         * is an int. The qapi/misc.json also mis-describes the grow
-         * and shrink values as pure add/remove values. The source
-         * util/aio-posix.c function aio_poll uses them as a factor
-         * or divisor in it's calculation. We will fetch and store
-         * them as defined in our structures. */
         if (virJSONValueObjectGetNumberUlong(child, "poll-max-ns",
                                              &info->poll_max_ns) == 0 &&
             virJSONValueObjectGetNumberUint(child, "poll-grow",