* poll_grow and poll_shrink parameters provided. A value set too large
* will cause more CPU time to be allocated the guest. A value set too
* small will not provide enough cycles for the guest to process data.
- * The polling interval is not available for statistical purposes.
+ * Accepted type is VIR_TYPED_PARAM_ULLONG.
*
* Since: 4.10.0
*/
* use to grow its polling interval up to the poll_max_ns value. A value
* of 0 (zero) allows the hypervisor to choose its own value. The algorithm
* to use for adjustment is hypervisor specific.
+ * Accepted type is VIR_TYPED_PARAM_UINT or since 9.3.0 VIR_TYPED_PARAM_ULLONG.
*
* Since: 4.10.0
*/
* the poll_max_ns value. A value of 0 (zero) allows the hypervisor to
* choose its own value. The algorithm to use for adjustment is hypervisor
* specific.
+ * Accepted type is VIR_TYPED_PARAM_UINT or since 9.3.0 VIR_TYPED_PARAM_ULLONG.
*
* Since: 4.10.0
*/
* "iothread.<id>.poll-max-ns" - maximum polling time in ns as an unsigned
* long long. A 0 (zero) means polling is
* disabled.
- * "iothread.<id>.poll-grow" - polling time factor as an unsigned int.
+ * "iothread.<id>.poll-grow" - polling time factor as an unsigned int or
+ * unsigned long long if exceeding range of
+ * unsigned int.
* A 0 (zero) indicates to allow the underlying
* hypervisor to choose how to grow the
* polling time.
- * "iothread.<id>.poll-shrink" - polling time divisor as an unsigned int.
- * A 0 (zero) indicates to allow the underlying
- * hypervisor to choose how to shrink the
- * polling time.
+ * "iothread.<id>.poll-shrink" - polling time divisor as an unsigned int or
+ * unsigned long long if exceeding range of
+ * unsigned int.
+ * A 0 (zero) indicates to allow the underlying
+ * hypervisor to choose how to shrink the
+ * polling time.
*
* VIR_DOMAIN_STATS_MEMORY:
* Return memory bandwidth statistics and the usage information. The typed
VIR_DOMAIN_IOTHREAD_POLL_MAX_NS,
VIR_TYPED_PARAM_ULLONG,
VIR_DOMAIN_IOTHREAD_POLL_GROW,
- VIR_TYPED_PARAM_UINT,
+ VIR_TYPED_PARAM_UNSIGNED,
VIR_DOMAIN_IOTHREAD_POLL_SHRINK,
- VIR_TYPED_PARAM_UINT,
+ VIR_TYPED_PARAM_UNSIGNED,
VIR_DOMAIN_IOTHREAD_THREAD_POOL_MIN,
VIR_TYPED_PARAM_INT,
VIR_DOMAIN_IOTHREAD_THREAD_POOL_MAX,
if (rc == 1)
iothread->set_poll_max_ns = true;
- if ((rc = virTypedParamsGetUInt(params, nparams,
- VIR_DOMAIN_IOTHREAD_POLL_GROW,
- &iothread->poll_grow)) < 0)
+ if ((rc = virTypedParamsGetUnsigned(params, nparams,
+ VIR_DOMAIN_IOTHREAD_POLL_GROW,
+ &iothread->poll_grow)) < 0)
return -1;
if (rc == 1)
iothread->set_poll_grow = true;
- if ((rc = virTypedParamsGetUInt(params, nparams,
- VIR_DOMAIN_IOTHREAD_POLL_SHRINK,
- &iothread->poll_shrink)) < 0)
+ if ((rc = virTypedParamsGetUnsigned(params, nparams,
+ VIR_DOMAIN_IOTHREAD_POLL_SHRINK,
+ &iothread->poll_shrink)) < 0)
return -1;
if (rc == 1)
iothread->set_poll_shrink = true;
virTypedParamListAddULLong(params, iothreads[i]->poll_max_ns,
"iothread.%u.poll-max-ns",
iothreads[i]->iothread_id);
- virTypedParamListAddUInt(params, iothreads[i]->poll_grow,
- "iothread.%u.poll-grow",
- iothreads[i]->iothread_id);
- virTypedParamListAddUInt(params, iothreads[i]->poll_shrink,
- "iothread.%u.poll-shrink",
- iothreads[i]->iothread_id);
+ virTypedParamListAddUnsigned(params, iothreads[i]->poll_grow,
+ "iothread.%u.poll-grow",
+ iothreads[i]->iothread_id);
+ virTypedParamListAddUnsigned(params, iothreads[i]->poll_shrink,
+ "iothread.%u.poll-shrink",
+ iothreads[i]->iothread_id);
}
}
int thread_id;
bool poll_valid;
unsigned long long poll_max_ns;
- unsigned int poll_grow;
- unsigned int poll_shrink;
+ unsigned long long poll_grow;
+ unsigned long long poll_shrink;
int thread_pool_min;
int thread_pool_max;
bool set_poll_max_ns;
if (virJSONValueObjectGetNumberUlong(child, "poll-max-ns",
&info->poll_max_ns) == 0 &&
- virJSONValueObjectGetNumberUint(child, "poll-grow",
- &info->poll_grow) == 0 &&
- virJSONValueObjectGetNumberUint(child, "poll-shrink",
- &info->poll_shrink) == 0)
+ virJSONValueObjectGetNumberUlong(child, "poll-grow",
+ &info->poll_grow) == 0 &&
+ virJSONValueObjectGetNumberUlong(child, "poll-shrink",
+ &info->poll_shrink) == 0)
info->poll_valid = true;
}
path = g_strdup_printf("/objects/iothread%u", iothreadInfo->iothread_id);
-#define VIR_IOTHREAD_SET_PROP(propName, propVal) \
+#define VIR_IOTHREAD_SET_PROP_UL(propName, propVal) \
if (iothreadInfo->set_##propVal) { \
memset(&prop, 0, sizeof(qemuMonitorJSONObjectProperty)); \
- prop.type = QEMU_MONITOR_OBJECT_PROPERTY_INT; \
- prop.val.iv = iothreadInfo->propVal; \
+ prop.type = QEMU_MONITOR_OBJECT_PROPERTY_ULONG; \
+ prop.val.ul = iothreadInfo->propVal; \
if (qemuMonitorJSONSetObjectProperty(mon, path, propName, &prop) < 0) \
return -1; \
}
- VIR_IOTHREAD_SET_PROP("poll-max-ns", poll_max_ns);
- VIR_IOTHREAD_SET_PROP("poll-grow", poll_grow);
- VIR_IOTHREAD_SET_PROP("poll-shrink", poll_shrink);
+ VIR_IOTHREAD_SET_PROP_UL("poll-max-ns", poll_max_ns);
+ VIR_IOTHREAD_SET_PROP_UL("poll-grow", poll_grow);
+ VIR_IOTHREAD_SET_PROP_UL("poll-shrink", poll_shrink);
+
+#undef VIR_IOTHREAD_SET_PROP_UL
if (iothreadInfo->set_thread_pool_min &&
iothreadInfo->set_thread_pool_max) {
setMaxFirst = true;
}
+#define VIR_IOTHREAD_SET_PROP_INT(propName, propVal) \
+ if (iothreadInfo->set_##propVal) { \
+ memset(&prop, 0, sizeof(qemuMonitorJSONObjectProperty)); \
+ prop.type = QEMU_MONITOR_OBJECT_PROPERTY_INT; \
+ prop.val.iv = iothreadInfo->propVal; \
+ if (qemuMonitorJSONSetObjectProperty(mon, path, propName, &prop) < 0) \
+ return -1; \
+ }
+
if (setMaxFirst) {
- VIR_IOTHREAD_SET_PROP("thread-pool-max", thread_pool_max);
- VIR_IOTHREAD_SET_PROP("thread-pool-min", thread_pool_min);
+ VIR_IOTHREAD_SET_PROP_INT("thread-pool-max", thread_pool_max);
+ VIR_IOTHREAD_SET_PROP_INT("thread-pool-min", thread_pool_min);
} else {
- VIR_IOTHREAD_SET_PROP("thread-pool-min", thread_pool_min);
- VIR_IOTHREAD_SET_PROP("thread-pool-max", thread_pool_max);
+ VIR_IOTHREAD_SET_PROP_INT("thread-pool-min", thread_pool_min);
+ VIR_IOTHREAD_SET_PROP_INT("thread-pool-max", thread_pool_max);
}
-#undef VIR_IOTHREAD_SET_PROP
+#undef VIR_IOTHREAD_SET_PROP_INT
return 0;
}