Re: [libvirt] [RFC PATCH 0/4] Add new macro to check for existent server

2018-07-08 Thread Matthias Bolte
2018-07-08 3:06 GMT+02:00 Marcos Paulo de Souza :
> Hello,
>
> I am trying to add a generic way to check for server, specially in drivers 
> that
> needs the server to be declared. If there is better way to put the check, or a
> better way to check this setting, let me know.
>
> Thanks in advance!

I'd realize this in a different way.

The virConnectDriver struct has a localOnly flag that is used to
indicate whether a connection driver permits a server in the URI. Then
virConnectOpenInternal uses this flag during its driver auto-probing
phase.

I suggest expanding this concept and adding a remoteOnly flag to the
virConnectDriver struct. Instead of checking the URI server part in
the driver's own open function let virConnectOpenInternal do this
check based on the remoteOnly flag.

-- 
Matthias Bolte
http://photron.blogspot.com

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


[libvirt] [RFC PATCH 0/4] Add new macro to check for existent server

2018-07-07 Thread Marcos Paulo de Souza
Hello,

I am trying to add a generic way to check for server, specially in drivers that
needs the server to be declared. If there is better way to put the check, or a
better way to check this setting, let me know.

Thanks in advance!

Marcos Paulo de Souza (4):
  driver.h: Add macro VIR_DRV_CONN_CHECK_SERVER
  esx_driver: Use VIR_DRV_CONN_CHECK_SERVER macro
  hyperv_driver: Use VIR_DRV_CONN_CHECK_SERVER macro
  phyp_driver: Use VIR_DRV_CONN_CHECK_SERVER macro

 src/driver.h   | 9 +
 src/esx/esx_driver.c   | 7 +--
 src/hyperv/hyperv_driver.c | 7 +--
 src/phyp/phyp_driver.c | 6 +-
 4 files changed, 12 insertions(+), 17 deletions(-)

-- 
2.17.1

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