summaryrefslogtreecommitdiffstats
path: root/daemon
diff options
context:
space:
mode:
Diffstat (limited to 'daemon')
-rw-r--r--daemon/actions.h1
-rw-r--r--daemon/stubs.c27
2 files changed, 28 insertions, 0 deletions
diff --git a/daemon/actions.h b/daemon/actions.h
index 8aed57c1..1615cfb1 100644
--- a/daemon/actions.h
+++ b/daemon/actions.h
@@ -128,3 +128,4 @@ extern int do_vg_activate (int activate, char * const* const volgroups);
extern int do_lvresize (const char *device, int mbytes);
extern int do_resize2fs (const char *device);
extern char **do_find (const char *directory);
+extern int do_e2fsck_f (const char *device);
diff --git a/daemon/stubs.c b/daemon/stubs.c
index 2df8bbac..51a75624 100644
--- a/daemon/stubs.c
+++ b/daemon/stubs.c
@@ -2695,6 +2695,30 @@ done:
xdr_free ((xdrproc_t) xdr_guestfs_find_args, (char *) &args);
}
+static void e2fsck_f_stub (XDR *xdr_in)
+{
+ int r;
+ struct guestfs_e2fsck_f_args args;
+ const char *device;
+
+ memset (&args, 0, sizeof args);
+
+ if (!xdr_guestfs_e2fsck_f_args (xdr_in, &args)) {
+ reply_with_error ("%s: daemon failed to decode procedure arguments", "e2fsck_f");
+ return;
+ }
+ device = args.device;
+
+ r = do_e2fsck_f (device);
+ if (r == -1)
+ /* do_e2fsck_f has already called reply_with_error */
+ goto done;
+
+ reply (NULL, NULL);
+done:
+ xdr_free ((xdrproc_t) xdr_guestfs_e2fsck_f_args, (char *) &args);
+}
+
void dispatch_incoming_message (XDR *xdr_in)
{
switch (proc_nr) {
@@ -3019,6 +3043,9 @@ void dispatch_incoming_message (XDR *xdr_in)
case GUESTFS_PROC_FIND:
find_stub (xdr_in);
break;
+ case GUESTFS_PROC_E2FSCK_F:
+ e2fsck_f_stub (xdr_in);
+ break;
default:
reply_with_error ("dispatch_incoming_message: unknown procedure number %d", proc_nr);
}