diff options
author | Richard Jones <rjones@redhat.com> | 2009-04-13 23:58:33 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-04-13 23:58:33 +0100 |
commit | adefe14e308a0f8cf73f9c60693a3dbbded157b9 (patch) | |
tree | cc1ecd798dd05c422ddcf99c1cdbef307aacb8fd /daemon | |
parent | 42283403886da648bb239177369aa65c0a659255 (diff) | |
download | libguestfs-adefe14e308a0f8cf73f9c60693a3dbbded157b9.tar.gz libguestfs-adefe14e308a0f8cf73f9c60693a3dbbded157b9.tar.xz libguestfs-adefe14e308a0f8cf73f9c60693a3dbbded157b9.zip |
Generated files for file(1) command.
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/actions.h | 1 | ||||
-rw-r--r-- | daemon/stubs.c | 30 |
2 files changed, 31 insertions, 0 deletions
diff --git a/daemon/actions.h b/daemon/actions.h index 2a9d3d1d..d53729bf 100644 --- a/daemon/actions.h +++ b/daemon/actions.h @@ -69,3 +69,4 @@ extern int do_umount (const char *pathordevice); extern char **do_mounts (void); extern int do_umount_all (void); extern int do_lvm_remove_all (void); +extern char *do_file (const char *path); diff --git a/daemon/stubs.c b/daemon/stubs.c index 4540ca56..af0f14c3 100644 --- a/daemon/stubs.c +++ b/daemon/stubs.c @@ -1137,6 +1137,33 @@ static void lvm_remove_all_stub (XDR *xdr_in) done: ; } +static void file_stub (XDR *xdr_in) +{ + char *r; + struct guestfs_file_args args; + const char *path; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_file_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "file"); + return; + } + path = args.path; + + r = do_file (path); + if (r == NULL) + /* do_file has already called reply_with_error */ + goto done; + + struct guestfs_file_ret ret; + ret.description = r; + reply ((xdrproc_t) &xdr_guestfs_file_ret, (char *) &ret); + free (r); +done: + xdr_free ((xdrproc_t) xdr_guestfs_file_args, (char *) &args); +} + void dispatch_incoming_message (XDR *xdr_in) { switch (proc_nr) { @@ -1284,6 +1311,9 @@ void dispatch_incoming_message (XDR *xdr_in) case GUESTFS_PROC_LVM_REMOVE_ALL: lvm_remove_all_stub (xdr_in); break; + case GUESTFS_PROC_FILE: + file_stub (xdr_in); + break; default: reply_with_error ("dispatch_incoming_message: unknown procedure number %d", proc_nr); } |