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 or -1 */
27 static void mount_cb (guestfs_h *g, void *data, XDR *xdr)
29 struct mount_rv *rv = (struct mount_rv *) data;
31 /* XXX */ rv.code = 0;
32 main_loop.main_loop_quit (g);
35 int guestfs_mount (guestfs_h *g,
37 const char *mountpoint)
39 struct guestfs_mount_args args;
42 if (g->state != READY) {
43 error (g, "guestfs_mount called from the wrong state, %d != READY",
48 args.device = (char *) device;
49 args.mountpoint = (char *) mountpoint;
50 if (dispatch (g, (xdrproc_t) xdr_guestfs_mount_args, (char *) &args) == -1)
54 g->reply_cb_internal = mount_cb;
55 g->reply_cb_internal_data = &rv;
56 main_loop.main_loop_run (g);
57 g->reply_cb_internal = NULL;
58 g->reply_cb_internal_data = NULL;
59 if (rv.err_code == 42) { /* callback wasn't called */
60 error (g, "guestfs_mount failed, see earlier error messages");
63 else if (rv.err_code == -1) { /* error from remote end */
64 error (g, "%s", rv.err_str);
72 int err_code; /* 0 or -1 */
76 static void sync_cb (guestfs_h *g, void *data, XDR *xdr)
78 struct sync_rv *rv = (struct sync_rv *) data;
80 /* XXX */ rv.code = 0;
81 main_loop.main_loop_quit (g);
84 int guestfs_sync (guestfs_h *g)
88 if (g->state != READY) {
89 error (g, "guestfs_sync called from the wrong state, %d != READY",
94 g->reply_cb_internal = sync_cb;
95 g->reply_cb_internal_data = &rv;
96 main_loop.main_loop_run (g);
97 g->reply_cb_internal = NULL;
98 g->reply_cb_internal_data = NULL;
99 if (rv.err_code == 42) { /* callback wasn't called */
100 error (g, "guestfs_sync failed, see earlier error messages");
103 else if (rv.err_code == -1) { /* error from remote end */
104 error (g, "%s", rv.err_str);
112 int err_code; /* 0 or -1 */
116 static void touch_cb (guestfs_h *g, void *data, XDR *xdr)
118 struct touch_rv *rv = (struct touch_rv *) data;
120 /* XXX */ rv.code = 0;
121 main_loop.main_loop_quit (g);
124 int guestfs_touch (guestfs_h *g,
127 struct guestfs_touch_args args;
130 if (g->state != READY) {
131 error (g, "guestfs_touch called from the wrong state, %d != READY",
136 args.path = (char *) path;
137 if (dispatch (g, (xdrproc_t) xdr_guestfs_touch_args, (char *) &args) == -1)
141 g->reply_cb_internal = touch_cb;
142 g->reply_cb_internal_data = &rv;
143 main_loop.main_loop_run (g);
144 g->reply_cb_internal = NULL;
145 g->reply_cb_internal_data = NULL;
146 if (rv.err_code == 42) { /* callback wasn't called */
147 error (g, "guestfs_touch failed, see earlier error messages");
150 else if (rv.err_code == -1) { /* error from remote end */
151 error (g, "%s", rv.err_str);