mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
virsh: cmdIOThreadSet: Use bigger types for --poll-grow and --poll-shrink
The qemu driver now accepts also _ULLONG as type for bigger numbers. Use the 'virTypedParamListAddUnsigned' helper to use the bigger typed parameter type if necessary to allow full range of the values while preserving compatibility. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
6f9d66c828
commit
6df1d137dd
@ -7853,8 +7853,7 @@ cmdIOThreadSet(vshControl *ctl, const vshCmd *cmd)
|
|||||||
g_autoptr(virTypedParamList) params = virTypedParamListNew();
|
g_autoptr(virTypedParamList) params = virTypedParamListNew();
|
||||||
virTypedParameterPtr par;
|
virTypedParameterPtr par;
|
||||||
size_t npar = 0;
|
size_t npar = 0;
|
||||||
unsigned long long poll_max;
|
unsigned long long poll_val;
|
||||||
unsigned int poll_val;
|
|
||||||
int thread_val;
|
int thread_val;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
@ -7876,20 +7875,20 @@ cmdIOThreadSet(vshControl *ctl, const vshCmd *cmd)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((rc = vshCommandOptULongLong(ctl, cmd, "poll-max-ns", &poll_max)) < 0)
|
if ((rc = vshCommandOptULongLong(ctl, cmd, "poll-max-ns", &poll_val)) < 0)
|
||||||
return false;
|
return false;
|
||||||
if (rc > 0)
|
if (rc > 0)
|
||||||
virTypedParamListAddULLong(params, poll_max, VIR_DOMAIN_IOTHREAD_POLL_MAX_NS);
|
virTypedParamListAddULLong(params, poll_val, VIR_DOMAIN_IOTHREAD_POLL_MAX_NS);
|
||||||
|
|
||||||
if ((rc = vshCommandOptUInt(ctl, cmd, "poll-grow", &poll_val)) < 0)
|
if ((rc = vshCommandOptULongLong(ctl, cmd, "poll-grow", &poll_val)) < 0)
|
||||||
return false;
|
return false;
|
||||||
if (rc > 0)
|
if (rc > 0)
|
||||||
virTypedParamListAddUInt(params, poll_val, VIR_DOMAIN_IOTHREAD_POLL_GROW);
|
virTypedParamListAddUnsigned(params, poll_val, VIR_DOMAIN_IOTHREAD_POLL_GROW);
|
||||||
|
|
||||||
if ((rc = vshCommandOptUInt(ctl, cmd, "poll-shrink", &poll_val)) < 0)
|
if ((rc = vshCommandOptULongLong(ctl, cmd, "poll-shrink", &poll_val)) < 0)
|
||||||
return false;
|
return false;
|
||||||
if (rc > 0)
|
if (rc > 0)
|
||||||
virTypedParamListAddUInt(params, poll_val, VIR_DOMAIN_IOTHREAD_POLL_SHRINK);
|
virTypedParamListAddUnsigned(params, poll_val, VIR_DOMAIN_IOTHREAD_POLL_SHRINK);
|
||||||
|
|
||||||
if ((rc = vshCommandOptInt(ctl, cmd, "thread-pool-min", &thread_val)) < 0)
|
if ((rc = vshCommandOptInt(ctl, cmd, "thread-pool-min", &thread_val)) < 0)
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user