Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy(a)virtuozzo.com>
Signed-off-by: Maxim Nestratov <mnestratov(a)virtuozzo.com>
---
daemon/libvirtd.c | 10 +
daemon/remote.c | 35 ++++
src/check-driverimpls.pl | 2 +
src/driver.h | 1 +
src/remote/remote_driver.c | 66 ++++++
src/remote/remote_protocol.x | 466 ++++++++++++++++++++++++++++++++++++++++++-
src/remote_protocol-structs | 165 +++++++++++++++
src/rpc/gendispatch.pl | 23 ++-
8 files changed, 760 insertions(+), 8 deletions(-)
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index 95c1b1c..b6d4d80 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -92,6 +92,9 @@
# ifdef WITH_STORAGE
# include "storage/storage_driver.h"
# endif
+# ifdef WITH_FS
+# include "fs/fs_driver.h"
+# endif
# ifdef WITH_NODE_DEVICES
# include "node_device/node_device_driver.h"
# endif
@@ -374,6 +377,9 @@ static void daemonInitialize(void)
# ifdef WITH_NWFILTER
virDriverLoadModule("nwfilter");
# endif
+# ifdef WITH_FS
+ virDriverLoadModule("fs");
+# endif
# ifdef WITH_XEN
virDriverLoadModule("xen");
# endif
@@ -398,6 +404,7 @@ static void daemonInitialize(void)
# ifdef WITH_VZ
virDriverLoadModule("vz");
# endif
+
#else
# ifdef WITH_NETWORK
networkRegister();
@@ -408,6 +415,9 @@ static void daemonInitialize(void)
# ifdef WITH_STORAGE
storageRegister();
# endif
+# ifdef WITH_FS
+ fsRegister();
+# endif
# ifdef WITH_NODE_DEVICES
nodedevRegister();
# endif
diff --git a/daemon/remote.c b/daemon/remote.c
index e414f92..98cd9f6 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -88,6 +88,8 @@ static virNetworkPtr get_nonnull_network(virConnectPtr conn,
remote_nonnull_netw
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);
+static virFSPoolPtr get_nonnull_fspool(virConnectPtr conn, remote_nonnull_fspool
fspool);
+static virFSItemPtr get_nonnull_fsitem(virConnectPtr conn, remote_nonnull_fsitem item);
static virSecretPtr get_nonnull_secret(virConnectPtr conn, remote_nonnull_secret
secret);
static virNWFilterPtr get_nonnull_nwfilter(virConnectPtr conn, remote_nonnull_nwfilter
nwfilter);
static virDomainSnapshotPtr get_nonnull_domain_snapshot(virDomainPtr dom,
remote_nonnull_domain_snapshot snapshot);
@@ -97,6 +99,8 @@ static void make_nonnull_network(remote_nonnull_network *net_dst,
virNetworkPtr
static void make_nonnull_interface(remote_nonnull_interface *interface_dst,
virInterfacePtr interface_src);
static void make_nonnull_storage_pool(remote_nonnull_storage_pool *pool_dst,
virStoragePoolPtr pool_src);
static void make_nonnull_storage_vol(remote_nonnull_storage_vol *vol_dst,
virStorageVolPtr vol_src);
+static void make_nonnull_fspool(remote_nonnull_fspool *fspool_dst, virFSPoolPtr
fspool_src);
+static void make_nonnull_fsitem(remote_nonnull_fsitem *item_dst, virFSItemPtr item_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);
@@ -6660,6 +6664,22 @@ get_nonnull_domain_snapshot(virDomainPtr dom,
remote_nonnull_domain_snapshot sna
return virGetDomainSnapshot(dom, snapshot.name);
}
+static virFSPoolPtr
+get_nonnull_fspool(virConnectPtr conn, remote_nonnull_fspool fspool)
+{
+ return virGetFSPool(conn, fspool.name, BAD_CAST fspool.uuid,
+ NULL, NULL);
+}
+
+static virFSItemPtr
+get_nonnull_fsitem(virConnectPtr conn, remote_nonnull_fsitem item)
+{
+ virFSItemPtr ret;
+ ret = virGetFSItem(conn, item.fspool, item.name, item.key,
+ NULL, NULL);
+ return ret;
+}
+
static virNodeDevicePtr
get_nonnull_node_device(virConnectPtr conn, remote_nonnull_node_device dev)
{
@@ -6706,6 +6726,21 @@ make_nonnull_storage_vol(remote_nonnull_storage_vol *vol_dst,
virStorageVolPtr v
}
static void
+make_nonnull_fspool(remote_nonnull_fspool *fspool_dst, virFSPoolPtr fspool_src)
+{
+ ignore_value(VIR_STRDUP_QUIET(fspool_dst->name, fspool_src->name));
+ memcpy(fspool_dst->uuid, fspool_src->uuid, VIR_UUID_BUFLEN);
+}
+
+static void
+make_nonnull_fsitem(remote_nonnull_fsitem *item_dst, virFSItemPtr item_src)
+{
+ ignore_value(VIR_STRDUP_QUIET(item_dst->fspool, item_src->fspool));
+ ignore_value(VIR_STRDUP_QUIET(item_dst->name, item_src->name));
+ ignore_value(VIR_STRDUP_QUIET(item_dst->key, item_src->key));
+}
+
+static void
make_nonnull_node_device(remote_nonnull_node_device *dev_dst, virNodeDevicePtr dev_src)
{
ignore_value(VIR_STRDUP_QUIET(dev_dst->name, dev_src->name));
diff --git a/src/check-driverimpls.pl b/src/check-driverimpls.pl
index e320558..bd86886 100755
--- a/src/check-driverimpls.pl
+++ b/src/check-driverimpls.pl
@@ -54,6 +54,8 @@ while (<>) {
if ($api !~ /^$mainprefix/) {
$suffix =~ s/^[a-z]+(?:Unified)?//;
$suffix =~ s/^([A-Z]+)/lc $1/e;
+ $suffix =~ s/fsitem/fsItem/;
+ $suffix =~ s/fspool/fsPool/;
}
if ($api ne $suffix) {
diff --git a/src/driver.h b/src/driver.h
index fb93083..64f7460 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -87,6 +87,7 @@ struct _virConnectDriver {
virNWFilterDriverPtr nwfilterDriver;
virSecretDriverPtr secretDriver;
virStorageDriverPtr storageDriver;
+ virFSDriverPtr fsDriver;
};
int virRegisterConnectDriver(virConnectDriverPtr driver,
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 3b8b796..e6cb753 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -144,6 +144,8 @@ static virNWFilterPtr get_nonnull_nwfilter(virConnectPtr conn,
remote_nonnull_nw
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);
+static virFSPoolPtr get_nonnull_fspool(virConnectPtr conn, remote_nonnull_fspool
fspool);
+static virFSItemPtr get_nonnull_fsitem(virConnectPtr conn, remote_nonnull_fsitem item);
static virNodeDevicePtr get_nonnull_node_device(virConnectPtr conn,
remote_nonnull_node_device dev);
static virSecretPtr get_nonnull_secret(virConnectPtr conn, remote_nonnull_secret
secret);
static virDomainSnapshotPtr get_nonnull_domain_snapshot(virDomainPtr domain,
remote_nonnull_domain_snapshot snapshot);
@@ -152,6 +154,8 @@ static void make_nonnull_network(remote_nonnull_network *net_dst,
virNetworkPtr
static void make_nonnull_interface(remote_nonnull_interface *interface_dst,
virInterfacePtr interface_src);
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_fspool(remote_nonnull_fspool *fspool_dst, virFSPoolPtr
fspool_src);
+static void make_nonnull_fsitem(remote_nonnull_fsitem *item_dst, virFSItemPtr item_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);
@@ -7841,6 +7845,19 @@ get_nonnull_storage_vol(virConnectPtr conn,
remote_nonnull_storage_vol vol)
NULL, NULL);
}
+static virFSPoolPtr
+get_nonnull_fspool(virConnectPtr conn, remote_nonnull_fspool fspool)
+{
+ return virGetFSPool(conn, fspool.name, BAD_CAST fspool.uuid,
+ NULL, NULL);
+}
+
+static virFSItemPtr
+get_nonnull_fsitem(virConnectPtr conn, remote_nonnull_fsitem item)
+{
+ return virGetFSItem(conn, item.fspool, item.name, item.key,
+ NULL, NULL);
+}
static virNodeDevicePtr
get_nonnull_node_device(virConnectPtr conn, remote_nonnull_node_device dev)
{
@@ -7906,6 +7923,21 @@ make_nonnull_storage_vol(remote_nonnull_storage_vol *vol_dst,
virStorageVolPtr v
}
static void
+make_nonnull_fspool(remote_nonnull_fspool *fspool_dst, virFSPoolPtr fspool_src)
+{
+ fspool_dst->name = fspool_src->name;
+ memcpy(fspool_dst->uuid, fspool_src->uuid, VIR_UUID_BUFLEN);
+}
+
+static void
+make_nonnull_fsitem(remote_nonnull_fsitem *item_dst, virFSItemPtr item_src)
+{
+ item_dst->fspool = item_src->fspool;
+ item_dst->name = item_src->name;
+ item_dst->key = item_src->key;
+}
+
+static void
make_nonnull_secret(remote_nonnull_secret *secret_dst, virSecretPtr secret_src)
{
memcpy(secret_dst->uuid, secret_src->uuid, VIR_UUID_BUFLEN);
@@ -8296,6 +8328,39 @@ static virNWFilterDriver nwfilter_driver = {
.connectListAllNWFilters = remoteConnectListAllNWFilters, /* 0.10.2 */
};
+static virFSDriver fspool_driver = {
+ .fsPoolLookupByName = remoteFSPoolLookupByName,
+ .fsPoolLookupByUUID = remoteFSPoolLookupByUUID,
+ .fsPoolLookupByItem = remoteFSPoolLookupByItem,
+ .fsPoolCreateXML = remoteFSPoolCreateXML,
+ .fsPoolDefineXML = remoteFSPoolDefineXML,
+ .fsPoolBuild = remoteFSPoolBuild,
+ .fsPoolUndefine = remoteFSPoolUndefine,
+ .fsPoolCreate = remoteFSPoolCreate,
+ .fsPoolDestroy = remoteFSPoolDestroy,
+ .fsPoolDelete = remoteFSPoolDelete,
+ .fsPoolRefresh = remoteFSPoolRefresh,
+ .fsPoolGetInfo = remoteFSPoolGetInfo,
+ .fsPoolGetXMLDesc = remoteFSPoolGetXMLDesc,
+ .fsPoolGetAutostart = remoteFSPoolGetAutostart,
+ .fsPoolSetAutostart = remoteFSPoolSetAutostart,
+ .fsPoolNumOfItems = remoteFSPoolNumOfItems,
+ .fsPoolListItems = remoteFSPoolListItems,
+ .fsPoolListAllItems = remoteFSPoolListAllItems,
+ .fsItemLookupByName = remoteFSItemLookupByName,
+ .fsItemLookupByKey = remoteFSItemLookupByKey,
+ .fsItemLookupByPath = remoteFSItemLookupByPath,
+ .fsItemCreateXML = remoteFSItemCreateXML,
+ .fsItemCreateXMLFrom = remoteFSItemCreateXMLFrom,
+ .fsItemDelete = remoteFSItemDelete,
+ .fsItemGetInfo = remoteFSItemGetInfo,
+ .fsItemGetXMLDesc = remoteFSItemGetXMLDesc,
+ .fsItemGetPath = remoteFSItemGetPath,
+ .fsPoolIsActive = remoteFSPoolIsActive,
+ .fsPoolIsPersistent = remoteFSPoolIsPersistent,
+ .connectListAllFSPools = remoteConnectListAllFSPools,
+};
+
static virConnectDriver connect_driver = {
.hypervisorDriver = &hypervisor_driver,
.interfaceDriver = &interface_driver,
@@ -8304,6 +8369,7 @@ static virConnectDriver connect_driver = {
.nwfilterDriver = &nwfilter_driver,
.secretDriver = &secret_driver,
.storageDriver = &storage_driver,
+ .fsDriver = &fspool_driver,
};
static virStateDriver state_driver = {
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
index 8a8e263..320e773 100644
--- a/src/remote/remote_protocol.x
+++ b/src/remote/remote_protocol.x
@@ -85,6 +85,12 @@ const REMOTE_STORAGE_POOL_LIST_MAX = 4096;
/* Upper limit on lists of storage vols. */
const REMOTE_STORAGE_VOL_LIST_MAX = 16384;
+/* Upper limit on lists of fspools. */
+const REMOTE_FSPOOL_LIST_MAX = 4096;
+
+/* Upper limit on lists of fsitems. */
+const REMOTE_FSITEM_LIST_MAX = 16384;
+
/* Upper limit on lists of node devices. */
const REMOTE_NODE_DEVICE_LIST_MAX = 16384;
@@ -294,6 +300,19 @@ struct remote_nonnull_storage_vol {
remote_nonnull_string key;
};
+/* A fspool which may not be NULL. */
+struct remote_nonnull_fspool {
+ remote_nonnull_string name;
+ remote_uuid uuid;
+};
+
+/* A fsitem which may not be NULL. */
+struct remote_nonnull_fsitem {
+ remote_nonnull_string fspool;
+ remote_nonnull_string name;
+ remote_nonnull_string key;
+};
+
/* A node device which may not be NULL. */
struct remote_nonnull_node_device {
remote_nonnull_string name;
@@ -318,6 +337,8 @@ 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_fspool *remote_fspool;
+typedef remote_nonnull_fsitem *remote_fsitem;
typedef remote_nonnull_node_device *remote_node_device;
/* Error message. See <virterror.h> for explanation of fields. */
@@ -1955,6 +1976,206 @@ struct remote_storage_vol_resize_args {
unsigned int flags;
};
+/* FS pool calls: */
+
+struct remote_fspool_lookup_by_uuid_args {
+ remote_uuid uuid;
+};
+
+struct remote_fspool_lookup_by_uuid_ret {
+ remote_nonnull_fspool pool;
+};
+
+struct remote_fspool_lookup_by_name_args {
+ remote_nonnull_string name;
+};
+
+struct remote_fspool_lookup_by_name_ret {
+ remote_nonnull_fspool fspool;
+};
+
+struct remote_fspool_lookup_by_item_args {
+ remote_nonnull_fsitem item;
+};
+
+struct remote_fspool_lookup_by_item_ret {
+ remote_nonnull_fspool fspool;
+};
+
+struct remote_fspool_create_xml_args {
+ remote_nonnull_string xml;
+ unsigned int flags;
+};
+
+struct remote_fspool_create_xml_ret {
+ remote_nonnull_fspool fspool;
+};
+
+struct remote_fspool_define_xml_args {
+ remote_nonnull_string xml;
+ unsigned int flags;
+};
+
+struct remote_fspool_define_xml_ret {
+ remote_nonnull_fspool fspool;
+};
+
+struct remote_fspool_build_args {
+ remote_nonnull_fspool fspool;
+ unsigned int flags;
+};
+
+struct remote_fspool_undefine_args {
+ remote_nonnull_fspool fspool;
+};
+
+struct remote_fspool_create_args {
+ remote_nonnull_fspool fspool;
+ unsigned int flags;
+};
+
+struct remote_fspool_destroy_args {
+ remote_nonnull_fspool fspool;
+};
+struct remote_fspool_delete_args {
+ remote_nonnull_fspool fspool;
+ unsigned int flags;
+};
+
+struct remote_fspool_get_xml_desc_args {
+ remote_nonnull_fspool fspool;
+ unsigned int flags;
+};
+
+struct remote_fs_pool_get_xml_desc_ret {
+ remote_nonnull_string xml;
+};
+
+struct remote_fspool_get_info_args {
+ remote_nonnull_fspool fspool;
+};
+
+struct remote_fspool_get_info_ret { /* insert@1 */
+ unsigned char state;
+ unsigned hyper capacity;
+ unsigned hyper allocation;
+ unsigned hyper available;
+};
+
+struct remote_fspool_get_autostart_args {
+ remote_nonnull_fspool fspool;
+};
+
+struct remote_fspool_get_autostart_ret {
+ int autostart;
+};
+
+struct remote_fspool_set_autostart_args {
+ remote_nonnull_fspool fspool;
+ int autostart;
+};
+
+struct remote_fspool_num_of_items_args {
+ remote_nonnull_fspool fspool;
+};
+
+struct remote_fspool_num_of_items_ret {
+ int num;
+};
+
+struct remote_fspool_list_items_args {
+ remote_nonnull_fspool fspool;
+ int maxnames;
+};
+
+struct remote_fspool_list_items_ret {
+ remote_nonnull_string names<REMOTE_FSITEM_LIST_MAX>; /* insert@1 */
+};
+struct remote_fspool_refresh_args {
+ remote_nonnull_fspool fspool;
+ unsigned int flags;
+};
+
+/* FS item calls: */
+
+struct remote_fsitem_lookup_by_name_args {
+ remote_nonnull_fspool fspool;
+ remote_nonnull_string name;
+};
+
+struct remote_fsitem_lookup_by_name_ret {
+ remote_nonnull_fsitem item;
+};
+
+struct remote_fsitem_lookup_by_key_args {
+ remote_nonnull_string key;
+};
+
+struct remote_fsitem_lookup_by_key_ret {
+ remote_nonnull_fsitem item;
+};
+
+struct remote_fsitem_lookup_by_path_args {
+ remote_nonnull_string path;
+};
+
+struct remote_fsitem_lookup_by_path_ret {
+ remote_nonnull_fsitem item;
+};
+
+struct remote_fsitem_create_xml_args {
+ remote_nonnull_fspool fspool;
+ remote_nonnull_string xml;
+ unsigned int flags;
+};
+
+struct remote_fsitem_create_xml_ret {
+ remote_nonnull_fsitem item;
+};
+
+struct remote_fsitem_create_xml_from_args {
+ remote_nonnull_fspool fspool;
+ remote_nonnull_string xml;
+ remote_nonnull_fsitem cloneitem;
+ unsigned int flags;
+};
+
+struct remote_fsitem_create_xml_from_ret {
+ remote_nonnull_fsitem item;
+};
+
+struct remote_fsitem_delete_args {
+ remote_nonnull_fsitem item;
+ unsigned int flags;
+};
+
+struct remote_fsitem_get_xml_desc_args {
+ remote_nonnull_fsitem item;
+ unsigned int flags;
+};
+
+struct remote_fsitem_get_xml_desc_ret {
+ remote_nonnull_string xml;
+};
+
+struct remote_fsitem_get_info_args {
+ remote_nonnull_fsitem item;
+};
+
+struct remote_fsitem_get_info_ret { /* insert@1 */
+ char type;
+ unsigned hyper capacity;
+ unsigned hyper allocation;
+};
+
+struct remote_fsitem_get_path_args {
+ remote_nonnull_fsitem item;
+};
+
+struct remote_fsitem_get_path_ret {
+ remote_nonnull_string name;
+};
+
/* Node driver calls: */
struct remote_node_num_of_devices_args {
@@ -2244,7 +2465,21 @@ struct remote_storage_pool_is_persistent_ret {
int persistent;
};
+struct remote_fspool_is_active_args {
+ remote_nonnull_fspool fspool;
+};
+struct remote_fspool_is_active_ret {
+ int active;
+};
+
+struct remote_fspool_is_persistent_args {
+ remote_nonnull_fspool fspool;
+};
+
+struct remote_fspool_is_persistent_ret {
+ int persistent;
+};
struct remote_interface_is_active_args {
remote_nonnull_interface iface;
};
@@ -2874,6 +3109,27 @@ struct remote_storage_pool_list_all_volumes_ret { /* insert@1 */
unsigned int ret;
};
+struct remote_connect_list_all_fspools_args {
+ int need_results;
+ unsigned int flags;
+};
+
+struct remote_connect_list_all_fspools_ret { /* insert@1 */
+ remote_nonnull_fspool fspools<REMOTE_FSPOOL_LIST_MAX>;
+ unsigned int ret;
+};
+
+struct remote_fspool_list_all_items_args {
+ remote_nonnull_fspool fspool;
+ int need_results;
+ unsigned int flags;
+};
+
+struct remote_fspool_list_all_items_ret { /* insert@1 */
+ remote_nonnull_fsitem items<REMOTE_FSITEM_LIST_MAX>;
+ unsigned int ret;
+};
+
struct remote_connect_list_all_networks_args {
int need_results;
unsigned int flags;
@@ -5934,5 +6190,213 @@ enum remote_procedure {
* @generate: both
* @acl: none
*/
- REMOTE_PROC_NODE_DEVICE_EVENT_UPDATE = 377
+ REMOTE_PROC_NODE_DEVICE_EVENT_UPDATE = 377,
+
+ /**
+ * @generate: both
+ * @acl: fspool:start
+ * @acl: fspool:write
+ */
+ REMOTE_PROC_FSPOOL_CREATE_XML = 382,
+
+ /**
+ * @generate: both
+ * @priority: high
+ * @acl: fspool:write
+ * @acl: fspool:save
+ */
+ REMOTE_PROC_FSPOOL_DEFINE_XML = 383,
+
+ /**
+ * @generate: both
+ * @acl: fspool:format
+ */
+ REMOTE_PROC_FSPOOL_BUILD = 384,
+
+ /**
+ * @generate: both
+ * @acl: fspool:format
+ */
+ REMOTE_PROC_FSPOOL_DELETE = 385,
+
+ /**
+ * @generate: both
+ * @priority: high
+ * @acl: fspool:delete
+ */
+ REMOTE_PROC_FSPOOL_UNDEFINE = 386,
+
+ /**
+ * @generate: both
+ * @priority: high
+ * @acl: fspool:getattr
+ */
+ REMOTE_PROC_FSPOOL_LOOKUP_BY_NAME = 387,
+
+ /**
+ * @generate: both
+ * @priority: high
+ * @acl: fspool:getattr
+ */
+ REMOTE_PROC_FSPOOL_LOOKUP_BY_UUID = 388,
+
+ /**
+ * @generate: both
+ * @priority: high
+ * @acl: fspool:getattr
+ */
+ REMOTE_PROC_FSPOOL_LOOKUP_BY_ITEM = 389,
+
+ /**
+ * @generate: both
+ * @priority: high
+ * @acl: fspool:read
+ */
+ REMOTE_PROC_FSPOOL_GET_INFO = 390,
+
+ /**
+ * @generate: both
+ * @priority: high
+ * @acl: fspool:read
+ */
+ REMOTE_PROC_FSPOOL_GET_XML_DESC = 391,
+
+ /**
+ * @generate: both
+ * @priority: high
+ * @acl: fspool:search_items
+ * @aclfilter: fsitem:getattr
+ */
+ REMOTE_PROC_FSPOOL_NUM_OF_ITEMS = 392,
+
+ /**
+ * @generate: both
+ * @priority: high
+ * @acl: fspool:search_items
+ * @aclfilter: fsitem:getattr
+ */
+ REMOTE_PROC_FSPOOL_LIST_ITEMS = 393,
+
+ /**
+ * @generate: both
+ * @acl: fsitem:create
+ */
+ REMOTE_PROC_FSITEM_CREATE_XML = 394,
+
+ /**
+ * @generate: both
+ * @acl: fsitem:delete
+ */
+ REMOTE_PROC_FSITEM_DELETE = 395,
+
+ /**
+ * @generate: both
+ * @priority: high
+ * @acl: fsitem:getattr
+ */
+ REMOTE_PROC_FSITEM_LOOKUP_BY_NAME = 396,
+
+ /**
+ * @generate: both
+ * @priority: high
+ * @acl: fsitem:getattr
+ */
+ REMOTE_PROC_FSITEM_LOOKUP_BY_KEY = 397,
+
+ /**
+ * @generate: both
+ * @priority: high
+ * @acl: fsitem:getattr
+ */
+ REMOTE_PROC_FSITEM_LOOKUP_BY_PATH = 398,
+
+ /**
+ * @generate: both
+ * @priority: high
+ * @acl: fsitem:read
+ */
+ REMOTE_PROC_FSITEM_GET_INFO = 399,
+
+ /**
+ * @generate: both
+ * @priority: high
+ * @acl: fsitem:read
+ */
+ REMOTE_PROC_FSITEM_GET_XML_DESC = 400,
+
+ /**
+ * @generate: both
+ * @priority: high
+ * @acl: fsitem:read
+ */
+ REMOTE_PROC_FSITEM_GET_PATH = 401,
+
+ /**
+ * @generate: both
+ * @acl: fsitem:create
+ */
+ REMOTE_PROC_FSITEM_CREATE_XML_FROM = 402,
+
+ /**
+ * @generate: both
+ * @priority: high
+ * @acl: connect:search_fspools
+ * @aclfilter: fspool:getattr
+ */
+ REMOTE_PROC_CONNECT_LIST_ALL_FSPOOLS = 403,
+
+ /**
+ * @generate: both
+ * @priority: high
+ * @acl: fspool:search_items
+ * @aclfilter: fsitem:getattr
+ */
+ REMOTE_PROC_FSPOOL_LIST_ALL_ITEMS = 404,
+
+ /**
+ * @generate: both
+ * @acl: fspool:refresh
+ */
+ REMOTE_PROC_FSPOOL_REFRESH = 405,
+
+ /**
+ * @generate: both
+ * @priority: high
+ * @acl: fspool:read
+ */
+ REMOTE_PROC_FSPOOL_IS_ACTIVE = 406,
+
+ /**
+ * @generate: both
+ * @priority: high
+ * @acl: fspool:read
+ */
+ REMOTE_PROC_FSPOOL_IS_PERSISTENT = 407,
+
+ /**
+ * @generate: both
+ * @priority: high
+ * @acl: fspool:read
+ */
+ REMOTE_PROC_FSPOOL_GET_AUTOSTART = 408,
+
+ /**
+ * @generate: both
+ * @priority: high
+ * @acl: fspool:write
+ */
+ REMOTE_PROC_FSPOOL_SET_AUTOSTART = 409,
+
+ /**
+ * @generate: both
+ * @acl: fspool:start
+ */
+ REMOTE_PROC_FSPOOL_CREATE = 410,
+
+ /**
+ * @generate: both
+ * @priority: high
+ * @acl: fspool:stop
+ */
+ REMOTE_PROC_FSPOOL_DESTROY = 411
};
diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs
index b71accc..bac0efb 100644
--- a/src/remote_protocol-structs
+++ b/src/remote_protocol-structs
@@ -34,6 +34,15 @@ struct remote_nonnull_storage_vol {
remote_nonnull_string name;
remote_nonnull_string key;
};
+struct remote_nonnull_fspool {
+ remote_nonnull_string name;
+ remote_uuid uuid;
+};
+struct remote_nonnull_fsitem {
+ remote_nonnull_string fspool;
+ remote_nonnull_string name;
+ remote_nonnull_string key;
+};
struct remote_nonnull_node_device {
remote_nonnull_string name;
};
@@ -1483,6 +1492,162 @@ struct remote_storage_vol_resize_args {
uint64_t capacity;
u_int flags;
};
+struct remote_fspool_lookup_by_uuid_args {
+ remote_uuid uuid;
+};
+struct remote_fspool_lookup_by_uuid_ret {
+ remote_nonnull_fspool pool;
+};
+struct remote_fspool_lookup_by_name_args {
+ remote_nonnull_string name;
+};
+struct remote_fspool_lookup_by_name_ret {
+ remote_nonnull_fspool fspool;
+};
+struct remote_fspool_lookup_by_item_args {
+ remote_nonnull_fsitem item;
+};
+struct remote_fspool_lookup_by_item_ret {
+ remote_nonnull_fspool fspool;
+};
+struct remote_fspool_create_xml_args {
+ remote_nonnull_string xml;
+ unsigned int flags;
+};
+struct remote_fspool_create_xml_ret {
+ remote_nonnull_fspool fspool;
+};
+struct remote_fspool_define_xml_args {
+ remote_nonnull_string xml;
+ unsigned int flags;
+};
+struct remote_fspool_define_xml_ret {
+ remote_nonnull_fspool fspool;
+};
+struct remote_fspool_build_args {
+ remote_nonnull_fspool fspool;
+ unsigned int flags;
+};
+struct remote_fspool_undefine_args {
+ remote_nonnull_fspool fspool;
+};
+struct remote_fspool_create_args {
+ remote_nonnull_fspool fspool;
+ unsigned int flags;
+};
+
+struct remote_fspool_destroy_args {
+ remote_nonnull_fspool fspool;
+};
+struct remote_fspool_delete_args {
+ remote_nonnull_fspool fspool;
+ unsigned int flags;
+};
+struct remote_fspool_get_xml_desc_args {
+ remote_nonnull_fspool fspool;
+ unsigned int flags;
+};
+struct remote_fs_pool_get_xml_desc_ret {
+ remote_nonnull_string xml;
+};
+struct remote_fspool_get_info_args {
+ remote_nonnull_fspool fspool;
+};
+struct remote_fspool_get_info_ret {
+ unsigned char state;
+ unsigned hyper capacity;
+ unsigned hyper allocation;
+ unsigned hyper available;
+};
+struct remote_fspool_get_autostart_args {
+ remote_nonnull_fspool fspool;
+};
+struct remote_fspool_get_autostart_ret {
+ int autostart;
+};
+struct remote_fspool_set_autostart_args {
+ remote_nonnull_fspool fspool;
+ int autostart;
+};
+struct remote_fspool_num_of_items_args {
+ remote_nonnull_fspool fspool;
+};
+struct remote_fspool_num_of_items_ret {
+ int num;
+};
+struct remote_fspool_list_items_args {
+ remote_nonnull_fspool fspool;
+ int maxnames;
+};
+
+struct remote_fspool_list_items_ret {
+ remote_nonnull_string names<REMOTE_FSITEM_LIST_MAX>;
+};
+struct remote_fspool_refresh_args {
+ remote_nonnull_fspool fspool;
+ unsigned int flags;
+};
+struct remote_fsitem_lookup_by_name_args {
+ remote_nonnull_fspool fspool;
+ remote_nonnull_string name;
+};
+struct remote_fsitem_lookup_by_name_ret {
+ remote_nonnull_fsitem item;
+};
+struct remote_fsitem_lookup_by_key_args {
+ remote_nonnull_string key;
+};
+struct remote_fsitem_lookup_by_key_ret {
+ remote_nonnull_fsitem item;
+};
+struct remote_fsitem_lookup_by_path_args {
+ remote_nonnull_string path;
+};
+struct remote_fsitem_lookup_by_path_ret {
+ remote_nonnull_fsitem item;
+};
+struct remote_fsitem_create_xml_args {
+ remote_nonnull_fspool fspool;
+ remote_nonnull_string xml;
+ unsigned int flags;
+};
+struct remote_fsitem_create_xml_ret {
+ remote_nonnull_fsitem item;
+};
+struct remote_fsitem_create_xml_from_args {
+ remote_nonnull_fspool fspool;
+ remote_nonnull_string xml;
+ remote_nonnull_fsitem cloneitem;
+ unsigned int flags;
+};
+struct remote_fsitem_create_xml_from_ret {
+ remote_nonnull_fsitem item;
+};
+struct remote_fsitem_delete_args {
+ remote_nonnull_fsitem item;
+ unsigned int flags;
+};
+struct remote_fsitem_get_xml_desc_args {
+ remote_nonnull_fsitem item;
+ unsigned int flags;
+};
+struct remote_fsitem_get_xml_desc_ret {
+ remote_nonnull_string xml;
+};
+struct remote_fsitem_get_info_args {
+ remote_nonnull_fsitem item;
+};
+struct remote_fsitem_get_info_ret {
+ char type;
+ unsigned hyper capacity;
+ unsigned hyper allocation;
+};
+struct remote_fsitem_get_path_args {
+ remote_nonnull_fsitem item;
+};
+struct remote_fsitem_get_path_ret {
+ remote_nonnull_string name;
+};
struct remote_node_num_of_devices_args {
remote_string cap;
u_int flags;
diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl
index 173189c..7fd0bbd 100755
--- a/src/rpc/gendispatch.pl
+++ b/src/rpc/gendispatch.pl
@@ -56,6 +56,8 @@ sub fixup_name {
my $name = shift;
$name =~ s/Nwfilter/NWFilter/;
+ $name =~ s/Fspool/FSPool/;
+ $name =~ s/Fsitem/FSItem/;
$name =~ s/Xml$/XML/;
$name =~ s/Uri$/URI/;
$name =~ s/Uuid$/UUID/;
@@ -500,7 +502,7 @@ elsif ($mode eq "server") {
if ($args_member =~ m/^remote_nonnull_string name;/ and $has_node_device)
{
# ignore the name arg for node devices
next
- } elsif ($args_member =~
m/^remote_nonnull_(domain|network|storage_pool|storage_vol|interface|secret|nwfilter)
(\S+);/) {
+ } elsif ($args_member =~
m/^remote_nonnull_(domain|network|storage_pool|storage_vol|interface|secret|nwfilter|fspool|fsitem)
(\S+);/) {
my $type_name = name_to_TypeName($1);
push(@vars_list, "vir${type_name}Ptr $2 = NULL");
@@ -665,7 +667,7 @@ elsif ($mode eq "server") {
if (!$modern_ret_as_list) {
push(@ret_list, "ret->$3 = tmp.$3;");
}
- } elsif ($ret_member =~
m/(?:admin|remote)_nonnull_(secret|nwfilter|node_device|interface|network|storage_vol|storage_pool|domain_snapshot|domain|server|client)
(\S+)<(\S+)>;/) {
+ } elsif ($ret_member =~
m/(?:admin|remote)_nonnull_(secret|nwfilter|node_device|interface|network|storage_vol|storage_pool|domain_snapshot|domain|server|client|fspool|fsitem)
(\S+)<(\S+)>;/) {
$modern_ret_struct_name = $1;
$single_ret_list_error_msg_type = $1;
$single_ret_list_name = $2;
@@ -723,7 +725,7 @@ elsif ($mode eq "server") {
$single_ret_var = $1;
$single_ret_by_ref = 0;
$single_ret_check = " == NULL";
- } elsif ($ret_member =~
m/^remote_nonnull_(domain|network|storage_pool|storage_vol|interface|node_device|secret|nwfilter|domain_snapshot)
(\S+);/) {
+ } elsif ($ret_member =~
m/^remote_nonnull_(domain|network|storage_pool|storage_vol|interface|node_device|secret|nwfilter|domain_snapshot|fspool|fsitem)
(\S+);/) {
my $type_name = name_to_TypeName($1);
if ($call->{ProcName} eq "DomainCreateWithFlags") {
@@ -1268,7 +1270,7 @@ elsif ($mode eq "client") {
$priv_src = "dev->conn";
push(@args_list, "virNodeDevicePtr dev");
push(@setters_list, "args.name = dev->name;");
- } elsif ($args_member =~
m/^remote_nonnull_(domain|network|storage_pool|storage_vol|interface|secret|nwfilter|domain_snapshot)
(\S+);/) {
+ } elsif ($args_member =~
m/^remote_nonnull_(domain|network|storage_pool|storage_vol|interface|secret|nwfilter|domain_snapshot|fspool|fsitem)
(\S+);/) {
my $name = $1;
my $arg_name = $2;
my $type_name = name_to_TypeName($name);
@@ -1461,7 +1463,7 @@ elsif ($mode eq "client") {
}
push(@ret_list, "memcpy(result->$3, ret.$3,
sizeof(result->$3));");
- } elsif ($ret_member =~
m/(?:admin|remote)_nonnull_(secret|nwfilter|node_device|interface|network|storage_vol|storage_pool|domain_snapshot|domain|server|client)
(\S+)<(\S+)>;/) {
+ } elsif ($ret_member =~
m/(?:admin|remote)_nonnull_(secret|nwfilter|node_device|interface|network|storage_vol|storage_pool|domain_snapshot|domain|server|client|fspool|fsitem)
(\S+)<(\S+)>;/) {
my $proc_name = name_to_TypeName($1);
if ($structprefix eq "admin") {
@@ -1513,7 +1515,7 @@ elsif ($mode eq "client") {
push(@ret_list, "VIR_FREE(ret.$1);");
$single_ret_var = "char *rv = NULL";
$single_ret_type = "char *";
- } elsif ($ret_member =~
m/^remote_nonnull_(domain|network|storage_pool|storage_vol|node_device|interface|secret|nwfilter|domain_snapshot)
(\S+);/) {
+ } elsif ($ret_member =~
m/^remote_nonnull_(domain|network|storage_pool|storage_vol|node_device|interface|secret|nwfilter|domain_snapshot|fspool|fsitem)
(\S+);/) {
my $name = $1;
my $arg_name = $2;
my $type_name = name_to_TypeName($name);
@@ -1968,7 +1970,8 @@ elsif ($mode eq "client") {
"storage_conf.h",
"nwfilter_conf.h",
"node_device_conf.h",
- "interface_conf.h"
+ "interface_conf.h",
+ "fs_conf.h"
);
foreach my $hdr (@headers) {
print "#include \"$hdr\"\n";
@@ -2053,6 +2056,8 @@ elsif ($mode eq "client") {
$object =~ s/^(\w)/uc $1/e;
$object =~ s/_(\w)/uc $1/e;
$object =~ s/Nwfilter/NWFilter/;
+ $object =~ s/Fspool/FSPool/;
+ $object =~ s/Fsitem/FSItem/;
my $objecttype = $prefix . $object . "DefPtr";
$apiname .= $action . "ACL";
@@ -2065,6 +2070,8 @@ elsif ($mode eq "client") {
if ($object ne "Connect") {
if ($object eq "StorageVol") {
push @argdecls, "virStoragePoolDefPtr pool";
+ } elsif ($object eq "FSItem") {
+ push @argdecls, "virFSPoolDefPtr fspool";
}
push @argdecls, "$objecttype $arg";
}
@@ -2094,6 +2101,8 @@ elsif ($mode eq "client") {
if ($object ne "Connect") {
if ($object eq "StorageVol") {
push @argvars, "pool";
+ } elsif ($object eq "FSItem") {
+ push @argvars, "fspool";
}
push @argvars, $arg;
}
--
1.8.3.1