mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 01:18:00 +03:00
Definition of the wire format, RPC client & server
This patch adds the definition of the wire format for RPC calls and implementation of the RPC client & server code Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
This commit is contained in:
parent
46e9b0fb4e
commit
965466c1ee
194
daemon/remote.c
194
daemon/remote.c
@ -66,6 +66,7 @@ static virInterfacePtr get_nonnull_interface (virConnectPtr conn, remote_nonnull
|
||||
static virStoragePoolPtr get_nonnull_storage_pool (virConnectPtr conn, remote_nonnull_storage_pool pool);
|
||||
static virStorageVolPtr get_nonnull_storage_vol (virConnectPtr conn, remote_nonnull_storage_vol vol);
|
||||
static virSecretPtr get_nonnull_secret (virConnectPtr conn, remote_nonnull_secret secret);
|
||||
static virNWFilterPtr get_nonnull_nwfilter (virConnectPtr conn, remote_nonnull_nwfilter nwfilter);
|
||||
static void make_nonnull_domain (remote_nonnull_domain *dom_dst, virDomainPtr dom_src);
|
||||
static void make_nonnull_network (remote_nonnull_network *net_dst, virNetworkPtr net_src);
|
||||
static void make_nonnull_interface (remote_nonnull_interface *interface_dst, virInterfacePtr interface_src);
|
||||
@ -73,6 +74,7 @@ static void make_nonnull_storage_pool (remote_nonnull_storage_pool *pool_dst, vi
|
||||
static void make_nonnull_storage_vol (remote_nonnull_storage_vol *vol_dst, virStorageVolPtr vol_src);
|
||||
static void make_nonnull_node_device (remote_nonnull_node_device *dev_dst, virNodeDevicePtr dev_src);
|
||||
static void make_nonnull_secret (remote_nonnull_secret *secret_dst, virSecretPtr secret_src);
|
||||
static void make_nonnull_nwfilter (remote_nonnull_nwfilter *net_dst, virNWFilterPtr nwfilter_src);
|
||||
|
||||
|
||||
#include "remote_dispatch_prototypes.h"
|
||||
@ -5837,6 +5839,185 @@ remoteDispatchDomainEventsDeregisterAny (struct qemud_server *server ATTRIBUTE_U
|
||||
}
|
||||
|
||||
|
||||
|
||||
static int
|
||||
remoteDispatchNwfilterLookupByName (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client ATTRIBUTE_UNUSED,
|
||||
virConnectPtr conn,
|
||||
remote_message_header *hdr ATTRIBUTE_UNUSED,
|
||||
remote_error *rerr,
|
||||
remote_nwfilter_lookup_by_name_args *args,
|
||||
remote_nwfilter_lookup_by_name_ret *ret)
|
||||
{
|
||||
virNWFilterPtr nwfilter;
|
||||
|
||||
nwfilter = virNWFilterLookupByName (conn, args->name);
|
||||
if (nwfilter == NULL) {
|
||||
remoteDispatchConnError(rerr, conn);
|
||||
return -1;
|
||||
}
|
||||
|
||||
make_nonnull_nwfilter (&ret->nwfilter, nwfilter);
|
||||
virNWFilterFree(nwfilter);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchNwfilterLookupByUuid (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client ATTRIBUTE_UNUSED,
|
||||
virConnectPtr conn,
|
||||
remote_message_header *hdr ATTRIBUTE_UNUSED,
|
||||
remote_error *rerr,
|
||||
remote_nwfilter_lookup_by_uuid_args *args,
|
||||
remote_nwfilter_lookup_by_uuid_ret *ret)
|
||||
{
|
||||
virNWFilterPtr nwfilter;
|
||||
|
||||
nwfilter = virNWFilterLookupByUUID (conn, (unsigned char *) args->uuid);
|
||||
if (nwfilter == NULL) {
|
||||
remoteDispatchConnError(rerr, conn);
|
||||
return -1;
|
||||
}
|
||||
|
||||
make_nonnull_nwfilter (&ret->nwfilter, nwfilter);
|
||||
virNWFilterFree(nwfilter);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
remoteDispatchNwfilterDefineXml (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client ATTRIBUTE_UNUSED,
|
||||
virConnectPtr conn,
|
||||
remote_message_header *hdr ATTRIBUTE_UNUSED,
|
||||
remote_error *rerr,
|
||||
remote_nwfilter_define_xml_args *args,
|
||||
remote_nwfilter_define_xml_ret *ret)
|
||||
{
|
||||
virNWFilterPtr nwfilter;
|
||||
|
||||
nwfilter = virNWFilterDefineXML (conn, args->xml);
|
||||
if (nwfilter == NULL) {
|
||||
remoteDispatchConnError(rerr, conn);
|
||||
return -1;
|
||||
}
|
||||
|
||||
make_nonnull_nwfilter (&ret->nwfilter, nwfilter);
|
||||
virNWFilterFree(nwfilter);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
remoteDispatchNwfilterUndefine (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client ATTRIBUTE_UNUSED,
|
||||
virConnectPtr conn,
|
||||
remote_message_header *hdr ATTRIBUTE_UNUSED,
|
||||
remote_error *rerr,
|
||||
remote_nwfilter_undefine_args *args,
|
||||
void *ret ATTRIBUTE_UNUSED)
|
||||
{
|
||||
virNWFilterPtr nwfilter;
|
||||
|
||||
nwfilter = get_nonnull_nwfilter (conn, args->nwfilter);
|
||||
if (nwfilter == NULL) {
|
||||
remoteDispatchConnError(rerr, conn);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (virNWFilterUndefine (nwfilter) == -1) {
|
||||
virNWFilterFree(nwfilter);
|
||||
remoteDispatchConnError(rerr, conn);
|
||||
return -1;
|
||||
}
|
||||
virNWFilterFree(nwfilter);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchListNwfilters (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client ATTRIBUTE_UNUSED,
|
||||
virConnectPtr conn,
|
||||
remote_message_header *hdr ATTRIBUTE_UNUSED,
|
||||
remote_error *rerr,
|
||||
remote_list_nwfilters_args *args,
|
||||
remote_list_nwfilters_ret *ret)
|
||||
{
|
||||
|
||||
if (args->maxnames > REMOTE_NWFILTER_NAME_LIST_MAX) {
|
||||
remoteDispatchFormatError (rerr,
|
||||
"%s", _("maxnames > REMOTE_NWFILTER_NAME_LIST_MAX"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Allocate return buffer. */
|
||||
if (VIR_ALLOC_N(ret->names.names_val, args->maxnames) < 0) {
|
||||
remoteDispatchOOMError(rerr);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret->names.names_len =
|
||||
virConnectListNWFilters (conn,
|
||||
ret->names.names_val, args->maxnames);
|
||||
if (ret->names.names_len == -1) {
|
||||
VIR_FREE(ret->names.names_len);
|
||||
remoteDispatchConnError(rerr, conn);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
remoteDispatchNwfilterGetXmlDesc (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client ATTRIBUTE_UNUSED,
|
||||
virConnectPtr conn,
|
||||
remote_message_header *hdr ATTRIBUTE_UNUSED,
|
||||
remote_error *rerr,
|
||||
remote_nwfilter_get_xml_desc_args *args,
|
||||
remote_nwfilter_get_xml_desc_ret *ret)
|
||||
{
|
||||
virNWFilterPtr nwfilter;
|
||||
|
||||
nwfilter = get_nonnull_nwfilter (conn, args->nwfilter);
|
||||
if (nwfilter == NULL) {
|
||||
remoteDispatchConnError(rerr, conn);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* remoteDispatchClientRequest will free this. */
|
||||
ret->xml = virNWFilterGetXMLDesc (nwfilter, args->flags);
|
||||
if (!ret->xml) {
|
||||
virNWFilterFree(nwfilter);
|
||||
remoteDispatchConnError(rerr, conn);
|
||||
return -1;
|
||||
}
|
||||
virNWFilterFree(nwfilter);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
remoteDispatchNumOfNwfilters (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client ATTRIBUTE_UNUSED,
|
||||
virConnectPtr conn,
|
||||
remote_message_header *hdr ATTRIBUTE_UNUSED,
|
||||
remote_error *rerr,
|
||||
void *args ATTRIBUTE_UNUSED,
|
||||
remote_num_of_nwfilters_ret *ret)
|
||||
{
|
||||
|
||||
ret->num = virConnectNumOfNWFilters (conn);
|
||||
if (ret->num == -1) {
|
||||
remoteDispatchConnError(rerr, conn);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*----- Helpers. -----*/
|
||||
|
||||
/* get_nonnull_domain and get_nonnull_network turn an on-wire
|
||||
@ -5889,6 +6070,12 @@ get_nonnull_secret (virConnectPtr conn, remote_nonnull_secret secret)
|
||||
return virGetSecret (conn, BAD_CAST secret.uuid, secret.usageType, secret.usageID);
|
||||
}
|
||||
|
||||
static virNWFilterPtr
|
||||
get_nonnull_nwfilter (virConnectPtr conn, remote_nonnull_nwfilter nwfilter)
|
||||
{
|
||||
return virGetNWFilter (conn, nwfilter.name, BAD_CAST nwfilter.uuid);
|
||||
}
|
||||
|
||||
/* Make remote_nonnull_domain and remote_nonnull_network. */
|
||||
static void
|
||||
make_nonnull_domain (remote_nonnull_domain *dom_dst, virDomainPtr dom_src)
|
||||
@ -5941,3 +6128,10 @@ make_nonnull_secret (remote_nonnull_secret *secret_dst, virSecretPtr secret_src)
|
||||
secret_dst->usageType = secret_src->usageType;
|
||||
secret_dst->usageID = strdup (secret_src->usageID);
|
||||
}
|
||||
|
||||
static void
|
||||
make_nonnull_nwfilter (remote_nonnull_nwfilter *nwfilter_dst, virNWFilterPtr nwfilter_src)
|
||||
{
|
||||
nwfilter_dst->name = strdup (nwfilter_src->name);
|
||||
memcpy (nwfilter_dst->uuid, nwfilter_src->uuid, VIR_UUID_BUFLEN);
|
||||
}
|
||||
|
@ -145,3 +145,9 @@
|
||||
remote_domain_events_register_any_args val_remote_domain_events_register_any_args;
|
||||
remote_domain_events_deregister_any_args val_remote_domain_events_deregister_any_args;
|
||||
remote_domain_update_device_flags_args val_remote_domain_update_device_flags_args;
|
||||
remote_nwfilter_lookup_by_name_args val_remote_nwfilter_lookup_by_name_args;
|
||||
remote_nwfilter_lookup_by_uuid_args val_remote_nwfilter_lookup_by_uuid_args;
|
||||
remote_nwfilter_get_xml_desc_args val_remote_nwfilter_get_xml_desc_args;
|
||||
remote_list_nwfilters_args val_remote_list_nwfilters_args;
|
||||
remote_nwfilter_define_xml_args val_remote_nwfilter_define_xml_args;
|
||||
remote_nwfilter_undefine_args val_remote_nwfilter_undefine_args;
|
||||
|
@ -722,6 +722,14 @@ static int remoteDispatchListNetworks(
|
||||
remote_error *err,
|
||||
remote_list_networks_args *args,
|
||||
remote_list_networks_ret *ret);
|
||||
static int remoteDispatchListNwfilters(
|
||||
struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
virConnectPtr conn,
|
||||
remote_message_header *hdr,
|
||||
remote_error *err,
|
||||
remote_list_nwfilters_args *args,
|
||||
remote_list_nwfilters_ret *ret);
|
||||
static int remoteDispatchListSecrets(
|
||||
struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
@ -1026,6 +1034,14 @@ static int remoteDispatchNumOfNetworks(
|
||||
remote_error *err,
|
||||
void *args,
|
||||
remote_num_of_networks_ret *ret);
|
||||
static int remoteDispatchNumOfNwfilters(
|
||||
struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
virConnectPtr conn,
|
||||
remote_message_header *hdr,
|
||||
remote_error *err,
|
||||
void *args,
|
||||
remote_num_of_nwfilters_ret *ret);
|
||||
static int remoteDispatchNumOfSecrets(
|
||||
struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
@ -1042,6 +1058,46 @@ static int remoteDispatchNumOfStoragePools(
|
||||
remote_error *err,
|
||||
void *args,
|
||||
remote_num_of_storage_pools_ret *ret);
|
||||
static int remoteDispatchNwfilterDefineXml(
|
||||
struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
virConnectPtr conn,
|
||||
remote_message_header *hdr,
|
||||
remote_error *err,
|
||||
remote_nwfilter_define_xml_args *args,
|
||||
remote_nwfilter_define_xml_ret *ret);
|
||||
static int remoteDispatchNwfilterGetXmlDesc(
|
||||
struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
virConnectPtr conn,
|
||||
remote_message_header *hdr,
|
||||
remote_error *err,
|
||||
remote_nwfilter_get_xml_desc_args *args,
|
||||
remote_nwfilter_get_xml_desc_ret *ret);
|
||||
static int remoteDispatchNwfilterLookupByName(
|
||||
struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
virConnectPtr conn,
|
||||
remote_message_header *hdr,
|
||||
remote_error *err,
|
||||
remote_nwfilter_lookup_by_name_args *args,
|
||||
remote_nwfilter_lookup_by_name_ret *ret);
|
||||
static int remoteDispatchNwfilterLookupByUuid(
|
||||
struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
virConnectPtr conn,
|
||||
remote_message_header *hdr,
|
||||
remote_error *err,
|
||||
remote_nwfilter_lookup_by_uuid_args *args,
|
||||
remote_nwfilter_lookup_by_uuid_ret *ret);
|
||||
static int remoteDispatchNwfilterUndefine(
|
||||
struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
virConnectPtr conn,
|
||||
remote_message_header *hdr,
|
||||
remote_error *err,
|
||||
remote_nwfilter_undefine_args *args,
|
||||
void *ret);
|
||||
static int remoteDispatchOpen(
|
||||
struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
|
@ -119,3 +119,9 @@
|
||||
remote_domain_memory_stats_ret val_remote_domain_memory_stats_ret;
|
||||
remote_cpu_baseline_ret val_remote_cpu_baseline_ret;
|
||||
remote_domain_get_job_info_ret val_remote_domain_get_job_info_ret;
|
||||
remote_nwfilter_lookup_by_name_ret val_remote_nwfilter_lookup_by_name_ret;
|
||||
remote_nwfilter_lookup_by_uuid_ret val_remote_nwfilter_lookup_by_uuid_ret;
|
||||
remote_nwfilter_get_xml_desc_ret val_remote_nwfilter_get_xml_desc_ret;
|
||||
remote_num_of_nwfilters_ret val_remote_num_of_nwfilters_ret;
|
||||
remote_list_nwfilters_ret val_remote_list_nwfilters_ret;
|
||||
remote_nwfilter_define_xml_ret val_remote_nwfilter_define_xml_ret;
|
||||
|
@ -877,3 +877,38 @@
|
||||
.args_filter = (xdrproc_t) xdr_remote_domain_update_device_flags_args,
|
||||
.ret_filter = (xdrproc_t) xdr_void,
|
||||
},
|
||||
{ /* NwfilterLookupByName => 175 */
|
||||
.fn = (dispatch_fn) remoteDispatchNwfilterLookupByName,
|
||||
.args_filter = (xdrproc_t) xdr_remote_nwfilter_lookup_by_name_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_nwfilter_lookup_by_name_ret,
|
||||
},
|
||||
{ /* NwfilterLookupByUuid => 176 */
|
||||
.fn = (dispatch_fn) remoteDispatchNwfilterLookupByUuid,
|
||||
.args_filter = (xdrproc_t) xdr_remote_nwfilter_lookup_by_uuid_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_nwfilter_lookup_by_uuid_ret,
|
||||
},
|
||||
{ /* NwfilterGetXmlDesc => 177 */
|
||||
.fn = (dispatch_fn) remoteDispatchNwfilterGetXmlDesc,
|
||||
.args_filter = (xdrproc_t) xdr_remote_nwfilter_get_xml_desc_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_nwfilter_get_xml_desc_ret,
|
||||
},
|
||||
{ /* NumOfNwfilters => 178 */
|
||||
.fn = (dispatch_fn) remoteDispatchNumOfNwfilters,
|
||||
.args_filter = (xdrproc_t) xdr_void,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_num_of_nwfilters_ret,
|
||||
},
|
||||
{ /* ListNwfilters => 179 */
|
||||
.fn = (dispatch_fn) remoteDispatchListNwfilters,
|
||||
.args_filter = (xdrproc_t) xdr_remote_list_nwfilters_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_list_nwfilters_ret,
|
||||
},
|
||||
{ /* NwfilterDefineXml => 180 */
|
||||
.fn = (dispatch_fn) remoteDispatchNwfilterDefineXml,
|
||||
.args_filter = (xdrproc_t) xdr_remote_nwfilter_define_xml_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_nwfilter_define_xml_ret,
|
||||
},
|
||||
{ /* NwfilterUndefine => 181 */
|
||||
.fn = (dispatch_fn) remoteDispatchNwfilterUndefine,
|
||||
.args_filter = (xdrproc_t) xdr_remote_nwfilter_undefine_args,
|
||||
.ret_filter = (xdrproc_t) xdr_void,
|
||||
},
|
||||
|
@ -248,6 +248,7 @@ static int remoteAuthPolkit (virConnectPtr conn, struct private_data *priv, int
|
||||
|
||||
static virDomainPtr get_nonnull_domain (virConnectPtr conn, remote_nonnull_domain domain);
|
||||
static virNetworkPtr get_nonnull_network (virConnectPtr conn, remote_nonnull_network network);
|
||||
static virNWFilterPtr get_nonnull_nwfilter (virConnectPtr conn, remote_nonnull_nwfilter nwfilter);
|
||||
static virInterfacePtr get_nonnull_interface (virConnectPtr conn, remote_nonnull_interface iface);
|
||||
static virStoragePoolPtr get_nonnull_storage_pool (virConnectPtr conn, remote_nonnull_storage_pool pool);
|
||||
static virStorageVolPtr get_nonnull_storage_vol (virConnectPtr conn, remote_nonnull_storage_vol vol);
|
||||
@ -259,6 +260,7 @@ static void make_nonnull_interface (remote_nonnull_interface *interface_dst, vir
|
||||
static void make_nonnull_storage_pool (remote_nonnull_storage_pool *pool_dst, virStoragePoolPtr vol_src);
|
||||
static void make_nonnull_storage_vol (remote_nonnull_storage_vol *vol_dst, virStorageVolPtr vol_src);
|
||||
static void make_nonnull_secret (remote_nonnull_secret *secret_dst, virSecretPtr secret_src);
|
||||
static void make_nonnull_nwfilter (remote_nonnull_nwfilter *nwfilter_dst, virNWFilterPtr nwfilter_src);
|
||||
void remoteDomainEventFired(int watch, int fd, int event, void *data);
|
||||
void remoteDomainEventQueueFlush(int timer, void *opaque);
|
||||
/*----------------------------------------------------------------------*/
|
||||
@ -6111,6 +6113,287 @@ done:
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------- */
|
||||
|
||||
static virDrvOpenStatus ATTRIBUTE_NONNULL (1)
|
||||
remoteNWFilterOpen (virConnectPtr conn,
|
||||
virConnectAuthPtr auth,
|
||||
int flags)
|
||||
{
|
||||
if (inside_daemon)
|
||||
return VIR_DRV_OPEN_DECLINED;
|
||||
|
||||
if (conn->driver &&
|
||||
STREQ (conn->driver->name, "remote")) {
|
||||
struct private_data *priv;
|
||||
|
||||
/* If we're here, the remote driver is already
|
||||
* in use due to a) a QEMU uri, or b) a remote
|
||||
* URI. So we can re-use existing connection
|
||||
*/
|
||||
priv = conn->privateData;
|
||||
remoteDriverLock(priv);
|
||||
priv->localUses++;
|
||||
conn->nwfilterPrivateData = priv;
|
||||
remoteDriverUnlock(priv);
|
||||
return VIR_DRV_OPEN_SUCCESS;
|
||||
} else {
|
||||
/* Using a non-remote driver, so we need to open a
|
||||
* new connection for network filtering APIs, forcing it to
|
||||
* use the UNIX transport. This handles Xen driver
|
||||
* which doesn't have its own impl of the network filtering APIs.
|
||||
*/
|
||||
struct private_data *priv;
|
||||
int ret;
|
||||
ret = remoteOpenSecondaryDriver(conn,
|
||||
auth,
|
||||
flags,
|
||||
&priv);
|
||||
if (ret == VIR_DRV_OPEN_SUCCESS)
|
||||
conn->nwfilterPrivateData = priv;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
remoteNWFilterClose (virConnectPtr conn)
|
||||
{
|
||||
int rv = 0;
|
||||
struct private_data *priv = conn->nwfilterPrivateData;
|
||||
|
||||
remoteDriverLock(priv);
|
||||
priv->localUses--;
|
||||
if (!priv->localUses) {
|
||||
rv = doRemoteClose(conn, priv);
|
||||
conn->nwfilterPrivateData = NULL;
|
||||
remoteDriverUnlock(priv);
|
||||
virMutexDestroy(&priv->lock);
|
||||
VIR_FREE(priv);
|
||||
}
|
||||
if (priv)
|
||||
remoteDriverUnlock(priv);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
remoteNumOfNWFilters (virConnectPtr conn)
|
||||
{
|
||||
int rv = -1;
|
||||
remote_num_of_nwfilters_ret ret;
|
||||
struct private_data *priv = conn->nwfilterPrivateData;
|
||||
|
||||
remoteDriverLock(priv);
|
||||
|
||||
memset (&ret, 0, sizeof ret);
|
||||
if (call (conn, priv, 0, REMOTE_PROC_NUM_OF_NWFILTERS,
|
||||
(xdrproc_t) xdr_void, (char *) NULL,
|
||||
(xdrproc_t) xdr_remote_num_of_nwfilters_ret, (char *) &ret) == -1)
|
||||
goto done;
|
||||
|
||||
rv = ret.num;
|
||||
|
||||
done:
|
||||
remoteDriverUnlock(priv);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
static virNWFilterPtr
|
||||
remoteNWFilterDefineXML (virConnectPtr conn, const char *xmlDesc,
|
||||
unsigned int flags ATTRIBUTE_UNUSED)
|
||||
{
|
||||
virNWFilterPtr net = NULL;
|
||||
remote_nwfilter_define_xml_args args;
|
||||
remote_nwfilter_define_xml_ret ret;
|
||||
struct private_data *priv = conn->nwfilterPrivateData;
|
||||
|
||||
remoteDriverLock(priv);
|
||||
|
||||
args.xml = (char *) xmlDesc;
|
||||
|
||||
memset (&ret, 0, sizeof ret);
|
||||
if (call (conn, priv, 0, REMOTE_PROC_NWFILTER_DEFINE_XML,
|
||||
(xdrproc_t) xdr_remote_nwfilter_define_xml_args, (char *) &args,
|
||||
(xdrproc_t) xdr_remote_nwfilter_define_xml_ret, (char *) &ret) == -1)
|
||||
goto done;
|
||||
|
||||
net = get_nonnull_nwfilter (conn, ret.nwfilter);
|
||||
xdr_free ((xdrproc_t) &xdr_remote_nwfilter_define_xml_ret, (char *) &ret);
|
||||
|
||||
done:
|
||||
remoteDriverUnlock(priv);
|
||||
return net;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
remoteNWFilterUndefine (virNWFilterPtr nwfilter)
|
||||
{
|
||||
int rv = -1;
|
||||
remote_nwfilter_undefine_args args;
|
||||
struct private_data *priv = nwfilter->conn->nwfilterPrivateData;
|
||||
|
||||
remoteDriverLock(priv);
|
||||
|
||||
make_nonnull_nwfilter (&args.nwfilter, nwfilter);
|
||||
|
||||
if (call (nwfilter->conn, priv, 0, REMOTE_PROC_NWFILTER_UNDEFINE,
|
||||
(xdrproc_t) xdr_remote_nwfilter_undefine_args, (char *) &args,
|
||||
(xdrproc_t) xdr_void, (char *) NULL) == -1)
|
||||
goto done;
|
||||
|
||||
rv = 0;
|
||||
|
||||
done:
|
||||
remoteDriverUnlock(priv);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
remoteListNWFilters (virConnectPtr conn, char **const names, int maxnames)
|
||||
{
|
||||
int rv = -1;
|
||||
int i;
|
||||
remote_list_nwfilters_args args;
|
||||
remote_list_nwfilters_ret ret;
|
||||
struct private_data *priv = conn->nwfilterPrivateData;
|
||||
|
||||
remoteDriverLock(priv);
|
||||
|
||||
if (maxnames > REMOTE_NWFILTER_NAME_LIST_MAX) {
|
||||
errorf (conn, VIR_ERR_RPC,
|
||||
_("too many remote nwfilters: %d > %d"),
|
||||
maxnames, REMOTE_NWFILTER_NAME_LIST_MAX);
|
||||
goto done;
|
||||
}
|
||||
args.maxnames = maxnames;
|
||||
|
||||
memset (&ret, 0, sizeof ret);
|
||||
if (call (conn, priv, 0, REMOTE_PROC_LIST_NWFILTERS,
|
||||
(xdrproc_t) xdr_remote_list_nwfilters_args, (char *) &args,
|
||||
(xdrproc_t) xdr_remote_list_nwfilters_ret, (char *) &ret) == -1)
|
||||
goto done;
|
||||
|
||||
if (ret.names.names_len > maxnames) {
|
||||
errorf (conn, VIR_ERR_RPC,
|
||||
_("too many remote nwfilters: %d > %d"),
|
||||
ret.names.names_len, maxnames);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* This call is caller-frees (although that isn't clear from
|
||||
* the documentation). However xdr_free will free up both the
|
||||
* names and the list of pointers, so we have to strdup the
|
||||
* names here.
|
||||
*/
|
||||
for (i = 0; i < ret.names.names_len; ++i) {
|
||||
names[i] = strdup (ret.names.names_val[i]);
|
||||
|
||||
if (names[i] == NULL) {
|
||||
for (--i; i >= 0; --i)
|
||||
VIR_FREE(names[i]);
|
||||
|
||||
virReportOOMError();
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
rv = ret.names.names_len;
|
||||
|
||||
cleanup:
|
||||
xdr_free ((xdrproc_t) xdr_remote_list_nwfilters_ret, (char *) &ret);
|
||||
|
||||
done:
|
||||
remoteDriverUnlock(priv);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static virNWFilterPtr
|
||||
remoteNWFilterLookupByUUID (virConnectPtr conn,
|
||||
const unsigned char *uuid)
|
||||
{
|
||||
virNWFilterPtr net = NULL;
|
||||
remote_nwfilter_lookup_by_uuid_args args;
|
||||
remote_nwfilter_lookup_by_uuid_ret ret;
|
||||
struct private_data *priv = conn->nwfilterPrivateData;
|
||||
|
||||
remoteDriverLock(priv);
|
||||
|
||||
memcpy (args.uuid, uuid, VIR_UUID_BUFLEN);
|
||||
|
||||
memset (&ret, 0, sizeof ret);
|
||||
if (call (conn, priv, 0, REMOTE_PROC_NWFILTER_LOOKUP_BY_UUID,
|
||||
(xdrproc_t) xdr_remote_nwfilter_lookup_by_uuid_args, (char *) &args,
|
||||
(xdrproc_t) xdr_remote_nwfilter_lookup_by_uuid_ret, (char *) &ret) == -1)
|
||||
goto done;
|
||||
|
||||
net = get_nonnull_nwfilter (conn, ret.nwfilter);
|
||||
xdr_free ((xdrproc_t) &xdr_remote_nwfilter_lookup_by_uuid_ret, (char *) &ret);
|
||||
|
||||
done:
|
||||
remoteDriverUnlock(priv);
|
||||
return net;
|
||||
}
|
||||
|
||||
static virNWFilterPtr
|
||||
remoteNWFilterLookupByName (virConnectPtr conn,
|
||||
const char *name)
|
||||
{
|
||||
virNWFilterPtr net = NULL;
|
||||
remote_nwfilter_lookup_by_name_args args;
|
||||
remote_nwfilter_lookup_by_name_ret ret;
|
||||
struct private_data *priv = conn->nwfilterPrivateData;
|
||||
|
||||
remoteDriverLock(priv);
|
||||
|
||||
args.name = (char *) name;
|
||||
|
||||
memset (&ret, 0, sizeof ret);
|
||||
if (call (conn, priv, 0, REMOTE_PROC_NWFILTER_LOOKUP_BY_NAME,
|
||||
(xdrproc_t) xdr_remote_nwfilter_lookup_by_name_args, (char *) &args,
|
||||
(xdrproc_t) xdr_remote_nwfilter_lookup_by_name_ret, (char *) &ret) == -1)
|
||||
goto done;
|
||||
|
||||
net = get_nonnull_nwfilter (conn, ret.nwfilter);
|
||||
xdr_free ((xdrproc_t) &xdr_remote_nwfilter_lookup_by_name_ret, (char *) &ret);
|
||||
|
||||
done:
|
||||
remoteDriverUnlock(priv);
|
||||
return net;
|
||||
}
|
||||
|
||||
|
||||
static char *
|
||||
remoteNWFilterGetXMLDesc (virNWFilterPtr nwfilter, unsigned int flags)
|
||||
{
|
||||
char *rv = NULL;
|
||||
remote_nwfilter_get_xml_desc_args args;
|
||||
remote_nwfilter_get_xml_desc_ret ret;
|
||||
struct private_data *priv = nwfilter->conn->nwfilterPrivateData;
|
||||
|
||||
remoteDriverLock(priv);
|
||||
|
||||
make_nonnull_nwfilter (&args.nwfilter, nwfilter);
|
||||
args.flags = flags;
|
||||
|
||||
memset (&ret, 0, sizeof ret);
|
||||
if (call (nwfilter->conn, priv, 0, REMOTE_PROC_NWFILTER_GET_XML_DESC,
|
||||
(xdrproc_t) xdr_remote_nwfilter_get_xml_desc_args, (char *) &args,
|
||||
(xdrproc_t) xdr_remote_nwfilter_get_xml_desc_ret, (char *) &ret) == -1)
|
||||
goto done;
|
||||
|
||||
/* Caller frees. */
|
||||
rv = ret.xml;
|
||||
|
||||
done:
|
||||
remoteDriverUnlock(priv);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
@ -9382,6 +9665,13 @@ get_nonnull_secret (virConnectPtr conn, remote_nonnull_secret secret)
|
||||
return virGetSecret(conn, BAD_CAST secret.uuid, secret.usageType, secret.usageID);
|
||||
}
|
||||
|
||||
static virNWFilterPtr
|
||||
get_nonnull_nwfilter (virConnectPtr conn, remote_nonnull_nwfilter nwfilter)
|
||||
{
|
||||
return virGetNWFilter (conn, nwfilter.name, BAD_CAST nwfilter.uuid);
|
||||
}
|
||||
|
||||
|
||||
/* Make remote_nonnull_domain and remote_nonnull_network. */
|
||||
static void
|
||||
make_nonnull_domain (remote_nonnull_domain *dom_dst, virDomainPtr dom_src)
|
||||
@ -9429,6 +9719,13 @@ make_nonnull_secret (remote_nonnull_secret *secret_dst, virSecretPtr secret_src)
|
||||
secret_dst->usageID = secret_src->usageID;
|
||||
}
|
||||
|
||||
static void
|
||||
make_nonnull_nwfilter (remote_nonnull_nwfilter *nwfilter_dst, virNWFilterPtr nwfilter_src)
|
||||
{
|
||||
nwfilter_dst->name = nwfilter_src->name;
|
||||
memcpy (nwfilter_dst->uuid, nwfilter_src->uuid, VIR_UUID_BUFLEN);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
unsigned long remoteVersion(void)
|
||||
@ -9635,6 +9932,19 @@ static virDeviceMonitor dev_monitor = {
|
||||
.deviceDestroy = remoteNodeDeviceDestroy
|
||||
};
|
||||
|
||||
static virNWFilterDriver nwfilter_driver = {
|
||||
.name = "remote",
|
||||
.open = remoteNWFilterOpen,
|
||||
.close = remoteNWFilterClose,
|
||||
.nwfilterLookupByUUID = remoteNWFilterLookupByUUID,
|
||||
.nwfilterLookupByName = remoteNWFilterLookupByName,
|
||||
.getXMLDesc = remoteNWFilterGetXMLDesc,
|
||||
.defineXML = remoteNWFilterDefineXML,
|
||||
.undefine = remoteNWFilterUndefine,
|
||||
.numOfNWFilters = remoteNumOfNWFilters,
|
||||
.listNWFilters = remoteListNWFilters,
|
||||
};
|
||||
|
||||
|
||||
#ifdef WITH_LIBVIRTD
|
||||
static virStateDriver state_driver = {
|
||||
@ -9659,6 +9969,7 @@ remoteRegister (void)
|
||||
if (virRegisterStorageDriver (&storage_driver) == -1) return -1;
|
||||
if (virRegisterDeviceMonitor (&dev_monitor) == -1) return -1;
|
||||
if (virRegisterSecretDriver (&secret_driver) == -1) return -1;
|
||||
if (virRegisterNWFilterDriver(&nwfilter_driver) == -1) return -1;
|
||||
#ifdef WITH_LIBVIRTD
|
||||
if (virRegisterStateDriver (&state_driver) == -1) return -1;
|
||||
#endif
|
||||
|
@ -59,6 +59,17 @@ xdr_remote_nonnull_network (XDR *xdrs, remote_nonnull_network *objp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_nonnull_nwfilter (XDR *xdrs, remote_nonnull_nwfilter *objp)
|
||||
{
|
||||
|
||||
if (!xdr_remote_nonnull_string (xdrs, &objp->name))
|
||||
return FALSE;
|
||||
if (!xdr_remote_uuid (xdrs, objp->uuid))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_nonnull_interface (XDR *xdrs, remote_nonnull_interface *objp)
|
||||
{
|
||||
@ -134,6 +145,15 @@ xdr_remote_network (XDR *xdrs, remote_network *objp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_nwfilter (XDR *xdrs, remote_nwfilter *objp)
|
||||
{
|
||||
|
||||
if (!xdr_pointer (xdrs, (char **)objp, sizeof (remote_nonnull_nwfilter), (xdrproc_t) xdr_remote_nonnull_nwfilter))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_storage_pool (XDR *xdrs, remote_storage_pool *objp)
|
||||
{
|
||||
@ -187,6 +207,8 @@ xdr_remote_error (XDR *xdrs, remote_error *objp)
|
||||
return FALSE;
|
||||
if (!xdr_remote_network (xdrs, &objp->net))
|
||||
return FALSE;
|
||||
if (!xdr_remote_nwfilter (xdrs, &objp->nwfilter))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1584,6 +1606,118 @@ xdr_remote_network_set_autostart_args (XDR *xdrs, remote_network_set_autostart_a
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_num_of_nwfilters_ret (XDR *xdrs, remote_num_of_nwfilters_ret *objp)
|
||||
{
|
||||
|
||||
if (!xdr_int (xdrs, &objp->num))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_list_nwfilters_args (XDR *xdrs, remote_list_nwfilters_args *objp)
|
||||
{
|
||||
|
||||
if (!xdr_int (xdrs, &objp->maxnames))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_list_nwfilters_ret (XDR *xdrs, remote_list_nwfilters_ret *objp)
|
||||
{
|
||||
char **objp_cpp0 = (char **) (void *) &objp->names.names_val;
|
||||
|
||||
if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->names.names_len, REMOTE_NWFILTER_NAME_LIST_MAX,
|
||||
sizeof (remote_nonnull_string), (xdrproc_t) xdr_remote_nonnull_string))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_nwfilter_lookup_by_uuid_args (XDR *xdrs, remote_nwfilter_lookup_by_uuid_args *objp)
|
||||
{
|
||||
|
||||
if (!xdr_remote_uuid (xdrs, objp->uuid))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_nwfilter_lookup_by_uuid_ret (XDR *xdrs, remote_nwfilter_lookup_by_uuid_ret *objp)
|
||||
{
|
||||
|
||||
if (!xdr_remote_nonnull_nwfilter (xdrs, &objp->nwfilter))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_nwfilter_lookup_by_name_args (XDR *xdrs, remote_nwfilter_lookup_by_name_args *objp)
|
||||
{
|
||||
|
||||
if (!xdr_remote_nonnull_string (xdrs, &objp->name))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_nwfilter_lookup_by_name_ret (XDR *xdrs, remote_nwfilter_lookup_by_name_ret *objp)
|
||||
{
|
||||
|
||||
if (!xdr_remote_nonnull_nwfilter (xdrs, &objp->nwfilter))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_nwfilter_define_xml_args (XDR *xdrs, remote_nwfilter_define_xml_args *objp)
|
||||
{
|
||||
|
||||
if (!xdr_remote_nonnull_string (xdrs, &objp->xml))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_nwfilter_define_xml_ret (XDR *xdrs, remote_nwfilter_define_xml_ret *objp)
|
||||
{
|
||||
|
||||
if (!xdr_remote_nonnull_nwfilter (xdrs, &objp->nwfilter))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_nwfilter_undefine_args (XDR *xdrs, remote_nwfilter_undefine_args *objp)
|
||||
{
|
||||
|
||||
if (!xdr_remote_nonnull_nwfilter (xdrs, &objp->nwfilter))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_nwfilter_get_xml_desc_args (XDR *xdrs, remote_nwfilter_get_xml_desc_args *objp)
|
||||
{
|
||||
|
||||
if (!xdr_remote_nonnull_nwfilter (xdrs, &objp->nwfilter))
|
||||
return FALSE;
|
||||
if (!xdr_int (xdrs, &objp->flags))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_nwfilter_get_xml_desc_ret (XDR *xdrs, remote_nwfilter_get_xml_desc_ret *objp)
|
||||
{
|
||||
|
||||
if (!xdr_remote_nonnull_string (xdrs, &objp->xml))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_num_of_interfaces_ret (XDR *xdrs, remote_num_of_interfaces_ret *objp)
|
||||
{
|
||||
|
@ -36,6 +36,7 @@ typedef remote_nonnull_string *remote_string;
|
||||
#define REMOTE_STORAGE_VOL_NAME_LIST_MAX 1024
|
||||
#define REMOTE_NODE_DEVICE_NAME_LIST_MAX 16384
|
||||
#define REMOTE_NODE_DEVICE_CAPS_LIST_MAX 16384
|
||||
#define REMOTE_NWFILTER_NAME_LIST_MAX 1024
|
||||
#define REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX 16
|
||||
#define REMOTE_NODE_MAX_CELLS 1024
|
||||
#define REMOTE_AUTH_SASL_DATA_MAX 65536
|
||||
@ -65,6 +66,12 @@ struct remote_nonnull_network {
|
||||
};
|
||||
typedef struct remote_nonnull_network remote_nonnull_network;
|
||||
|
||||
struct remote_nonnull_nwfilter {
|
||||
remote_nonnull_string name;
|
||||
remote_uuid uuid;
|
||||
};
|
||||
typedef struct remote_nonnull_nwfilter remote_nonnull_nwfilter;
|
||||
|
||||
struct remote_nonnull_interface {
|
||||
remote_nonnull_string name;
|
||||
remote_nonnull_string mac;
|
||||
@ -100,6 +107,8 @@ typedef remote_nonnull_domain *remote_domain;
|
||||
|
||||
typedef remote_nonnull_network *remote_network;
|
||||
|
||||
typedef remote_nonnull_nwfilter *remote_nwfilter;
|
||||
|
||||
typedef remote_nonnull_storage_pool *remote_storage_pool;
|
||||
|
||||
typedef remote_nonnull_storage_vol *remote_storage_vol;
|
||||
@ -118,6 +127,7 @@ struct remote_error {
|
||||
int int1;
|
||||
int int2;
|
||||
remote_network net;
|
||||
remote_nwfilter nwfilter;
|
||||
};
|
||||
typedef struct remote_error remote_error;
|
||||
|
||||
@ -890,6 +900,70 @@ struct remote_network_set_autostart_args {
|
||||
};
|
||||
typedef struct remote_network_set_autostart_args remote_network_set_autostart_args;
|
||||
|
||||
struct remote_num_of_nwfilters_ret {
|
||||
int num;
|
||||
};
|
||||
typedef struct remote_num_of_nwfilters_ret remote_num_of_nwfilters_ret;
|
||||
|
||||
struct remote_list_nwfilters_args {
|
||||
int maxnames;
|
||||
};
|
||||
typedef struct remote_list_nwfilters_args remote_list_nwfilters_args;
|
||||
|
||||
struct remote_list_nwfilters_ret {
|
||||
struct {
|
||||
u_int names_len;
|
||||
remote_nonnull_string *names_val;
|
||||
} names;
|
||||
};
|
||||
typedef struct remote_list_nwfilters_ret remote_list_nwfilters_ret;
|
||||
|
||||
struct remote_nwfilter_lookup_by_uuid_args {
|
||||
remote_uuid uuid;
|
||||
};
|
||||
typedef struct remote_nwfilter_lookup_by_uuid_args remote_nwfilter_lookup_by_uuid_args;
|
||||
|
||||
struct remote_nwfilter_lookup_by_uuid_ret {
|
||||
remote_nonnull_nwfilter nwfilter;
|
||||
};
|
||||
typedef struct remote_nwfilter_lookup_by_uuid_ret remote_nwfilter_lookup_by_uuid_ret;
|
||||
|
||||
struct remote_nwfilter_lookup_by_name_args {
|
||||
remote_nonnull_string name;
|
||||
};
|
||||
typedef struct remote_nwfilter_lookup_by_name_args remote_nwfilter_lookup_by_name_args;
|
||||
|
||||
struct remote_nwfilter_lookup_by_name_ret {
|
||||
remote_nonnull_nwfilter nwfilter;
|
||||
};
|
||||
typedef struct remote_nwfilter_lookup_by_name_ret remote_nwfilter_lookup_by_name_ret;
|
||||
|
||||
struct remote_nwfilter_define_xml_args {
|
||||
remote_nonnull_string xml;
|
||||
};
|
||||
typedef struct remote_nwfilter_define_xml_args remote_nwfilter_define_xml_args;
|
||||
|
||||
struct remote_nwfilter_define_xml_ret {
|
||||
remote_nonnull_nwfilter nwfilter;
|
||||
};
|
||||
typedef struct remote_nwfilter_define_xml_ret remote_nwfilter_define_xml_ret;
|
||||
|
||||
struct remote_nwfilter_undefine_args {
|
||||
remote_nonnull_nwfilter nwfilter;
|
||||
};
|
||||
typedef struct remote_nwfilter_undefine_args remote_nwfilter_undefine_args;
|
||||
|
||||
struct remote_nwfilter_get_xml_desc_args {
|
||||
remote_nonnull_nwfilter nwfilter;
|
||||
int flags;
|
||||
};
|
||||
typedef struct remote_nwfilter_get_xml_desc_args remote_nwfilter_get_xml_desc_args;
|
||||
|
||||
struct remote_nwfilter_get_xml_desc_ret {
|
||||
remote_nonnull_string xml;
|
||||
};
|
||||
typedef struct remote_nwfilter_get_xml_desc_ret remote_nwfilter_get_xml_desc_ret;
|
||||
|
||||
struct remote_num_of_interfaces_ret {
|
||||
int num;
|
||||
};
|
||||
@ -1964,6 +2038,13 @@ enum remote_procedure {
|
||||
REMOTE_PROC_DOMAIN_EVENT_IO_ERROR = 172,
|
||||
REMOTE_PROC_DOMAIN_EVENT_GRAPHICS = 173,
|
||||
REMOTE_PROC_DOMAIN_UPDATE_DEVICE_FLAGS = 174,
|
||||
REMOTE_PROC_NWFILTER_LOOKUP_BY_NAME = 175,
|
||||
REMOTE_PROC_NWFILTER_LOOKUP_BY_UUID = 176,
|
||||
REMOTE_PROC_NWFILTER_GET_XML_DESC = 177,
|
||||
REMOTE_PROC_NUM_OF_NWFILTERS = 178,
|
||||
REMOTE_PROC_LIST_NWFILTERS = 179,
|
||||
REMOTE_PROC_NWFILTER_DEFINE_XML = 180,
|
||||
REMOTE_PROC_NWFILTER_UNDEFINE = 181,
|
||||
};
|
||||
typedef enum remote_procedure remote_procedure;
|
||||
|
||||
@ -2001,6 +2082,7 @@ extern bool_t xdr_remote_string (XDR *, remote_string*);
|
||||
extern bool_t xdr_remote_uuid (XDR *, remote_uuid);
|
||||
extern bool_t xdr_remote_nonnull_domain (XDR *, remote_nonnull_domain*);
|
||||
extern bool_t xdr_remote_nonnull_network (XDR *, remote_nonnull_network*);
|
||||
extern bool_t xdr_remote_nonnull_nwfilter (XDR *, remote_nonnull_nwfilter*);
|
||||
extern bool_t xdr_remote_nonnull_interface (XDR *, remote_nonnull_interface*);
|
||||
extern bool_t xdr_remote_nonnull_storage_pool (XDR *, remote_nonnull_storage_pool*);
|
||||
extern bool_t xdr_remote_nonnull_storage_vol (XDR *, remote_nonnull_storage_vol*);
|
||||
@ -2008,6 +2090,7 @@ extern bool_t xdr_remote_nonnull_node_device (XDR *, remote_nonnull_node_device
|
||||
extern bool_t xdr_remote_nonnull_secret (XDR *, remote_nonnull_secret*);
|
||||
extern bool_t xdr_remote_domain (XDR *, remote_domain*);
|
||||
extern bool_t xdr_remote_network (XDR *, remote_network*);
|
||||
extern bool_t xdr_remote_nwfilter (XDR *, remote_nwfilter*);
|
||||
extern bool_t xdr_remote_storage_pool (XDR *, remote_storage_pool*);
|
||||
extern bool_t xdr_remote_storage_vol (XDR *, remote_storage_vol*);
|
||||
extern bool_t xdr_remote_node_device (XDR *, remote_node_device*);
|
||||
@ -2133,6 +2216,18 @@ extern bool_t xdr_remote_network_get_bridge_name_ret (XDR *, remote_network_get
|
||||
extern bool_t xdr_remote_network_get_autostart_args (XDR *, remote_network_get_autostart_args*);
|
||||
extern bool_t xdr_remote_network_get_autostart_ret (XDR *, remote_network_get_autostart_ret*);
|
||||
extern bool_t xdr_remote_network_set_autostart_args (XDR *, remote_network_set_autostart_args*);
|
||||
extern bool_t xdr_remote_num_of_nwfilters_ret (XDR *, remote_num_of_nwfilters_ret*);
|
||||
extern bool_t xdr_remote_list_nwfilters_args (XDR *, remote_list_nwfilters_args*);
|
||||
extern bool_t xdr_remote_list_nwfilters_ret (XDR *, remote_list_nwfilters_ret*);
|
||||
extern bool_t xdr_remote_nwfilter_lookup_by_uuid_args (XDR *, remote_nwfilter_lookup_by_uuid_args*);
|
||||
extern bool_t xdr_remote_nwfilter_lookup_by_uuid_ret (XDR *, remote_nwfilter_lookup_by_uuid_ret*);
|
||||
extern bool_t xdr_remote_nwfilter_lookup_by_name_args (XDR *, remote_nwfilter_lookup_by_name_args*);
|
||||
extern bool_t xdr_remote_nwfilter_lookup_by_name_ret (XDR *, remote_nwfilter_lookup_by_name_ret*);
|
||||
extern bool_t xdr_remote_nwfilter_define_xml_args (XDR *, remote_nwfilter_define_xml_args*);
|
||||
extern bool_t xdr_remote_nwfilter_define_xml_ret (XDR *, remote_nwfilter_define_xml_ret*);
|
||||
extern bool_t xdr_remote_nwfilter_undefine_args (XDR *, remote_nwfilter_undefine_args*);
|
||||
extern bool_t xdr_remote_nwfilter_get_xml_desc_args (XDR *, remote_nwfilter_get_xml_desc_args*);
|
||||
extern bool_t xdr_remote_nwfilter_get_xml_desc_ret (XDR *, remote_nwfilter_get_xml_desc_ret*);
|
||||
extern bool_t xdr_remote_num_of_interfaces_ret (XDR *, remote_num_of_interfaces_ret*);
|
||||
extern bool_t xdr_remote_list_interfaces_args (XDR *, remote_list_interfaces_args*);
|
||||
extern bool_t xdr_remote_list_interfaces_ret (XDR *, remote_list_interfaces_ret*);
|
||||
@ -2296,6 +2391,7 @@ extern bool_t xdr_remote_string ();
|
||||
extern bool_t xdr_remote_uuid ();
|
||||
extern bool_t xdr_remote_nonnull_domain ();
|
||||
extern bool_t xdr_remote_nonnull_network ();
|
||||
extern bool_t xdr_remote_nonnull_nwfilter ();
|
||||
extern bool_t xdr_remote_nonnull_interface ();
|
||||
extern bool_t xdr_remote_nonnull_storage_pool ();
|
||||
extern bool_t xdr_remote_nonnull_storage_vol ();
|
||||
@ -2303,6 +2399,7 @@ extern bool_t xdr_remote_nonnull_node_device ();
|
||||
extern bool_t xdr_remote_nonnull_secret ();
|
||||
extern bool_t xdr_remote_domain ();
|
||||
extern bool_t xdr_remote_network ();
|
||||
extern bool_t xdr_remote_nwfilter ();
|
||||
extern bool_t xdr_remote_storage_pool ();
|
||||
extern bool_t xdr_remote_storage_vol ();
|
||||
extern bool_t xdr_remote_node_device ();
|
||||
@ -2428,6 +2525,18 @@ extern bool_t xdr_remote_network_get_bridge_name_ret ();
|
||||
extern bool_t xdr_remote_network_get_autostart_args ();
|
||||
extern bool_t xdr_remote_network_get_autostart_ret ();
|
||||
extern bool_t xdr_remote_network_set_autostart_args ();
|
||||
extern bool_t xdr_remote_num_of_nwfilters_ret ();
|
||||
extern bool_t xdr_remote_list_nwfilters_args ();
|
||||
extern bool_t xdr_remote_list_nwfilters_ret ();
|
||||
extern bool_t xdr_remote_nwfilter_lookup_by_uuid_args ();
|
||||
extern bool_t xdr_remote_nwfilter_lookup_by_uuid_ret ();
|
||||
extern bool_t xdr_remote_nwfilter_lookup_by_name_args ();
|
||||
extern bool_t xdr_remote_nwfilter_lookup_by_name_ret ();
|
||||
extern bool_t xdr_remote_nwfilter_define_xml_args ();
|
||||
extern bool_t xdr_remote_nwfilter_define_xml_ret ();
|
||||
extern bool_t xdr_remote_nwfilter_undefine_args ();
|
||||
extern bool_t xdr_remote_nwfilter_get_xml_desc_args ();
|
||||
extern bool_t xdr_remote_nwfilter_get_xml_desc_ret ();
|
||||
extern bool_t xdr_remote_num_of_interfaces_ret ();
|
||||
extern bool_t xdr_remote_list_interfaces_args ();
|
||||
extern bool_t xdr_remote_list_interfaces_ret ();
|
||||
|
@ -103,6 +103,9 @@ const REMOTE_NODE_DEVICE_NAME_LIST_MAX = 16384;
|
||||
/* Upper limit on lists of node device capabilities. */
|
||||
const REMOTE_NODE_DEVICE_CAPS_LIST_MAX = 16384;
|
||||
|
||||
/* Upper limit on lists of network filter names. */
|
||||
const REMOTE_NWFILTER_NAME_LIST_MAX = 1024;
|
||||
|
||||
/* Upper limit on list of scheduler parameters. */
|
||||
const REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX = 16;
|
||||
|
||||
@ -176,6 +179,12 @@ struct remote_nonnull_network {
|
||||
remote_uuid uuid;
|
||||
};
|
||||
|
||||
/* A network filter which may not be NULL. */
|
||||
struct remote_nonnull_nwfilter {
|
||||
remote_nonnull_string name;
|
||||
remote_uuid uuid;
|
||||
};
|
||||
|
||||
/* An interface which may not be NULL. */
|
||||
struct remote_nonnull_interface {
|
||||
remote_nonnull_string name;
|
||||
@ -210,6 +219,7 @@ struct remote_nonnull_secret {
|
||||
/* A domain or network which may be NULL. */
|
||||
typedef remote_nonnull_domain *remote_domain;
|
||||
typedef remote_nonnull_network *remote_network;
|
||||
typedef remote_nonnull_nwfilter *remote_nwfilter;
|
||||
typedef remote_nonnull_storage_pool *remote_storage_pool;
|
||||
typedef remote_nonnull_storage_vol *remote_storage_vol;
|
||||
typedef remote_nonnull_node_device *remote_node_device;
|
||||
@ -234,6 +244,7 @@ struct remote_error {
|
||||
int int1;
|
||||
int int2;
|
||||
remote_network net;
|
||||
remote_nwfilter nwfilter;
|
||||
};
|
||||
|
||||
/* Authentication types available thus far.... */
|
||||
@ -849,6 +860,57 @@ struct remote_network_set_autostart_args {
|
||||
int autostart;
|
||||
};
|
||||
|
||||
/* network filter calls */
|
||||
|
||||
struct remote_num_of_nwfilters_ret {
|
||||
int num;
|
||||
};
|
||||
|
||||
struct remote_list_nwfilters_args {
|
||||
int maxnames;
|
||||
};
|
||||
|
||||
struct remote_list_nwfilters_ret {
|
||||
remote_nonnull_string names<REMOTE_NWFILTER_NAME_LIST_MAX>;
|
||||
};
|
||||
|
||||
struct remote_nwfilter_lookup_by_uuid_args {
|
||||
remote_uuid uuid;
|
||||
};
|
||||
|
||||
struct remote_nwfilter_lookup_by_uuid_ret {
|
||||
remote_nonnull_nwfilter nwfilter;
|
||||
};
|
||||
|
||||
struct remote_nwfilter_lookup_by_name_args {
|
||||
remote_nonnull_string name;
|
||||
};
|
||||
|
||||
struct remote_nwfilter_lookup_by_name_ret {
|
||||
remote_nonnull_nwfilter nwfilter;
|
||||
};
|
||||
|
||||
struct remote_nwfilter_define_xml_args {
|
||||
remote_nonnull_string xml;
|
||||
};
|
||||
|
||||
struct remote_nwfilter_define_xml_ret {
|
||||
remote_nonnull_nwfilter nwfilter;
|
||||
};
|
||||
|
||||
struct remote_nwfilter_undefine_args {
|
||||
remote_nonnull_nwfilter nwfilter;
|
||||
};
|
||||
|
||||
struct remote_nwfilter_get_xml_desc_args {
|
||||
remote_nonnull_nwfilter nwfilter;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct remote_nwfilter_get_xml_desc_ret {
|
||||
remote_nonnull_string xml;
|
||||
};
|
||||
|
||||
|
||||
/* Interface calls: */
|
||||
|
||||
@ -1782,7 +1844,15 @@ enum remote_procedure {
|
||||
REMOTE_PROC_DOMAIN_EVENT_WATCHDOG = 171,
|
||||
REMOTE_PROC_DOMAIN_EVENT_IO_ERROR = 172,
|
||||
REMOTE_PROC_DOMAIN_EVENT_GRAPHICS = 173,
|
||||
REMOTE_PROC_DOMAIN_UPDATE_DEVICE_FLAGS = 174
|
||||
REMOTE_PROC_DOMAIN_UPDATE_DEVICE_FLAGS = 174,
|
||||
REMOTE_PROC_NWFILTER_LOOKUP_BY_NAME = 175,
|
||||
REMOTE_PROC_NWFILTER_LOOKUP_BY_UUID = 176,
|
||||
REMOTE_PROC_NWFILTER_GET_XML_DESC = 177,
|
||||
REMOTE_PROC_NUM_OF_NWFILTERS = 178,
|
||||
REMOTE_PROC_LIST_NWFILTERS = 179,
|
||||
REMOTE_PROC_NWFILTER_DEFINE_XML = 180,
|
||||
|
||||
REMOTE_PROC_NWFILTER_UNDEFINE = 181
|
||||
|
||||
/*
|
||||
* Notice how the entries are grouped in sets of 10 ?
|
||||
|
Loading…
Reference in New Issue
Block a user