New rules are added in fixup_name in gendispatch.pl to keep the name
FSFreeze and FSThaw. Also these use new ACL permission 'fs_freeze'.
Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama(a)hds.com>
---
src/access/viraccessperm.c | 2 +-
src/access/viraccessperm.h | 6 ++++++
src/remote/remote_driver.c | 2 ++
src/remote/remote_protocol.x | 26 +++++++++++++++++++++++++-
src/remote_protocol-structs | 12 ++++++++++++
src/rpc/gendispatch.pl | 2 ++
6 files changed, 48 insertions(+), 2 deletions(-)
diff --git a/src/access/viraccessperm.c b/src/access/viraccessperm.c
index d517c66..92f7366 100644
--- a/src/access/viraccessperm.c
+++ b/src/access/viraccessperm.c
@@ -42,7 +42,7 @@ VIR_ENUM_IMPL(virAccessPermDomain,
"init_control", "inject_nmi", "send_input",
"send_signal", "fs_trim",
"block_read", "block_write", "mem_read",
"open_graphics", "open_device",
"screenshot",
- "open_namespace");
+ "open_namespace", "fs_freeze");
VIR_ENUM_IMPL(virAccessPermInterface,
VIR_ACCESS_PERM_INTERFACE_LAST,
diff --git a/src/access/viraccessperm.h b/src/access/viraccessperm.h
index fdc461b..ab569ec 100644
--- a/src/access/viraccessperm.h
+++ b/src/access/viraccessperm.h
@@ -242,6 +242,12 @@ typedef enum {
*/
VIR_ACCESS_PERM_DOMAIN_FS_TRIM, /* Issue TRIM to guest filesystems */
+ /**
+ * @desc: Fsfreeze and thaw domain filesystems
+ * @message: Freezing and thawing domain filesystems require authorization
+ */
+ VIR_ACCESS_PERM_DOMAIN_FS_FREEZE, /* Freeze/thaw guest filesystems */
+
/* Peeking at guest */
/**
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 7181949..fa12174 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -7013,6 +7013,8 @@ static virDriver remote_driver = {
.domainMigrateFinish3Params = remoteDomainMigrateFinish3Params, /* 1.1.0 */
.domainMigrateConfirm3Params = remoteDomainMigrateConfirm3Params, /* 1.1.0 */
.connectGetCPUModelNames = remoteConnectGetCPUModelNames, /* 1.1.3 */
+ .domainFSFreeze = remoteDomainFSFreeze, /* 1.1.5 */
+ .domainFSThaw = remoteDomainFSThaw, /* 1.1.5 */
};
static virNetworkDriver network_driver = {
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
index f942670..584440d 100644
--- a/src/remote/remote_protocol.x
+++ b/src/remote/remote_protocol.x
@@ -2849,6 +2849,18 @@ struct remote_connect_get_cpu_model_names_ret {
int ret;
};
+struct remote_domain_fsfreeze_args {
+ remote_nonnull_domain dom;
+ remote_string mountPoint;
+ unsigned int flags;
+};
+
+struct remote_domain_fsthaw_args {
+ remote_nonnull_domain dom;
+ remote_string mountPoint;
+ unsigned int flags;
+};
+
/*----- Protocol. -----*/
/* Define the program number, protocol version and procedure numbers here. */
@@ -5018,5 +5030,17 @@ enum remote_procedure {
* @generate: none
* @acl: connect:read
*/
- REMOTE_PROC_CONNECT_GET_CPU_MODEL_NAMES = 312
+ REMOTE_PROC_CONNECT_GET_CPU_MODEL_NAMES = 312,
+
+ /**
+ * @generate: both
+ * @acl: domain:fs_freeze
+ */
+ REMOTE_PROC_DOMAIN_FSFREEZE = 313,
+
+ /**
+ * @generate: both
+ * @acl: domain:fs_freeze
+ */
+ REMOTE_PROC_DOMAIN_FSTHAW = 314
};
diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs
index 98d2d5b..b09c9b0 100644
--- a/src/remote_protocol-structs
+++ b/src/remote_protocol-structs
@@ -2328,6 +2328,16 @@ struct remote_connect_get_cpu_model_names_ret {
} models;
int ret;
};
+struct remote_domain_fsfreeze_args {
+ remote_nonnull_domain dom;
+ remote_string mountPoint;
+ u_int flags;
+};
+struct remote_domain_fsthaw_args {
+ remote_nonnull_domain dom;
+ remote_string mountPoint;
+ u_int flags;
+};
enum remote_procedure {
REMOTE_PROC_CONNECT_OPEN = 1,
REMOTE_PROC_CONNECT_CLOSE = 2,
@@ -2641,4 +2651,6 @@ enum remote_procedure {
REMOTE_PROC_DOMAIN_CREATE_WITH_FILES = 310,
REMOTE_PROC_DOMAIN_EVENT_DEVICE_REMOVED = 311,
REMOTE_PROC_CONNECT_GET_CPU_MODEL_NAMES = 312,
+ REMOTE_PROC_DOMAIN_FSFREEZE = 313,
+ REMOTE_PROC_DOMAIN_FSTHAW = 314,
};
diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl
index ceb1ad8..0b256f3 100755
--- a/src/rpc/gendispatch.pl
+++ b/src/rpc/gendispatch.pl
@@ -64,6 +64,8 @@ sub fixup_name {
$name =~ s/Nmi$/NMI/;
$name =~ s/Pm/PM/;
$name =~ s/Fstrim$/FSTrim/;
+ $name =~ s/Fsfreeze$/FSFreeze/;
+ $name =~ s/Fsthaw$/FSThaw/;
$name =~ s/Scsi/SCSI/;
$name =~ s/Wwn$/WWN/;