[libvirt] [PATCH 10/20] test: rename defaultConn to defaultPrivconn

Marc Hartmayer posted 20 patches 7 years, 2 months ago
[libvirt] [PATCH 10/20] test: rename defaultConn to defaultPrivconn
Posted by Marc Hartmayer 7 years, 2 months ago
Rename the variable @defaultConn to @defaultPrivconn as it doesn't
point to a default connection but to the private data used for the
shared default connection of the test driver.

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
---
 src/test/test_driver.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 5561d0c2ae70..d450be21704e 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -126,7 +126,7 @@ struct _testDriver {
 typedef struct _testDriver testDriver;
 typedef testDriver *testDriverPtr;
 
-static testDriverPtr defaultConn;
+static testDriverPtr defaultPrivconn;
 static int defaultConnections;
 static virMutex defaultLock = VIR_MUTEX_INITIALIZER;
 
@@ -1314,7 +1314,7 @@ testOpenDefault(virConnectPtr conn)
 
     virMutexLock(&defaultLock);
     if (defaultConnections++) {
-        conn->privateData = defaultConn;
+        conn->privateData = defaultPrivconn;
         virMutexUnlock(&defaultLock);
         return VIR_DRV_OPEN_SUCCESS;
     }
@@ -1354,7 +1354,7 @@ testOpenDefault(virConnectPtr conn)
     if (testOpenParse(privconn, NULL, ctxt) < 0)
         goto error;
 
-    defaultConn = privconn;
+    defaultPrivconn = privconn;
     ret = VIR_DRV_OPEN_SUCCESS;
  cleanup:
     virMutexUnlock(&defaultLock);
@@ -1478,7 +1478,7 @@ static int testConnectClose(virConnectPtr conn)
     testDriverPtr privconn = conn->privateData;
     bool dflt = false;
 
-    if (privconn == defaultConn) {
+    if (privconn == defaultPrivconn) {
         dflt = true;
         virMutexLock(&defaultLock);
         if (--defaultConnections) {
@@ -1492,7 +1492,7 @@ static int testConnectClose(virConnectPtr conn)
     testDriverFree(privconn);
 
     if (dflt) {
-        defaultConn = NULL;
+        defaultPrivconn = NULL;
         virMutexUnlock(&defaultLock);
     }
 
-- 
2.13.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 10/20] test: rename defaultConn to defaultPrivconn
Posted by John Ferlan 7 years, 1 month ago

On 03/08/2018 07:20 AM, Marc Hartmayer wrote:
> Rename the variable @defaultConn to @defaultPrivconn as it doesn't
> point to a default connection but to the private data used for the
> shared default connection of the test driver.
> 
> Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
> Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
> ---
>  src/test/test_driver.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/src/test/test_driver.c b/src/test/test_driver.c
> index 5561d0c2ae70..d450be21704e 100644
> --- a/src/test/test_driver.c
> +++ b/src/test/test_driver.c
> @@ -126,7 +126,7 @@ struct _testDriver {
>  typedef struct _testDriver testDriver;
>  typedef testDriver *testDriverPtr;
>  
> -static testDriverPtr defaultConn;
> +static testDriverPtr defaultPrivconn;

Probably should be defaultPrivateData then instead since it's assigned
to conn->privateData...

(I can change locally before doing any sort of push as long as you agree)...


Reviewed-by: John Ferlan <jferlan@redhat.com>

John

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 10/20] test: rename defaultConn to defaultPrivconn
Posted by Marc Hartmayer 7 years, 1 month ago
On Thu, Mar 15, 2018 at 03:38 PM +0100, John Ferlan <jferlan@redhat.com> wrote:
> On 03/08/2018 07:20 AM, Marc Hartmayer wrote:
>> Rename the variable @defaultConn to @defaultPrivconn as it doesn't
>> point to a default connection but to the private data used for the
>> shared default connection of the test driver.
>> 
>> Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
>> Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
>> ---
>>  src/test/test_driver.c | 10 +++++-----
>>  1 file changed, 5 insertions(+), 5 deletions(-)
>> 
>> diff --git a/src/test/test_driver.c b/src/test/test_driver.c
>> index 5561d0c2ae70..d450be21704e 100644
>> --- a/src/test/test_driver.c
>> +++ b/src/test/test_driver.c
>> @@ -126,7 +126,7 @@ struct _testDriver {
>>  typedef struct _testDriver testDriver;
>>  typedef testDriver *testDriverPtr;
>>  
>> -static testDriverPtr defaultConn;
>> +static testDriverPtr defaultPrivconn;
>
> Probably should be defaultPrivateData then instead since it's assigned
> to conn->privateData...

The naming is “inherited” by the variable 'privconn' :)

>
> (I can change locally before doing any sort of push as long as you agree)...
>
>
> Reviewed-by: John Ferlan <jferlan@redhat.com>
>
> John
>
-- 
Beste Grüße / Kind regards
   Marc Hartmayer

IBM Deutschland Research & Development GmbH
Vorsitzende des Aufsichtsrats: Martina Koederitz
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list