aboutsummaryrefslogtreecommitdiff
path: root/qga/commands-common.h
diff options
context:
space:
mode:
authorAlexander Ivanov <alexander.ivanov@virtuozzo.com>2022-10-17 09:28:21 +0200
committerKonstantin Kostiuk <kkostiuk@redhat.com>2022-10-26 20:35:07 +0300
commitbad0001eeb34484c4595c3862e14a4ee22a3abee (patch)
tree6a2fc855fbe26494eca61307d503893cd50a4871 /qga/commands-common.h
parent518b0d800b5ab046b72fac423ace7549ab187329 (diff)
qga: Add UFS freeze/thaw support for FreeBSD
UFS supports FS freezing through ioctl UFSSUSPEND on /dev/ufssuspend. Frozen FS can be thawed by closing /dev/ufssuspend file descriptior. Use getmntinfo to get a list of mounted FS. Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com> Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Diffstat (limited to 'qga/commands-common.h')
-rw-r--r--qga/commands-common.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/qga/commands-common.h b/qga/commands-common.h
index cb51b1c6e9..d0583c6ddb 100644
--- a/qga/commands-common.h
+++ b/qga/commands-common.h
@@ -23,11 +23,22 @@
#endif
#endif /* __linux__ */
+#ifdef __FreeBSD__
+#include <ufs/ffs/fs.h>
+#ifdef UFSSUSPEND
+#define CONFIG_FSFREEZE
+#endif
+#endif /* __FreeBSD__ */
+
#if defined(CONFIG_FSFREEZE) || defined(CONFIG_FSTRIM)
typedef struct FsMount {
char *dirname;
char *devtype;
unsigned int devmajor, devminor;
+#if defined(__FreeBSD__)
+ dev_t dev;
+ fsid_t fsid;
+#endif
QTAILQ_ENTRY(FsMount) next;
} FsMount;