diff options
Diffstat (limited to 'daemon/stubs.c')
-rw-r--r-- | daemon/stubs.c | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/daemon/stubs.c b/daemon/stubs.c index 67e6ef5b..6d7cb0e7 100644 --- a/daemon/stubs.c +++ b/daemon/stubs.c @@ -3205,6 +3205,60 @@ done: xdr_free ((xdrproc_t) xdr_guestfs_du_args, (char *) &args); } +static void initrd_list_stub (XDR *xdr_in) +{ + char **r; + struct guestfs_initrd_list_args args; + char *path; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_initrd_list_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "initrd_list"); + return; + } + path = args.path; + + r = do_initrd_list (path); + if (r == NULL) + /* do_initrd_list has already called reply_with_error */ + goto done; + + struct guestfs_initrd_list_ret ret; + ret.filenames.filenames_len = count_strings (r); + ret.filenames.filenames_val = r; + reply ((xdrproc_t) &xdr_guestfs_initrd_list_ret, (char *) &ret); + free_strings (r); +done: + xdr_free ((xdrproc_t) xdr_guestfs_initrd_list_args, (char *) &args); +} + +static void mount_loop_stub (XDR *xdr_in) +{ + int r; + struct guestfs_mount_loop_args args; + char *file; + char *mountpoint; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_mount_loop_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "mount_loop"); + return; + } + file = args.file; + mountpoint = args.mountpoint; + + r = do_mount_loop (file, mountpoint); + if (r == -1) + /* do_mount_loop has already called reply_with_error */ + goto done; + + reply (NULL, NULL); +done: + xdr_free ((xdrproc_t) xdr_guestfs_mount_loop_args, (char *) &args); +} + void dispatch_incoming_message (XDR *xdr_in) { switch (proc_nr) { @@ -3589,6 +3643,12 @@ void dispatch_incoming_message (XDR *xdr_in) case GUESTFS_PROC_DU: du_stub (xdr_in); break; + case GUESTFS_PROC_INITRD_LIST: + initrd_list_stub (xdr_in); + break; + case GUESTFS_PROC_MOUNT_LOOP: + mount_loop_stub (xdr_in); + break; default: reply_with_error ("dispatch_incoming_message: unknown procedure number %d, set LIBGUESTFS_PATH to point to the matching libguestfs appliance directory", proc_nr); } |