mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
qemuMonitorRemoveFdset: Convert @fdset to unsigned int to avoid error
'qemuMonitorRemoveFdset' validates that the 'fdset' argument isn't less than 0. We can turn it to unsigned and thus avoid the error message completely. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
6e433cc8df
commit
b25f2a2192
@ -2553,24 +2553,18 @@ qemuMonitorAddFileHandleToSet(qemuMonitor *mon,
|
||||
/**
|
||||
* qemuMonitorRemoveFdset:
|
||||
* @mon: monitor object
|
||||
* @fdset: the fdset to remove
|
||||
* @fdset: id of the fdset to remove
|
||||
*
|
||||
* Attempts to remove a fdset from qemu and close associated file descriptors
|
||||
* Attempts to remove @fdset from qemu and close associated file descriptors
|
||||
* Returns 0 if ok, and -1 on failure */
|
||||
int
|
||||
qemuMonitorRemoveFdset(qemuMonitor *mon,
|
||||
int fdset)
|
||||
unsigned int fdset)
|
||||
{
|
||||
VIR_DEBUG("fdset=%d", fdset);
|
||||
VIR_DEBUG("fdset=%u", fdset);
|
||||
|
||||
QEMU_CHECK_MONITOR(mon);
|
||||
|
||||
if (fdset < 0) {
|
||||
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||
_("fdset must be valid"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
return qemuMonitorJSONRemoveFdset(mon, fdset);
|
||||
}
|
||||
|
||||
|
@ -974,7 +974,7 @@ qemuMonitorAddFileHandleToSet(qemuMonitor *mon,
|
||||
|
||||
int
|
||||
qemuMonitorRemoveFdset(qemuMonitor *mon,
|
||||
int fdset);
|
||||
unsigned int fdset);
|
||||
|
||||
typedef struct _qemuMonitorFdsetFdInfo qemuMonitorFdsetFdInfo;
|
||||
struct _qemuMonitorFdsetFdInfo {
|
||||
|
@ -3766,11 +3766,11 @@ int qemuMonitorJSONQueryFdsets(qemuMonitor *mon,
|
||||
|
||||
|
||||
int qemuMonitorJSONRemoveFdset(qemuMonitor *mon,
|
||||
int fdset)
|
||||
unsigned int fdset)
|
||||
{
|
||||
g_autoptr(virJSONValue) reply = NULL;
|
||||
g_autoptr(virJSONValue) cmd = qemuMonitorJSONMakeCommand("remove-fd",
|
||||
"i:fdset-id", fdset,
|
||||
"u:fdset-id", fdset,
|
||||
NULL);
|
||||
|
||||
if (!cmd)
|
||||
|
@ -257,7 +257,7 @@ qemuMonitorJSONAddFileHandleToSet(qemuMonitor *mon,
|
||||
|
||||
int
|
||||
qemuMonitorJSONRemoveFdset(qemuMonitor *mon,
|
||||
int fdset);
|
||||
unsigned int fdset);
|
||||
|
||||
int
|
||||
qemuMonitorJSONQueryFdsets(qemuMonitor *mon,
|
||||
|
Loading…
x
Reference in New Issue
Block a user