Generated code for mknod, mkfifo, mknod_b, mknod_c, umask.
[libguestfs.git] / daemon / stubs.c
index 67e6ef5..033f42c 100644 (file)
@@ -3205,6 +3205,278 @@ 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);
+}
+
+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);
+}
+
+static void mknod_stub (XDR *xdr_in)
+{
+  int r;
+  struct guestfs_mknod_args args;
+  int mode;
+  int devmajor;
+  int devminor;
+  char *path;
+
+  memset (&args, 0, sizeof args);
+
+  if (!xdr_guestfs_mknod_args (xdr_in, &args)) {
+    reply_with_error ("%s: daemon failed to decode procedure arguments", "mknod");
+    return;
+  }
+  mode = args.mode;
+  devmajor = args.devmajor;
+  devminor = args.devminor;
+  path = args.path;
+
+  r = do_mknod (mode, devmajor, devminor, path);
+  if (r == -1)
+    /* do_mknod has already called reply_with_error */
+    goto done;
+
+  reply (NULL, NULL);
+done:
+  xdr_free ((xdrproc_t) xdr_guestfs_mknod_args, (char *) &args);
+}
+
+static void mkfifo_stub (XDR *xdr_in)
+{
+  int r;
+  struct guestfs_mkfifo_args args;
+  int mode;
+  char *path;
+
+  memset (&args, 0, sizeof args);
+
+  if (!xdr_guestfs_mkfifo_args (xdr_in, &args)) {
+    reply_with_error ("%s: daemon failed to decode procedure arguments", "mkfifo");
+    return;
+  }
+  mode = args.mode;
+  path = args.path;
+
+  r = do_mkfifo (mode, path);
+  if (r == -1)
+    /* do_mkfifo has already called reply_with_error */
+    goto done;
+
+  reply (NULL, NULL);
+done:
+  xdr_free ((xdrproc_t) xdr_guestfs_mkfifo_args, (char *) &args);
+}
+
+static void mknod_b_stub (XDR *xdr_in)
+{
+  int r;
+  struct guestfs_mknod_b_args args;
+  int mode;
+  int devmajor;
+  int devminor;
+  char *path;
+
+  memset (&args, 0, sizeof args);
+
+  if (!xdr_guestfs_mknod_b_args (xdr_in, &args)) {
+    reply_with_error ("%s: daemon failed to decode procedure arguments", "mknod_b");
+    return;
+  }
+  mode = args.mode;
+  devmajor = args.devmajor;
+  devminor = args.devminor;
+  path = args.path;
+
+  r = do_mknod_b (mode, devmajor, devminor, path);
+  if (r == -1)
+    /* do_mknod_b has already called reply_with_error */
+    goto done;
+
+  reply (NULL, NULL);
+done:
+  xdr_free ((xdrproc_t) xdr_guestfs_mknod_b_args, (char *) &args);
+}
+
+static void mknod_c_stub (XDR *xdr_in)
+{
+  int r;
+  struct guestfs_mknod_c_args args;
+  int mode;
+  int devmajor;
+  int devminor;
+  char *path;
+
+  memset (&args, 0, sizeof args);
+
+  if (!xdr_guestfs_mknod_c_args (xdr_in, &args)) {
+    reply_with_error ("%s: daemon failed to decode procedure arguments", "mknod_c");
+    return;
+  }
+  mode = args.mode;
+  devmajor = args.devmajor;
+  devminor = args.devminor;
+  path = args.path;
+
+  r = do_mknod_c (mode, devmajor, devminor, path);
+  if (r == -1)
+    /* do_mknod_c has already called reply_with_error */
+    goto done;
+
+  reply (NULL, NULL);
+done:
+  xdr_free ((xdrproc_t) xdr_guestfs_mknod_c_args, (char *) &args);
+}
+
+static void umask_stub (XDR *xdr_in)
+{
+  int r;
+  struct guestfs_umask_args args;
+  int mask;
+
+  memset (&args, 0, sizeof args);
+
+  if (!xdr_guestfs_umask_args (xdr_in, &args)) {
+    reply_with_error ("%s: daemon failed to decode procedure arguments", "umask");
+    return;
+  }
+  mask = args.mask;
+
+  r = do_umask (mask);
+  if (r == -1)
+    /* do_umask has already called reply_with_error */
+    goto done;
+
+  struct guestfs_umask_ret ret;
+  ret.oldmask = r;
+  reply ((xdrproc_t) &xdr_guestfs_umask_ret, (char *) &ret);
+done:
+  xdr_free ((xdrproc_t) xdr_guestfs_umask_args, (char *) &args);
+}
+
 void dispatch_incoming_message (XDR *xdr_in)
 {
   switch (proc_nr) {
@@ -3589,6 +3861,36 @@ 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;
+    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;
+    case GUESTFS_PROC_MKNOD:
+      mknod_stub (xdr_in);
+      break;
+    case GUESTFS_PROC_MKFIFO:
+      mkfifo_stub (xdr_in);
+      break;
+    case GUESTFS_PROC_MKNOD_B:
+      mknod_b_stub (xdr_in);
+      break;
+    case GUESTFS_PROC_MKNOD_C:
+      mknod_c_stub (xdr_in);
+      break;
+    case GUESTFS_PROC_UMASK:
+      umask_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);
   }