On Sat, May 28, 2016 at 09:55:12 -0400, John Ferlan wrote:
Rather than inline code secret lookup for rbd/iscsi, use the common
function.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
This just makes the iscsi/rbd storage driver use the common function...
work that was started by pkrempa in commit id '1d632c39'
src/Makefile.am | 1 +
src/storage/storage_backend_iscsi.c | 48 +++++--------------------------------
src/storage/storage_backend_rbd.c | 45 +++-------------------------------
3 files changed, 10 insertions(+), 84 deletions(-)
[...]
diff --git a/src/storage/storage_backend_iscsi.c
b/src/storage/storage_backend_iscsi.c
index bccfba3..999b610 100644
--- a/src/storage/storage_backend_iscsi.c
+++ b/src/storage/storage_backend_iscsi.c
@@ -1,7 +1,7 @@
/*
* storage_backend_iscsi.c: storage backend for iSCSI handling
*
- * Copyright (C) 2007-2014 Red Hat, Inc.
+ * Copyright (C) 2007-2016 Red Hat, Inc.
I'm not a fan of this noise added by the editor.
* Copyright (C) 2007-2008 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
[...]
@@ -279,9 +279,9 @@ virStorageBackendISCSISetAuth(const char
*portal,
{
virSecretPtr secret = NULL;
This shouldn't be necessary any more.
unsigned char *secret_value = NULL;
+ size_t secret_size;
virStorageAuthDefPtr authdef = source->auth;
int ret = -1;
- char uuidStr[VIR_UUID_STRING_BUFLEN];
if (!authdef || authdef->authType == VIR_STORAGE_AUTH_TYPE_NONE)
return 0;
[...]
@@ -359,7 +323,7 @@ virStorageBackendISCSISetAuth(const char
*portal,
cleanup:
virObjectUnref(secret);
And this could be removed too.
- VIR_FREE(secret_value);
+ VIR_DISPOSE_N(secret_value, secret_size);
return ret;
}
diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c
index ac46b9d..34005ce 100644
--- a/src/storage/storage_backend_rbd.c
+++ b/src/storage/storage_backend_rbd.c
[...]
@@ -63,7 +64,6 @@
virStorageBackendRBDOpenRADOSConn(virStorageBackendRBDStatePtr ptr,
char *rados_key = NULL;
virBuffer mon_host = VIR_BUFFER_INITIALIZER;
virSecretPtr secret = NULL;
You also don't need @secret any more.
- char secretUuid[VIR_UUID_STRING_BUFLEN];
size_t i;
char *mon_buff = NULL;
const char *client_mount_timeout = "30";
ACK with the suggested changes after the release. This patch can be
applied stand-alone.
Peter