driver: allow drivers to indicate if they permit remote connections

Add a localOnly flag to the virConnectDriver struct which allows a
driver to indicate whether it is local-only, or permits remote
connections. Stateful drivers running inside libvirtd are generally
local only. This allows us to remote the check for uri->server != NULL
from most drivers.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé
2018-03-28 10:53:31 +01:00
parent 20ad55a8fd
commit 3714cc952d
23 changed files with 30 additions and 73 deletions

View File

@@ -379,10 +379,6 @@ nwfilterConnectOpen(virConnectPtr conn,
if (STRNEQ_NULLABLE(conn->uri->scheme, "nwfilter"))
return VIR_DRV_OPEN_DECLINED;
/* Leave for remote driver */
if (conn->uri->server != NULL)
return VIR_DRV_OPEN_DECLINED;
if (driver == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("nwfilter state driver is not active"));
@@ -712,6 +708,7 @@ static virHypervisorDriver nwfilterHypervisorDriver = {
static virConnectDriver nwfilterConnectDriver = {
.localOnly = true,
.hypervisorDriver = &nwfilterHypervisorDriver,
.nwfilterDriver = &nwfilterDriver,
};