Implementing Remote Protocol for Network Metadata

- Defines wire protocol format.
- Implements remote driver.

Signed-off-by: K Shiva Kiran <shiva_kr@riseup.net>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
K Shiva Kiran 2023-08-17 00:17:11 +05:30 committed by Michal Privoznik
parent 5b6d41ccb0
commit 7ab9d1ec88
3 changed files with 56 additions and 1 deletions

View File

@ -8153,6 +8153,8 @@ static virNetworkDriver network_driver = {
.networkPortSetParameters = remoteNetworkPortSetParameters, /* 5.5.0 */ .networkPortSetParameters = remoteNetworkPortSetParameters, /* 5.5.0 */
.networkPortGetParameters = remoteNetworkPortGetParameters, /* 5.5.0 */ .networkPortGetParameters = remoteNetworkPortGetParameters, /* 5.5.0 */
.networkPortDelete = remoteNetworkPortDelete, /* 5.5.0 */ .networkPortDelete = remoteNetworkPortDelete, /* 5.5.0 */
.networkSetMetadata = remoteNetworkSetMetadata, /* 9.7.0 */
.networkGetMetadata = remoteNetworkGetMetadata, /* 9.7.0 */
}; };
static virInterfaceDriver interface_driver = { static virInterfaceDriver interface_driver = {

View File

@ -3323,6 +3323,26 @@ struct remote_network_event_lifecycle_msg {
int detail; int detail;
}; };
struct remote_network_set_metadata_args {
remote_nonnull_network network;
int type;
remote_string metadata;
remote_string key;
remote_string uri;
unsigned int flags;
};
struct remote_network_get_metadata_args {
remote_nonnull_network network;
int type;
remote_string uri;
unsigned int flags;
};
struct remote_network_get_metadata_ret {
remote_nonnull_string metadata;
};
struct remote_connect_storage_pool_event_register_any_args { struct remote_connect_storage_pool_event_register_any_args {
int eventID; int eventID;
remote_storage_pool pool; remote_storage_pool pool;
@ -6974,5 +6994,19 @@ enum remote_procedure {
* @generate: none * @generate: none
* @acl: domain:write * @acl: domain:write
*/ */
REMOTE_PROC_DOMAIN_FD_ASSOCIATE = 443 REMOTE_PROC_DOMAIN_FD_ASSOCIATE = 443,
/**
* @generate: both
* @acl: network:write
* @acl: network:save:!VIR_NETWORK_UPDATE_AFFECT_CONFIG|VIR_NETWORK_UPDATE_AFFECT_LIVE
* @acl: network:save:VIR_NETWORK_UPDATE_AFFECT_CONFIG
*/
REMOTE_PROC_NETWORK_SET_METADATA = 444,
/**
* @generate: both
* @acl: network:read
*/
REMOTE_PROC_NETWORK_GET_METADATA = 445
}; };

View File

@ -2687,6 +2687,23 @@ struct remote_network_event_lifecycle_msg {
int event; int event;
int detail; int detail;
}; };
struct remote_network_set_metadata_args {
remote_nonnull_network network;
int type;
remote_string metadata;
remote_string key;
remote_string uri;
u_int flags;
};
struct remote_network_get_metadata_args {
remote_nonnull_network network;
int type;
remote_string uri;
u_int flags;
};
struct remote_network_get_metadata_ret {
remote_nonnull_string metadata;
};
struct remote_connect_storage_pool_event_register_any_args { struct remote_connect_storage_pool_event_register_any_args {
int eventID; int eventID;
remote_storage_pool pool; remote_storage_pool pool;
@ -3717,4 +3734,6 @@ enum remote_procedure {
REMOTE_PROC_DOMAIN_RESTORE_PARAMS = 441, REMOTE_PROC_DOMAIN_RESTORE_PARAMS = 441,
REMOTE_PROC_DOMAIN_ABORT_JOB_FLAGS = 442, REMOTE_PROC_DOMAIN_ABORT_JOB_FLAGS = 442,
REMOTE_PROC_DOMAIN_FD_ASSOCIATE = 443, REMOTE_PROC_DOMAIN_FD_ASSOCIATE = 443,
REMOTE_PROC_NETWORK_SET_METADATA = 444,
REMOTE_PROC_NETWORK_GET_METADATA = 445,
}; };