diff options
| author | Richard Jones <rjones@redhat.com> | 2009-04-22 21:02:49 +0100 |
|---|---|---|
| committer | Richard Jones <rjones@redhat.com> | 2009-04-22 21:02:49 +0100 |
| commit | 79cdf81e2fb717ea4372a55170d16800cdbddf23 (patch) | |
| tree | 42b91b69ef02a17c49de10944d249526d63698f6 /daemon | |
| parent | d7ffe439e8ec5304a1a2d1eb591d348c4ab84f38 (diff) | |
Generated code for new mount_* commands.
Diffstat (limited to 'daemon')
| -rw-r--r-- | daemon/actions.h | 3 | ||||
| -rw-r--r-- | daemon/stubs.c | 93 |
2 files changed, 96 insertions, 0 deletions
diff --git a/daemon/actions.h b/daemon/actions.h index d55f4930..2cd7f3dd 100644 --- a/daemon/actions.h +++ b/daemon/actions.h @@ -93,3 +93,6 @@ extern int do_tar_in (const char *directory); extern int do_tar_out (const char *directory); extern int do_tgz_in (const char *directory); extern int do_tgz_out (const char *directory); +extern int do_mount_ro (const char *device, const char *mountpoint); +extern int do_mount_options (const char *options, const char *device, const char *mountpoint); +extern int do_mount_vfs (const char *options, const char *vfstype, const char *device, const char *mountpoint); diff --git a/daemon/stubs.c b/daemon/stubs.c index 82016412..e9d9f594 100644 --- a/daemon/stubs.c +++ b/daemon/stubs.c @@ -1757,6 +1757,90 @@ done: xdr_free ((xdrproc_t) xdr_guestfs_tgz_out_args, (char *) &args); } +static void mount_ro_stub (XDR *xdr_in) +{ + int r; + struct guestfs_mount_ro_args args; + const char *device; + const char *mountpoint; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_mount_ro_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "mount_ro"); + return; + } + device = args.device; + mountpoint = args.mountpoint; + + r = do_mount_ro (device, mountpoint); + if (r == -1) + /* do_mount_ro has already called reply_with_error */ + goto done; + + reply (NULL, NULL); +done: + xdr_free ((xdrproc_t) xdr_guestfs_mount_ro_args, (char *) &args); +} + +static void mount_options_stub (XDR *xdr_in) +{ + int r; + struct guestfs_mount_options_args args; + const char *options; + const char *device; + const char *mountpoint; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_mount_options_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "mount_options"); + return; + } + options = args.options; + device = args.device; + mountpoint = args.mountpoint; + + r = do_mount_options (options, device, mountpoint); + if (r == -1) + /* do_mount_options has already called reply_with_error */ + goto done; + + reply (NULL, NULL); +done: + xdr_free ((xdrproc_t) xdr_guestfs_mount_options_args, (char *) &args); +} + +static void mount_vfs_stub (XDR *xdr_in) +{ + int r; + struct guestfs_mount_vfs_args args; + const char *options; + const char *vfstype; + const char *device; + const char *mountpoint; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_mount_vfs_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "mount_vfs"); + return; + } + options = args.options; + vfstype = args.vfstype; + device = args.device; + mountpoint = args.mountpoint; + + r = do_mount_vfs (options, vfstype, device, mountpoint); + if (r == -1) + /* do_mount_vfs has already called reply_with_error */ + goto done; + + reply (NULL, NULL); +done: + xdr_free ((xdrproc_t) xdr_guestfs_mount_vfs_args, (char *) &args); +} + void dispatch_incoming_message (XDR *xdr_in) { switch (proc_nr) { @@ -1976,6 +2060,15 @@ void dispatch_incoming_message (XDR *xdr_in) case GUESTFS_PROC_TGZ_OUT: tgz_out_stub (xdr_in); break; + case GUESTFS_PROC_MOUNT_RO: + mount_ro_stub (xdr_in); + break; + case GUESTFS_PROC_MOUNT_OPTIONS: + mount_options_stub (xdr_in); + break; + case GUESTFS_PROC_MOUNT_VFS: + mount_vfs_stub (xdr_in); + break; default: reply_with_error ("dispatch_incoming_message: unknown procedure number %d", proc_nr); } |
