1 /* libguestfs generated file
2 * WARNING: THIS FILE IS GENERATED BY 'src/generator.ml'.
3 * ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST.
5 * Copyright (C) 2009 Red Hat Inc.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 int err_code; /* 0 OK or -1 error */
24 int serial; /* serial number of reply */
25 char err_str[GUESTFS_ERROR_LEN]; /* error from daemon */
28 static void mount_cb (guestfs_h *g, void *data, XDR *xdr)
30 struct mount_rv *rv = (struct mount_rv *) data;
32 /* XXX */ rv->err_code = 0;
33 /* XXX rv->serial = ?; */
34 main_loop.main_loop_quit (g);
37 int guestfs_mount (guestfs_h *g,
39 const char *mountpoint)
41 struct guestfs_mount_args args;
45 if (g->state != READY) {
46 error (g, "guestfs_mount called from the wrong state, %d != READY",
51 args.device = (char *) device;
52 args.mountpoint = (char *) mountpoint;
53 serial = dispatch (g, GUESTFS_PROC_MOUNT,
54 (xdrproc_t) xdr_guestfs_mount_args, (char *) &args);
59 g->reply_cb_internal = mount_cb;
60 g->reply_cb_internal_data = &rv;
61 main_loop.main_loop_run (g);
62 g->reply_cb_internal = NULL;
63 g->reply_cb_internal_data = NULL;
64 if (rv.err_code == 42) { /* callback wasn't called */
65 error (g, "guestfs_mount failed, see earlier error messages");
68 else if (rv.err_code == -1) { /* error from remote end */
69 error (g, "%s", rv.err_str);
73 /* XXX check serial number agrees */
79 int err_code; /* 0 OK or -1 error */
80 int serial; /* serial number of reply */
81 char err_str[GUESTFS_ERROR_LEN]; /* error from daemon */
84 static void sync_cb (guestfs_h *g, void *data, XDR *xdr)
86 struct sync_rv *rv = (struct sync_rv *) data;
88 /* XXX */ rv->err_code = 0;
89 /* XXX rv->serial = ?; */
90 main_loop.main_loop_quit (g);
93 int guestfs_sync (guestfs_h *g)
98 if (g->state != READY) {
99 error (g, "guestfs_sync called from the wrong state, %d != READY",
103 serial = dispatch (g, GUESTFS_PROC_SYNC, NULL, NULL);
108 g->reply_cb_internal = sync_cb;
109 g->reply_cb_internal_data = &rv;
110 main_loop.main_loop_run (g);
111 g->reply_cb_internal = NULL;
112 g->reply_cb_internal_data = NULL;
113 if (rv.err_code == 42) { /* callback wasn't called */
114 error (g, "guestfs_sync failed, see earlier error messages");
117 else if (rv.err_code == -1) { /* error from remote end */
118 error (g, "%s", rv.err_str);
122 /* XXX check serial number agrees */
128 int err_code; /* 0 OK or -1 error */
129 int serial; /* serial number of reply */
130 char err_str[GUESTFS_ERROR_LEN]; /* error from daemon */
133 static void touch_cb (guestfs_h *g, void *data, XDR *xdr)
135 struct touch_rv *rv = (struct touch_rv *) data;
137 /* XXX */ rv->err_code = 0;
138 /* XXX rv->serial = ?; */
139 main_loop.main_loop_quit (g);
142 int guestfs_touch (guestfs_h *g,
145 struct guestfs_touch_args args;
149 if (g->state != READY) {
150 error (g, "guestfs_touch called from the wrong state, %d != READY",
155 args.path = (char *) path;
156 serial = dispatch (g, GUESTFS_PROC_TOUCH,
157 (xdrproc_t) xdr_guestfs_touch_args, (char *) &args);
162 g->reply_cb_internal = touch_cb;
163 g->reply_cb_internal_data = &rv;
164 main_loop.main_loop_run (g);
165 g->reply_cb_internal = NULL;
166 g->reply_cb_internal_data = NULL;
167 if (rv.err_code == 42) { /* callback wasn't called */
168 error (g, "guestfs_touch failed, see earlier error messages");
171 else if (rv.err_code == -1) { /* error from remote end */
172 error (g, "%s", rv.err_str);
176 /* XXX check serial number agrees */