[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 2/2] admin: Remove flags checking from virAdmConnectOpen public API



On 05/05/16 14:13, Peter Krempa wrote:
> On Thu, May 05, 2016 at 13:49:24 +0200, Erik Skultety wrote:
>> Unlike the previous commit, we do actually support one client-side only flag
>> VIR_CONNECT_NO_ALIASES, so besides removing the check for flags this flag
>> has to be masked out before sending a message to the daemon, otherwise it
>> would trigger an error when checking flags on the daemon side.
>>
>> Signed-off-by: Erik Skultety <eskultet redhat com>
>> ---
>>  src/admin/admin_remote.c | 2 +-
>>  src/libvirt-admin.c      | 4 ++--
>>  2 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/admin/admin_remote.c b/src/admin/admin_remote.c
>> index 40fcddb..180dd3b 100644
>> --- a/src/admin/admin_remote.c
>> +++ b/src/admin/admin_remote.c
>> @@ -162,7 +162,7 @@ remoteAdminConnectOpen(virAdmConnectPtr conn, unsigned int flags)
>>  
>>      virObjectLock(priv);
>>  
>> -    args.flags = flags;
>> +    args.flags = flags ^ VIR_CONNECT_NO_ALIASES;
> 
> This won't mask out the flag, this will invert it.
> 
Sigh...attempt n.2, see my fix in the attached patch.

Erik
>From b71145abebb99d291704d6ea03735cd4ac5ad7bd Mon Sep 17 00:00:00 2001
Message-Id: <b71145abebb99d291704d6ea03735cd4ac5ad7bd 1462451856 git eskultet redhat com>
In-Reply-To: <c66e7732f59fafdbafbe3261356348f9268f2a7b 1462451856 git eskultet redhat com>
References: <c66e7732f59fafdbafbe3261356348f9268f2a7b 1462451856 git eskultet redhat com>
From: Erik Skultety <eskultet redhat com>
Date: Thu, 5 May 2016 13:42:52 +0200
Subject: [PATCH 2/2] admin: Remove flags checking from virAdmConnectOpen
 public API

Unlike the previous commit, we do actually support one client-side only flag
VIR_CONNECT_NO_ALIASES, so besides removing the check for flags this flag
has to be masked out before sending a message to the daemon, otherwise it
would trigger an error when checking flags on the daemon side.

Signed-off-by: Erik Skultety <eskultet redhat com>
---
 src/admin/admin_remote.c | 2 +-
 src/libvirt-admin.c      | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/admin/admin_remote.c b/src/admin/admin_remote.c
index 40fcddb..632aaa8 100644
--- a/src/admin/admin_remote.c
+++ b/src/admin/admin_remote.c
@@ -162,7 +162,7 @@ remoteAdminConnectOpen(virAdmConnectPtr conn, unsigned int flags)
 
     virObjectLock(priv);
 
-    args.flags = flags;
+    args.flags = flags & ~VIR_CONNECT_NO_ALIASES;
 
     if (virNetClientRegisterAsyncIO(priv->client) < 0) {
         VIR_DEBUG("Failed to add event watch, disabling events and support for"
diff --git a/src/libvirt-admin.c b/src/libvirt-admin.c
index d7a66ff..91f40c8 100644
--- a/src/libvirt-admin.c
+++ b/src/libvirt-admin.c
@@ -185,7 +185,8 @@ virAdmGetDefaultURI(virConfPtr conf)
 /**
  * virAdmConnectOpen:
  * @name: uri of the daemon to connect to, NULL for default
- * @flags: extra flags; not used yet, so callers should always pass 0
+ * @flags: extra flags; currently the only supported client-side flag is
+ *         VIR_CONNECT_NO_ALIASES
  *
  * Opens connection to admin interface of the daemon.
  *
@@ -204,7 +205,6 @@ virAdmConnectOpen(const char *name, unsigned int flags)
 
     VIR_DEBUG("flags=%x", flags);
     virResetLastError();
-    virCheckFlagsGoto(VIR_CONNECT_NO_ALIASES, error);
 
     if (!(conn = virAdmConnectNew()))
         goto error;
-- 
2.4.11


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]