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(a)redhat.com>
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
include/libvirt/libvirt-domain.h | 2 +-
src/driver-hypervisor.h | 2 +-
src/libvirt-domain.c | 4 ++--
src/qemu/qemu_driver.c | 2 +-
src/remote/remote_driver.c | 2 +-
5 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index d81157ccaf..b929877643 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -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 */
diff --git a/src/driver-hypervisor.h b/src/driver-hypervisor.h
index 5a5ea95c51..9e8fe89921 100644
--- a/src/driver-hypervisor.h
+++ b/src/driver-hypervisor.h
@@ -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;
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 63d4954e68..0d0041f983 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -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();
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index b69be1bedc..20e24e2479 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -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;
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 6c0e7f7514..b0af3ee88e 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -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;
--
2.26.2