diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2009-06-29 20:24:47 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2009-06-29 20:25:20 +0100 |
commit | da8ddb2745c3d53c36e3ad7f09836a4c27a4d3e6 (patch) | |
tree | 5555f9addd140af8cf2b40c9526d1b1837abdd7f /daemon | |
parent | 662617ae725c5e41c24128a037060419fbe4b026 (diff) | |
download | libguestfs-da8ddb2745c3d53c36e3ad7f09836a4c27a4d3e6.tar.gz libguestfs-da8ddb2745c3d53c36e3ad7f09836a4c27a4d3e6.tar.xz libguestfs-da8ddb2745c3d53c36e3ad7f09836a4c27a4d3e6.zip |
Generated code for the 'mkswap*' commands.
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/actions.h | 3 | ||||
-rw-r--r-- | daemon/stubs.c | 85 |
2 files changed, 88 insertions, 0 deletions
diff --git a/daemon/actions.h b/daemon/actions.h index 1d412dcc..3f8b7a80 100644 --- a/daemon/actions.h +++ b/daemon/actions.h @@ -150,3 +150,6 @@ extern char *do_df_h (void); extern int64_t do_du (char *path); extern char **do_initrd_list (char *path); extern int do_mount_loop (char *file, char *mountpoint); +extern int do_mkswap (char *device); +extern int do_mkswap_L (char *label, char *device); +extern int do_mkswap_U (char *uuid, char *device); diff --git a/daemon/stubs.c b/daemon/stubs.c index 6d7cb0e7..48f16c28 100644 --- a/daemon/stubs.c +++ b/daemon/stubs.c @@ -3259,6 +3259,82 @@ done: xdr_free ((xdrproc_t) xdr_guestfs_mount_loop_args, (char *) &args); } +static void mkswap_stub (XDR *xdr_in) +{ + int r; + struct guestfs_mkswap_args args; + char *device; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_mkswap_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "mkswap"); + return; + } + device = args.device; + + r = do_mkswap (device); + if (r == -1) + /* do_mkswap has already called reply_with_error */ + goto done; + + reply (NULL, NULL); +done: + xdr_free ((xdrproc_t) xdr_guestfs_mkswap_args, (char *) &args); +} + +static void mkswap_L_stub (XDR *xdr_in) +{ + int r; + struct guestfs_mkswap_L_args args; + char *label; + char *device; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_mkswap_L_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "mkswap_L"); + return; + } + label = args.label; + device = args.device; + + r = do_mkswap_L (label, device); + if (r == -1) + /* do_mkswap_L has already called reply_with_error */ + goto done; + + reply (NULL, NULL); +done: + xdr_free ((xdrproc_t) xdr_guestfs_mkswap_L_args, (char *) &args); +} + +static void mkswap_U_stub (XDR *xdr_in) +{ + int r; + struct guestfs_mkswap_U_args args; + char *uuid; + char *device; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_mkswap_U_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "mkswap_U"); + return; + } + uuid = args.uuid; + device = args.device; + + r = do_mkswap_U (uuid, device); + if (r == -1) + /* do_mkswap_U has already called reply_with_error */ + goto done; + + reply (NULL, NULL); +done: + xdr_free ((xdrproc_t) xdr_guestfs_mkswap_U_args, (char *) &args); +} + void dispatch_incoming_message (XDR *xdr_in) { switch (proc_nr) { @@ -3649,6 +3725,15 @@ void dispatch_incoming_message (XDR *xdr_in) case GUESTFS_PROC_MOUNT_LOOP: mount_loop_stub (xdr_in); break; + case GUESTFS_PROC_MKSWAP: + mkswap_stub (xdr_in); + break; + case GUESTFS_PROC_MKSWAP_L: + mkswap_L_stub (xdr_in); + break; + case GUESTFS_PROC_MKSWAP_U: + mkswap_U_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); } |