mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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:
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user