Re: [libvirt] [PATCH v3 3/5] esx_driver: Set remoteOnly member of virConnectDriver

2018-07-11 Thread Michal Privoznik
On 07/11/2018 01:31 AM, Marcos Paulo de Souza wrote:
> ESX driver can't function without a server being informed, so this flag
> makes libvirt to check for a valid server before calling connectOpen.
> 
> Signed-off-by: Marcos Paulo de Souza 
> ---
>  src/esx/esx_driver.c | 8 +---
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
> index 06e1238385..d937daac83 100644
> --- a/src/esx/esx_driver.c
> +++ b/src/esx/esx_driver.c
> @@ -854,13 +854,6 @@ esxConnectOpen(virConnectPtr conn, virConnectAuthPtr 
> auth,
>   conn->uri->path, conn->uri->scheme);
>  }
>  
> -/* Require server part */
> -if (!conn->uri->server) {
> -virReportError(VIR_ERR_INVALID_ARG, "%s",
> -   _("URI is missing the server part"));
> -return VIR_DRV_OPEN_ERROR;
> -}
> -
>  /* Require auth */
>  if (!auth || !auth->cb) {
>  virReportError(VIR_ERR_INVALID_ARG, "%s",
> @@ -5218,6 +5211,7 @@ static virConnectDriver esxConnectDriver = {
>  .interfaceDriver = ,
>  .networkDriver = ,
>  .storageDriver = ,
> +.remoteOnly = true,

Nit pick, I think this remoteOnly should be placed a few lines upfront -
to honour ordering laid down by _virConnectDriver declaration. The
second reason is to group driver attributes setting (uri schemas,
local/remote only) and drivers callback.

Michal

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


[libvirt] [PATCH v3 3/5] esx_driver: Set remoteOnly member of virConnectDriver

2018-07-10 Thread Marcos Paulo de Souza
ESX driver can't function without a server being informed, so this flag
makes libvirt to check for a valid server before calling connectOpen.

Signed-off-by: Marcos Paulo de Souza 
---
 src/esx/esx_driver.c | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
index 06e1238385..d937daac83 100644
--- a/src/esx/esx_driver.c
+++ b/src/esx/esx_driver.c
@@ -854,13 +854,6 @@ esxConnectOpen(virConnectPtr conn, virConnectAuthPtr auth,
  conn->uri->path, conn->uri->scheme);
 }
 
-/* Require server part */
-if (!conn->uri->server) {
-virReportError(VIR_ERR_INVALID_ARG, "%s",
-   _("URI is missing the server part"));
-return VIR_DRV_OPEN_ERROR;
-}
-
 /* Require auth */
 if (!auth || !auth->cb) {
 virReportError(VIR_ERR_INVALID_ARG, "%s",
@@ -5218,6 +5211,7 @@ static virConnectDriver esxConnectDriver = {
 .interfaceDriver = ,
 .networkDriver = ,
 .storageDriver = ,
+.remoteOnly = true,
 };
 
 int
-- 
2.17.1

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