virDomainAuthorizedSSHKeysSet: Use uint for @nkeys

When introducing the API I've mistakenly used 'int' type for
@nkeys argument which does nothing more than tells the API how
many items there are in @keys array. Obviously, negative values
are not expected and therefore 'unsigned int' should have been
used.

Reported-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Michal Privoznik 2020-11-23 13:09:35 +01:00
parent f1c3d847ec
commit cbf33fbaf6
5 changed files with 6 additions and 6 deletions

View File

@ -5115,7 +5115,7 @@ typedef enum {
int virDomainAuthorizedSSHKeysSet(virDomainPtr domain,
const char *user,
const char **keys,
int nkeys,
unsigned int nkeys,
unsigned int flags);
#endif /* LIBVIRT_DOMAIN_H */

View File

@ -1397,7 +1397,7 @@ typedef int
(*virDrvDomainAuthorizedSSHKeysSet)(virDomainPtr domain,
const char *user,
const char **keys,
int nkeys,
unsigned int nkeys,
unsigned int flags);
typedef struct _virHypervisorDriver virHypervisorDriver;

View File

@ -12853,12 +12853,12 @@ int
virDomainAuthorizedSSHKeysSet(virDomainPtr domain,
const char *user,
const char **keys,
int nkeys,
unsigned int nkeys,
unsigned int flags)
{
virConnectPtr conn;
VIR_DOMAIN_DEBUG(domain, "user=%s, keys=%p, nkeys=%d, flags=0x%x",
VIR_DOMAIN_DEBUG(domain, "user=%s, keys=%p, nkeys=%u, flags=0x%x",
user, keys, nkeys, flags);
virResetLastError();

View File

@ -20134,7 +20134,7 @@ static int
qemuDomainAuthorizedSSHKeysSet(virDomainPtr dom,
const char *user,
const char **keys,
int nkeys,
unsigned int nkeys,
unsigned int flags)
{
virQEMUDriverPtr driver = dom->conn->privateData;

View File

@ -8066,7 +8066,7 @@ static int
remoteDomainAuthorizedSSHKeysSet(virDomainPtr domain,
const char *user,
const char **keys,
int nkeys,
unsigned int nkeys,
unsigned int flags)
{
int rv = -1;